From b9b2ae8bbf911b7762fe41ecbb5dbc64a8e2b5a7 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 14 Aug 2012 08:31:57 +0000 Subject: 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. --- gold/object.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'gold/object.cc') diff --git a/gold/object.cc b/gold/object.cc index fc8533e..417ccfc 100644 --- a/gold/object.cc +++ b/gold/object.cc @@ -1494,6 +1494,7 @@ Sized_relobj_file::do_layout(Symbol_table* symtab, if (is_gc_pass_one && parameters->options().gc_sections()) { if (this->is_section_name_included(name) + || layout->keep_input_section (this, name) || shdr.get_sh_type() == elfcpp::SHT_INIT_ARRAY || shdr.get_sh_type() == elfcpp::SHT_FINI_ARRAY) { -- cgit v1.1