This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objdump] Correctly distinguish between the MachO upper/lower16 relocations
ClosedPublic

Authored by mstorsjo on Jul 11 2017, 2:40 AM.

Details

Summary

All other code in MachODump.cpp uses the same comparison, ((r_length & 0x1) == 1), for distinguishing between the two, while the code in llvm-objdump.cpp seemed to be incorrect.

Diff Detail

Repository
rL LLVM

Event Timeline

mstorsjo created this revision.Jul 11 2017, 2:40 AM
lhames accepted this revision.Jul 12 2017, 3:38 PM
lhames added a subscriber: lhames.

LGTM.

I believe thumb mode uses 3/2 in the length field, rather than 1/0. Would you be interested in adding support and a test case for that too?

This revision is now accepted and ready to land.Jul 12 2017, 3:38 PM

Oops - I didn't look closely enough: I thought you were just comparing against 1, but you're actually masking with 0x1 first, so this should work as-is for both ARM and Thumb encodings.

This revision was automatically updated to reflect the committed changes.