mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-07 16:42:34 +00:00
Correctly compute the offset of the symbol. Forgot these bits from the
last commit. llvm-svn: 114678
This commit is contained in:
parent
ea20e257b2
commit
6366d1b858
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user