This is an archive of the discontinued LLVM Phabricator instance.

[ELF][MIPS] Convert .reginfo and .MIPS.options sections to synthetic input sections
ClosedPublic

Authored by atanasyan on Nov 9 2016, 2:34 AM.

Details

Summary

Previously, we have both input and output sections for .reginfo and .MIPS.options. Now for each such sections we have one synthetic input sections: MipsReginfoSection and MipsOptionsSection respectively.

Both sections are handled as regular sections until the control reaches Writer. Writer then aggregates all sections whose type is SHT_MIPS_REGINFO or SHT_MIPS_OPTIONS to create a single synthesized input section. In that moment Writer also save GP0 value to the MipsGp0 field of the corresponding ObjectFile. This value required for R_MIPS_GPREL16 and R_MIPS_GPREL32 relocations calculation.

This patch supersedes D26327.

Diff Detail

Repository
rL LLVM

Event Timeline

atanasyan updated this revision to Diff 77326.Nov 9 2016, 2:34 AM
atanasyan retitled this revision from to [ELF][MIPS] Convert .reginfo and .MIPS.options sections to synthetic input sections.
atanasyan updated this object.
atanasyan added a reviewer: ruiu.
atanasyan set the repository for this revision to rL LLVM.
atanasyan added a project: lld.
atanasyan added a subscriber: llvm-commits.
ruiu accepted this revision.Nov 9 2016, 1:14 PM
ruiu edited edge metadata.

LGTM. Thanks!

ELF/InputSection.h
42

I expect MipsAbiFlags will be converted in future, correct?

This revision is now accepted and ready to land.Nov 9 2016, 1:14 PM
This revision was automatically updated to reflect the committed changes.
test/ELF/basic-mips.s