diff options
author | Alan Modra <amodra@gmail.com> | 2018-02-13 14:09:48 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2018-02-13 22:55:49 +1030 |
commit | 6e5e9d58c1eeef5677c90886578a895cb8c164c5 (patch) | |
tree | cb2ae019115967a391262d5f9533e0fd19e7944f /binutils/testsuite/binutils-all/objcopy.exp | |
parent | f2731e0c374e5323ce4cdae2bcc7b7fe22da1a6f (diff) | |
download | binutils-gdb-6e5e9d58c1eeef5677c90886578a895cb8c164c5.tar.gz |
PR22836, "-r -s" doesn't work with -g3 using GCC 7
This fixes the case where all of a group is removed with ld -r, the
situation in the PR, and failures where part of a group is removed
that contain relocs.
bfd/
PR 22836
* elf.c (_bfd_elf_fixup_group_sections): Account for removed
relocation sections. If size reduces to just the flag word,
remove that too and mark with SEC_EXCLUDE.
* elflink.c (bfd_elf_final_link): Strip empty group sections.
binutils/
* testsuite/binutils-all/group-7.s,
* testsuite/binutils-all/group-7a.d,
* testsuite/binutils-all/group-7b.d,
* testsuite/binutils-all/group-7c.d: New tests.
* testsuite/binutils-all/objcopy.exp: Run them.
ld/
* testsuite/ld-elf/pr22836-2.d,
* testsuite/ld-elf/pr22836-2.s: New test.
Diffstat (limited to 'binutils/testsuite/binutils-all/objcopy.exp')
-rw-r--r-- | binutils/testsuite/binutils-all/objcopy.exp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp index 377f88c0e16..f4a7692cdf3 100644 --- a/binutils/testsuite/binutils-all/objcopy.exp +++ b/binutils/testsuite/binutils-all/objcopy.exp @@ -1051,6 +1051,9 @@ if [is_elf_format] { objcopy_test_readelf "GNU_MBIND section" mbind1.s run_dump_test "group-5" run_dump_test "group-6" + run_dump_test "group-7a" + run_dump_test "group-7b" + run_dump_test "group-7c" run_dump_test "copy-1" run_dump_test "note-1" if [is_elf64 tmpdir/bintest.o] { |