MCELF: Fix a thinko of mine.
authorBenjamin Kramer <benny.kra@googlemail.com>
Thu, 26 Aug 2010 18:12:04 +0000 (18:12 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Thu, 26 Aug 2010 18:12:04 +0000 (18:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112203 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/ELFObjectWriter.cpp

index e71d546616a145ddad2fad7eb183c3a37aad1ff8..0135662804733bd2202e4d310b6e39f73317fdb2 100644 (file)
@@ -480,7 +480,8 @@ void ELFObjectWriterImpl::RecordRelocation(const MCAssembler &Asm,
         Value += Layout.getSymbolAddress(&SD) - Layout.getSymbolAddress(Base);
       Addend = Value;
       // Compensate for the addend on i386.
-      FixedValue = Is64Bit ? 0 : Value;
+      if (Is64Bit)
+        Value = 0;
     } else {
       if (F) {
         // Index of the section in .symtab against this symbol
@@ -495,6 +496,7 @@ void ELFObjectWriterImpl::RecordRelocation(const MCAssembler &Asm,
         return;
       }
     }
+    FixedValue = Value;
   }
 
   // determine the type of the relocation