From 2843fdaab1bfef475382e13acfd6651bc4ae9e32 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 11 Jul 2011 12:03:55 +0000 Subject: [PATCH] * 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. --- ld/testsuite/ChangeLog | 7 +++++++ ld/testsuite/ld-powerpc/powerpc.exp | 6 +++++- ld/testsuite/ld-powerpc/tocopt2.d | 5 +++++ ld/testsuite/ld-powerpc/tocopt2.out | 1 + ld/testsuite/ld-powerpc/tocopt2.s | 10 ++++++++++ ld/testsuite/ld-powerpc/tocopt3.d | 5 +++++ ld/testsuite/ld-powerpc/tocopt3.s | 9 +++++++++ 7 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 ld/testsuite/ld-powerpc/tocopt2.d create mode 100644 ld/testsuite/ld-powerpc/tocopt2.out create mode 100644 ld/testsuite/ld-powerpc/tocopt2.s create mode 100644 ld/testsuite/ld-powerpc/tocopt3.d create mode 100644 ld/testsuite/ld-powerpc/tocopt3.s diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 1e74f6f3db..4fe8d0c482 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 ef0a6e16da..bfffb42c5e 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 0000000000..174af27fbb --- /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 0000000000..9f2907164b --- /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 0000000000..8d07de09a3 --- /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 0000000000..174af27fbb --- /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 0000000000..abadbfa6bb --- /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) -- 2.34.1