mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-14 15:28:20 +00:00
remove the TargetLoweringObjectFileMachO::getMachoSection
api and update clients to use MCContext instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100808 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -127,20 +127,6 @@ public:
|
|||||||
virtual bool shouldEmitUsedDirectiveFor(const GlobalValue *GV,
|
virtual bool shouldEmitUsedDirectiveFor(const GlobalValue *GV,
|
||||||
Mangler *) const;
|
Mangler *) const;
|
||||||
|
|
||||||
/// getMachOSection - Return the MCSection for the specified mach-o section.
|
|
||||||
/// This requires the operands to be valid.
|
|
||||||
const MCSectionMachO *getMachOSection(StringRef Segment,
|
|
||||||
StringRef Section,
|
|
||||||
unsigned TypeAndAttributes,
|
|
||||||
SectionKind K) const {
|
|
||||||
return getMachOSection(Segment, Section, TypeAndAttributes, 0, K);
|
|
||||||
}
|
|
||||||
const MCSectionMachO *getMachOSection(StringRef Segment,
|
|
||||||
StringRef Section,
|
|
||||||
unsigned TypeAndAttributes,
|
|
||||||
unsigned Reserved2,
|
|
||||||
SectionKind K) const;
|
|
||||||
|
|
||||||
/// getTextCoalSection - Return the "__TEXT,__textcoal_nt" section we put weak
|
/// getTextCoalSection - Return the "__TEXT,__textcoal_nt" section we put weak
|
||||||
/// text symbols into.
|
/// text symbols into.
|
||||||
const MCSection *getTextCoalSection() const {
|
const MCSection *getTextCoalSection() const {
|
||||||
|
@@ -80,11 +80,19 @@ namespace llvm {
|
|||||||
/// @name Section Managment
|
/// @name Section Managment
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
|
/// getMachOSection - Return the MCSection for the specified mach-o section.
|
||||||
|
/// This requires the operands to be valid.
|
||||||
const MCSectionMachO *getMachOSection(StringRef Segment,
|
const MCSectionMachO *getMachOSection(StringRef Segment,
|
||||||
StringRef Section,
|
StringRef Section,
|
||||||
unsigned TypeAndAttributes,
|
unsigned TypeAndAttributes,
|
||||||
unsigned Reserved2,
|
unsigned Reserved2,
|
||||||
SectionKind K);
|
SectionKind K);
|
||||||
|
const MCSectionMachO *getMachOSection(StringRef Segment,
|
||||||
|
StringRef Section,
|
||||||
|
unsigned TypeAndAttributes,
|
||||||
|
SectionKind K) {
|
||||||
|
return getMachOSection(Segment, Section, TypeAndAttributes, 0, K);
|
||||||
|
}
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
@@ -426,17 +426,6 @@ getExprForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
|||||||
// MachO
|
// MachO
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
|
||||||
const MCSectionMachO *TargetLoweringObjectFileMachO::
|
|
||||||
getMachOSection(StringRef Segment, StringRef Section,
|
|
||||||
unsigned TypeAndAttributes,
|
|
||||||
unsigned Reserved2, SectionKind Kind) const {
|
|
||||||
|
|
||||||
return getContext().getMachOSection(Segment, Section, TypeAndAttributes,
|
|
||||||
Reserved2, Kind);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void TargetLoweringObjectFileMachO::Initialize(MCContext &Ctx,
|
void TargetLoweringObjectFileMachO::Initialize(MCContext &Ctx,
|
||||||
const TargetMachine &TM) {
|
const TargetMachine &TM) {
|
||||||
// _foo.eh symbols are currently always exported so that the linker knows
|
// _foo.eh symbols are currently always exported so that the linker knows
|
||||||
@@ -450,23 +439,27 @@ void TargetLoweringObjectFileMachO::Initialize(MCContext &Ctx,
|
|||||||
TargetLoweringObjectFile::Initialize(Ctx, TM);
|
TargetLoweringObjectFile::Initialize(Ctx, TM);
|
||||||
|
|
||||||
TextSection // .text
|
TextSection // .text
|
||||||
= getMachOSection("__TEXT", "__text",
|
= getContext().getMachOSection("__TEXT", "__text",
|
||||||
MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
|
MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
|
||||||
SectionKind::getText());
|
SectionKind::getText());
|
||||||
DataSection // .data
|
DataSection // .data
|
||||||
= getMachOSection("__DATA", "__data", 0, SectionKind::getDataRel());
|
= getContext().getMachOSection("__DATA", "__data", 0,
|
||||||
|
SectionKind::getDataRel());
|
||||||
|
|
||||||
CStringSection // .cstring
|
CStringSection // .cstring
|
||||||
= getMachOSection("__TEXT", "__cstring", MCSectionMachO::S_CSTRING_LITERALS,
|
= getContext().getMachOSection("__TEXT", "__cstring",
|
||||||
|
MCSectionMachO::S_CSTRING_LITERALS,
|
||||||
SectionKind::getMergeable1ByteCString());
|
SectionKind::getMergeable1ByteCString());
|
||||||
UStringSection
|
UStringSection
|
||||||
= getMachOSection("__TEXT","__ustring", 0,
|
= getContext().getMachOSection("__TEXT","__ustring", 0,
|
||||||
SectionKind::getMergeable2ByteCString());
|
SectionKind::getMergeable2ByteCString());
|
||||||
FourByteConstantSection // .literal4
|
FourByteConstantSection // .literal4
|
||||||
= getMachOSection("__TEXT", "__literal4", MCSectionMachO::S_4BYTE_LITERALS,
|
= getContext().getMachOSection("__TEXT", "__literal4",
|
||||||
|
MCSectionMachO::S_4BYTE_LITERALS,
|
||||||
SectionKind::getMergeableConst4());
|
SectionKind::getMergeableConst4());
|
||||||
EightByteConstantSection // .literal8
|
EightByteConstantSection // .literal8
|
||||||
= getMachOSection("__TEXT", "__literal8", MCSectionMachO::S_8BYTE_LITERALS,
|
= getContext().getMachOSection("__TEXT", "__literal8",
|
||||||
|
MCSectionMachO::S_8BYTE_LITERALS,
|
||||||
SectionKind::getMergeableConst8());
|
SectionKind::getMergeableConst8());
|
||||||
|
|
||||||
// ld_classic doesn't support .literal16 in 32-bit mode, and ld64 falls back
|
// ld_classic doesn't support .literal16 in 32-bit mode, and ld64 falls back
|
||||||
@@ -475,67 +468,75 @@ void TargetLoweringObjectFileMachO::Initialize(MCContext &Ctx,
|
|||||||
if (TM.getRelocationModel() != Reloc::Static &&
|
if (TM.getRelocationModel() != Reloc::Static &&
|
||||||
TM.getTargetData()->getPointerSize() == 32)
|
TM.getTargetData()->getPointerSize() == 32)
|
||||||
SixteenByteConstantSection = // .literal16
|
SixteenByteConstantSection = // .literal16
|
||||||
getMachOSection("__TEXT", "__literal16",MCSectionMachO::S_16BYTE_LITERALS,
|
getContext().getMachOSection("__TEXT", "__literal16",
|
||||||
|
MCSectionMachO::S_16BYTE_LITERALS,
|
||||||
SectionKind::getMergeableConst16());
|
SectionKind::getMergeableConst16());
|
||||||
|
|
||||||
ReadOnlySection // .const
|
ReadOnlySection // .const
|
||||||
= getMachOSection("__TEXT", "__const", 0, SectionKind::getReadOnly());
|
= getContext().getMachOSection("__TEXT", "__const", 0,
|
||||||
|
SectionKind::getReadOnly());
|
||||||
|
|
||||||
TextCoalSection
|
TextCoalSection
|
||||||
= getMachOSection("__TEXT", "__textcoal_nt",
|
= getContext().getMachOSection("__TEXT", "__textcoal_nt",
|
||||||
MCSectionMachO::S_COALESCED |
|
MCSectionMachO::S_COALESCED |
|
||||||
MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
|
MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
|
||||||
SectionKind::getText());
|
SectionKind::getText());
|
||||||
ConstTextCoalSection
|
ConstTextCoalSection
|
||||||
= getMachOSection("__TEXT", "__const_coal", MCSectionMachO::S_COALESCED,
|
= getContext().getMachOSection("__TEXT", "__const_coal",
|
||||||
|
MCSectionMachO::S_COALESCED,
|
||||||
SectionKind::getText());
|
SectionKind::getText());
|
||||||
ConstDataCoalSection
|
ConstDataCoalSection
|
||||||
= getMachOSection("__DATA","__const_coal", MCSectionMachO::S_COALESCED,
|
= getContext().getMachOSection("__DATA","__const_coal",
|
||||||
|
MCSectionMachO::S_COALESCED,
|
||||||
SectionKind::getText());
|
SectionKind::getText());
|
||||||
ConstDataSection // .const_data
|
ConstDataSection // .const_data
|
||||||
= getMachOSection("__DATA", "__const", 0,
|
= getContext().getMachOSection("__DATA", "__const", 0,
|
||||||
SectionKind::getReadOnlyWithRel());
|
SectionKind::getReadOnlyWithRel());
|
||||||
DataCoalSection
|
DataCoalSection
|
||||||
= getMachOSection("__DATA","__datacoal_nt", MCSectionMachO::S_COALESCED,
|
= getContext().getMachOSection("__DATA","__datacoal_nt",
|
||||||
|
MCSectionMachO::S_COALESCED,
|
||||||
SectionKind::getDataRel());
|
SectionKind::getDataRel());
|
||||||
DataCommonSection
|
DataCommonSection
|
||||||
= getMachOSection("__DATA","__common", MCSectionMachO::S_ZEROFILL,
|
= getContext().getMachOSection("__DATA","__common",
|
||||||
|
MCSectionMachO::S_ZEROFILL,
|
||||||
SectionKind::getBSS());
|
SectionKind::getBSS());
|
||||||
DataBSSSection
|
DataBSSSection
|
||||||
= getMachOSection("__DATA","__bss", MCSectionMachO::S_ZEROFILL,
|
= getContext().getMachOSection("__DATA","__bss", MCSectionMachO::S_ZEROFILL,
|
||||||
SectionKind::getBSS());
|
SectionKind::getBSS());
|
||||||
|
|
||||||
|
|
||||||
LazySymbolPointerSection
|
LazySymbolPointerSection
|
||||||
= getMachOSection("__DATA", "__la_symbol_ptr",
|
= getContext().getMachOSection("__DATA", "__la_symbol_ptr",
|
||||||
MCSectionMachO::S_LAZY_SYMBOL_POINTERS,
|
MCSectionMachO::S_LAZY_SYMBOL_POINTERS,
|
||||||
SectionKind::getMetadata());
|
SectionKind::getMetadata());
|
||||||
NonLazySymbolPointerSection
|
NonLazySymbolPointerSection
|
||||||
= getMachOSection("__DATA", "__nl_symbol_ptr",
|
= getContext().getMachOSection("__DATA", "__nl_symbol_ptr",
|
||||||
MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS,
|
MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS,
|
||||||
SectionKind::getMetadata());
|
SectionKind::getMetadata());
|
||||||
|
|
||||||
if (TM.getRelocationModel() == Reloc::Static) {
|
if (TM.getRelocationModel() == Reloc::Static) {
|
||||||
StaticCtorSection
|
StaticCtorSection
|
||||||
= getMachOSection("__TEXT", "__constructor", 0,SectionKind::getDataRel());
|
= getContext().getMachOSection("__TEXT", "__constructor", 0,
|
||||||
|
SectionKind::getDataRel());
|
||||||
StaticDtorSection
|
StaticDtorSection
|
||||||
= getMachOSection("__TEXT", "__destructor", 0, SectionKind::getDataRel());
|
= getContext().getMachOSection("__TEXT", "__destructor", 0,
|
||||||
|
SectionKind::getDataRel());
|
||||||
} else {
|
} else {
|
||||||
StaticCtorSection
|
StaticCtorSection
|
||||||
= getMachOSection("__DATA", "__mod_init_func",
|
= getContext().getMachOSection("__DATA", "__mod_init_func",
|
||||||
MCSectionMachO::S_MOD_INIT_FUNC_POINTERS,
|
MCSectionMachO::S_MOD_INIT_FUNC_POINTERS,
|
||||||
SectionKind::getDataRel());
|
SectionKind::getDataRel());
|
||||||
StaticDtorSection
|
StaticDtorSection
|
||||||
= getMachOSection("__DATA", "__mod_term_func",
|
= getContext().getMachOSection("__DATA", "__mod_term_func",
|
||||||
MCSectionMachO::S_MOD_TERM_FUNC_POINTERS,
|
MCSectionMachO::S_MOD_TERM_FUNC_POINTERS,
|
||||||
SectionKind::getDataRel());
|
SectionKind::getDataRel());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exception Handling.
|
// Exception Handling.
|
||||||
LSDASection = getMachOSection("__TEXT", "__gcc_except_tab", 0,
|
LSDASection = getContext().getMachOSection("__TEXT", "__gcc_except_tab", 0,
|
||||||
SectionKind::getReadOnlyWithRel());
|
SectionKind::getReadOnlyWithRel());
|
||||||
EHFrameSection =
|
EHFrameSection =
|
||||||
getMachOSection("__TEXT", "__eh_frame",
|
getContext().getMachOSection("__TEXT", "__eh_frame",
|
||||||
MCSectionMachO::S_COALESCED |
|
MCSectionMachO::S_COALESCED |
|
||||||
MCSectionMachO::S_ATTR_NO_TOC |
|
MCSectionMachO::S_ATTR_NO_TOC |
|
||||||
MCSectionMachO::S_ATTR_STRIP_STATIC_SYMS |
|
MCSectionMachO::S_ATTR_STRIP_STATIC_SYMS |
|
||||||
@@ -544,40 +545,52 @@ void TargetLoweringObjectFileMachO::Initialize(MCContext &Ctx,
|
|||||||
|
|
||||||
// Debug Information.
|
// Debug Information.
|
||||||
DwarfAbbrevSection =
|
DwarfAbbrevSection =
|
||||||
getMachOSection("__DWARF", "__debug_abbrev", MCSectionMachO::S_ATTR_DEBUG,
|
getContext().getMachOSection("__DWARF", "__debug_abbrev",
|
||||||
|
MCSectionMachO::S_ATTR_DEBUG,
|
||||||
SectionKind::getMetadata());
|
SectionKind::getMetadata());
|
||||||
DwarfInfoSection =
|
DwarfInfoSection =
|
||||||
getMachOSection("__DWARF", "__debug_info", MCSectionMachO::S_ATTR_DEBUG,
|
getContext().getMachOSection("__DWARF", "__debug_info",
|
||||||
|
MCSectionMachO::S_ATTR_DEBUG,
|
||||||
SectionKind::getMetadata());
|
SectionKind::getMetadata());
|
||||||
DwarfLineSection =
|
DwarfLineSection =
|
||||||
getMachOSection("__DWARF", "__debug_line", MCSectionMachO::S_ATTR_DEBUG,
|
getContext().getMachOSection("__DWARF", "__debug_line",
|
||||||
|
MCSectionMachO::S_ATTR_DEBUG,
|
||||||
SectionKind::getMetadata());
|
SectionKind::getMetadata());
|
||||||
DwarfFrameSection =
|
DwarfFrameSection =
|
||||||
getMachOSection("__DWARF", "__debug_frame", MCSectionMachO::S_ATTR_DEBUG,
|
getContext().getMachOSection("__DWARF", "__debug_frame",
|
||||||
|
MCSectionMachO::S_ATTR_DEBUG,
|
||||||
SectionKind::getMetadata());
|
SectionKind::getMetadata());
|
||||||
DwarfPubNamesSection =
|
DwarfPubNamesSection =
|
||||||
getMachOSection("__DWARF", "__debug_pubnames", MCSectionMachO::S_ATTR_DEBUG,
|
getContext().getMachOSection("__DWARF", "__debug_pubnames",
|
||||||
|
MCSectionMachO::S_ATTR_DEBUG,
|
||||||
SectionKind::getMetadata());
|
SectionKind::getMetadata());
|
||||||
DwarfPubTypesSection =
|
DwarfPubTypesSection =
|
||||||
getMachOSection("__DWARF", "__debug_pubtypes", MCSectionMachO::S_ATTR_DEBUG,
|
getContext().getMachOSection("__DWARF", "__debug_pubtypes",
|
||||||
|
MCSectionMachO::S_ATTR_DEBUG,
|
||||||
SectionKind::getMetadata());
|
SectionKind::getMetadata());
|
||||||
DwarfStrSection =
|
DwarfStrSection =
|
||||||
getMachOSection("__DWARF", "__debug_str", MCSectionMachO::S_ATTR_DEBUG,
|
getContext().getMachOSection("__DWARF", "__debug_str",
|
||||||
|
MCSectionMachO::S_ATTR_DEBUG,
|
||||||
SectionKind::getMetadata());
|
SectionKind::getMetadata());
|
||||||
DwarfLocSection =
|
DwarfLocSection =
|
||||||
getMachOSection("__DWARF", "__debug_loc", MCSectionMachO::S_ATTR_DEBUG,
|
getContext().getMachOSection("__DWARF", "__debug_loc",
|
||||||
|
MCSectionMachO::S_ATTR_DEBUG,
|
||||||
SectionKind::getMetadata());
|
SectionKind::getMetadata());
|
||||||
DwarfARangesSection =
|
DwarfARangesSection =
|
||||||
getMachOSection("__DWARF", "__debug_aranges", MCSectionMachO::S_ATTR_DEBUG,
|
getContext().getMachOSection("__DWARF", "__debug_aranges",
|
||||||
|
MCSectionMachO::S_ATTR_DEBUG,
|
||||||
SectionKind::getMetadata());
|
SectionKind::getMetadata());
|
||||||
DwarfRangesSection =
|
DwarfRangesSection =
|
||||||
getMachOSection("__DWARF", "__debug_ranges", MCSectionMachO::S_ATTR_DEBUG,
|
getContext().getMachOSection("__DWARF", "__debug_ranges",
|
||||||
|
MCSectionMachO::S_ATTR_DEBUG,
|
||||||
SectionKind::getMetadata());
|
SectionKind::getMetadata());
|
||||||
DwarfMacroInfoSection =
|
DwarfMacroInfoSection =
|
||||||
getMachOSection("__DWARF", "__debug_macinfo", MCSectionMachO::S_ATTR_DEBUG,
|
getContext().getMachOSection("__DWARF", "__debug_macinfo",
|
||||||
|
MCSectionMachO::S_ATTR_DEBUG,
|
||||||
SectionKind::getMetadata());
|
SectionKind::getMetadata());
|
||||||
DwarfDebugInlineSection =
|
DwarfDebugInlineSection =
|
||||||
getMachOSection("__DWARF", "__debug_inlined", MCSectionMachO::S_ATTR_DEBUG,
|
getContext().getMachOSection("__DWARF", "__debug_inlined",
|
||||||
|
MCSectionMachO::S_ATTR_DEBUG,
|
||||||
SectionKind::getMetadata());
|
SectionKind::getMetadata());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -601,7 +614,7 @@ getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
|
|||||||
|
|
||||||
// Get the section.
|
// Get the section.
|
||||||
const MCSectionMachO *S =
|
const MCSectionMachO *S =
|
||||||
getMachOSection(Segment, Section, TAA, StubSize, Kind);
|
getContext().getMachOSection(Segment, Section, TAA, StubSize, Kind);
|
||||||
|
|
||||||
// Okay, now that we got the section, verify that the TAA & StubSize agree.
|
// Okay, now that we got the section, verify that the TAA & StubSize agree.
|
||||||
// If the user declared multiple globals with different section flags, we need
|
// If the user declared multiple globals with different section flags, we need
|
||||||
|
@@ -1136,13 +1136,13 @@ void ARMAsmPrinter::EmitStartOfAsmFile(Module &M) {
|
|||||||
OutStreamer.SwitchSection(TLOFMacho.getConstTextCoalSection());
|
OutStreamer.SwitchSection(TLOFMacho.getConstTextCoalSection());
|
||||||
if (RelocM == Reloc::DynamicNoPIC) {
|
if (RelocM == Reloc::DynamicNoPIC) {
|
||||||
const MCSection *sect =
|
const MCSection *sect =
|
||||||
TLOFMacho.getMachOSection("__TEXT", "__symbol_stub4",
|
OutContext.getMachOSection("__TEXT", "__symbol_stub4",
|
||||||
MCSectionMachO::S_SYMBOL_STUBS,
|
MCSectionMachO::S_SYMBOL_STUBS,
|
||||||
12, SectionKind::getText());
|
12, SectionKind::getText());
|
||||||
OutStreamer.SwitchSection(sect);
|
OutStreamer.SwitchSection(sect);
|
||||||
} else {
|
} else {
|
||||||
const MCSection *sect =
|
const MCSection *sect =
|
||||||
TLOFMacho.getMachOSection("__TEXT", "__picsymbolstub4",
|
OutContext.getMachOSection("__TEXT", "__picsymbolstub4",
|
||||||
MCSectionMachO::S_SYMBOL_STUBS,
|
MCSectionMachO::S_SYMBOL_STUBS,
|
||||||
16, SectionKind::getText());
|
16, SectionKind::getText());
|
||||||
OutStreamer.SwitchSection(sect);
|
OutStreamer.SwitchSection(sect);
|
||||||
|
@@ -654,13 +654,13 @@ void PPCDarwinAsmPrinter::EmitStartOfAsmFile(Module &M) {
|
|||||||
OutStreamer.SwitchSection(TLOFMacho.getTextCoalSection());
|
OutStreamer.SwitchSection(TLOFMacho.getTextCoalSection());
|
||||||
if (TM.getRelocationModel() == Reloc::PIC_) {
|
if (TM.getRelocationModel() == Reloc::PIC_) {
|
||||||
OutStreamer.SwitchSection(
|
OutStreamer.SwitchSection(
|
||||||
TLOFMacho.getMachOSection("__TEXT", "__picsymbolstub1",
|
OutContext.getMachOSection("__TEXT", "__picsymbolstub1",
|
||||||
MCSectionMachO::S_SYMBOL_STUBS |
|
MCSectionMachO::S_SYMBOL_STUBS |
|
||||||
MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
|
MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
|
||||||
32, SectionKind::getText()));
|
32, SectionKind::getText()));
|
||||||
} else if (TM.getRelocationModel() == Reloc::DynamicNoPIC) {
|
} else if (TM.getRelocationModel() == Reloc::DynamicNoPIC) {
|
||||||
OutStreamer.SwitchSection(
|
OutStreamer.SwitchSection(
|
||||||
TLOFMacho.getMachOSection("__TEXT","__symbol_stub1",
|
OutContext.getMachOSection("__TEXT","__symbol_stub1",
|
||||||
MCSectionMachO::S_SYMBOL_STUBS |
|
MCSectionMachO::S_SYMBOL_STUBS |
|
||||||
MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
|
MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
|
||||||
16, SectionKind::getText()));
|
16, SectionKind::getText()));
|
||||||
@@ -695,7 +695,7 @@ EmitFunctionStubs(const MachineModuleInfoMachO::SymbolListTy &Stubs) {
|
|||||||
// Output stubs for dynamically-linked functions
|
// Output stubs for dynamically-linked functions
|
||||||
if (TM.getRelocationModel() == Reloc::PIC_) {
|
if (TM.getRelocationModel() == Reloc::PIC_) {
|
||||||
const MCSection *StubSection =
|
const MCSection *StubSection =
|
||||||
TLOFMacho.getMachOSection("__TEXT", "__picsymbolstub1",
|
OutContext.getMachOSection("__TEXT", "__picsymbolstub1",
|
||||||
MCSectionMachO::S_SYMBOL_STUBS |
|
MCSectionMachO::S_SYMBOL_STUBS |
|
||||||
MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
|
MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
|
||||||
32, SectionKind::getText());
|
32, SectionKind::getText());
|
||||||
@@ -742,7 +742,7 @@ EmitFunctionStubs(const MachineModuleInfoMachO::SymbolListTy &Stubs) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const MCSection *StubSection =
|
const MCSection *StubSection =
|
||||||
TLOFMacho.getMachOSection("__TEXT","__symbol_stub1",
|
OutContext.getMachOSection("__TEXT","__symbol_stub1",
|
||||||
MCSectionMachO::S_SYMBOL_STUBS |
|
MCSectionMachO::S_SYMBOL_STUBS |
|
||||||
MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
|
MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
|
||||||
16, SectionKind::getText());
|
16, SectionKind::getText());
|
||||||
|
@@ -474,9 +474,6 @@ void X86AsmPrinter::EmitStartOfAsmFile(Module &M) {
|
|||||||
void X86AsmPrinter::EmitEndOfAsmFile(Module &M) {
|
void X86AsmPrinter::EmitEndOfAsmFile(Module &M) {
|
||||||
if (Subtarget->isTargetDarwin()) {
|
if (Subtarget->isTargetDarwin()) {
|
||||||
// All darwin targets use mach-o.
|
// All darwin targets use mach-o.
|
||||||
TargetLoweringObjectFileMachO &TLOFMacho =
|
|
||||||
static_cast<TargetLoweringObjectFileMachO &>(getObjFileLowering());
|
|
||||||
|
|
||||||
MachineModuleInfoMachO &MMIMacho =
|
MachineModuleInfoMachO &MMIMacho =
|
||||||
MMI->getObjFileInfo<MachineModuleInfoMachO>();
|
MMI->getObjFileInfo<MachineModuleInfoMachO>();
|
||||||
|
|
||||||
@@ -486,7 +483,7 @@ void X86AsmPrinter::EmitEndOfAsmFile(Module &M) {
|
|||||||
Stubs = MMIMacho.GetFnStubList();
|
Stubs = MMIMacho.GetFnStubList();
|
||||||
if (!Stubs.empty()) {
|
if (!Stubs.empty()) {
|
||||||
const MCSection *TheSection =
|
const MCSection *TheSection =
|
||||||
TLOFMacho.getMachOSection("__IMPORT", "__jump_table",
|
OutContext.getMachOSection("__IMPORT", "__jump_table",
|
||||||
MCSectionMachO::S_SYMBOL_STUBS |
|
MCSectionMachO::S_SYMBOL_STUBS |
|
||||||
MCSectionMachO::S_ATTR_SELF_MODIFYING_CODE |
|
MCSectionMachO::S_ATTR_SELF_MODIFYING_CODE |
|
||||||
MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
|
MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
|
||||||
@@ -512,7 +509,7 @@ void X86AsmPrinter::EmitEndOfAsmFile(Module &M) {
|
|||||||
Stubs = MMIMacho.GetGVStubList();
|
Stubs = MMIMacho.GetGVStubList();
|
||||||
if (!Stubs.empty()) {
|
if (!Stubs.empty()) {
|
||||||
const MCSection *TheSection =
|
const MCSection *TheSection =
|
||||||
TLOFMacho.getMachOSection("__IMPORT", "__pointers",
|
OutContext.getMachOSection("__IMPORT", "__pointers",
|
||||||
MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS,
|
MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS,
|
||||||
SectionKind::getMetadata());
|
SectionKind::getMetadata());
|
||||||
OutStreamer.SwitchSection(TheSection);
|
OutStreamer.SwitchSection(TheSection);
|
||||||
|
Reference in New Issue
Block a user