forked from OSchip/llvm-project
Allow L symbols in no_dead_strip sections.
If a section cannot be dead stripped, it is safe to use L symbols, since the linker will keep all of it in the end. llvm-svn: 221431
This commit is contained in:
parent
7fea87cb59
commit
bf77ed6826
|
@ -588,6 +588,10 @@ bool TargetLoweringObjectFileMachO::isSectionAtomizableBySymbols(
|
|||
SMO.getSectionName() == "__cfstring")
|
||||
return false;
|
||||
|
||||
// no_dead_strip sections are not atomized in practice.
|
||||
if (SMO.hasAttribute(MachO::S_ATTR_NO_DEAD_STRIP))
|
||||
return false;
|
||||
|
||||
switch (SMO.getType()) {
|
||||
default:
|
||||
return true;
|
||||
|
|
|
@ -69,3 +69,8 @@
|
|||
; CHECK: .section __DATA,__foobar,interposing
|
||||
; CHECK-NEXT: .align 3
|
||||
; CHECK-NEXT: L_private12:
|
||||
|
||||
@private13 = private global i32 42, section "__DATA, __objc_classlist, regular, no_dead_strip"
|
||||
; CHECK: .section __DATA,__objc_classlist,regular,no_dead_strip
|
||||
; CHECK-NEXT: .align 2
|
||||
; CHECK-NEXT: L_private13:
|
||||
|
|
Loading…
Reference in New Issue