summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorSteven Wu <stevenwu@apple.com>2018-04-10 20:16:35 +0000
committerSteven Wu <stevenwu@apple.com>2018-04-10 20:16:35 +0000
commitd0804aa6dc476f75017a74d5fd77e737efe9a9ea (patch)
tree63f04a66107c24bc5694b7164efcccac0e6dcb30 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parentc0f879bcecd4058732aad6c1e113adf78990f5a3 (diff)
downloadbcm5719-llvm-d0804aa6dc476f75017a74d5fd77e737efe9a9ea.tar.gz
bcm5719-llvm-d0804aa6dc476f75017a74d5fd77e737efe9a9ea.zip
[MachO] Emit Weak ReadOnlyWithRel to ConstDataSection
Summary: Darwin dynamic linker can handle weak symbols in ConstDataSection. ReadonReadOnlyWithRel symbols should be emitted in ConstDataSection instead of normal DataSection. rdar://problem/39298457 Reviewers: dexonsmith, kledzik Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45472 llvm-svn: 329752
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index dc3efe1d4bc..a4a54e1fb24 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -744,6 +744,8 @@ MCSection *TargetLoweringObjectFileMachO::SelectSectionForGlobal(
if (GO->isWeakForLinker()) {
if (Kind.isReadOnly())
return ConstTextCoalSection;
+ if (Kind.isReadOnlyWithRel())
+ return ConstDataCoalSection;
return DataCoalSection;
}
OpenPOWER on IntegriCloud