diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-12-21 15:26:45 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-12-21 15:26:45 +0000 |
commit | e1feeb9da41fd48002e363c6dbb0a3d7bf0b7811 (patch) | |
tree | 137599350619b8f203f0f514fc3ccf23fe8a4813 /lib/MC/MachObjectWriter.cpp | |
parent | 025c98bdbdda72fa06c3cbbeb7a3190ed0006300 (diff) |
MC/Mach-O: Shuffle enums a bit to make it harder to inadvertently use the wrong
type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122334 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MachObjectWriter.cpp')
-rw-r--r-- | lib/MC/MachObjectWriter.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/MC/MachObjectWriter.cpp b/lib/MC/MachObjectWriter.cpp index 11681ca90b..3a15d242d0 100644 --- a/lib/MC/MachObjectWriter.cpp +++ b/lib/MC/MachObjectWriter.cpp @@ -766,13 +766,14 @@ public: // relocation types from the linkers point of view, this is done solely // for pedantic compatibility with 'as'. Type = A_SD->isExternal() ? macho::RIT_Difference : - macho::RIT_LocalDifference; + macho::RIT_Generic_LocalDifference; Value2 = getSymbolAddress(B_SD, Layout); FixedValue -= getSectionAddress(B_SD->getFragment()->getParent()); } // Relocations are written out in reverse order, so the PAIR comes first. - if (Type == macho::RIT_Difference || Type == macho::RIT_LocalDifference) { + if (Type == macho::RIT_Difference || + Type == macho::RIT_Generic_LocalDifference) { macho::RelocationEntry MRE; MRE.Word0 = ((0 << 0) | (macho::RIT_Pair << 24) | @@ -830,11 +831,11 @@ public: // struct relocation_info (8 bytes) macho::RelocationEntry MRE; MRE.Word0 = Value; - MRE.Word1 = ((Index << 0) | - (IsPCRel << 24) | - (Log2Size << 25) | - (1 << 27) | // Extern - (macho::RIT_TLV << 28)); // Type + MRE.Word1 = ((Index << 0) | + (IsPCRel << 24) | + (Log2Size << 25) | + (1 << 27) | // Extern + (macho::RIT_Generic_TLV << 28)); // Type Relocations[Fragment->getParent()].push_back(MRE); } |