diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2020-10-02 11:08:19 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2020-10-02 11:08:19 +0100 |
commit | 7026832e52cff026f877616ac0033c7bb8d1df6f (patch) | |
tree | f51aba6d7c5928bdf994047762182a07ba7a6627 /ld | |
parent | 048fde1ef43843aa67e9ac30829e0d30f019a7dd (diff) | |
download | binutils-7026832e52cff026f877616ac0033c7bb8d1df6f.zip binutils-7026832e52cff026f877616ac0033c7bb8d1df6f.tar.gz binutils-7026832e52cff026f877616ac0033c7bb8d1df6f.tar.bz2 |
Allow note sections to be discarded when they are linked to another discarded secction.
PR 26681
bfd * elflink.c (bfd_elf_gc_sections): Do not arbitrarily keep note
sections which are linked to another section.
ld * testsuite/ld-elf/pr26681.s: New test.
* testsuite/ld-elf/pr26681.d: New test driver.
* testsuite/ld-elf/pr26681.l: New test output.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 7 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr26681.d | 3 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr26681.l | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr26681.s | 10 |
4 files changed, 25 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 134db8c..a6beac0 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,10 @@ +2020-10-01 H.J. Lu <hongjiu.lu@intel.com> + + PR 26681 + * testsuite/ld-elf/pr26681.s: New test. + * testsuite/ld-elf/pr26681.d: New test driver. + * testsuite/ld-elf/pr26681.l: New test output. + 2020-09-30 H.J. Lu <hongjiu.lu@intel.com> PR ld/26675 diff --git a/ld/testsuite/ld-elf/pr26681.d b/ld/testsuite/ld-elf/pr26681.d new file mode 100644 index 0000000..01c1ce8 --- /dev/null +++ b/ld/testsuite/ld-elf/pr26681.d @@ -0,0 +1,3 @@ +#ld: --gc-sections --print-gc-sections -e _start +#warning_output: pr26681.l +#target: [check_gc_sections_available] diff --git a/ld/testsuite/ld-elf/pr26681.l b/ld/testsuite/ld-elf/pr26681.l new file mode 100644 index 0000000..05da9b2 --- /dev/null +++ b/ld/testsuite/ld-elf/pr26681.l @@ -0,0 +1,5 @@ +#... +.*: removing unused section '\.unused1' in file 'tmpdir/.*\.o' +#... +.*: removing unused section '\.gnu.note1' in file 'tmpdir/.*\.o' +#... diff --git a/ld/testsuite/ld-elf/pr26681.s b/ld/testsuite/ld-elf/pr26681.s new file mode 100644 index 0000000..0417bed --- /dev/null +++ b/ld/testsuite/ld-elf/pr26681.s @@ -0,0 +1,10 @@ + .text + .globl _start +_start: + .nop + + .section .unused1, "ax", %progbits + .nop + + .section .gnu.note1, "o", %note, .unused1 + .word 2 |