mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
Cleanup handling of .zerofill on darwin:
1. TargetLoweringObjectFileMachO should decide if something goes in zerofill instead of having every target do it. 2. TargetLoweringObjectFileMachO should assign said symbols to the right MCSection, the asmprinters should just emit to the right section. 3. Since all zerofill stuff goes through mcstreamer anymore, MAI can have a bool "haszerofill" instead of having the textual directive to emit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93838 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -750,6 +750,9 @@ void TargetLoweringObjectFileMachO::Initialize(MCContext &Ctx,
|
||||
ConstDataCoalSection
|
||||
= getMachOSection("__DATA","__const_coal", MCSectionMachO::S_COALESCED,
|
||||
SectionKind::getText());
|
||||
DataCommonSection
|
||||
= getMachOSection("__DATA","__common", MCSectionMachO::S_ZEROFILL,
|
||||
SectionKind::getBSS());
|
||||
ConstDataSection // .const_data
|
||||
= getMachOSection("__DATA", "__const", 0,
|
||||
SectionKind::getReadOnlyWithRel());
|
||||
@@ -915,6 +918,11 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
|
||||
if (Kind.isReadOnlyWithRel())
|
||||
return ConstDataSection;
|
||||
|
||||
// Put zero initialized globals with strong external linkage in the
|
||||
// DATA, __common section with the .zerofill directive.
|
||||
if (Kind.isBSS() && GV->hasExternalLinkage())
|
||||
return DataCommonSection;
|
||||
|
||||
// Otherwise, just drop the variable in the normal data section.
|
||||
return DataSection;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user