mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-10 02:25:47 +00:00
Distinguish .const and .const_data on Darwin, when needed. This is somehow crazy :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53350 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -245,6 +245,7 @@ const Section*
|
|||||||
X86DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
|
X86DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
|
||||||
SectionKind::Kind Kind = SectionKindForGlobal(GV);
|
SectionKind::Kind Kind = SectionKindForGlobal(GV);
|
||||||
bool isWeak = GV->isWeakForLinker();
|
bool isWeak = GV->isWeakForLinker();
|
||||||
|
bool isNonStatic = (X86TM->getRelocationModel() != Reloc::Static);
|
||||||
|
|
||||||
switch (Kind) {
|
switch (Kind) {
|
||||||
case SectionKind::Text:
|
case SectionKind::Text:
|
||||||
@@ -261,7 +262,8 @@ X86DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const {
|
|||||||
else
|
else
|
||||||
return (isWeak ? DataCoalSection : getDataSection_());
|
return (isWeak ? DataCoalSection : getDataSection_());
|
||||||
case SectionKind::ROData:
|
case SectionKind::ROData:
|
||||||
return (isWeak ? ConstDataCoalSection : getReadOnlySection_());
|
return (isWeak ? ConstDataCoalSection :
|
||||||
|
(isNonStatic ? ConstDataSection : getReadOnlySection_()));
|
||||||
case SectionKind::RODataMergeStr:
|
case SectionKind::RODataMergeStr:
|
||||||
return (isWeak ?
|
return (isWeak ?
|
||||||
ConstDataCoalSection :
|
ConstDataCoalSection :
|
||||||
|
Reference in New Issue
Block a user