Skip to content

Commit f35fa7d

Browse files
committed
[lld] enable fixup chains by default
1 parent d133ada commit f35fa7d

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

lld/MachO/Driver.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,8 +1075,7 @@ static bool shouldEmitChainedFixups(const InputArgList &args) {
10751075
return false;
10761076
}
10771077

1078-
// TODO: Enable by default once stable.
1079-
return isRequested;
1078+
return true;
10801079
}
10811080

10821081
void SymbolPatterns::clear() {

lld/test/MachO/arm64-objc-stubs-dyn.s

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,18 @@
4141
# CHECK-EMPTY:
4242

4343
# STUB: Contents of (__TEXT,__stubs) section
44-
# STUB-NEXT: adrp x16, 8 ; 0x100008000
44+
# STUB-NEXT: adrp x16, 4 ; 0x100004000
4545
# STUB-NEXT: ldr x16, [x16]
4646
# STUB-NEXT: br x16
4747

4848
# SMALL: Contents of (__TEXT,__objc_stubs) section
4949
# SMALL-NEXT: _objc_msgSend$foo:
5050
# SMALL-NEXT: adrp x1, 8 ; 0x100008000
51-
# SMALL-NEXT: ldr x1, [x1, #0x18]
51+
# SMALL-NEXT: ldr x1, [x1, #0x10]
5252
# SMALL-NEXT: b
5353
# SMALL-NEXT: _objc_msgSend$length:
5454
# SMALL-NEXT: adrp x1, 8 ; 0x100008000
55-
# SMALL-NEXT: ldr x1, [x1, #0x20]
55+
# SMALL-NEXT: ldr x1, [x1, #0x18]
5656
# SMALL-NEXT: b
5757

5858
.section __TEXT,__objc_methname,cstring_literals

lld/test/MachO/arm64-relocs.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# CHECK-NEXT: ret
2323

2424
# CHECK-LABEL: Contents of (__DATA_CONST,__const) section
25-
# CHECK: [[#PTR_1]] {{0*}}[[#BAZ]] 00000000 00000000 00000000
25+
# CHECK: [[#PTR_1]] {{0*}}[[#BAZ]] 00200000 00000000 00000000
2626
# CHECK: [[#PTR_2]] {{0*}}[[#BAZ+123]] 00000000 00000000 00000000
2727

2828
.text

lld/test/MachO/arm64-stubs.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/test.s -o %t/test.o
66
# RUN: %lld -arch arm64 -dylib -install_name @executable_path/libfoo.dylib %t/foo.o -o %t/libfoo.dylib
77
# RUN: %lld -arch arm64 -dylib -install_name @executable_path/libbar.dylib %t/bar.o -o %t/libbar.dylib
8-
# RUN: %lld -arch arm64 -lSystem %t/libfoo.dylib %t/libbar.dylib %t/test.o -o %t/test
8+
# RUN: %lld -arch arm64 -lSystem %t/libfoo.dylib %t/libbar.dylib %t/test.o -o %t/test -no_fixup_chains
99

1010
# RUN: llvm-objdump --no-print-imm-hex --macho -d --no-show-raw-insn --section="__TEXT,__stubs" --section="__TEXT,__stub_helper" %t/test | FileCheck %s
1111

lld/test/MachO/dyld-stub-binder.s

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,27 @@
1414
# RUN: %lld -arch arm64 -lSystem -dylib %t/foo.o -o %t/libfoo.dylib
1515
# RUN: llvm-nm -m %t/libfoo.dylib | FileCheck --check-prefix=STUB %s
1616

17-
1817
## Dylibs that do lazy dynamic calls do need dyld_stub_binder.
1918
# RUN: not %no-lsystem-lld -arch arm64 -dylib %t/bar.o %t/libfoo.dylib \
20-
# RUN: -o %t/libbar.dylib 2>&1 | FileCheck --check-prefix=MISSINGSTUB %s
19+
# RUN: -o %t/libbar.dylib -no_fixup_chains 2>&1 | \
20+
# RUN: FileCheck --check-prefix=MISSINGSTUB %s
2121
# RUN: %lld -arch arm64 -lSystem -dylib %t/bar.o %t/libfoo.dylib \
22-
# RUN: -o %t/libbar.dylib
22+
# RUN: -o %t/libbar.dylib -no_fixup_chains
2323
# RUN: llvm-nm -m %t/libbar.dylib | FileCheck --check-prefix=STUB %s
2424

2525
## As do executables.
2626
# RUN: not %no-lsystem-lld -arch arm64 %t/libfoo.dylib %t/libbar.dylib %t/test.o \
27-
# RUN: -o %t/test 2>&1 | FileCheck --check-prefix=MISSINGSTUB %s
27+
# RUN: -o %t/test -no_fixup_chains 2>&1 | FileCheck --check-prefix=MISSINGSTUB %s
2828
# RUN: %lld -arch arm64 -lSystem %t/libfoo.dylib %t/libbar.dylib %t/test.o \
29-
# RUN: -o %t/test
29+
# RUN: -o %t/test -no_fixup_chains
3030
# RUN: llvm-nm -m %t/test | FileCheck --check-prefix=STUB %s
3131

3232
## Test dynamic lookup of dyld_stub_binder.
3333
# RUN: %no-lsystem-lld -arch arm64 %t/libfoo.dylib %t/libbar.dylib %t/test.o \
34-
# RUN: -o %t/test -undefined dynamic_lookup
34+
# RUN: -o %t/test -undefined dynamic_lookup -no_fixup_chains
3535
# RUN: llvm-nm -m %t/test | FileCheck --check-prefix=DYNSTUB %s
3636
# RUN: %no-lsystem-lld -arch arm64 %t/libfoo.dylib %t/libbar.dylib %t/test.o \
37-
# RUN: -o %t/test -U dyld_stub_binder
37+
# RUN: -o %t/test -U dyld_stub_binder -no_fixup_chains
3838
# RUN: llvm-nm -m %t/test | FileCheck --check-prefix=DYNSTUB %s
3939

4040
# MISSINGSTUB: error: undefined symbol: dyld_stub_binder

lld/test/MachO/icf-safe.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
; RUN: rm -rf %t; mkdir %t
44

55
; RUN: llc -filetype=obj %s -O3 -o %t/icf-obj.o -enable-machine-outliner=never -mtriple arm64-apple-macos -addrsig
6-
; RUN: %lld -arch arm64 -lSystem --icf=safe -dylib -o %t/icf-safe.dylib %t/icf-obj.o
7-
; RUN: %lld -arch arm64 -lSystem --icf=all -dylib -o %t/icf-all.dylib %t/icf-obj.o
6+
; RUN: %lld -arch arm64 -lSystem --icf=safe -dylib -o %t/icf-safe.dylib %t/icf-obj.o -no_fixup_chains
7+
; RUN: %lld -arch arm64 -lSystem --icf=all -dylib -o %t/icf-all.dylib %t/icf-obj.o -no_fixup_chains
88
; RUN: llvm-objdump %t/icf-safe.dylib -d --macho | FileCheck %s --check-prefix=ICFSAFE
99
; RUN: llvm-objdump %t/icf-all.dylib -d --macho | FileCheck %s --check-prefix=ICFALL
1010

1111
; RUN: llvm-as %s -o %t/icf-bitcode.o
12-
; RUN: %lld -arch arm64 -lSystem --icf=safe -dylib -o %t/icf-safe-bitcode.dylib %t/icf-bitcode.o
13-
; RUN: %lld -arch arm64 -lSystem --icf=all -dylib -o %t/icf-all-bitcode.dylib %t/icf-bitcode.o
12+
; RUN: %lld -arch arm64 -lSystem --icf=safe -dylib -o %t/icf-safe-bitcode.dylib %t/icf-bitcode.o -no_fixup_chains
13+
; RUN: %lld -arch arm64 -lSystem --icf=all -dylib -o %t/icf-all-bitcode.dylib %t/icf-bitcode.o -no_fixup_chains
1414
; RUN: llvm-objdump %t/icf-safe-bitcode.dylib -d --macho | FileCheck %s --check-prefix=ICFSAFE
1515
; RUN: llvm-objdump %t/icf-all-bitcode.dylib -d --macho | FileCheck %s --check-prefix=ICFALL
1616

lld/test/MachO/objc-selrefs.s

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
# RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/implicit-selrefs.s -o %t/implicit-selrefs.o
77

88
# RUN: %lld -dylib -arch arm64 -lSystem -o %t/explicit-only-no-icf \
9-
# RUN: %t/explicit-selrefs-1.o %t/explicit-selrefs-2.o
9+
# RUN: %t/explicit-selrefs-1.o %t/explicit-selrefs-2.o -no_fixup_chains
1010
# RUN: llvm-otool -vs __DATA __objc_selrefs %t/explicit-only-no-icf | \
1111
# RUN: FileCheck %s --check-prefix=EXPLICIT-NO-ICF
1212

1313
## NOTE: ld64 always dedups the selrefs unconditionally, but we only do it when
1414
## ICF is enabled.
1515
# RUN: %lld -dylib -arch arm64 -lSystem -o %t/explicit-only-with-icf \
16-
# RUN: %t/explicit-selrefs-1.o %t/explicit-selrefs-2.o
16+
# RUN: %t/explicit-selrefs-1.o %t/explicit-selrefs-2.o -no_fixup_chains
1717
# RUN: llvm-otool -vs __DATA __objc_selrefs %t/explicit-only-with-icf \
1818
# RUN: | FileCheck %s --check-prefix=EXPLICIT-WITH-ICF
1919

@@ -26,7 +26,8 @@
2626

2727
## We don't yet support dedup'ing implicitly-defined selrefs.
2828
# RUN: %lld -dylib -arch arm64 -lSystem --icf=all -o %t/explicit-and-implicit \
29-
# RUN: %t/explicit-selrefs-1.o %t/explicit-selrefs-2.o %t/implicit-selrefs.o
29+
# RUN: %t/explicit-selrefs-1.o %t/explicit-selrefs-2.o %t/implicit-selrefs.o \
30+
# RUN: -no_fixup_chains
3031
# RUN: llvm-otool -vs __DATA __objc_selrefs %t/explicit-and-implicit \
3132
# RUN: | FileCheck %s --check-prefix=EXPLICIT-AND-IMPLICIT
3233

0 commit comments

Comments
 (0)