summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorSean Fertile <sd.fertile@gmail.com>2019-10-28 16:07:10 -0400
committerSean Fertile <sd.fertile@gmail.com>2019-11-11 18:52:10 -0500
commite5e2e0a66b033bfe9b75b5a6352d215e02729836 (patch)
tree1128b00f05d61a4f2dec85c83160bf57b47a75ed /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parent6b0af41ad7becad333fa61626cf3a01561626bb8 (diff)
downloadbcm5719-llvm-e5e2e0a66b033bfe9b75b5a6352d215e02729836.tar.gz
bcm5719-llvm-e5e2e0a66b033bfe9b75b5a6352d215e02729836.zip
[PowerPC][XCOFF] Add support for zero initialized global values.
For XCOFF, globals mapped into the .bss section are linked as COMMON definitions. This behaviour is incorrect for zero initialized data, so emit those to the .data section instead. Differential Revision: https://reviews.llvm.org/D69528
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 4978f4b9500..f941b98890c 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -1855,6 +1855,12 @@ MCSection *TargetLoweringObjectFileXCOFF::SelectSectionForGlobal(
if (Kind.isData())
return DataSection;
+ // Zero initialized data must be emitted to the .data section because external
+ // linkage control sections that get mapped to the .bss section will be linked
+ // as tentative defintions, which is only appropriate for SectionKind::Common.
+ if (Kind.isBSS())
+ return DataSection;
+
report_fatal_error("XCOFF other section types not yet implemented.");
}
OpenPOWER on IntegriCloud