mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 19:12:56 +02: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);
|
FixedValue -= Layout.getSymbolOffset(SD);
|
||||||
} else {
|
} else {
|
||||||
// The index is the section ordinal (1-based).
|
// The index is the section ordinal (1-based).
|
||||||
Index = SD->getFragment()->getParent()->getOrdinal() + 1;
|
const MCSectionData &SymSD = Asm.getSectionData(
|
||||||
FixedValue += getSectionAddress(SD->getFragment()->getParent());
|
SD->getSymbol().getSection());
|
||||||
|
Index = SymSD.getOrdinal() + 1;
|
||||||
|
FixedValue += getSectionAddress(&SymSD);
|
||||||
}
|
}
|
||||||
if (IsPCRel)
|
if (IsPCRel)
|
||||||
FixedValue -= getSectionAddress(Fragment->getParent());
|
FixedValue -= getSectionAddress(Fragment->getParent());
|
||||||
@ -1149,8 +1151,10 @@ public:
|
|||||||
FixedValue -= Layout.getSymbolOffset(SD);
|
FixedValue -= Layout.getSymbolOffset(SD);
|
||||||
} else {
|
} else {
|
||||||
// The index is the section ordinal (1-based).
|
// The index is the section ordinal (1-based).
|
||||||
Index = SD->getFragment()->getParent()->getOrdinal() + 1;
|
const MCSectionData &SymSD = Asm.getSectionData(
|
||||||
FixedValue += getSectionAddress(SD->getFragment()->getParent());
|
SD->getSymbol().getSection());
|
||||||
|
Index = SymSD.getOrdinal() + 1;
|
||||||
|
FixedValue += getSectionAddress(&SymSD);
|
||||||
}
|
}
|
||||||
if (IsPCRel)
|
if (IsPCRel)
|
||||||
FixedValue -= getSectionAddress(Fragment->getParent());
|
FixedValue -= getSectionAddress(Fragment->getParent());
|
||||||
|
Loading…
Reference in New Issue
Block a user