diff options
author | David Fang <fang@csl.cornell.edu> | 2013-08-08 20:14:40 +0000 |
---|---|---|
committer | David Fang <fang@csl.cornell.edu> | 2013-08-08 20:14:40 +0000 |
commit | b88cdf62f58db831aba26b6c94a8e6866a96a0b7 (patch) | |
tree | b7a0298c05a267b4e7f5d5293a5ab2cba9a86745 /llvm/lib/Object | |
parent | 614f707362f8be2d6fcdcabb1c9f75e91ccfee71 (diff) | |
download | bcm5719-llvm-b88cdf62f58db831aba26b6c94a8e6866a96a0b7.tar.gz bcm5719-llvm-b88cdf62f58db831aba26b6c94a8e6866a96a0b7.zip |
initial draft of PPCMachObjectWriter.cpp
this records relocation entries in the mach-o object file
for PIC code generation.
tested on powerpc-darwin8, validated against darwin otool -rvV
llvm-svn: 188004
Diffstat (limited to 'llvm/lib/Object')
-rw-r--r-- | llvm/lib/Object/MachOObjectFile.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index 5d0399ebd4f..9d6f53dca77 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -1059,7 +1059,8 @@ MachOObjectFile::getRelocationValueString(DataRefImpl Rel, break; } // X86 and ARM share some relocation types in common. - } else if (Arch == Triple::x86 || Arch == Triple::arm) { + } else if (Arch == Triple::x86 || Arch == Triple::arm || + Arch == Triple::ppc) { // Generic relocation types... switch (Type) { case macho::RIT_Pair: // GENERIC_RELOC_PAIR - prints no info @@ -1084,7 +1085,7 @@ MachOObjectFile::getRelocationValueString(DataRefImpl Rel, } } - if (Arch == Triple::x86) { + if (Arch == Triple::x86 || Arch == Triple::ppc) { // All X86 relocations that need special printing were already // handled in the generic code. switch (Type) { @@ -1177,7 +1178,7 @@ MachOObjectFile::getRelocationHidden(DataRefImpl Rel, bool &Result) const { // On arches that use the generic relocations, GENERIC_RELOC_PAIR // is always hidden. - if (Arch == Triple::x86 || Arch == Triple::arm) { + if (Arch == Triple::x86 || Arch == Triple::arm || Arch == Triple::ppc) { if (Type == macho::RIT_Pair) Result = true; } else if (Arch == Triple::x86_64) { // On x86_64, X86_64_RELOC_UNSIGNED is hidden only when it follows |