bfd,ld: Continue after partially-successful relaxed call relocations in sparc.
bfd/ChangeLog: 2016-12-05 Alyssa Milburn <amilburn@zall.org> * elfxx-sparc.c: Do not stop processing relocations after partially relaxing a call with WDISP30. ld/ChangeLog: 2016-12-05 Alyssa Milburn <amilburn@zall.org> * testsuite/ld-sparc/wdispcall.s: New file. * testsuite/ld-sparc/wdispcall.dd: Likewise. * testsuite/ld-sparc/sparc.exp: Run new test.
This commit is contained in:
parent
a55c9876bb
commit
597e138ca0
6 changed files with 48 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2016-12-05 Alyssa Milburn <amilburn@zall.org>
|
||||||
|
|
||||||
|
* elfxx-sparc.c: Do not stop processing relocations after
|
||||||
|
partially relaxing a call with WDISP30.
|
||||||
|
|
||||||
2016-12-05 Nick Clifton <nickc@redhat.com>
|
2016-12-05 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
PR binutils/20922
|
PR binutils/20922
|
||||||
|
|
|
@ -4122,7 +4122,7 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd,
|
||||||
contents + rel->r_offset - 4);
|
contents + rel->r_offset - 4);
|
||||||
if ((z & (0xffffffff ^ RD(~0)))
|
if ((z & (0xffffffff ^ RD(~0)))
|
||||||
!= (INSN_OR | RS1(O7) | RS2(G0)))
|
!= (INSN_OR | RS1(O7) | RS2(G0)))
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
/* The sequence was
|
/* The sequence was
|
||||||
or %o7, %g0, %rN
|
or %o7, %g0, %rN
|
||||||
|
@ -4135,7 +4135,7 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd,
|
||||||
reg = (y & RS1(~0)) >> 14;
|
reg = (y & RS1(~0)) >> 14;
|
||||||
if (reg != ((z & RD(~0)) >> 25)
|
if (reg != ((z & RD(~0)) >> 25)
|
||||||
|| reg == G0 || reg == O7)
|
|| reg == G0 || reg == O7)
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
bfd_put_32 (input_bfd, (bfd_vma) INSN_NOP,
|
bfd_put_32 (input_bfd, (bfd_vma) INSN_NOP,
|
||||||
contents + rel->r_offset + 4);
|
contents + rel->r_offset + 4);
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
2016-12-05 Alyssa Milburn <amilburn@zall.org>
|
||||||
|
|
||||||
|
* testsuite/ld-sparc/wdispcall.s: New file.
|
||||||
|
* testsuite/ld-sparc/wdispcall.dd: Likewise.
|
||||||
|
* testsuite/ld-sparc/sparc.exp: Run new test.
|
||||||
|
|
||||||
2016-12-03 Alan Modra <amodra@gmail.com>
|
2016-12-03 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Don't call
|
* emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Don't call
|
||||||
|
|
|
@ -94,6 +94,9 @@ set sparctests {
|
||||||
{{readelf -WSsrl gotop32.rd} {objdump -drj.text gotop32.dd}
|
{{readelf -WSsrl gotop32.rd} {objdump -drj.text gotop32.dd}
|
||||||
{objdump -sj.got gotop32.sd} {objdump -sj.data gotop32.td}}
|
{objdump -sj.got gotop32.sd} {objdump -sj.data gotop32.td}}
|
||||||
"libgotop32.so"}
|
"libgotop32.so"}
|
||||||
|
{"relaxed call WDISP30 relocation" "-static -melf32_sparc -relax" ""
|
||||||
|
"--32" {wdispcall.s}
|
||||||
|
{{objdump -dj.wdispcall wdispcall.dd}} "wdispcall"}
|
||||||
}
|
}
|
||||||
set sparc64tests {
|
set sparc64tests {
|
||||||
{"64-bit: TLS -fpic -shared transitions" "-shared -melf64_sparc" ""
|
{"64-bit: TLS -fpic -shared transitions" "-shared -melf64_sparc" ""
|
||||||
|
|
18
ld/testsuite/ld-sparc/wdispcall.dd
Normal file
18
ld/testsuite/ld-sparc/wdispcall.dd
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#source: wdispcall.s
|
||||||
|
#as: --32
|
||||||
|
#ld: -static -melf32_sparc -relax
|
||||||
|
#objdump: -dj.wdispcall
|
||||||
|
#target: sparc*-*-*
|
||||||
|
|
||||||
|
.*: +file format elf32-sparc
|
||||||
|
|
||||||
|
Disassembly of section .wdispcall:
|
||||||
|
|
||||||
|
00000000 <foo>:
|
||||||
|
+0: 01 00 00 00 nop *
|
||||||
|
+4: 10 80 40 ff b 10400 <bar>
|
||||||
|
+8: 9e 10 40 00 mov %g1, %o7
|
||||||
|
+c: 01 00 00 00 nop *
|
||||||
|
+10: 40 00 40 fc call 10400 <bar>
|
||||||
|
+14: 01 00 00 00 nop *
|
||||||
|
|
14
ld/testsuite/ld-sparc/wdispcall.s
Normal file
14
ld/testsuite/ld-sparc/wdispcall.s
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
.text
|
||||||
|
bar:
|
||||||
|
retl
|
||||||
|
nop
|
||||||
|
|
||||||
|
.align 1024
|
||||||
|
.section ".wdispcall"
|
||||||
|
foo:
|
||||||
|
nop
|
||||||
|
call bar
|
||||||
|
or %r1, %g0, %o7
|
||||||
|
nop
|
||||||
|
call bar
|
||||||
|
nop
|
Loading…
Add table
Add a link
Reference in a new issue