]>
Commit | Line | Data |
---|---|---|
36b60023 MM |
1 | # Checking that when linking as standard, the BL and the GOT access both use |
2 | # the PLT. This link does not do anything special to maintain pointer equality | |
3 | # since there is no access which directly uses the address. | |
4 | # | |
5 | # Things this testcase checks: | |
6 | # 1) Fragment of IRELATIVE relocation is PCC_START with bounds and | |
7 | # permissions of PCC. | |
8 | # 2) GOT access uses IRELATIVE relocation in the PLTGOT when no direct access | |
9 | # to address is used. | |
10 | # 3) BL to an IFUNC branches to a PLT stub which uses the a PLTGOT slot | |
11 | # initialised by an IRELATIVE relocation against our resolver. | |
12 | #as: -march=morello+c64 | |
13 | #ld: | |
14 | #objdump: -Dr --section-headers | |
15 | ||
16 | .*: file format .* | |
17 | ||
18 | Sections: | |
19 | Idx Name Size VMA LMA File off Algn | |
20 | #record: PCC_START | |
21 | 0 \.[^ ]+ +[0-9a-f]+ ([0-9a-f]+) [0-9a-f]+ [0-9a-f]+ 2\*\*. | |
22 | CONTENTS, ALLOC, LOAD, READONLY, DATA | |
36b60023 | 23 | #... |
816fc4e7 | 24 | *[0-9]+ \.got\.plt *[0-9a-f]+ [0-9a-f]+ .* |
36b60023 | 25 | CONTENTS, ALLOC, LOAD, DATA |
816fc4e7 MM |
26 | #record: PCC_END |
27 | *[0-9]+ \.[^ ]* +[0-9a-f]* ([0-9a-f]+) .* | |
36b60023 MM |
28 | #... |
29 | ||
30 | Disassembly of section \.rela\.plt: | |
31 | ||
32 | [0-9a-f]+ <.*>: | |
33 | #record: PLTGOT_LOC | |
34 | +[0-9a-f]+: ([0-9a-f]+) .* | |
35 | +[0-9a-f]+: 00000000 .* | |
36 | +[0-9a-f]+: 0000e804 .* | |
37 | +[0-9a-f]+: 00000000 .* | |
38 | #record: IREL_ADDEND | |
39 | +[0-9a-f]+: ([0-9a-f]+) .* | |
40 | +[0-9a-f]+: 00000000 .* | |
41 | #record: CHERICAP_LOC | |
42 | *[0-9a-f]+: ([0-9a-f]+) .* | |
43 | *[0-9a-f]+: 00000000 .* | |
44 | *[0-9a-f]+: 0000e804 .* | |
45 | *[0-9a-f]+: 00000000 .* | |
46 | #check: CHERICAP_ADDEND string tolower $IREL_ADDEND | |
47 | *[0-9a-f]+: CHERICAP_ADDEND .* | |
48 | *[0-9a-f]+: 00000000 .* | |
49 | ||
50 | Disassembly of section \.plt: | |
51 | ||
52 | #check: PLTGOT_PAGE format %x [expr "0x$PLTGOT_LOC & (~0xfff)"] | |
53 | #check: PLTGOT_DEC_OFF expr "0x$PLTGOT_LOC & 0xfff" | |
54 | [0-9a-f]+ <\.plt>: | |
55 | #record: PLTADDR | |
56 | *([0-9a-f]+): .* adrp c16, PLTGOT_PAGE .* | |
57 | *[0-9a-f]+: .* ldr c17, \[c16, #PLTGOT_DEC_OFF\] | |
58 | *[0-9a-f]+: .* add c16, c16, #0x.* | |
59 | *[0-9a-f]+: .* br c17 | |
60 | ||
61 | Disassembly of section \.text: | |
62 | ||
63 | [0-9a-f]+ <foo_1>: | |
64 | #... | |
65 | ||
66 | [0-9a-f]+ <foo_2>: | |
67 | #... | |
68 | ||
69 | #check: FOO_ADDR format %016x [expr "0x$PCC_START + (0x$IREL_ADDEND & ~1)"] | |
70 | FOO_ADDR <foo>: | |
71 | *[0-9a-f]+: .* mov x1, #0x2a // #42 | |
72 | *[0-9a-f]+: .* tst x0, x1 | |
73 | *[0-9a-f]+: .* b\.ne .* <foo\+0x18> // b\.any | |
74 | *[0-9a-f]+: .* adrp c0, .* | |
75 | *[0-9a-f]+: .* add c0, c0, .* | |
76 | *[0-9a-f]+: .* ret c30 | |
77 | *[0-9a-f]+: .* adrp c0, .* | |
78 | *[0-9a-f]+: .* add c0, .* | |
79 | *[0-9a-f]+: .* b .* <foo\+0x14> | |
80 | ||
81 | [0-9a-f]+ <_start>: | |
82 | #check: PLTLOC string tolower $PLTADDR | |
83 | *[0-9a-f]+: .* bl PLTLOC .* | |
84 | *[0-9a-f]+: .* adrp c0, PLTGOT_PAGE .* | |
85 | *[0-9a-f]+: .* ldr c0, \[c0, #PLTGOT_DEC_OFF\] | |
86 | *[0-9a-f]+: .* ret c30 | |
87 | ||
88 | Disassembly of section \.got: | |
89 | ||
90 | [0-9a-f]+ <.*>: | |
91 | \.\.\. | |
92 | ||
93 | Disassembly of section \.got\.plt: | |
94 | ||
95 | #check: GOTLOC format %x 0x$PLTGOT_LOC | |
96 | #check: FRAGBASE format %08x 0x$PCC_START | |
816fc4e7 | 97 | #check: FRAGSIZE format %08x [expr "0x$PCC_END - 0x$PCC_START"] |
36b60023 MM |
98 | [0-9a-f]+ <.*>: |
99 | \.\.\. | |
100 | *GOTLOC: FRAGBASE .* | |
101 | *[0-9a-f]+: 00000000 .* | |
102 | *[0-9a-f]+: FRAGSIZE .* | |
103 | *[0-9a-f]+: 04000000 .* | |
104 | #... | |
105 | Disassembly of section \.data: | |
106 | ||
107 | #check: CHERICAPLOC format %x 0x$CHERICAP_LOC | |
108 | [0-9a-f]+ <.*>: | |
109 | *CHERICAPLOC: FRAGBASE .* | |
110 | *[0-9a-f]+: 00000000 .* | |
111 | *[0-9a-f]+: FRAGSIZE .* | |
112 | *[0-9a-f]+: 04000000 .* | |
113 | #pass | |
114 |