diff options
author | Nick Clifton <nickc@redhat.com> | 2012-08-14 08:31:57 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2012-08-14 08:31:57 +0000 |
commit | b9b2ae8bbf911b7762fe41ecbb5dbc64a8e2b5a7 (patch) | |
tree | 53b5d6d4c8f3c498a9c9ebfb42d572a2553bfd4f /ld/testsuite/ld-gc/pr14265.d | |
parent | 921b53228fa18e00beca6b19b3aa43c23903b900 (diff) | |
download | binutils-gdb-b9b2ae8bbf911b7762fe41ecbb5dbc64a8e2b5a7.tar.gz |
PR ld/14265
* script-sections.cc (Sections_element::output_section_name): Add
keep return parameter.
(Output_section_element::match_name): Add keep return parameter.
Return the value of the keep_ member.
* script-sections.h (class Output_section): Update
output_section_name prototype.
* layout.cc (Layout::keep_input_section): New public member
function.
(Layout::choose_output_section): Pass keep parameter to
output_section_name.
* layout.h (class Layout): Add keep_input_section.
* object.cc (Sized_relobj_file::do_layout): Check for kept input
sections.
* testsuite/Makefile.am: Add a test.
* testsuite/Makefile.in: Regenerate.
* testsuite/pr14265.c: Source file for the test.
* testsuite/pr14265.t: Linker script for the test.
* testsuite/pr14265.sh: Shell script for the test.
* ld-gc/gc.exp: Add a new test.
* ld-gc/pr14265.c: Source file for the new test.
* ld-gc/pr14265.t: Linker script for the new test.
* ld-gc/pr14265.d: Expected symbol dump.
Diffstat (limited to 'ld/testsuite/ld-gc/pr14265.d')
-rw-r--r-- | ld/testsuite/ld-gc/pr14265.d | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ld/testsuite/ld-gc/pr14265.d b/ld/testsuite/ld-gc/pr14265.d new file mode 100644 index 00000000000..04af9825c1d --- /dev/null +++ b/ld/testsuite/ld-gc/pr14265.d @@ -0,0 +1,13 @@ +#name: --gc-sections with KEEP +#source: dummy.s +#ld: --gc-sections -T pr14265.t -e 0 tmpdir/pr14265.o +#nm: --format=bsd --numeric-sort + +#... +[0-9a-f]+[ ]d[ ]_*foo1_start +[0-9a-f]+[ ]D[ ]_*foo1 +[0-9a-f]+[ ]d[ ]_*foo1_end +[0-9a-f]+[ ]d[ ]_*foo2_start +[0-9a-f]+[ ]D[ ]_*foo2 +[0-9a-f]+[ ]d[ ]_*foo2_end +#... |