mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 15:13:49 -04:00
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329752 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -135,6 +135,10 @@ void MCObjectFileInfo::initMachOMCObjectFileInfo(const Triple &T) {
|
||||
// "__DATA/__datacoal_nt" => section "__DATA/__data"
|
||||
Triple::ArchType ArchTy = T.getArch();
|
||||
|
||||
ConstDataSection // .const_data
|
||||
= Ctx->getMachOSection("__DATA", "__const", 0,
|
||||
SectionKind::getReadOnlyWithRel());
|
||||
|
||||
if (ArchTy == Triple::ppc || ArchTy == Triple::ppc64) {
|
||||
TextCoalSection
|
||||
= Ctx->getMachOSection("__TEXT", "__textcoal_nt",
|
||||
@@ -147,15 +151,14 @@ void MCObjectFileInfo::initMachOMCObjectFileInfo(const Triple &T) {
|
||||
SectionKind::getReadOnly());
|
||||
DataCoalSection = Ctx->getMachOSection(
|
||||
"__DATA", "__datacoal_nt", MachO::S_COALESCED, SectionKind::getData());
|
||||
ConstDataCoalSection = DataCoalSection;
|
||||
} else {
|
||||
TextCoalSection = TextSection;
|
||||
ConstTextCoalSection = ReadOnlySection;
|
||||
DataCoalSection = DataSection;
|
||||
ConstDataCoalSection = ConstDataSection;
|
||||
}
|
||||
|
||||
ConstDataSection // .const_data
|
||||
= Ctx->getMachOSection("__DATA", "__const", 0,
|
||||
SectionKind::getReadOnlyWithRel());
|
||||
DataCommonSection
|
||||
= Ctx->getMachOSection("__DATA","__common",
|
||||
MachO::S_ZEROFILL,
|
||||
|
||||
Reference in New Issue
Block a user