MC-COFF: Fix (PR8278) temporary symbol relocations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115656 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Michael J. Spencer
2010-10-05 19:48:03 +00:00
parent e452b17130
commit eb6e77f8cc
2 changed files with 39 additions and 31 deletions

View File

@ -660,7 +660,8 @@ void WinCOFFObjectWriter::RecordRelocation(const MCAssembler &Asm,
// turn relocations for temporary symbols into section relocations
if (coff_symbol->MCData->getSymbol().isTemporary()) {
Reloc.Symb = coff_symbol->Section->Symbol;
FixedValue += Layout.getFragmentOffset(coff_symbol->MCData->Fragment);
FixedValue += Layout.getFragmentOffset(coff_symbol->MCData->Fragment)
+ coff_symbol->MCData->getOffset();
} else
Reloc.Symb = coff_symbol;