mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-14 07:31:39 +00:00
Use OutStreamer.SwitchSection instead of writing out textual section directives.
Add a new TargetLoweringObjectFileMachO::getConstTextCoalSection method to get access to that section. llvm-svn: 83178
This commit is contained in:
parent
1cf44c8225
commit
d6896006b1
@ -301,11 +301,17 @@ public:
|
|||||||
SectionKind K) const;
|
SectionKind K) const;
|
||||||
|
|
||||||
/// getTextCoalSection - Return the "__TEXT,__textcoal_nt" section we put weak
|
/// getTextCoalSection - Return the "__TEXT,__textcoal_nt" section we put weak
|
||||||
/// symbols into.
|
/// text symbols into.
|
||||||
const MCSection *getTextCoalSection() const {
|
const MCSection *getTextCoalSection() const {
|
||||||
return TextCoalSection;
|
return TextCoalSection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// getConstTextCoalSection - Return the "__TEXT,__const_coal" section
|
||||||
|
/// we put weak read-only symbols into.
|
||||||
|
const MCSection *getConstTextCoalSection() const {
|
||||||
|
return ConstTextCoalSection;
|
||||||
|
}
|
||||||
|
|
||||||
/// getLazySymbolPointerSection - Return the section corresponding to
|
/// getLazySymbolPointerSection - Return the section corresponding to
|
||||||
/// the .lazy_symbol_pointer directive.
|
/// the .lazy_symbol_pointer directive.
|
||||||
const MCSection *getLazySymbolPointerSection() const {
|
const MCSection *getLazySymbolPointerSection() const {
|
||||||
|
@ -1053,13 +1053,24 @@ void ARMAsmPrinter::EmitStartOfAsmFile(Module &M) {
|
|||||||
// avoid out-of-range branches that are due a fundamental limitation of
|
// avoid out-of-range branches that are due a fundamental limitation of
|
||||||
// the way symbol offsets are encoded with the current Darwin ARM
|
// the way symbol offsets are encoded with the current Darwin ARM
|
||||||
// relocations.
|
// relocations.
|
||||||
O << "\t.section __TEXT,__text,regular\n"
|
TargetLoweringObjectFileMachO &TLOFMacho =
|
||||||
<< "\t.section __TEXT,__textcoal_nt,coalesced\n"
|
static_cast<TargetLoweringObjectFileMachO &>(getObjFileLowering());
|
||||||
<< "\t.section __TEXT,__const_coal,coalesced\n";
|
OutStreamer.SwitchSection(TLOFMacho.getTextSection());
|
||||||
if (RelocM == Reloc::DynamicNoPIC)
|
OutStreamer.SwitchSection(TLOFMacho.getTextCoalSection());
|
||||||
O << "\t.section __TEXT,__symbol_stub4,symbol_stubs,none,12\n";
|
OutStreamer.SwitchSection(TLOFMacho.getConstTextCoalSection());
|
||||||
else
|
if (RelocM == Reloc::DynamicNoPIC) {
|
||||||
O << "\t.section __TEXT,__picsymbolstub4,symbol_stubs,none,16\n";
|
const MCSection *sect =
|
||||||
|
TLOFMacho.getMachOSection("__TEXT", "__symbol_stub4",
|
||||||
|
MCSectionMachO::S_SYMBOL_STUBS,
|
||||||
|
12, SectionKind::getText());
|
||||||
|
OutStreamer.SwitchSection(sect);
|
||||||
|
} else {
|
||||||
|
const MCSection *sect =
|
||||||
|
TLOFMacho.getMachOSection("__TEXT", "__picsymbolstub4",
|
||||||
|
MCSectionMachO::S_SYMBOL_STUBS,
|
||||||
|
16, SectionKind::getText());
|
||||||
|
OutStreamer.SwitchSection(sect);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user