This is an archive of the discontinued LLVM Phabricator instance.

[mips] Add SHF_MIPS_GPREL flag to the MIPS .sbss and .sdata sections
ClosedPublic

Authored by atanasyan on Dec 23 2015, 3:16 AM.

Details

Summary

MIPS ABI states that .sbss and .sdata sections must have SHF_MIPS_GPREL flag. See Figure 4–7 on page 69 in the following document: ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf.

Diff Detail

Repository
rL LLVM

Event Timeline

atanasyan updated this revision to Diff 43518.Dec 23 2015, 3:16 AM
atanasyan retitled this revision from to [mips] Add SHF_MIPS_GPREL flag to the MIPS .sbss and .sdata sections.
atanasyan updated this object.
atanasyan added a reviewer: dsanders.
atanasyan set the repository for this revision to rL LLVM.
atanasyan added a subscriber: llvm-commits.
khemant added inline comments.
tools/llvm-readobj/ELFDumper.cpp
803 ↗(On Diff #43518)

Probably I am not understanding this right, this flag is in SHF_MASKPROC bit fields. Shouldn't the flag printer (for instance in section printer) be checking processor printing the section flags ? Adding it here makes any processor that may use the same field not be able to use the enum string other than SHF_MIPS_GPREL.

atanasyan added inline comments.Jan 14 2016, 11:37 AM
tools/llvm-readobj/ELFDumper.cpp
803 ↗(On Diff #43518)

Good point, thanks. I will fix it.

atanasyan updated this revision to Diff 45422.Jan 20 2016, 12:38 PM
atanasyan updated this object.

I implemented support for target specific ELF section flags in a separate commit r258334. Now this patch contains MIPS specific code only.

dsanders accepted this revision.Feb 3 2016, 2:14 AM
dsanders edited edge metadata.

LGTM with a test for .sbss too

This revision is now accepted and ready to land.Feb 3 2016, 2:14 AM
This revision was automatically updated to reflect the committed changes.