From: Benjamin Kramer Date: Fri, 27 Aug 2010 10:38:39 +0000 (+0000) Subject: MCELF: Always overwrite FixedValue. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=95c602ade3aa30de17abd53b85968a3feb8fdfbc;p=oota-llvm.git MCELF: Always overwrite FixedValue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112259 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/MC/ELFObjectWriter.cpp b/lib/MC/ELFObjectWriter.cpp index 01356628047..02a98bb9478 100644 --- a/lib/MC/ELFObjectWriter.cpp +++ b/lib/MC/ELFObjectWriter.cpp @@ -462,13 +462,13 @@ void ELFObjectWriterImpl::RecordRelocation(const MCAssembler &Asm, uint64_t &FixedValue) { int64_t Addend = 0; unsigned Index = 0; + int64_t Value = Target.getConstant(); if (!Target.isAbsolute()) { const MCSymbol *Symbol = &Target.getSymA()->getSymbol(); MCSymbolData &SD = Asm.getSymbolData(*Symbol); const MCSymbolData *Base = Asm.getAtom(Layout, &SD); MCFragment *F = SD.getFragment(); - int64_t Value = Target.getConstant(); if (Base) { if (F && (!Symbol->isInSection() || SD.isCommon())) { @@ -496,9 +496,10 @@ void ELFObjectWriterImpl::RecordRelocation(const MCAssembler &Asm, return; } } - FixedValue = Value; } + FixedValue = Value; + // determine the type of the relocation bool IsPCRel = isFixupKindX86PCRel(Fixup.getKind()); unsigned Type;