diff options
author | Maciej W. Rozycki <macro@mips.com> | 2018-01-30 01:31:23 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@mips.com> | 2018-01-30 01:34:05 +0000 |
commit | af667f2218ecf772ac2f8882ceba6a16ddc18ddc (patch) | |
tree | ec2a508873aacd8016077fbb52841d17ff5163d4 | |
parent | 822520337789f93b528fe0babc7dcfb03bb50fcd (diff) | |
download | gdb-af667f2218ecf772ac2f8882ceba6a16ddc18ddc.zip gdb-af667f2218ecf772ac2f8882ceba6a16ddc18ddc.tar.gz gdb-af667f2218ecf772ac2f8882ceba6a16ddc18ddc.tar.bz2 |
MIPS/LD/testsuite: Correct PR ld/22649 test case failures
Fix commit d664fd41e15f ("Ignore dynamic references on forced local
symbols") and use alternative test actions and match patterns to
correctly handle messages like:
.../ld/ld-new: Removing unused section '.reginfo' in file 'tmpdir/pr22649-2b.o'
or:
.../ld/ld-new: Removing unused section '.MIPS.options' in file 'tmpdir/pr22649-2b.o'
produced by LD on MIPS targets, removing:
FAIL: Build pr22649-2c.so
FAIL: Build pr22649-2d.so
test suite failures and tightening checks made with `pr22649-2a.so' and
`pr22649-2b.so' test cases.
Keep the original empty action with `pr22649-2c.so' and `pr22649-2d.so'
links and MIPS/ELF targets though, because for them the linker does not
garbage-collect the `.reginfo' section. This is because the section has
its flags set differently by code in GAS in `md_begin':
if (strncmp (TARGET_OS, "elf", 3) != 0)
flags |= SEC_ALLOC | SEC_LOAD;
and consequently BFD linker code in `_bfd_elf_gc_mark_extra_sections':
else if (((isec->flags & SEC_DEBUGGING) != 0
|| (isec->flags & (SEC_ALLOC | SEC_LOAD | SEC_RELOC)) == 0)
&& elf_next_in_group (isec) == NULL)
isec->gc_mark = 1;
marks these sections to be kept due to their SEC_ALLOC, SEC_LOAD and
SEC_RELOC flags all being zero (`.reginfo' sections never have
relocations attached).
ld/
PR ld/22649
* testsuite/ld-elf/pr22649-2ab-mips.msg: New stderr output.
* testsuite/ld-elf/pr22649-2cd-mips.msg: New stderr output.
* testsuite/ld-elf/shared.exp: Use the new outputs with
`mips*-*-*' targets.
-rw-r--r-- | ld/ChangeLog | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr22649-2ab-mips.msg | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr22649-2cd-mips.msg | 1 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/shared.exp | 20 |
4 files changed, 27 insertions, 4 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index ad05c54..83c9689 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,13 @@ 2018-01-30 Maciej W. Rozycki <macro@mips.com> + PR ld/22649 + * testsuite/ld-elf/pr22649-2ab-mips.msg: New stderr output. + * testsuite/ld-elf/pr22649-2cd-mips.msg: New stderr output. + * testsuite/ld-elf/shared.exp: Use the new outputs with + `mips*-*-*' targets. + +2018-01-30 Maciej W. Rozycki <macro@mips.com> + * testsuite/ld-elf/comm-data1.sd: Alternatively accept `PRC[0xff02]' in place of a regular section index. * testsuite/ld-elf/pr21703-shared.sd: Likewise `PRC[0xff01]'. diff --git a/ld/testsuite/ld-elf/pr22649-2ab-mips.msg b/ld/testsuite/ld-elf/pr22649-2ab-mips.msg new file mode 100644 index 0000000..e27e6e4 --- /dev/null +++ b/ld/testsuite/ld-elf/pr22649-2ab-mips.msg @@ -0,0 +1,2 @@ +.*: Removing unused section '\.data' in file 'tmpdir/pr22649-2.\.o' +.*: Removing unused section '\.(?:reginfo|MIPS\.options)' in file 'tmpdir/pr22649-2.\.o' diff --git a/ld/testsuite/ld-elf/pr22649-2cd-mips.msg b/ld/testsuite/ld-elf/pr22649-2cd-mips.msg new file mode 100644 index 0000000..6a7aa77 --- /dev/null +++ b/ld/testsuite/ld-elf/pr22649-2cd-mips.msg @@ -0,0 +1 @@ +.*: Removing unused section '\.(?:reginfo|MIPS\.options)' in file 'tmpdir/pr22649-2.\.o' diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp index 3dfcef2..8223d3d 100644 --- a/ld/testsuite/ld-elf/shared.exp +++ b/ld/testsuite/ld-elf/shared.exp @@ -97,6 +97,11 @@ run_ld_link_tests [list \ ] if { [check_gc_sections_available] } { + if [istarget mips*-*-*] { + set actions {{ld pr22649-2ab-mips.msg}} + } else { + set actions {{ld pr22649.msg}} + } run_ld_link_tests [list \ [list \ "Build pr22649-2a.so" \ @@ -104,7 +109,7 @@ if { [check_gc_sections_available] } { "" \ "$AFLAGS_PIC" \ {pr22649-2a.s} \ - {{ld pr22649.msg}} \ + $actions \ "pr22649-2a.so" \ ] \ [list \ @@ -113,16 +118,23 @@ if { [check_gc_sections_available] } { "tmpdir/pr22649-1.so" \ "$AFLAGS_PIC" \ {pr22649-2a.s} \ - {{ld pr22649.msg}} \ + $actions \ "pr22649-2b.so" \ ] \ + ] + if { [istarget mips*-*-*] && ![istarget *-*-elf*] } { + set actions {{ld pr22649-2cd-mips.msg}} + } else { + set actions {} + } + run_ld_link_tests [list \ [list \ "Build pr22649-2c.so" \ "$LFLAGS -shared -gc-sections -print-gc-sections" \ "" \ "$AFLAGS_PIC" \ {pr22649-2b.s} \ - {} \ + $actions \ "pr22649-2b.so" \ ] \ [list \ @@ -131,7 +143,7 @@ if { [check_gc_sections_available] } { "tmpdir/pr22649-1.so" \ "$AFLAGS_PIC" \ {pr22649-2b.s} \ - {} \ + $actions \ "pr22649-2b.so" \ ] \ ] |