summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-09-23 18:01:31 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-09-23 18:01:31 +0000
commit6366d1b85886d08397b13943dfb66a30f84ca282 (patch)
treeeb75276e49e3bd1676713fa3ce4395234c379398 /llvm/lib/MC
parentea20e257b26c0ca6cba58ecf3c6d0668f3cb104b (diff)
downloadbcm5719-llvm-6366d1b85886d08397b13943dfb66a30f84ca282.tar.gz
bcm5719-llvm-6366d1b85886d08397b13943dfb66a30f84ca282.zip
Correctly compute the offset of the symbol. Forgot these bits from the
last commit. llvm-svn: 114678
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r--llvm/lib/MC/ELFObjectWriter.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index 7960a07499a..587489c26be 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -504,7 +504,10 @@ void ELFObjectWriterImpl::RecordRelocation(const MCAssembler &Asm,
if (Base) {
if (F && !SD.isExternal()) {
Index = F->getParent()->getOrdinal() + LocalSymbolData.size() + 1;
- Value += Layout.getSymbolAddress(&SD);
+
+ MCSectionData *FSD = F->getParent();
+ // Offset of the symbol in the section
+ Value += Layout.getSymbolAddress(&SD) - Layout.getSectionAddress(FSD);
} else
Index = getSymbolIndexInSymbolTable(Asm, Symbol);
if (Base != &SD)
OpenPOWER on IntegriCloud