summaryrefslogtreecommitdiff
path: root/lib/Object/MachOObjectFile.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2011-10-26 17:05:20 +0000
committerOwen Anderson <resistor@mac.com>2011-10-26 17:05:20 +0000
commit929e27cc3c67d4c6355c7b56b2983722d28d2624 (patch)
tree37c80b07ed61254ef494bdff7c51fa7fe4bd5ea9 /lib/Object/MachOObjectFile.cpp
parente8ec225e776c6b73ffc7d28f21677ce53b040df5 (diff)
downloadllvm-929e27cc3c67d4c6355c7b56b2983722d28d2624.tar.gz
llvm-929e27cc3c67d4c6355c7b56b2983722d28d2624.tar.bz2
llvm-929e27cc3c67d4c6355c7b56b2983722d28d2624.tar.xz
Improve pretty printing of GOT relocations in MachO on x86_64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143031 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object/MachOObjectFile.cpp')
-rw-r--r--lib/Object/MachOObjectFile.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Object/MachOObjectFile.cpp b/lib/Object/MachOObjectFile.cpp
index e3a7499bcc..d973f430c4 100644
--- a/lib/Object/MachOObjectFile.cpp
+++ b/lib/Object/MachOObjectFile.cpp
@@ -807,8 +807,15 @@ error_code MachOObjectFile::getRelocationValueString(DataRefImpl Rel,
StringRef Name;
if (error_code ec = getRelocationTargetName(RE->Word1, Name))
report_fatal_error(ec.message());
+ bool isPCRel = ((RE->Word1 >> 24) & 1);
switch (Type) {
+ case 3: // X86_64_RELOC_GOT_LOAD
+ case 4: { // X86_64_RELOC_GOT
+ fmt << Name << "@GOT";
+ if (isPCRel) fmt << "PCREL";
+ break;
+ }
case 5: { // X86_64_RELOC_SUBTRACTOR
InMemoryStruct<macho::RelocationEntry> RENext;
DataRefImpl RelNext = Rel;