aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2013-07-09 10:00:16 +0000
committerAlexander Potapenko <glider@google.com>2013-07-09 10:00:16 +0000
commit9467b3e0ac593571a205041c129ed5ae11bf9d1f (patch)
tree3ad833e8eda133fae3d3db03f25bcf1389c5aa82 /lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parent9fb5a6588becc92be1d7cf503d2947b170be3c31 (diff)
downloadexternal_llvm-9467b3e0ac593571a205041c129ed5ae11bf9d1f.tar.gz
external_llvm-9467b3e0ac593571a205041c129ed5ae11bf9d1f.tar.bz2
external_llvm-9467b3e0ac593571a205041c129ed5ae11bf9d1f.zip
Revert r185872 - "Stop emitting weak symbols into the "coal" sections"
This patch broke `make check-asan` on Mac, causing ld warnings like the following one: ld: warning: direct access in __GLOBAL__I_a to global weak symbol ___asan_mapping_scale means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings. The resulting test binaries crashed with incorrect ASan warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185923 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--lib/CodeGen/TargetLoweringObjectFileImpl.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index c92894555b..3e1afc01e0 100644
--- a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -524,14 +524,14 @@ const MCSection *TargetLoweringObjectFileMachO::
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
Mangler *Mang, const TargetMachine &TM) const {
if (Kind.isText())
- return TextSection;
-
- // If this is weak/linkonce, put this in a read only or data section depending
- // on whether or not it's writable.
+ return GV->isWeakForLinker() ? TextCoalSection : TextSection;
+
+ // If this is weak/linkonce, put this in a coalescable section, either in text
+ // or data depending on if it is writable.
if (GV->isWeakForLinker()) {
if (Kind.isReadOnly())
- return ReadOnlySection;
- return DataSection;
+ return ConstTextCoalSection;
+ return DataCoalSection;
}
// FIXME: Alignment check should be handled by section classifier.