diff options
author | Alan Modra <amodra@gmail.com> | 2020-06-15 12:11:27 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-06-15 12:11:27 +0930 |
commit | ea4b3731ecd4b00afa199cdcf988e6b1c706f7de (patch) | |
tree | 7ee37b25031968a8da266e8d9f788910609819cb /ld | |
parent | 75cfe082c067db0b12fb982de0833309e454a8e2 (diff) | |
download | gdb-ea4b3731ecd4b00afa199cdcf988e6b1c706f7de.zip gdb-ea4b3731ecd4b00afa199cdcf988e6b1c706f7de.tar.gz gdb-ea4b3731ecd4b00afa199cdcf988e6b1c706f7de.tar.bz2 |
PR26103 testcase
PR 26103
* testsuite/ld-linkonce/ref1.s,
* testsuite/ld-linkonce/ref2.s,
* testsuite/ld-linkonce/sym1.s,
* testsuite/ld-linkonce/sym2.s,
* testsuite/ld-linkonce/sym3.s: New test files.
* testsuite/ld-linkonce/linkonce.exp: Run tests for PE too.
Add pr26103 test. Remove unnecessary load_lib.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 11 | ||||
-rw-r--r-- | ld/testsuite/ld-linkonce/linkonce.exp | 19 | ||||
-rw-r--r-- | ld/testsuite/ld-linkonce/ref1.s | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-linkonce/ref2.s | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-linkonce/sym1.s | 12 | ||||
-rw-r--r-- | ld/testsuite/ld-linkonce/sym2.s | 12 | ||||
-rw-r--r-- | ld/testsuite/ld-linkonce/sym3.s | 12 |
7 files changed, 61 insertions, 9 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 6aeafe6..5ecd26a 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,16 @@ 2020-06-15 Alan Modra <amodra@gmail.com> + PR 26103 + * testsuite/ld-linkonce/ref1.s, + * testsuite/ld-linkonce/ref2.s, + * testsuite/ld-linkonce/sym1.s, + * testsuite/ld-linkonce/sym2.s, + * testsuite/ld-linkonce/sym3.s: New test files. + * testsuite/ld-linkonce/linkonce.exp: Run tests for PE too. + Add pr26103 test. Remove unnecessary load_lib. + +2020-06-15 Alan Modra <amodra@gmail.com> + * testsuite/ld-linkonce/zeroeh_x.s: Rename from x.s. * testsuite/ld-linkonce/zeroeh_y.s: Rename from y.s. * testsuite/ld-linkonce/zeroehl32.d: Adjust for renaming. Support diff --git a/ld/testsuite/ld-linkonce/linkonce.exp b/ld/testsuite/ld-linkonce/linkonce.exp index 5bac44f..924602c 100644 --- a/ld/testsuite/ld-linkonce/linkonce.exp +++ b/ld/testsuite/ld-linkonce/linkonce.exp @@ -21,18 +21,19 @@ # Written by Hans-Peter Nilsson (hp@axis.com) # -# Test for ELF here (or really, .gnu.linkonce functionality), so we don't -# have to qualify on ELF specifically in every .d-file. - -if { ![istarget *-*-linux*] \ - && ![istarget *-*-gnu*] \ - && ![istarget *-*-nacl*] \ - && ![istarget hppa*64*-*-hpux*] \ - && ![istarget *-*-elf] } { +# Test .gnu.linkonce functionality +if { ![is_elf_format] && ![is_pecoff_format] } { return } -load_lib ld-lib.exp +run_ld_link_tests [list \ + [list "Build sym.a" \ + "" "" \ + "" {sym1.s sym2.s sym3.s ref2.s} {} "sym.a" ] \ + [list "pr26103" \ + "" "--start-group tmpdir/sym.a tmpdir/ref2.o --end-group" \ + "" {ref1.s} {} "pr26103" ] \ +] set rd_test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]] for { set i 0 } { $i < [llength $rd_test_list] } { incr i } { diff --git a/ld/testsuite/ld-linkonce/ref1.s b/ld/testsuite/ld-linkonce/ref1.s new file mode 100644 index 0000000..fa138e9 --- /dev/null +++ b/ld/testsuite/ld-linkonce/ref1.s @@ -0,0 +1,2 @@ + .data + .dc.a one, two, three diff --git a/ld/testsuite/ld-linkonce/ref2.s b/ld/testsuite/ld-linkonce/ref2.s new file mode 100644 index 0000000..302b889 --- /dev/null +++ b/ld/testsuite/ld-linkonce/ref2.s @@ -0,0 +1,2 @@ + .data + .dc.a four diff --git a/ld/testsuite/ld-linkonce/sym1.s b/ld/testsuite/ld-linkonce/sym1.s new file mode 100644 index 0000000..704d9f6 --- /dev/null +++ b/ld/testsuite/ld-linkonce/sym1.s @@ -0,0 +1,12 @@ + .data + .global two +two: + .long 2 + + .section .gnu.linkonce.d.foo, "aw" + .global foo +# PE signature of the comdat group +foo: + .global one +one: + .long 1 diff --git a/ld/testsuite/ld-linkonce/sym2.s b/ld/testsuite/ld-linkonce/sym2.s new file mode 100644 index 0000000..041f424 --- /dev/null +++ b/ld/testsuite/ld-linkonce/sym2.s @@ -0,0 +1,12 @@ + .data + .global three +three: + .long 3 + + .section .gnu.linkonce.d.foo, "aw" + .global foo +# PE signature of the comdat group +foo: + .global onex +onex: + .long 1 diff --git a/ld/testsuite/ld-linkonce/sym3.s b/ld/testsuite/ld-linkonce/sym3.s new file mode 100644 index 0000000..28ae0fe --- /dev/null +++ b/ld/testsuite/ld-linkonce/sym3.s @@ -0,0 +1,12 @@ + .data + .global four +four: + .long 4 + + .section .gnu.linkonce.d.foo, "aw" + .global foo +# PE signature of the comdat group +foo: + .global oney +oney: + .long 1 |