mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-26 07:24:25 +00:00
Compute the ELF SectionKind from the flags.
Any code creating an MCSectionELF knows ELF and already provides the flags. SectionKind is an abstraction used by common code that uses a plain MCSection. Use the flags to compute the SectionKind. This removes a lot of guessing and boilerplate from the MCSectionELF construction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227476 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -704,8 +704,8 @@ void MipsAsmPrinter::EmitStartOfAsmFile(Module &M) {
|
||||
|
||||
// Tell the assembler which ABI we are using
|
||||
std::string SectionName = std::string(".mdebug.") + getCurrentABIString();
|
||||
OutStreamer.SwitchSection(OutContext.getELFSection(
|
||||
SectionName, ELF::SHT_PROGBITS, 0, SectionKind::getDataRel()));
|
||||
OutStreamer.SwitchSection(
|
||||
OutContext.getELFSection(SectionName, ELF::SHT_PROGBITS, 0));
|
||||
|
||||
// NaN: At the moment we only support:
|
||||
// 1. .nan legacy (default)
|
||||
@ -717,13 +717,11 @@ void MipsAsmPrinter::EmitStartOfAsmFile(Module &M) {
|
||||
|
||||
if (Subtarget->isABI_EABI()) {
|
||||
if (Subtarget->isGP32bit())
|
||||
OutStreamer.SwitchSection(
|
||||
OutContext.getELFSection(".gcc_compiled_long32", ELF::SHT_PROGBITS, 0,
|
||||
SectionKind::getDataRel()));
|
||||
OutStreamer.SwitchSection(OutContext.getELFSection(".gcc_compiled_long32",
|
||||
ELF::SHT_PROGBITS, 0));
|
||||
else
|
||||
OutStreamer.SwitchSection(
|
||||
OutContext.getELFSection(".gcc_compiled_long64", ELF::SHT_PROGBITS, 0,
|
||||
SectionKind::getDataRel()));
|
||||
OutStreamer.SwitchSection(OutContext.getELFSection(".gcc_compiled_long64",
|
||||
ELF::SHT_PROGBITS, 0));
|
||||
}
|
||||
|
||||
getTargetStreamer().updateABIInfo(*Subtarget);
|
||||
@ -945,7 +943,7 @@ void MipsAsmPrinter::EmitFPCallStub(
|
||||
//
|
||||
const MCSectionELF *M = OutContext.getELFSection(
|
||||
".mips16.call.fp." + std::string(Symbol), ELF::SHT_PROGBITS,
|
||||
ELF::SHF_ALLOC | ELF::SHF_EXECINSTR, SectionKind::getText());
|
||||
ELF::SHF_ALLOC | ELF::SHF_EXECINSTR);
|
||||
OutStreamer.SwitchSection(M, nullptr);
|
||||
//
|
||||
// .align 2
|
||||
|
Reference in New Issue
Block a user