aboutsummaryrefslogtreecommitdiff
path: root/gold/output.cc
diff options
context:
space:
mode:
authorDoug Kwan <dougkwan@google.com>2010-07-13 20:07:08 +0000
committerDoug Kwan <dougkwan@google.com>2010-07-13 20:07:08 +0000
commit131687b4ade7fdff127269e3b92b01ec3d0872c7 (patch)
tree8994edc5cc4a60b17d581e3801eb32270bfbd298 /gold/output.cc
parent2f395978370b2ee7d2c987a0c93e21ca5c65a972 (diff)
downloadgdb-131687b4ade7fdff127269e3b92b01ec3d0872c7.zip
gdb-131687b4ade7fdff127269e3b92b01ec3d0872c7.tar.gz
gdb-131687b4ade7fdff127269e3b92b01ec3d0872c7.tar.bz2
2010-07-13 Doug Kwan <dougkwan@google.com>
* arm.cc (Arm_input_section::Arm_input_section): For a SHT_ARM_EXIDX section, always keeps the input sections. (Arm_input_section::set_exidx_section_link): New method. (Arm_exidx_input_section::Arm_exidx_input_section): Initialize has_errors_ to false. (Arm_exidx_input_section::has_errors, Arm_exidx_input_section::set_has_errors): New methods. (Arm_exidx_input_section::has_errors_): New data member. (Arm_relobj::get_exidx_shndx_list): New method. (Arm_output_section::append_text_sections_to_list): Do not skip section without SHF_EXECINSTR. (Arm_output_section::fix_exidx_coverage): Skip input sections with errors. (Arm_relobj::make_exidx_input_section): Add new parameter for text section header. Make error messages more verbose. Check for a non-executable section linked to an EXIDX section. (Arm_relobj::do_read_symbols): Remove error checking, which has been moved to Arm_relobj::make_exidx_input_section. Add an assertion to check that there is no deferred EXIDX section if we exit early. Instead of not making an EXIDX section in case of an error, make one and set the has_errors flag of it. (Target_arm::do_finalize_sections): Fix up links of EXIDX sections in a relocatable link. (Target_arm::do_relax): Look for the EXIDX output section instead of assuming that it is called .ARM.exidx. (Target_arm::fix_exidx_coverage): Add a new parameter for input section list. Do not check for SHF_EXECINSTR section flags but skip any input section with errors. * output.cc (Output_section::Output_section): Initialize always_keeps_input_sections_ to false. (Output_section::add_input_section): Check for always_keeps_input_sections_. * output.h (Output_section::always_keeps_input_sections, Output_section::set_always_keeps_input_sections): New methods. (Output_section::always_keeps_input_sections): New data member.
Diffstat (limited to 'gold/output.cc')
-rw-r--r--gold/output.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/gold/output.cc b/gold/output.cc
index 3ac8a3d..a487eb8 100644
--- a/gold/output.cc
+++ b/gold/output.cc
@@ -1949,6 +1949,7 @@ Output_section::Output_section(const char* name, elfcpp::Elf_Word type,
is_entsize_zero_(false),
section_offsets_need_adjustment_(false),
is_noload_(false),
+ always_keeps_input_sections_(false),
tls_offset_(0),
checkpoint_(NULL),
lookup_maps_(new Output_section_lookup_maps)
@@ -2038,8 +2039,10 @@ Output_section::add_input_section(Layout* layout,
{
// Keep information about merged input sections for rebuilding fast
// lookup maps if we have sections-script or we do relaxation.
- bool keeps_input_sections =
- have_sections_script || parameters->target().may_relax();
+ bool keeps_input_sections = (this->always_keeps_input_sections_
+ || have_sections_script
+ || parameters->target().may_relax());
+
if (this->add_merge_input_section(object, shndx, sh_flags, entsize,
addralign, keeps_input_sections))
{
@@ -2100,7 +2103,8 @@ Output_section::add_input_section(Layout* layout,
// the future, we keep track of the sections. If the
// --section-ordering-file option is used to specify the order of
// sections, we need to keep track of sections.
- if (have_sections_script
+ if (this->always_keeps_input_sections_
+ || have_sections_script
|| !this->input_sections_.empty()
|| this->may_sort_attached_input_sections()
|| this->must_sort_attached_input_sections()