This is an archive of the discontinued LLVM Phabricator instance.

Updated llvm-objdump to display local relocations in Mach-O binaries
ClosedPublic

Authored by mtrent on Dec 10 2017, 9:11 PM.

Details

Summary

llvm-objdump's Mach-O parser was updated in r306037 to display external
relocations for MH_KEXT_BUNDLE file types. This change extends the Macho-O
parser to display local relocations for MH_PRELOAD files. When used with
the -macho option relocations will be displayed in a historical format.

rdar://35778019

Diff Detail

Repository
rL LLVM

Event Timeline

mtrent created this revision.Dec 10 2017, 9:11 PM
enderby added inline comments.Dec 11 2017, 10:28 AM
tools/llvm-objdump/MachODump.cpp
698 ↗(On Diff #126307)

I think you might need a test that r_symbolnum is zero first and output "(?,?)" in that case before you subtract one. Not sure that case will call out with the logic below. See the change in r317373.

mtrent updated this revision to Diff 126572.Dec 12 2017, 10:07 AM

Update diff based on feedback from Kevin Enderby: test r_symbolnum for 0

Looks good to me Mike!

This revision was not accepted when it landed; it landed in state Needs Review.Dec 12 2017, 3:54 PM
This revision was automatically updated to reflect the committed changes.
mtrent marked an inline comment as done.