|
1 | | -// REQUIRES: aarch64 |
2 | | - |
3 | | -// RUN: llvm-mc -filetype=obj -triple=aarch64 %p/Inputs/shared2.s -o %t.so.o |
4 | | -// RUN: ld.lld -shared %t.so.o -soname=so -o %t.so |
5 | | -// RUN: llvm-mc -filetype=obj -triple=aarch64 %s -o %t.o |
6 | | -// RUN: ld.lld -pie -z nopack-relative-relocs %t.o %t.so -o %t2 |
7 | | -// RUN: llvm-readobj -r %t2 | FileCheck --check-prefix=UNPACKED %s |
8 | | - |
9 | | -// UNPACKED: Section ({{.+}}) .rela.dyn { |
10 | | -// UNPACKED-NEXT: 0x303C8 R_AARCH64_AUTH_RELATIVE - 0x1 |
11 | | -// UNPACKED-NEXT: 0x303E1 R_AARCH64_AUTH_RELATIVE - 0x2 |
12 | | -// UNPACKED-NEXT: 0x303D0 R_AARCH64_AUTH_ABS64 zed2 0x0 |
13 | | -// UNPACKED-NEXT: 0x303D8 R_AARCH64_AUTH_ABS64 bar2 0x0 |
14 | | -// UNPACKED-NEXT: } |
15 | | - |
16 | | -// RUN: ld.lld -pie -z pack-relative-relocs %t.o %t.so -o %t2 |
17 | | -// RUN: llvm-readobj -S --dynamic-table %t2 | FileCheck --check-prefix=RELR-HEADERS %s |
18 | | -// RUN: llvm-readobj -r --raw-relr %t2 | FileCheck --check-prefix=RAW-RELR %s |
19 | | -// RUN: llvm-readobj -r %t2 | FileCheck --check-prefix=RELR %s |
20 | | - |
21 | | -// RELR-HEADERS: Index: 1 |
22 | | -// RELR-HEADERS-NEXT: Name: .dynsym |
23 | | - |
24 | | -// RELR-HEADERS: Name: .relr.auth.dyn |
25 | | -// RELR-HEADERS-NEXT: Type: SHT_AARCH64_AUTH_RELR |
26 | | -// RELR-HEADERS-NEXT: Flags [ (0x2) |
27 | | -// RELR-HEADERS-NEXT: SHF_ALLOC (0x2) |
28 | | -// RELR-HEADERS-NEXT: ] |
29 | | -// RELR-HEADERS-NEXT: Address: [[ADDR:.*]] |
30 | | -// RELR-HEADERS-NEXT: Offset: [[ADDR]] |
31 | | -// RELR-HEADERS-NEXT: Size: 8 |
32 | | -// RELR-HEADERS-NEXT: Link: 0 |
33 | | -// RELR-HEADERS-NEXT: Info: 0 |
34 | | -// RELR-HEADERS-NEXT: AddressAlignment: 8 |
35 | | -// RELR-HEADERS-NEXT: EntrySize: 8 |
36 | | - |
37 | | -// RELR-HEADERS: 0x0000000070000012 AARCH64_AUTH_RELR [[ADDR]] |
38 | | -// RELR-HEADERS: 0x0000000070000011 AARCH64_AUTH_RELRSZ 8 (bytes) |
39 | | -// RELR-HEADERS: 0x0000000070000013 AARCH64_AUTH_RELRENT 8 (bytes) |
40 | | - |
41 | | -/// SHT_RELR section contains address/bitmap entries |
42 | | -/// encoding the offsets for relative relocation. |
43 | | -// RAW-RELR: Section ({{.+}}) .relr.auth.dyn { |
44 | | -// RAW-RELR-NEXT: 0x303E8 |
45 | | -// RAW-RELR-NEXT: } |
46 | | - |
47 | | -/// Decoded SHT_RELR section is same as UNPACKED, |
48 | | -/// but contains only the relative relocations. |
49 | | -/// Any relative relocations with odd offset stay in SHT_RELA. |
50 | | - |
51 | | -// RELR: Section ({{.+}}) .rela.dyn { |
52 | | -// RELR-NEXT: 0x30401 R_AARCH64_AUTH_RELATIVE - 0x2 |
53 | | -// RELR-NEXT: 0x303F0 R_AARCH64_AUTH_ABS64 zed2 0x0 |
54 | | -// RELR-NEXT: 0x303F8 R_AARCH64_AUTH_ABS64 bar2 0x0 |
55 | | -// RELR-NEXT: } |
56 | | -// RELR-NEXT: Section ({{.+}}) .relr.auth.dyn { |
57 | | -// RELR-NEXT: 0x303E8 R_AARCH64_RELATIVE - |
58 | | -// RELR-NEXT: } |
| 1 | +# REQUIRES: aarch64 |
| 2 | + |
| 3 | +# RUN: llvm-mc -filetype=obj -triple=aarch64 %p/Inputs/shared2.s -o %t.so.o |
| 4 | +# RUN: ld.lld -shared %t.so.o -soname=so -o %t.so |
| 5 | +# RUN: llvm-mc -filetype=obj -triple=aarch64 %s -o %t.o |
| 6 | +# RUN: ld.lld -pie -z nopack-relative-relocs %t.o %t.so -o %t2 |
| 7 | +# RUN: llvm-readobj -r %t2 | FileCheck --check-prefix=UNPACKED %s |
| 8 | + |
| 9 | +# UNPACKED: Section ({{.+}}) .rela.dyn { |
| 10 | +# UNPACKED-NEXT: 0x303C8 R_AARCH64_AUTH_RELATIVE - 0x1 |
| 11 | +# UNPACKED-NEXT: 0x303E1 R_AARCH64_AUTH_RELATIVE - 0x2 |
| 12 | +# UNPACKED-NEXT: 0x303D0 R_AARCH64_AUTH_ABS64 zed2 0x0 |
| 13 | +# UNPACKED-NEXT: 0x303D8 R_AARCH64_AUTH_ABS64 bar2 0x0 |
| 14 | +# UNPACKED-NEXT: } |
| 15 | + |
| 16 | +# RUN: ld.lld -pie -z pack-relative-relocs %t.o %t.so -o %t2 |
| 17 | +# RUN: llvm-readelf -S --dynamic-table %t2 | FileCheck --check-prefix=RELR-HEADERS %s |
| 18 | +# RUN: llvm-readobj -r --raw-relr %t2 | FileCheck --check-prefix=RAW-RELR %s |
| 19 | +# RUN: llvm-readobj -r %t2 | FileCheck --check-prefix=RELR %s |
| 20 | + |
| 21 | +# RELR-HEADERS: Section Headers: |
| 22 | +# RELR-HEADERS-NEXT: Name Type Address Off Size ES Flg Lk Inf Al |
| 23 | +# RELR-HEADERS: .relr.auth.dyn AARCH64_AUTH_RELR 0000000000[[ADDR:.*]] [[ADDR]] 000008 08 A 0 0 8 |
| 24 | + |
| 25 | +# RELR-HEADERS: Dynamic section at offset 0x2e8 contains 16 entries |
| 26 | +# RELR-HEADERS: 0x0000000070000012 (AARCH64_AUTH_RELR) 0x2e0 |
| 27 | +# RELR-HEADERS-NEXT: 0x0000000070000011 (AARCH64_AUTH_RELRSZ) 8 (bytes) |
| 28 | +# RELR-HEADERS-NEXT: 0x0000000070000013 (AARCH64_AUTH_RELRENT) 8 (bytes) |
| 29 | + |
| 30 | +## SHT_RELR section contains address/bitmap entries |
| 31 | +## encoding the offsets for relative relocation. |
| 32 | +# RAW-RELR: Section ({{.+}}) .relr.auth.dyn { |
| 33 | +# RAW-RELR-NEXT: 0x303E8 |
| 34 | +# RAW-RELR-NEXT: } |
| 35 | + |
| 36 | +## Decoded SHT_RELR section is same as UNPACKED, |
| 37 | +## but contains only the relative relocations. |
| 38 | +## Any relative relocations with odd offset stay in SHT_RELA. |
| 39 | + |
| 40 | +# RELR: Section ({{.+}}) .rela.dyn { |
| 41 | +# RELR-NEXT: 0x30401 R_AARCH64_AUTH_RELATIVE - 0x2 |
| 42 | +# RELR-NEXT: 0x303F0 R_AARCH64_AUTH_ABS64 zed2 0x0 |
| 43 | +# RELR-NEXT: 0x303F8 R_AARCH64_AUTH_ABS64 bar2 0x0 |
| 44 | +# RELR-NEXT: } |
| 45 | +# RELR-NEXT: Section ({{.+}}) .relr.auth.dyn { |
| 46 | +# RELR-NEXT: 0x303E8 R_AARCH64_RELATIVE - |
| 47 | +# RELR-NEXT: } |
59 | 48 |
|
60 | 49 | .section .test, "aw" |
61 | 50 | .p2align 3 |
|
0 commit comments