Browse Source
* coff-rs6000.c (xcoff_howto_table): Change size to 0 and bitsize to 1. (_bfd_xcoff_reloc_type_lookup): Handle BFD_RELOC_NONE. * coff64-rs6000.c (xcoff64_howto_table): Change size to 0 and bitsize to 1. (xcoff64_reloc_type_lookup): Handle BFD_RELOC_NONE. gas/ * write.h (fix_at_start): Declare. * write.c (fix_new_internal): Add at_beginning parameter. Use it instead of REVERSE_SORT_RELOCS. Fix the handling of seg_fix_tailP for the at_beginning/REVERSE_SORT_RELOCS case. (fix_new, fix_new_exp): Update accordingly. (fix_at_start): New function. * config/tc-ppc.c (md_pseudo_table): Add .ref to the OBJ_XCOFF section. (ppc_ref): New function, for OBJ_XCOFF. (md_apply_fix): Handle BFD_RELOC_NONE for OBJ_XCOFF. * config/te-i386aix.h (REVERSE_SORT_RELOCS): Remove #undef. gas/testsuite/ * gas/ppc/xcoff-ref-1.s, gas/ppc/xcoff-ref-1.l: New test. * gas/ppc/aix.exp: Run it. ld/testsuite/ * ld-powerpc/aix-ref-1-32.od, ld-powerpc/aix-ref-1-64.od, ld-powerpc/aix-ref-1.s: New tests. * ld-powerpc/aix52.exp: Run them.gdb_7_1-branch
17 changed files with 270 additions and 32 deletions
@ -0,0 +1,5 @@ |
|||
.*: Assembler messages: |
|||
.*:1: Error: .ref outside .csect |
|||
.*:3: Error: junk at end of line, first unrecognized character is `1' |
|||
.*:4: Error: missing symbol name |
|||
.*:5: Error: missing symbol name |
|||
@ -0,0 +1,6 @@ |
|||
.ref foo |
|||
.csect bar[rw] |
|||
.ref 1234 |
|||
.ref a, |
|||
.ref , |
|||
.ref |
|||
@ -0,0 +1,30 @@ |
|||
|
|||
.* |
|||
|
|||
|
|||
Disassembly of section \.text: |
|||
|
|||
.* <foo1>: |
|||
.*: 60 00 00 00 oril r0,r0,0 |
|||
.*: R_REF foo2\+.* |
|||
.*: 80 22 00 00 l r1,0\(r2\) |
|||
.*: R_TOC stuff\+.* |
|||
.*: 4e 80 00 20 br |
|||
|
|||
.* <foo2>: |
|||
.*: 60 00 00 00 oril r0,r0,0 |
|||
.*: R_REF foo6\+.* |
|||
.*: R_REF foo4\+.* |
|||
.*: 80 22 00 00 l r1,0\(r2\) |
|||
.*: R_TOC stuff\+.* |
|||
|
|||
.* <foo4>: |
|||
.*: 60 00 00 00 oril r0,r0,0 |
|||
.*: 80 22 00 00 l r1,0\(r2\) |
|||
.*: R_TOC stuff\+.* |
|||
|
|||
.* <foo6>: |
|||
.*: 60 00 00 00 oril r0,r0,0 |
|||
.*: 80 22 00 00 l r1,0\(r2\) |
|||
.*: R_TOC stuff\+.* |
|||
\.\.\. |
|||
@ -0,0 +1,30 @@ |
|||
|
|||
.* |
|||
|
|||
|
|||
Disassembly of section \.text: |
|||
|
|||
.* <foo1>: |
|||
.*: 60 00 00 00 nop |
|||
.*: R_REF foo2\+.* |
|||
.*: e8 22 00 00 ld r1,0\(r2\) |
|||
.*: R_TOC stuff\+.* |
|||
.*: 4e 80 00 20 blr |
|||
|
|||
.* <foo2>: |
|||
.*: 60 00 00 00 nop |
|||
.*: R_REF foo6\+.* |
|||
.*: R_REF foo4\+.* |
|||
.*: e8 22 00 00 ld r1,0\(r2\) |
|||
.*: R_TOC stuff\+.* |
|||
|
|||
.* <foo4>: |
|||
.*: 60 00 00 00 nop |
|||
.*: e8 22 00 00 ld r1,0\(r2\) |
|||
.*: R_TOC stuff\+.* |
|||
|
|||
.* <foo6>: |
|||
.*: 60 00 00 00 nop |
|||
.*: e8 22 00 00 ld r1,0\(r2\) |
|||
.*: R_TOC stuff\+.* |
|||
\.\.\. |
|||
@ -0,0 +1,57 @@ |
|||
.macro loadtoc,sym |
|||
.if size == 32 |
|||
lwz 1,\sym(2) |
|||
.else |
|||
ld 1,\sym(2) |
|||
.endif |
|||
.endm |
|||
|
|||
.toc |
|||
LC01: .tc stuff[TC],stuff[RW] |
|||
|
|||
.globl foo1 |
|||
.csect foo1[pr] |
|||
foo1: |
|||
.align 8 |
|||
nop |
|||
loadtoc LC01 |
|||
|
|||
.globl foo2 |
|||
.csect foo2[pr] |
|||
foo2: |
|||
nop |
|||
loadtoc LC01 |
|||
.ref foo4 , foo6 |
|||
|
|||
.globl foo3 |
|||
.csect foo3[pr] |
|||
foo3: |
|||
nop |
|||
loadtoc LC01 |
|||
|
|||
.globl foo4 |
|||
.csect foo4[pr] |
|||
foo4: |
|||
nop |
|||
loadtoc LC01 |
|||
|
|||
.globl foo5 |
|||
.csect foo5[pr] |
|||
foo5: |
|||
nop |
|||
loadtoc LC01 |
|||
.ref foo3 |
|||
|
|||
.globl foo6 |
|||
.csect foo6[pr] |
|||
foo6: |
|||
nop |
|||
loadtoc LC01 |
|||
|
|||
.csect foo1[pr] |
|||
blr |
|||
.ref foo2 |
|||
|
|||
.csect stuff[rw] |
|||
stuff: |
|||
.long 1 |
|||
Loading…
Reference in new issue