]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - ld/testsuite/ld-powerpc/tocopt5.s
PowerPC disassembly of pcrel references
[thirdparty/binutils-gdb.git] / ld / testsuite / ld-powerpc / tocopt5.s
1 .section .toc,"aw"
2 x4t:
3 .quad x4
4 x5t:
5 .quad x5
6 x6t:
7 .quad x6
8
9 .section .sdata,"aw"
10 x1:
11 .byte 1
12 x2:
13 .byte 2
14 x3:
15 .byte 3
16 x4:
17 .byte 4
18 x5:
19 .byte 5
20 x6:
21 .byte 6
22
23 .globl _start
24 .text
25 _start:
26 # no need for got entry, optimise to nop,addi
27 addis 9,2,x1@got@ha
28 ld 9,x1@got@l(9)
29 # must keep got entry, optimise to nop,addi,ld
30 addis 4,2,x2@got@ha
31 addi 5,4,x2@got@l
32 ld 6,0(5)
33
34 # no need for toc entry, optimise to nop,addi
35 addis 9,2,x4t@toc@ha
36 ld 9,x4t@toc@l(9)
37 # must keep toc entry, optimise to nop,addi,ld
38 # if we had a reloc tying the ld to x5/x5t then we could throw away
39 # the toc entry and optimise to nop,nop,addi
40 addis 4,2,x5t@toc@ha
41 addi 5,4,x5t@toc@l
42 ld 6,0(5)