This is an archive of the discontinued LLVM Phabricator instance.

Implement the ".rdata" MIPS assembly directive.
ClosedPublic

Authored by bsdjhb on Jun 21 2017, 7:54 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

bsdjhb created this revision.Jun 21 2017, 7:54 AM

I chose to just map .rdata to .rodata since that is what binutils appears to do for MIPS ELF. binutils doesn't appear to set SHF_MIPS_GPREL so I'm not sure if that should be set as it is for .sdata and .sbss. Having a separate .rdata from .rodata probably isn't the end of the world if that is more correct.

sdardis accepted this revision.Jun 21 2017, 9:13 AM

LGTM. .rdata is the SGI pseudo op equivalent of the ELF .rodata.

Nit: The test should be in test/MC/Mips/mips-rdata.s

The SHF_MIPS_GPREL flag is set when a section is called "srdata" but there is no pseudo-op support for that. That's irrelevant to this patch though.

Do you need me to commit this for you?

test/CodeGen/Mips/mips-rdata.s
1–13 ↗(On Diff #103382)

This file belongs in test/MC/Mips/mips-rdata.s

This revision is now accepted and ready to land.Jun 21 2017, 9:13 AM
davide added a subscriber: davide.Jun 21 2017, 10:40 AM

Do you need somebody this to commit for you John, or you have commit access?

This revision was automatically updated to reflect the committed changes.