diff options
author | Stephen McGroarty <stephen@codeplay.com> | 2015-07-16 16:25:33 +0100 |
---|---|---|
committer | Stephen McGroarty <stephen@codeplay.com> | 2015-07-16 16:27:48 +0100 |
commit | fda4bbd63841e8ae3418637b24b7416f6bf56ca6 (patch) | |
tree | 9187533dfdf5d6bc4ca0076c205c31d3db13e368 | |
parent | 9bf2653f664950396a4a955785a8fd58c5f4dbee (diff) | |
download | mclinker-fda4bbd63841e8ae3418637b24b7416f6bf56ca6.tar.gz |
Cherry picked debug info fix from upstream MCLinker.
For the issue fixed by this patch see the discussion here (https://groups.google.com/forum/#!topic/mclinker/WiVvcnX7QdA).
Picked from commit (https://github.com/mclinker/mclinker/commit/9da046f3cd0702704713d7935814b3eb26072268).
Original message:
debug info: Fix debug string offset
Also update Mips64 regression test
Conflicts:
test/Mips/dso/libfoo64.golden.so
Change-Id: I9e6ca2691ebfa47db5b0c71689126f4e69e940b8
-rw-r--r-- | lib/Target/AArch64/AArch64Relocator.cpp | 2 | ||||
-rw-r--r-- | lib/Target/ARM/ARMRelocator.cpp | 2 | ||||
-rw-r--r-- | lib/Target/Mips/MipsRelocator.cpp | 2 | ||||
-rw-r--r-- | lib/Target/X86/X86Relocator.cpp | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/lib/Target/AArch64/AArch64Relocator.cpp b/lib/Target/AArch64/AArch64Relocator.cpp index 9f1e9b9..e59c112 100644 --- a/lib/Target/AArch64/AArch64Relocator.cpp +++ b/lib/Target/AArch64/AArch64Relocator.cpp @@ -405,7 +405,7 @@ uint32_t AArch64Relocator::getDebugStringOffset(Relocation& pReloc) const { << getName(pReloc.type()) << "mclinker@googlegroups.com"; if (pReloc.symInfo()->type() == ResolveInfo::Section) - return pReloc.target(); + return pReloc.target() + pReloc.addend(); else return pReloc.symInfo()->outSymbol()->fragRef()->offset() + pReloc.target() + pReloc.addend(); diff --git a/lib/Target/ARM/ARMRelocator.cpp b/lib/Target/ARM/ARMRelocator.cpp index 2605664..fd845cf 100644 --- a/lib/Target/ARM/ARMRelocator.cpp +++ b/lib/Target/ARM/ARMRelocator.cpp @@ -763,7 +763,7 @@ uint32_t ARMRelocator::getDebugStringOffset(Relocation& pReloc) const { << getName(pReloc.type()) << "mclinker@googlegroups.com"; if (pReloc.symInfo()->type() == ResolveInfo::Section) - return pReloc.target(); + return pReloc.target() + pReloc.addend(); else return pReloc.symInfo()->outSymbol()->fragRef()->offset() + pReloc.target() + pReloc.addend(); diff --git a/lib/Target/Mips/MipsRelocator.cpp b/lib/Target/Mips/MipsRelocator.cpp index d8039b7..701a876 100644 --- a/lib/Target/Mips/MipsRelocator.cpp +++ b/lib/Target/Mips/MipsRelocator.cpp @@ -687,7 +687,7 @@ uint32_t MipsRelocator::getDebugStringOffset(Relocation& pReloc) const { error(diag::unsupport_reloc_for_debug_string) << getName(pReloc.type()) << "mclinker@googlegroups.com"; if (pReloc.symInfo()->type() == ResolveInfo::Section) - return pReloc.target(); + return pReloc.target() + pReloc.addend(); else return pReloc.symInfo()->outSymbol()->fragRef()->offset() + pReloc.target() + pReloc.addend(); diff --git a/lib/Target/X86/X86Relocator.cpp b/lib/Target/X86/X86Relocator.cpp index b685d51..dc93dee 100644 --- a/lib/Target/X86/X86Relocator.cpp +++ b/lib/Target/X86/X86Relocator.cpp @@ -836,7 +836,7 @@ uint32_t X86_32Relocator::getDebugStringOffset(Relocation& pReloc) const { << getName(pReloc.type()) << "mclinker@googlegroups.com"; if (pReloc.symInfo()->type() == ResolveInfo::Section) - return pReloc.target(); + return pReloc.target() + pReloc.addend(); else return pReloc.symInfo()->outSymbol()->fragRef()->offset() + pReloc.target() + pReloc.addend(); @@ -1505,7 +1505,7 @@ uint32_t X86_64Relocator::getDebugStringOffset(Relocation& pReloc) const { << getName(pReloc.type()) << "mclinker@googlegroups.com"; if (pReloc.symInfo()->type() == ResolveInfo::Section) - return pReloc.target(); + return pReloc.target() + pReloc.addend(); else return pReloc.symInfo()->outSymbol()->fragRef()->offset() + pReloc.target() + pReloc.addend(); |