From 01017ef89a902536817c86aa0d0562184807a954 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Mon, 10 Aug 2009 13:38:44 +0000 Subject: bfd/ * elf32-ppc.c (shared_stub_entry, stub_entry): Use r12, not r11. (ppc_elf_relax_section): Use symbol index to distinguish relocatable stubs. ld/testsuite/ * ld-powerpc/relax.s: New. * ld-powerpc/relax.d: New. * ld-powerpc/relaxr.d: New. * ld-powerpc/powerpc.exp: Add new tests. --- ld/testsuite/ChangeLog | 7 +++++++ ld/testsuite/ld-powerpc/powerpc.exp | 6 ++++++ ld/testsuite/ld-powerpc/relax.d | 15 +++++++++++++++ ld/testsuite/ld-powerpc/relax.s | 6 ++++++ ld/testsuite/ld-powerpc/relaxr.d | 25 +++++++++++++++++++++++++ 5 files changed, 59 insertions(+) create mode 100644 ld/testsuite/ld-powerpc/relax.d create mode 100644 ld/testsuite/ld-powerpc/relax.s create mode 100644 ld/testsuite/ld-powerpc/relaxr.d (limited to 'ld/testsuite') diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index d0e1699..29457a6 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2009-08-10 Nathan Sidwell + + * ld-powerpc/relax.s: New. + * ld-powerpc/relax.d: New. + * ld-powerpc/relaxr.d: New. + * ld-powerpc/powerpc.exp: Add new tests. + 2009-08-06 Nathan Sidwell * ld-arm/arm-elf.exp: Add new test. diff --git a/ld/testsuite/ld-powerpc/powerpc.exp b/ld/testsuite/ld-powerpc/powerpc.exp index bc63a46..edfab3f 100644 --- a/ld/testsuite/ld-powerpc/powerpc.exp +++ b/ld/testsuite/ld-powerpc/powerpc.exp @@ -158,6 +158,12 @@ set ppc64elftests { "tlsmark"} {"sym@tocbase" "-shared -melf64ppc" "-a64" {symtocbase-1.s symtocbase-2.s} {{objdump -dj.data symtocbase.d}} "symtocbase.so"} + {"relaxing" "-melf32ppc --relax -Ttext=0 --defsym far=0x80001234 --defsym near=0x00004320" "" "relax.s" + {{objdump -dr relax.d}} + "relax"} + {"relocatable relaxing" "-melf32ppc -r --relax" "" "relax.s" + {{objdump -dr relaxr.d}} + "relax"} } diff --git a/ld/testsuite/ld-powerpc/relax.d b/ld/testsuite/ld-powerpc/relax.d new file mode 100644 index 0000000..2f09522 --- /dev/null +++ b/ld/testsuite/ld-powerpc/relax.d @@ -0,0 +1,15 @@ + +.*: file format .* + +Disassembly of section .text: + +00000000 <_start>: + 0: 48 00 43 21 bl 4320 + 4: 48 00 00 11 bl 14 <_start\+0x14> + 8: 48 00 43 19 bl 4320 + c: 48 00 00 09 bl 14 <_start\+0x14> + 10: 48 00 00 14 b 24 <.*> + 14: 3d 80 80 00 lis r12,-32768 + 18: 39 8c 12 34 addi r12,r12,4660 + 1c: 7d 89 03 a6 mtctr r12 + 20: 4e 80 04 20 bctr diff --git a/ld/testsuite/ld-powerpc/relax.s b/ld/testsuite/ld-powerpc/relax.s new file mode 100644 index 0000000..2e05569 --- /dev/null +++ b/ld/testsuite/ld-powerpc/relax.s @@ -0,0 +1,6 @@ + .globl _start +_start: + bl near + bl far + bl near + bl far diff --git a/ld/testsuite/ld-powerpc/relaxr.d b/ld/testsuite/ld-powerpc/relaxr.d new file mode 100644 index 0000000..62fa8ae --- /dev/null +++ b/ld/testsuite/ld-powerpc/relaxr.d @@ -0,0 +1,25 @@ + +.*: file format .* + +Disassembly of section .text: + +00000000 <_start>: + 0: 48 00 00 15 bl 14 <_start\+0x14> + 4: 48 00 00 21 bl 24 <_start\+0x24> + 8: 48 00 00 0d bl 14 <_start\+0x14> + 8: R_PPC_NONE \*ABS\* + c: 48 00 00 19 bl 24 <_start\+0x24> + c: R_PPC_NONE \*ABS\* + 10: 48 00 00 24 b 34 <_start\+0x34> + 14: 3d 80 00 00 lis r12,0 + 16: R_PPC_ADDR16_HA near + 18: 39 8c 00 00 addi r12,r12,0 + 1a: R_PPC_ADDR16_LO near + 1c: 7d 89 03 a6 mtctr r12 + 20: 4e 80 04 20 bctr + 24: 3d 80 00 00 lis r12,0 + 26: R_PPC_ADDR16_HA far + 28: 39 8c 00 00 addi r12,r12,0 + 2a: R_PPC_ADDR16_LO far + 2c: 7d 89 03 a6 mtctr r12 + 30: 4e 80 04 20 bctr -- cgit v1.1