diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2011-01-16 17:19:34 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2011-01-16 17:19:34 +0000 |
commit | 7010401c6bdfb9895eba73af4fa7cb896f032ebe (patch) | |
tree | f419d943b22873b71a322bc5f053d15b4ccbc55f /lib/Target/TargetLoweringObjectFile.cpp | |
parent | d6e5cbc84226ad4a62e8847f1babecf86089d415 (diff) | |
download | llvm-7010401c6bdfb9895eba73af4fa7cb896f032ebe.tar.gz llvm-7010401c6bdfb9895eba73af4fa7cb896f032ebe.tar.bz2 llvm-7010401c6bdfb9895eba73af4fa7cb896f032ebe.tar.xz |
Only put unnamed_addr constants in mergeable sections. Fixes PR8297.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123585 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetLoweringObjectFile.cpp')
-rw-r--r-- | lib/Target/TargetLoweringObjectFile.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Target/TargetLoweringObjectFile.cpp b/lib/Target/TargetLoweringObjectFile.cpp index 0e67fe5d98..eab43fb427 100644 --- a/lib/Target/TargetLoweringObjectFile.cpp +++ b/lib/Target/TargetLoweringObjectFile.cpp @@ -162,7 +162,7 @@ SectionKind TargetLoweringObjectFile::getKindForGlobal(const GlobalValue *GV, // If the global is marked constant, we can put it into a mergable section, // a mergable string section, or general .data if it contains relocations. - if (GVar->isConstant()) { + if (GVar->isConstant() && GVar->hasUnnamedAddr()) { // If the initializer for the global contains something that requires a // relocation, then we may have to drop this into a wriable data section // even though it is marked const. |