aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC/MCAssembler.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-02-17 23:45:16 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-02-17 23:45:16 +0000
commit4eeee732ba8643c6d1d44d5253f31a4843a7db1b (patch)
treeefce839635595495336ccd493a6eaafac9bf8d71 /lib/MC/MCAssembler.cpp
parent39aa65958835c0d1e4f76efd009c9c0a498acd9b (diff)
downloadexternal_llvm-4eeee732ba8643c6d1d44d5253f31a4843a7db1b.zip
external_llvm-4eeee732ba8643c6d1d44d5253f31a4843a7db1b.tar.gz
external_llvm-4eeee732ba8643c6d1d44d5253f31a4843a7db1b.tar.bz2
MC/Mach-O: Update fixup values for change to X86 offsets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96532 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCAssembler.cpp')
-rw-r--r--lib/MC/MCAssembler.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp
index 26bd9eb..528c5c0 100644
--- a/lib/MC/MCAssembler.cpp
+++ b/lib/MC/MCAssembler.cpp
@@ -439,6 +439,7 @@ public:
std::vector<MachRelocationEntry> &Relocs) {
uint32_t Address = Fragment.getOffset() + Fixup.Offset;
unsigned IsPCRel = 0;
+ unsigned Log2Size = getFixupKindLog2Size(Fixup.Kind);
unsigned Type = RIT_Vanilla;
// See <reloc.h>.
@@ -454,12 +455,10 @@ public:
Value2 = SD->getFragment()->getAddress() + SD->getOffset();
}
- unsigned Log2Size = getFixupKindLog2Size(Fixup.Kind);
-
// The value which goes in the fixup is current value of the expression.
Fixup.FixedValue = Value - Value2 + Target.getConstant();
if (isFixupKindPCRel(Fixup.Kind)) {
- Fixup.FixedValue -= Address + (1 << Log2Size);
+ Fixup.FixedValue -= Address;
IsPCRel = 1;
}
@@ -507,6 +506,7 @@ public:
uint32_t Value = 0;
unsigned Index = 0;
unsigned IsPCRel = 0;
+ unsigned Log2Size = getFixupKindLog2Size(Fixup.Kind);
unsigned IsExtern = 0;
unsigned Type = 0;
@@ -544,10 +544,8 @@ public:
// The value which goes in the fixup is current value of the expression.
Fixup.FixedValue = Value + Target.getConstant();
- unsigned Log2Size = getFixupKindLog2Size(Fixup.Kind);
-
if (isFixupKindPCRel(Fixup.Kind)) {
- Fixup.FixedValue -= Address + (1<<Log2Size);
+ Fixup.FixedValue -= Address;
IsPCRel = 1;
}