From: Alan Modra Date: Mon, 11 Jul 2011 12:03:55 +0000 (+0000) Subject: * ld-powerpc/tocopt2.s, * ld-powerpc/tocopt2.out, X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2843fdaab1bfef475382e13acfd6651bc4ae9e32;p=binutils-gdb.git * ld-powerpc/tocopt2.s, * ld-powerpc/tocopt2.out, * ld-powerpc/tocopt2.d: New test. * ld-powerpc/tocopt3.s, * ld-powerpc/tocopt3.d: New test. * ld-powerpc/powerpc.exp (ppc64elftests) Run them. --- diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 1e74f6f3db1..4fe8d0c4820 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2011-07-11 Alan Modra + + * ld-powerpc/tocopt2.s, * ld-powerpc/tocopt2.out, + * ld-powerpc/tocopt2.d: New test. + * ld-powerpc/tocopt3.s, * ld-powerpc/tocopt3.d: New test. + * ld-powerpc/powerpc.exp (ppc64elftests) Run them. + 2011-07-03 Samuel Thibault Thomas Schwinge diff --git a/ld/testsuite/ld-powerpc/powerpc.exp b/ld/testsuite/ld-powerpc/powerpc.exp index ef0a6e16da1..bfffb42c5ee 100644 --- a/ld/testsuite/ld-powerpc/powerpc.exp +++ b/ld/testsuite/ld-powerpc/powerpc.exp @@ -204,7 +204,11 @@ set ppc64elftests { {"sym@tocbase" "-shared -melf64ppc" "-a64" {symtocbase-1.s symtocbase-2.s} {{objdump -dj.data symtocbase.d}} "symtocbase.so"} {"TOC opt" "-melf64ppc" "-a64" {tocopt.s} - {{objdump -s tocopt.d}} "tocopt"} + {{objdump -s tocopt.d}} "tocopt"} + {"TOC opt2" "-melf64ppc --defsym x=2" "-a64" {tocopt2.s} + {{ld tocopt2.out} {objdump -s tocopt2.d}} "tocopt2"} + {"TOC opt3" "-melf64ppc -no-keep-memory --defsym x=2" "-a64" {tocopt3.s} + {{objdump -s tocopt3.d}} "tocopt3"} } diff --git a/ld/testsuite/ld-powerpc/tocopt2.d b/ld/testsuite/ld-powerpc/tocopt2.d new file mode 100644 index 00000000000..174af27fbbe --- /dev/null +++ b/ld/testsuite/ld-powerpc/tocopt2.d @@ -0,0 +1,5 @@ + +.*: file format .* + +Contents of section \.text: + 100000b0 3d22effe 39297f4a .* diff --git a/ld/testsuite/ld-powerpc/tocopt2.out b/ld/testsuite/ld-powerpc/tocopt2.out new file mode 100644 index 00000000000..9f2907164bc --- /dev/null +++ b/ld/testsuite/ld-powerpc/tocopt2.out @@ -0,0 +1 @@ +.*: xt defined on removed toc entry diff --git a/ld/testsuite/ld-powerpc/tocopt2.s b/ld/testsuite/ld-powerpc/tocopt2.s new file mode 100644 index 00000000000..8d07de09a3a --- /dev/null +++ b/ld/testsuite/ld-powerpc/tocopt2.s @@ -0,0 +1,10 @@ + .globl xt + .section .toc,"aw" +xt: + .quad x + + .globl _start + .text +_start: + addis 9,2,xt@toc@ha + ld 9,xt@toc@l(9) diff --git a/ld/testsuite/ld-powerpc/tocopt3.d b/ld/testsuite/ld-powerpc/tocopt3.d new file mode 100644 index 00000000000..174af27fbbe --- /dev/null +++ b/ld/testsuite/ld-powerpc/tocopt3.d @@ -0,0 +1,5 @@ + +.*: file format .* + +Contents of section \.text: + 100000b0 3d22effe 39297f4a .* diff --git a/ld/testsuite/ld-powerpc/tocopt3.s b/ld/testsuite/ld-powerpc/tocopt3.s new file mode 100644 index 00000000000..abadbfa6bb3 --- /dev/null +++ b/ld/testsuite/ld-powerpc/tocopt3.s @@ -0,0 +1,9 @@ + .section .toc,"aw" +0: + .quad x + + .globl _start + .text +_start: + addis 9,2,0b@toc@ha + ld 9,0b@toc@l(9)