This is an archive of the discontinued LLVM Phabricator instance.

Set the thumb flag for thumb symbols coming from an ELF file
ClosedPublic

Authored by tberghammer on Mar 8 2016, 3:59 AM.

Details

Summary

Set the thumb flag for thumb symbols coming from an ELF file

Without setting the flag there is no way to determine if a symbol
points to an arm or to a thumb function as the LSB of the address
masked out in all getter function.

Diff Detail

Repository
rL LLVM

Event Timeline

tberghammer updated this revision to Diff 50035.Mar 8 2016, 3:59 AM
tberghammer retitled this revision from to Set the thumb flag for thumb symbols coming from an ELF file.
tberghammer updated this object.
tberghammer added reviewers: rengolin, rafael.
tberghammer added a subscriber: llvm-commits.
rafael edited edge metadata.Apr 3 2016, 7:45 AM
rafael added a subscriber: rafael.

testcase?

Currently I don't see any easy way to test this as the thumb flag is only used by llvm-objdump when dumping a MachO file. The ELF dumping code in llvm-objdump should be fixed to use this flag as well as it currently fails to disassemble thumb code but doing it requires a significant amount of refactor. I plan to create a fix for that issue but I don't know when I will have time for doing it. If you have any suggestion about how can I write a standalone test for this change I would appreciate any suggestion.

P.S. I detected the issue while working on an external library using the object file parsing logic from llvm.

rafael accepted this revision.Apr 4 2016, 12:01 PM
rafael edited edge metadata.

LGTM.

Please say in the commit message why it is not tested.

This revision is now accepted and ready to land.Apr 4 2016, 12:01 PM
This revision was automatically updated to reflect the committed changes.