aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Object
diff options
context:
space:
mode:
authorDavid Fang <fang@csl.cornell.edu>2013-08-08 20:14:40 +0000
committerDavid Fang <fang@csl.cornell.edu>2013-08-08 20:14:40 +0000
commitd4f9d05fde4b2cfd202a5852ec1ec3e960ef53ed (patch)
tree2985448ae6fb868cfa0138d8ff941428f6b66d1b /lib/Object
parent783a0387c5eef62ff50950aa3e977b2652a3c3a5 (diff)
downloadexternal_llvm-d4f9d05fde4b2cfd202a5852ec1ec3e960ef53ed.zip
external_llvm-d4f9d05fde4b2cfd202a5852ec1ec3e960ef53ed.tar.gz
external_llvm-d4f9d05fde4b2cfd202a5852ec1ec3e960ef53ed.tar.bz2
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188004 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object')
-rw-r--r--lib/Object/MachOObjectFile.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Object/MachOObjectFile.cpp b/lib/Object/MachOObjectFile.cpp
index 5d0399e..9d6f53d 100644
--- a/lib/Object/MachOObjectFile.cpp
+++ b/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