bool hasInstructions() const { return HasInstructions; }
void setHasInstructions(bool Value) { HasInstructions = Value; }
- unsigned getOrdinal() const;
- void setOrdinal(unsigned Value);
-
unsigned getLayoutOrder() const { return LayoutOrder; }
void setLayoutOrder(unsigned Value) { LayoutOrder = Value; }
A->getSectionList().push_back(this);
}
-unsigned MCSectionData::getOrdinal() const { return Section->getOrdinal(); }
-void MCSectionData::setOrdinal(unsigned Value) { Section->setOrdinal(Value); }
-
MCSectionData::iterator
MCSectionData::getSubsectionInsertionPoint(unsigned Subsection) {
if (Subsection == 0 && SubsectionFragmentMap.empty())
if (it->getFragmentList().empty())
new MCDataFragment(it);
- it->setOrdinal(SectionIndex++);
+ it->getSection().setOrdinal(SectionIndex++);
}
// Assign layout order indices to sections and fragments.
"'. Must have non-local symbol earlier in section.");
// Adjust the relocation to be section-relative.
// The index is the section ordinal (1-based).
- const MCSectionData &SymSD = Asm.getSectionData(Symbol->getSection());
- Index = SymSD.getOrdinal() + 1;
+ const MCSection &Sec = Symbol->getSection();
+ Index = Sec.getOrdinal() + 1;
Value += Writer->getSymbolAddress(*Symbol, Layout);
if (IsPCRel)
#include "llvm/MC/MCFixupKindInfo.h"
#include "llvm/MC/MCMachOSymbolFlags.h"
#include "llvm/MC/MCMachObjectWriter.h"
+#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCValue.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MachO.h"
FixedValue -= Layout.getSymbolOffset(*A);
} else {
// The index is the section ordinal (1-based).
- const MCSectionData &SymSD = Asm.getSectionData(A->getSection());
- Index = SymSD.getOrdinal() + 1;
+ const MCSection &Sec = A->getSection();
+ const MCSectionData &SymSD = Asm.getSectionData(Sec);
+ Index = Sec.getOrdinal() + 1;
FixedValue += Writer->getSectionAddress(&SymSD);
}
if (IsPCRel)
FixedValue -= Layout.getSymbolOffset(*A);
} else {
// The index is the section ordinal (1-based).
- const MCSectionData &SymSD = Asm.getSectionData(A->getSection());
- Index = SymSD.getOrdinal() + 1;
+ const MCSection &Sec = A->getSection();
+ const MCSectionData &SymSD = Asm.getSectionData(Sec);
+ Index = Sec.getOrdinal() + 1;
FixedValue += Writer->getSectionAddress(&SymSD);
}
if (IsPCRel)
(!B_Base ? 0 : Writer->getSymbolAddress(*B_Base, Layout));
if (!A_Base)
- Index = A_SD.getFragment()->getParent()->getOrdinal() + 1;
+ Index = A_SD.getFragment()->getParent()->getSection().getOrdinal() + 1;
Type = MachO::X86_64_RELOC_UNSIGNED;
MachO::any_relocation_info MRE;
if (B_Base)
RelSymbol = B_Base;
else
- Index = B_SD.getFragment()->getParent()->getOrdinal() + 1;
+ Index = B_SD.getFragment()->getParent()->getSection().getOrdinal() + 1;
Type = MachO::X86_64_RELOC_SUBTRACTOR;
} else {
const MCSymbol *Symbol = &Target.getSymA()->getSymbol();
Layout.getSymbolOffset(*RelSymbol);
} else if (Symbol->isInSection() && !Symbol->isVariable()) {
// The index is the section ordinal (1-based).
- Index = SD.getFragment()->getParent()->getOrdinal() + 1;
+ Index = SD.getFragment()->getParent()->getSection().getOrdinal() + 1;
Value += Writer->getSymbolAddress(*Symbol, Layout);
if (IsPCRel)
FixedValue -= Layout.getSymbolOffset(*A);
} else {
// The index is the section ordinal (1-based).
- const MCSectionData &SymSD = Asm.getSectionData(A->getSection());
- Index = SymSD.getOrdinal() + 1;
+ const MCSection &Sec = A->getSection();
+ const MCSectionData &SymSD = Asm.getSectionData(Sec);
+ Index = Sec.getOrdinal() + 1;
FixedValue += Writer->getSectionAddress(&SymSD);
}
if (IsPCRel)