Commit | Line | Data |
---|---|---|
94a03f18 KK |
1 | .text |
2 | .align 1 | |
3 | .global fn | |
4 | .type fn, @function | |
5 | fn: | |
6 | ! Main binary, PIC | |
7 | mov.l r12,@-r15 | |
8 | mov.l r14,@-r15 | |
9 | mov r15,r14 | |
10 | mova .L3,r0 | |
11 | mov.l .L3,r12 | |
12 | add r0,r12 | |
13 | ||
14 | mov.l 1f,r0 | |
15 | stc gbr,r1 | |
16 | mov.l @(r0,r12),r0 | |
17 | bra 2f | |
18 | add r0,r1 | |
19 | .align 2 | |
20 | 1: .long foo@GOTTPOFF | |
21 | 2: ! now r1 contains &foo | |
22 | ||
23 | mov r1,r0 | |
24 | mov r14,r15 | |
25 | mov.l @r15+,r14 | |
26 | rts | |
27 | mov.l @r15+,r12 | |
28 | ||
29 | .align 2 | |
30 | .L3: .long _GLOBAL_OFFSET_TABLE_ |