This is an archive of the discontinued LLVM Phabricator instance.

[mips] Extend MipsAsmParser class to handle expressions in the %tprel / %dtprel relocations
AbandonedPublic

Authored by atanasyan on Mar 2 2016, 7:39 AM.

Details

Summary

Now the asm parser supports %tprel_hi/lo and %dtprel_hi/lo relocations with a symbol argument only. But expressions like sym + const are valid also and accepted by GAS.

Diff Detail

Repository
rL LLVM

Event Timeline

atanasyan updated this revision to Diff 49621.Mar 2 2016, 7:39 AM
atanasyan retitled this revision from to [mips] Extend MipsAsmParser class to handle expressions in the %tprel / %dtprel relocations.
atanasyan updated this object.
atanasyan added reviewers: dsanders, vkalintiris.
atanasyan set the repository for this revision to rL LLVM.
atanasyan added a subscriber: llvm-commits.
atanasyan updated this revision to Diff 49739.Mar 3 2016, 7:39 AM

Do not right shift addend for DTPREL_HI and TPREL_HI relocations to mimics GAS behavior and LD expectations.

atanasyan abandoned this revision.Mar 22 2016, 6:03 AM
dsanders edited edge metadata.Mar 22 2016, 7:06 AM

Sorry for the delay in looking at this. I wasn't able to comment until I'd found some information on how they were expected to behave.

I see you've just abandoned the revision but it LGTM on the basis that the odd addends work the same way as GAS does.

test/MC/Mips/tprel-hi-lo-expr.s
10

GAS does the same thing but is this addend really correct? I'd have expected to get 'lui $3, 0' since the offset is in the low 16-bits but '$loc0+0x7ffc' seems to be interpreted as '$loc0+0x7ffc0000'