summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-02-04 21:27:24 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-02-04 21:27:24 +0000
commita092f17580d76749a4f96714d6fe6fb26d1a174a (patch)
treee298a86a3dfebbb4b9b8b3e45b63aa03a6d6ecad /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parent39477c4c8b7c063441ee70f5f65c1e1edd194f09 (diff)
downloadbcm5719-llvm-a092f17580d76749a4f96714d6fe6fb26d1a174a.tar.gz
bcm5719-llvm-a092f17580d76749a4f96714d6fe6fb26d1a174a.zip
Don' try to make sections in comdats SHF_MERGE.
Parts of llvm were not expecting it and we wouldn't print the entity size of the section. Given what comdats are used for, having SHF_MERGE sections would be just a small improvement, so just disable it for now. Fixes pr22463. llvm-svn: 228196
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 0cbd7753055..396d9e4fbfa 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -166,7 +166,7 @@ static unsigned getELFSectionType(StringRef Name, SectionKind K) {
static unsigned
-getELFSectionFlags(SectionKind K) {
+getELFSectionFlags(SectionKind K, bool InCOMDAT) {
unsigned Flags = 0;
if (!K.isMetadata())
@@ -181,7 +181,7 @@ getELFSectionFlags(SectionKind K) {
if (K.isThreadLocal())
Flags |= ELF::SHF_TLS;
- if (K.isMergeableCString() || K.isMergeableConst())
+ if (!InCOMDAT && (K.isMergeableCString() || K.isMergeableConst()))
Flags |= ELF::SHF_MERGE;
if (K.isMergeableCString())
@@ -211,7 +211,7 @@ const MCSection *TargetLoweringObjectFileELF::getExplicitSectionGlobal(
Kind = getELFKindForNamedSection(SectionName, Kind);
StringRef Group = "";
- unsigned Flags = getELFSectionFlags(Kind);
+ unsigned Flags = getELFSectionFlags(Kind, GV->hasComdat());
if (const Comdat *C = getELFComdat(GV)) {
Group = C->getName();
Flags |= ELF::SHF_GROUP;
@@ -243,7 +243,7 @@ static StringRef getSectionPrefixForGlobal(SectionKind Kind) {
const MCSection *TargetLoweringObjectFileELF::
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
Mangler &Mang, const TargetMachine &TM) const {
- unsigned Flags = getELFSectionFlags(Kind);
+ unsigned Flags = getELFSectionFlags(Kind, GV->hasComdat());
// If we have -ffunction-section or -fdata-section then we should emit the
// global value to a uniqued section specifically for it.
OpenPOWER on IntegriCloud