From 3ab94f96a99e88c5cb6d5acd34bd0a35ba6f376a Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sun, 13 Mar 2016 08:57:10 -0700 Subject: [PATCH] Add more tests for PR ld/19539 PR ld/19539 * testsuite/ld-i386/i386.exp: Run pr19539. * testsuite/ld-i386/pr19539.d: New file. * testsuite/ld-i386/pr19539.s: Likewise. * testsuite/ld-i386/pr19539.t: Likewise. * testsuite/ld-x86-64/pr19539.s: Likewise. * testsuite/ld-x86-64/pr19539.t: Likewise. * testsuite/ld-x86-64/pr19539a.d: Likewise. * testsuite/ld-x86-64/pr19539b.d: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run pr19539a and pr19539b. --- ld/ChangeLog | 13 +++++++++++++ ld/testsuite/ld-i386/i386.exp | 1 + ld/testsuite/ld-i386/pr19539.d | 7 +++++++ ld/testsuite/ld-i386/pr19539.s | 6 ++++++ ld/testsuite/ld-i386/pr19539.t | 1 + ld/testsuite/ld-x86-64/pr19539.s | 6 ++++++ ld/testsuite/ld-x86-64/pr19539.t | 1 + ld/testsuite/ld-x86-64/pr19539a.d | 8 ++++++++ ld/testsuite/ld-x86-64/pr19539b.d | 8 ++++++++ ld/testsuite/ld-x86-64/x86-64.exp | 2 ++ 10 files changed, 53 insertions(+) create mode 100644 ld/testsuite/ld-i386/pr19539.d create mode 100644 ld/testsuite/ld-i386/pr19539.s create mode 100644 ld/testsuite/ld-i386/pr19539.t create mode 100644 ld/testsuite/ld-x86-64/pr19539.s create mode 100644 ld/testsuite/ld-x86-64/pr19539.t create mode 100644 ld/testsuite/ld-x86-64/pr19539a.d create mode 100644 ld/testsuite/ld-x86-64/pr19539b.d diff --git a/ld/ChangeLog b/ld/ChangeLog index 4890e430dc6..1dfe830421a 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,16 @@ +2016-03-13 H.J. Lu + + PR ld/19539 + * testsuite/ld-i386/i386.exp: Run pr19539. + * testsuite/ld-i386/pr19539.d: New file. + * testsuite/ld-i386/pr19539.s: Likewise. + * testsuite/ld-i386/pr19539.t: Likewise. + * testsuite/ld-x86-64/pr19539.s: Likewise. + * testsuite/ld-x86-64/pr19539.t: Likewise. + * testsuite/ld-x86-64/pr19539a.d: Likewise. + * testsuite/ld-x86-64/pr19539b.d: Likewise. + * testsuite/ld-x86-64/x86-64.exp: Run pr19539a and pr19539b. + 2016-03-10 Mickael Guene PR gas/19744 diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp index a032ca734e3..1e52cdbaca7 100644 --- a/ld/testsuite/ld-i386/i386.exp +++ b/ld/testsuite/ld-i386/i386.exp @@ -363,6 +363,7 @@ run_dump_test "pr19609-2b" run_dump_test "pr19609-2c" run_dump_test "undefweaka" run_dump_test "undefweakb" +run_dump_test "pr19539" if { !([istarget "i?86-*-linux*"] || [istarget "i?86-*-gnu*"] diff --git a/ld/testsuite/ld-i386/pr19539.d b/ld/testsuite/ld-i386/pr19539.d new file mode 100644 index 00000000000..ac7b73fc874 --- /dev/null +++ b/ld/testsuite/ld-i386/pr19539.d @@ -0,0 +1,7 @@ +#as: --32 +#ld: -pie -m elf_i386 -T pr19539.t +#readelf: -r --wide + +Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 1 entries: + Offset Info Type Sym. Value Symbol's Name +[0-9a-f]+ +[0-9a-f]+ +R_386_RELATIVE + diff --git a/ld/testsuite/ld-i386/pr19539.s b/ld/testsuite/ld-i386/pr19539.s new file mode 100644 index 00000000000..16e0f70143a --- /dev/null +++ b/ld/testsuite/ld-i386/pr19539.s @@ -0,0 +1,6 @@ + .text + .global _start +_start: + .dc.a 0 + .section .prefix,"a",%progbits + .dc.a foo diff --git a/ld/testsuite/ld-i386/pr19539.t b/ld/testsuite/ld-i386/pr19539.t new file mode 100644 index 00000000000..b6b48e71d3c --- /dev/null +++ b/ld/testsuite/ld-i386/pr19539.t @@ -0,0 +1 @@ +HIDDEN (foo = .); diff --git a/ld/testsuite/ld-x86-64/pr19539.s b/ld/testsuite/ld-x86-64/pr19539.s new file mode 100644 index 00000000000..16e0f70143a --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr19539.s @@ -0,0 +1,6 @@ + .text + .global _start +_start: + .dc.a 0 + .section .prefix,"a",%progbits + .dc.a foo diff --git a/ld/testsuite/ld-x86-64/pr19539.t b/ld/testsuite/ld-x86-64/pr19539.t new file mode 100644 index 00000000000..b6b48e71d3c --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr19539.t @@ -0,0 +1 @@ +HIDDEN (foo = .); diff --git a/ld/testsuite/ld-x86-64/pr19539a.d b/ld/testsuite/ld-x86-64/pr19539a.d new file mode 100644 index 00000000000..27d5df9064a --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr19539a.d @@ -0,0 +1,8 @@ +#source: pr19539.s +#as: --64 +#ld: -pie -m elf_x86_64 -T pr19539.t +#readelf: -r --wide + +Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 1 entries: + Offset Info Type Symbol's Value Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_RELATIVE +[0-9a-f]+ diff --git a/ld/testsuite/ld-x86-64/pr19539b.d b/ld/testsuite/ld-x86-64/pr19539b.d new file mode 100644 index 00000000000..58da85a0ee0 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr19539b.d @@ -0,0 +1,8 @@ +#source: pr19539.s +#as: --x32 +#ld: -pie -m elf32_x86_64 -T pr19539.t +#readelf: -r --wide + +Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 1 entries: + Offset Info Type Sym. Value Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_RELATIVE +[0-9a-f]+ diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp index 4dd7cfa17a6..49f9fa3c2cb 100644 --- a/ld/testsuite/ld-x86-64/x86-64.exp +++ b/ld/testsuite/ld-x86-64/x86-64.exp @@ -245,6 +245,8 @@ run_dump_test "largecomm-1c" run_dump_test "largecomm-1d" run_dump_test "largecomm-1e" run_dump_test "largecomm-1f" +run_dump_test "pr19539a" +run_dump_test "pr19539b" if { ![istarget "x86_64-*-linux*"] && ![istarget "x86_64-*-nacl*"]} { return -- 2.30.2