From d0804aa6dc476f75017a74d5fd77e737efe9a9ea Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Tue, 10 Apr 2018 20:16:35 +0000 Subject: [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 --- llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp') 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; } -- cgit v1.2.3