mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-15 09:33:39 +00:00
Provide default implementation of different small-sections related stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53920 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0980980174
commit
04dda73926
@ -231,6 +231,13 @@ TargetAsmInfo::SectionFlagsForGlobal(const GlobalValue *GV,
|
|||||||
case SectionKind::RODataMergeConst:
|
case SectionKind::RODataMergeConst:
|
||||||
// No additional flags here
|
// No additional flags here
|
||||||
break;
|
break;
|
||||||
|
case SectionKind::SmallData:
|
||||||
|
case SectionKind::SmallBSS:
|
||||||
|
Flags |= SectionFlags::Writeable;
|
||||||
|
// FALLS THROUGH
|
||||||
|
case SectionKind::SmallROData:
|
||||||
|
Flags |= SectionFlags::Small;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0 && "Unexpected section kind!");
|
assert(0 && "Unexpected section kind!");
|
||||||
}
|
}
|
||||||
@ -245,7 +252,9 @@ TargetAsmInfo::SectionFlagsForGlobal(const GlobalValue *GV,
|
|||||||
|
|
||||||
// Some lame default implementation based on some magic section names.
|
// Some lame default implementation based on some magic section names.
|
||||||
if (strncmp(Name, ".gnu.linkonce.b.", 16) == 0 ||
|
if (strncmp(Name, ".gnu.linkonce.b.", 16) == 0 ||
|
||||||
strncmp(Name, ".llvm.linkonce.b.", 17) == 0)
|
strncmp(Name, ".llvm.linkonce.b.", 17) == 0 ||
|
||||||
|
strncmp(Name, ".gnu.linkonce.sb.", 17) == 0 ||
|
||||||
|
strncmp(Name, ".llvm.linkonce.sb.", 18) == 0)
|
||||||
Flags |= SectionFlags::BSS;
|
Flags |= SectionFlags::BSS;
|
||||||
else if (strcmp(Name, ".tdata") == 0 ||
|
else if (strcmp(Name, ".tdata") == 0 ||
|
||||||
strncmp(Name, ".tdata.", 7) == 0 ||
|
strncmp(Name, ".tdata.", 7) == 0 ||
|
||||||
@ -297,12 +306,15 @@ TargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
|
|||||||
} else {
|
} else {
|
||||||
if (Kind == SectionKind::Text)
|
if (Kind == SectionKind::Text)
|
||||||
return getTextSection_();
|
return getTextSection_();
|
||||||
else if (Kind == SectionKind::BSS && getBSSSection_())
|
else if ((Kind == SectionKind::BSS ||
|
||||||
|
Kind == SectionKind::SmallBSS) &&
|
||||||
|
getBSSSection_())
|
||||||
return getBSSSection_();
|
return getBSSSection_();
|
||||||
else if (getReadOnlySection_() &&
|
else if (getReadOnlySection_() &&
|
||||||
(Kind == SectionKind::ROData ||
|
(Kind == SectionKind::ROData ||
|
||||||
Kind == SectionKind::RODataMergeConst ||
|
Kind == SectionKind::RODataMergeConst ||
|
||||||
Kind == SectionKind::RODataMergeStr))
|
Kind == SectionKind::RODataMergeStr ||
|
||||||
|
Kind == SectionKind::SmallROData))
|
||||||
return getReadOnlySection_();
|
return getReadOnlySection_();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -317,12 +329,18 @@ TargetAsmInfo::UniqueSectionForGlobal(const GlobalValue* GV,
|
|||||||
return ".gnu.linkonce.t." + GV->getName();
|
return ".gnu.linkonce.t." + GV->getName();
|
||||||
case SectionKind::Data:
|
case SectionKind::Data:
|
||||||
return ".gnu.linkonce.d." + GV->getName();
|
return ".gnu.linkonce.d." + GV->getName();
|
||||||
|
case SectionKind::SmallData:
|
||||||
|
return ".gnu.linkonce.s." + GV->getName();
|
||||||
case SectionKind::BSS:
|
case SectionKind::BSS:
|
||||||
return ".gnu.linkonce.b." + GV->getName();
|
return ".gnu.linkonce.b." + GV->getName();
|
||||||
|
case SectionKind::SmallBSS:
|
||||||
|
return ".gnu.linkonce.sb." + GV->getName();
|
||||||
case SectionKind::ROData:
|
case SectionKind::ROData:
|
||||||
case SectionKind::RODataMergeConst:
|
case SectionKind::RODataMergeConst:
|
||||||
case SectionKind::RODataMergeStr:
|
case SectionKind::RODataMergeStr:
|
||||||
return ".gnu.linkonce.r." + GV->getName();
|
return ".gnu.linkonce.r." + GV->getName();
|
||||||
|
case SectionKind::SmallROData:
|
||||||
|
return ".gnu.linkonce.s2." + GV->getName();
|
||||||
case SectionKind::ThreadData:
|
case SectionKind::ThreadData:
|
||||||
return ".gnu.linkonce.td." + GV->getName();
|
return ".gnu.linkonce.td." + GV->getName();
|
||||||
case SectionKind::ThreadBSS:
|
case SectionKind::ThreadBSS:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user