[llvm-commits] [llvm] r111824 - /llvm/trunk/lib/MC/ELFObjectWriter.cpp
Benjamin Kramer
benny.kra at googlemail.com
Mon Aug 23 12:05:46 PDT 2010
Author: d0k
Date: Mon Aug 23 14:05:46 2010
New Revision: 111824
URL: http://llvm.org/viewvc/llvm-project?rev=111824&view=rev
Log:
Add the symbol offset to the relocation value when we relocate against section. By Roman Divacky.
Modified:
llvm/trunk/lib/MC/ELFObjectWriter.cpp
Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=111824&r1=111823&r2=111824&view=diff
==============================================================================
--- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Mon Aug 23 14:05:46 2010
@@ -511,9 +511,10 @@
const MCSymbolData *Base = Asm.getAtom(Layout, &SD);
if (Base) {
- if (MCFragment *F = SD.getFragment())
+ if (MCFragment *F = SD.getFragment()) {
Index = F->getParent()->getOrdinal() + getNumOfLocalSymbols(Asm) + 1;
- else
+ Value += Layout.getSymbolAddress(&SD);
+ } else
Index = getSymbolIndexInSymbolTable(const_cast<MCAssembler &>(Asm), Symbol);
if (Base != &SD)
Value += Layout.getSymbolAddress(&SD) - Layout.getSymbolAddress(Base);
More information about the llvm-commits
mailing list