[dwarfdump] Do not apply relocations in mach-o files if there is no LoadedObjectInfo.
authorFrederic Riss <friss@apple.com>
Sun, 23 Aug 2015 04:44:21 +0000 (04:44 +0000)
committerFrederic Riss <friss@apple.com>
Sun, 23 Aug 2015 04:44:21 +0000 (04:44 +0000)
commitd2681e88129a763fc16f9d0c1977670d0370fee4
tree226665ca6cce784af06fc7c358bf1b0ca56921a9
parent8f7e8462cdf3b0eed913202b81f14e2fead62be4
[dwarfdump] Do not apply relocations in mach-o files if there is no LoadedObjectInfo.

Not only do we not need to do anything to read correct values from the
object files, but the current logic actually wrongly applies twice the
section base address when there is no LoadedObjectInfo passed to the
DWARFContext creation (as the added test shows).

Simply do not apply any relocations on the mach-o debug info if there is
no load offset to apply.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245807 91177308-0d34-0410-b5e6-96231b3b80d8
lib/DebugInfo/DWARF/DWARFContext.cpp
test/DebugInfo/Inputs/dwarfdump-macho-relocs.macho.x86_64.o [new file with mode: 0644]
test/DebugInfo/dwarfdump-macho-relocs.test [new file with mode: 0644]