|
1 | 1 | # REQUIRES: aarch64
|
2 | 2 |
|
3 | 3 | # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %s -o %t.o
|
4 |
| -# RUN: %lld -arch arm64 -lSystem -o %t.out %t.o |
| 4 | +# RUN: %lld -arch arm64 -lSystem -o %t.out %t.o -U _external_func |
5 | 5 | # RUN: llvm-otool -vs __TEXT __objc_stubs %t.out | FileCheck %s
|
6 |
| -# RUN: %lld -arch arm64 -lSystem -o %t.out %t.o -dead_strip |
| 6 | +# RUN: %lld -arch arm64 -lSystem -o %t.out %t.o -dead_strip -U _external_func |
7 | 7 | # RUN: llvm-otool -vs __TEXT __objc_stubs %t.out | FileCheck %s
|
8 |
| -# RUN: %lld -arch arm64 -lSystem -o %t.out %t.o -objc_stubs_fast |
| 8 | +# RUN: %lld -arch arm64 -lSystem -o %t.out %t.o -objc_stubs_fast -U _external_func |
9 | 9 | # RUN: llvm-otool -vs __TEXT __objc_stubs %t.out | FileCheck %s
|
10 | 10 | # RUN: llvm-otool -l %t.out | FileCheck %s --check-prefix=FASTALIGN
|
11 |
| -# RUN: %lld -arch arm64 -lSystem -o %t.out %t.o -objc_stubs_small |
| 11 | +# RUN: %lld -arch arm64 -lSystem -o %t.out %t.o -objc_stubs_small -U _external_func |
12 | 12 | # RUN: llvm-otool -vs __TEXT __objc_stubs %t.out | FileCheck %s --check-prefix=SMALL
|
13 | 13 | # RUN: llvm-otool -l %t.out | FileCheck %s --check-prefix=SMALLALIGN
|
| 14 | +# RUN: llvm-objdump --section-headers %t.out | FileCheck %s --check-prefix=SECTIONS |
14 | 15 |
|
15 | 16 | # CHECK: Contents of (__TEXT,__objc_stubs) section
|
16 | 17 |
|
17 | 18 | # CHECK-NEXT: _objc_msgSend$foo:
|
18 | 19 | # CHECK-NEXT: adrp x1, 8 ; 0x100008000
|
19 |
| -# CHECK-NEXT: ldr x1, [x1, #0x10] |
| 20 | +# CHECK-NEXT: ldr x1, [x1, #0x18] |
20 | 21 | # CHECK-NEXT: adrp x16, 4 ; 0x100004000
|
21 | 22 | # CHECK-NEXT: ldr x16, [x16]
|
22 | 23 | # CHECK-NEXT: br x16
|
|
26 | 27 |
|
27 | 28 | # CHECK-NEXT: _objc_msgSend$length:
|
28 | 29 | # CHECK-NEXT: adrp x1, 8 ; 0x100008000
|
29 |
| -# CHECK-NEXT: ldr x1, [x1, #0x18] |
| 30 | +# CHECK-NEXT: ldr x1, [x1, #0x20] |
30 | 31 | # CHECK-NEXT: adrp x16, 4 ; 0x100004000
|
31 | 32 | # CHECK-NEXT: ldr x16, [x16]
|
32 | 33 | # CHECK-NEXT: br x16
|
|
44 | 45 | # FASTALIGN-NEXT: align 2^5 (32)
|
45 | 46 |
|
46 | 47 | # SMALL: _objc_msgSend$foo:
|
47 |
| -# SMALL-NEXT: adrp x1, 4 ; 0x100004000 |
48 |
| -# SMALL-NEXT: ldr x1, [x1, #0x10] |
| 48 | +# SMALL-NEXT: adrp x1, 8 ; 0x100008000 |
| 49 | +# SMALL-NEXT: ldr x1, [x1, #0x18] |
49 | 50 | # SMALL-NEXT: b
|
50 | 51 |
|
51 | 52 | # SMALL-NEXT: _objc_msgSend$length:
|
52 |
| -# SMALL-NEXT: adrp x1, 4 ; 0x100004000 |
53 |
| -# SMALL-NEXT: ldr x1, [x1, #0x18] |
| 53 | +# SMALL-NEXT: adrp x1, 8 ; 0x100008000 |
| 54 | +# SMALL-NEXT: ldr x1, [x1, #0x20] |
54 | 55 | # SMALL-NEXT: b
|
55 | 56 |
|
56 | 57 | # SMALLALIGN: sectname __objc_stubs
|
|
60 | 61 | # SMALLALIGN-NEXT: offset
|
61 | 62 | # SMALLALIGN-NEXT: align 2^2 (4)
|
62 | 63 |
|
| 64 | +## Check correct section ordering |
| 65 | +# SECTIONS: Sections: |
| 66 | +# SECTIONS: __text |
| 67 | +# SECTIONS: __stubs |
| 68 | +# SECTIONS: __objc_stubs |
| 69 | + |
63 | 70 | .section __TEXT,__objc_methname,cstring_literals
|
64 | 71 | lselref1:
|
65 | 72 | .asciz "foo"
|
|
81 | 88 | bl _objc_msgSend$length
|
82 | 89 | bl _objc_msgSend$foo
|
83 | 90 | bl _objc_msgSend$foo
|
| 91 | + bl _external_func |
84 | 92 | ret
|
0 commit comments