mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
On MachO, don't put non-private constants in mergeable sections.
On MachO, putting a symbol that doesn't start with a 'L' or 'l' in one of the __TEXT,__literal* sections prevents the linker from merging the context of the section. Since private GVs are the ones the get mangled to start with 'L' or 'l', we now only put those on the __TEXT,__literal* sections. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216682 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -626,7 +626,9 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
|
||||
cast<GlobalVariable>(GV)) < 32)
|
||||
return UStringSection;
|
||||
|
||||
if (Kind.isMergeableConst()) {
|
||||
// With MachO only variables whose corresponding symbol starts with 'l' or
|
||||
// 'L' can be merged, so we only try merging GVs with private linkage.
|
||||
if (GV->hasPrivateLinkage() && Kind.isMergeableConst()) {
|
||||
if (Kind.isMergeableConst4())
|
||||
return FourByteConstantSection;
|
||||
if (Kind.isMergeableConst8())
|
||||
|
Reference in New Issue
Block a user