mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 17:24:48 +00:00
MC/Mach-O: Switch to MCSectionData::getOrdinal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99504 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -559,15 +559,8 @@ public:
|
|||||||
if (Base != &SD)
|
if (Base != &SD)
|
||||||
Value += Layout.getSymbolAddress(&SD) - Layout.getSymbolAddress(Base);
|
Value += Layout.getSymbolAddress(&SD) - Layout.getSymbolAddress(Base);
|
||||||
} else {
|
} else {
|
||||||
// The index is the section ordinal.
|
// The index is the section ordinal (1-based).
|
||||||
//
|
Index = SD.getFragment()->getParent()->getOrdinal() + 1;
|
||||||
// FIXME: O(N)
|
|
||||||
Index = 1;
|
|
||||||
MCAssembler::const_iterator it = Asm.begin(), ie = Asm.end();
|
|
||||||
for (; it != ie; ++it, ++Index)
|
|
||||||
if (&*it == SD.getFragment()->getParent())
|
|
||||||
break;
|
|
||||||
assert(it != ie && "Unable to find section index!");
|
|
||||||
IsExtern = 0;
|
IsExtern = 0;
|
||||||
Value += Layout.getSymbolAddress(&SD);
|
Value += Layout.getSymbolAddress(&SD);
|
||||||
|
|
||||||
@ -747,15 +740,8 @@ public:
|
|||||||
Index = SD->getIndex();
|
Index = SD->getIndex();
|
||||||
Value = 0;
|
Value = 0;
|
||||||
} else {
|
} else {
|
||||||
// The index is the section ordinal.
|
// The index is the section ordinal (1-based).
|
||||||
//
|
Index = SD->getFragment()->getParent()->getOrdinal() + 1;
|
||||||
// FIXME: O(N)
|
|
||||||
Index = 1;
|
|
||||||
MCAssembler::const_iterator it = Asm.begin(), ie = Asm.end();
|
|
||||||
for (; it != ie; ++it, ++Index)
|
|
||||||
if (&*it == SD->getFragment()->getParent())
|
|
||||||
break;
|
|
||||||
assert(it != ie && "Unable to find section index!");
|
|
||||||
Value = Layout.getSymbolAddress(SD);
|
Value = Layout.getSymbolAddress(SD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user