This is an archive of the discontinued LLVM Phabricator instance.

[mips] Extend MipsAsmParser class to handle %got(sym + const) expressions
ClosedPublic

Authored by atanasyan on Feb 4 2016, 7:17 AM.

Details

Summary

Now the parser supports %got(sym) expressions only but %got(sym + const) variant is also valid and accepted by GAS.

Diff Detail

Repository
rL LLVM

Event Timeline

atanasyan updated this revision to Diff 46914.Feb 4 2016, 7:17 AM
atanasyan retitled this revision from to [mips] Extend MipsAsmParser class to handle %got(sym + const) expressions.
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.
rafael accepted this revision.Feb 5 2016, 6:18 AM
rafael added a reviewer: rafael.
rafael added a subscriber: rafael.

LGTM, but can you make the test more specific? The current one passes if I change 1004 to 1003 for example.

This revision is now accepted and ready to land.Feb 5 2016, 6:18 AM

LGTM, but can you make the test more specific? The current one passes if I change 1004 to 1003 for example.

Thanks for review.

Do you change first or second or both 0x10004? If you change only the first one in the lw instruction, it is expected that the test passes because %got() takes upper 16-bits of the value. I use two instructions and two relocations in the test because such pair of relocations is a common case in the code.

This revision was automatically updated to reflect the committed changes.