aboutsummaryrefslogtreecommitdiff
path: root/gold/gc.h
diff options
context:
space:
mode:
authorSriraman Tallam <tmsriram@google.com>2010-02-21 00:57:59 +0000
committerSriraman Tallam <tmsriram@google.com>2010-02-21 00:57:59 +0000
commitb487ad64e5aa3da0c80b8648f7079b5415c45a3a (patch)
treedb254f4182cc73c2abc52dc46c266b495265654f /gold/gc.h
parent307d2493b8685a7f69b85dc48db0df13921f0665 (diff)
downloadgdb-b487ad64e5aa3da0c80b8648f7079b5415c45a3a.zip
gdb-b487ad64e5aa3da0c80b8648f7079b5415c45a3a.tar.gz
gdb-b487ad64e5aa3da0c80b8648f7079b5415c45a3a.tar.bz2
2010-02-20 Sriraman Tallam <tmsriram@google.com>
* 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.
Diffstat (limited to 'gold/gc.h')
-rw-r--r--gold/gc.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/gold/gc.h b/gold/gc.h
index d4fd02e..b79bd77 100644
--- a/gold/gc.h
+++ b/gold/gc.h
@@ -181,9 +181,10 @@ gc_process_relocs(
const int reloc_size = Reloc_types<sh_type, size, big_endian>::reloc_size;
const int sym_size = elfcpp::Elf_sizes<size>::sym_size;
- std::vector<Section_id>* secvec = NULL;
- std::vector<Symbol*>* symvec = NULL;
- std::vector<std::pair<long long, long long> >* 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<long long>(lsym.get_st_value());
(*addendvec).push_back(std::make_pair(symvalue,
static_cast<long long>(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<long long>(sized_gsym->value());
(*addendvec).push_back(std::make_pair(symvalue,
static_cast<long long>(addend)));
+ uint64_t reloc_offset =
+ convert_to_section_size_type(reloc.get_r_offset());
+ (*offsetvec).push_back(reloc_offset);
}
}
if (parameters->options().gc_sections())