mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-03-01 08:47:42 +00:00
MC/Mach-O: Find section ordinal's by looking at the symbol, instead of assuming they are present in a fragment.
llvm-svn: 130519
This commit is contained in:
parent
acce3eb6b2
commit
6178302330
@ -1050,8 +1050,10 @@ public:
|
||||
FixedValue -= Layout.getSymbolOffset(SD);
|
||||
} else {
|
||||
// The index is the section ordinal (1-based).
|
||||
Index = SD->getFragment()->getParent()->getOrdinal() + 1;
|
||||
FixedValue += getSectionAddress(SD->getFragment()->getParent());
|
||||
const MCSectionData &SymSD = Asm.getSectionData(
|
||||
SD->getSymbol().getSection());
|
||||
Index = SymSD.getOrdinal() + 1;
|
||||
FixedValue += getSectionAddress(&SymSD);
|
||||
}
|
||||
if (IsPCRel)
|
||||
FixedValue -= getSectionAddress(Fragment->getParent());
|
||||
@ -1149,8 +1151,10 @@ public:
|
||||
FixedValue -= Layout.getSymbolOffset(SD);
|
||||
} else {
|
||||
// The index is the section ordinal (1-based).
|
||||
Index = SD->getFragment()->getParent()->getOrdinal() + 1;
|
||||
FixedValue += getSectionAddress(SD->getFragment()->getParent());
|
||||
const MCSectionData &SymSD = Asm.getSectionData(
|
||||
SD->getSymbol().getSection());
|
||||
Index = SymSD.getOrdinal() + 1;
|
||||
FixedValue += getSectionAddress(&SymSD);
|
||||
}
|
||||
if (IsPCRel)
|
||||
FixedValue -= getSectionAddress(Fragment->getParent());
|
||||
|
Loading…
x
Reference in New Issue
Block a user