mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-12 01:25:10 +00:00
Change SectionKind to be a property that is true of a *section*, it
should have no state that is specific to particular globals in the section. In this case, it means the removal of the "isWeak" and "ExplicitSection" bits. MCSection uses the new form of SectionKind. To handle isWeak, I introduced a new SectionInfo class, which is SectionKind + isWeak, and it is used by the part of the code generator that does classification of a specific global. The ExplicitSection disappears. It is moved onto MCSection as a new "IsDirective" bit. Since the Name of a section is either a section or directive, it makes sense to keep this bit in MCSection. Ultimately the creator of MCSection should canonicalize (e.g.) .text to whatever the actual section is. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77803 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -16,9 +16,12 @@ using namespace llvm;
|
||||
void XCoreTargetObjectFile::Initialize(MCContext &Ctx, const TargetMachine &TM){
|
||||
TargetLoweringObjectFileELF::Initialize(Ctx, TM);
|
||||
|
||||
TextSection = getOrCreateSection("\t.text", true, SectionKind::Text);
|
||||
DataSection = getOrCreateSection("\t.dp.data", false, SectionKind::DataRel);
|
||||
BSSSection_ = getOrCreateSection("\t.dp.bss", false, SectionKind::BSS);
|
||||
TextSection = getOrCreateSection("\t.text", true,
|
||||
SectionKind::get(SectionKind::Text));
|
||||
DataSection = getOrCreateSection("\t.dp.data", false,
|
||||
SectionKind::get(SectionKind::DataRel));
|
||||
BSSSection_ = getOrCreateSection("\t.dp.bss", false,
|
||||
SectionKind::get(SectionKind::BSS));
|
||||
|
||||
// TLS globals are lowered in the backend to arrays indexed by the current
|
||||
// thread id. After lowering they require no special handling by the linker
|
||||
@@ -29,8 +32,8 @@ void XCoreTargetObjectFile::Initialize(MCContext &Ctx, const TargetMachine &TM){
|
||||
if (TM.getSubtarget<XCoreSubtarget>().isXS1A())
|
||||
// FIXME: Why is this writable ("datarel")???
|
||||
ReadOnlySection = getOrCreateSection("\t.dp.rodata", false,
|
||||
SectionKind::DataRel);
|
||||
SectionKind::get(SectionKind::DataRel));
|
||||
else
|
||||
ReadOnlySection = getOrCreateSection("\t.cp.rodata", false,
|
||||
SectionKind::ReadOnly);
|
||||
SectionKind::get(SectionKind::ReadOnly));
|
||||
}
|
||||
|
Reference in New Issue
Block a user