From d6344fb5ba8bfe0219f91c52e296707dbcdb07e3 Mon Sep 17 00:00:00 2001 From: Doug Kwan Date: Thu, 17 Dec 2009 00:00:26 +0000 Subject: 2009-12-16 Doug Kwan * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated sections. * object.cc (Sized_relobj::do_finalize_local_symbols): Handle relaxed input sections. * output.cc (Output_section::find_relaxed_input_section): Change return type to Output_relaxed_input_section pointer. Adjust code for new type of relaxed_input_section_map_. * output.h (Output_section::find_relaxed_input_section): Change return type to Output_relaxed_input_section pointer. (Output_section::Output_relaxed_input_section_by_input_section_map): New type. (Output_section::relaxed_input_section_map_): Change type to Output_section::Output_relaxed_input_section_by_input_section_map. * symtab.cc (Symbol_table::compute_final_value): Handle relaxed input section. --- gold/symtab.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'gold/symtab.cc') diff --git a/gold/symtab.cc b/gold/symtab.cc index 7e8a89021d9..8cd4a40f1cf 100644 --- a/gold/symtab.cc +++ b/gold/symtab.cc @@ -2413,7 +2413,6 @@ Symbol_table::compute_final_value( { Relobj* relobj = static_cast(symobj); Output_section* os = relobj->output_section(shndx); - uint64_t secoff64 = relobj->output_section_offset(shndx); if (this->is_section_folded(relobj, shndx)) { @@ -2423,11 +2422,17 @@ Symbol_table::compute_final_value( shndx); gold_assert(folded.first != NULL); Relobj* folded_obj = reinterpret_cast(folded.first); - os = folded_obj->output_section(folded.second); + unsigned folded_shndx = folded.second; + + os = folded_obj->output_section(folded_shndx); gold_assert(os != NULL); - secoff64 = folded_obj->output_section_offset(folded.second); + + // Replace (relobj, shndx) with canonical ICF input section. + shndx = folded_shndx; + relobj = folded_obj; } + uint64_t secoff64 = relobj->output_section_offset(shndx); if (os == NULL) { bool static_or_reloc = (parameters->doing_static_link() || -- cgit v1.2.1