diff options
author | Alexander Potapenko <glider@google.com> | 2013-07-09 10:00:16 +0000 |
---|---|---|
committer | Alexander Potapenko <glider@google.com> | 2013-07-09 10:00:16 +0000 |
commit | 8d2d79d05f93c5ed8b3eba750b076ea3471eb1f0 (patch) | |
tree | fe0bc2ba5926d46a77e9c13e979b298910c1d74d /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
parent | 2d0175e8fb2ed6b92c8061544ed7cdfd851a8731 (diff) | |
download | bcm5719-llvm-8d2d79d05f93c5ed8b3eba750b076ea3471eb1f0.tar.gz bcm5719-llvm-8d2d79d05f93c5ed8b3eba750b076ea3471eb1f0.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.
llvm-svn: 185923
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index c92894555bf..3e1afc01e06 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/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. |