From b487ad64e5aa3da0c80b8648f7079b5415c45a3a Mon Sep 17 00:00:00 2001 From: Sriraman Tallam Date: Sun, 21 Feb 2010 00:57:59 +0000 Subject: 2010-02-20 Sriraman Tallam * gc.h (gc_process_relocs): Change vectors to point to the new list. Add reloc offset information. * icf.cc (get_section_contents): Change iterators to point to the new vectors. Add reloc offset information to the contents. * icf.h (Icf::Sections_reachable_info): New typedef. (Icf::Sections_reachable_list): New typedef. (Icf::Offset_info): New typedef. (Icf::Reloc_info): New struct typedef. (Icf::Reloc_info_list): New typedef. (Icf::symbol_reloc_list): Delete method. (Icf::addend_reloc_list): Delete method. (Icf::section_reloc_list): Delete method. (Icf::reloc_info_list): New method. (Icf::reloc_info_list_): New member. --- gold/gc.h | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'gold/gc.h') diff --git a/gold/gc.h b/gold/gc.h index d4fd02e3bdd..b79bd77e666 100644 --- a/gold/gc.h +++ b/gold/gc.h @@ -181,9 +181,10 @@ gc_process_relocs( const int reloc_size = Reloc_types::reloc_size; const int sym_size = elfcpp::Elf_sizes::sym_size; - std::vector* secvec = NULL; - std::vector* symvec = NULL; - std::vector >* addendvec = NULL; + Icf::Sections_reachable_info* secvec = NULL; + Icf::Symbol_info* symvec = NULL; + Icf::Addend_info* addendvec = NULL; + Icf::Offset_info* offsetvec = NULL; bool is_icf_tracked = false; const char* cident_section_name = NULL; @@ -198,9 +199,12 @@ gc_process_relocs( { is_icf_tracked = true; Section_id src_id(src_obj, src_indx); - secvec = &symtab->icf()->section_reloc_list()[src_id]; - symvec = &symtab->icf()->symbol_reloc_list()[src_id]; - addendvec = &symtab->icf()->addend_reloc_list()[src_id]; + Icf::Reloc_info* reloc_info = + &symtab->icf()->reloc_info_list()[src_id]; + secvec = &reloc_info->section_info; + symvec = &reloc_info->symbol_info; + addendvec = &reloc_info->addend_info; + offsetvec = &reloc_info->offset_info; } check_section_for_function_pointers = @@ -236,6 +240,9 @@ gc_process_relocs( long long symvalue = static_cast(lsym.get_st_value()); (*addendvec).push_back(std::make_pair(symvalue, static_cast(addend))); + uint64_t reloc_offset = + convert_to_section_size_type(reloc.get_r_offset()); + (*offsetvec).push_back(reloc_offset); } // When doing safe folding, check to see if this relocation is that @@ -301,6 +308,9 @@ gc_process_relocs( static_cast(sized_gsym->value()); (*addendvec).push_back(std::make_pair(symvalue, static_cast(addend))); + uint64_t reloc_offset = + convert_to_section_size_type(reloc.get_r_offset()); + (*offsetvec).push_back(reloc_offset); } } if (parameters->options().gc_sections()) -- cgit v1.2.1