[llvm-commits] [llvm] r96532 - /llvm/trunk/lib/MC/MCAssembler.cpp
Daniel Dunbar
daniel at zuster.org
Wed Feb 17 15:45:16 PST 2010
Author: ddunbar
Date: Wed Feb 17 17:45:16 2010
New Revision: 96532
URL: http://llvm.org/viewvc/llvm-project?rev=96532&view=rev
Log:
MC/Mach-O: Update fixup values for change to X86 offsets.
Modified:
llvm/trunk/lib/MC/MCAssembler.cpp
Modified: llvm/trunk/lib/MC/MCAssembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=96532&r1=96531&r2=96532&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAssembler.cpp (original)
+++ llvm/trunk/lib/MC/MCAssembler.cpp Wed Feb 17 17:45:16 2010
@@ -439,6 +439,7 @@
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 @@
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 @@
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 @@
// 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;
}
More information about the llvm-commits
mailing list