diff options
author | Alan Modra <amodra@gmail.com> | 2012-09-09 03:43:51 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2012-09-09 03:43:51 +0000 |
commit | e81fea4d172699b2e986bc541f812cac0995da6b (patch) | |
tree | f53406e2ad174c23989c3052f9f6367ff7967099 /gold/gc.h | |
parent | b7099d964f9a5736272cadb6d19083d643005aa1 (diff) | |
download | gdb-e81fea4d172699b2e986bc541f812cac0995da6b.zip gdb-e81fea4d172699b2e986bc541f812cac0995da6b.tar.gz gdb-e81fea4d172699b2e986bc541f812cac0995da6b.tar.bz2 |
* target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
(Sized_target::gc_add_reference, do_gc_add_reference): New functions.
* gc.h (gc_process_relocs): Call target gc_add_reference.
* gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
* symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
(Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
unnecessary cast.
* powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
to cater for when we don't need code offset. Update use.
(Powerpc_relobj::access_from_map_, opd_valid_): New vars.
(Powerpc_relobj::access_from_map, add_reference, opd_valid,
set_opd_valid): New functions.
(Target_powerpc::do_gc_add_reference): New function.
(Target_powerpc::gc_process_relocs): Call gc()->add_reference on
stashed refs.
(Target_powerpc::do_gc_mark_symbol): New function.
Diffstat (limited to 'gold/gc.h')
-rw-r--r-- | gold/gc.h | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -187,8 +187,6 @@ gc_process_relocs( size_t local_count, const unsigned char* plocal_syms) { - Object* dst_obj; - unsigned int dst_indx; Scan scan; typedef typename Reloc_types<sh_type, size, big_endian>::Reloc Reltype; @@ -235,6 +233,9 @@ gc_process_relocs( unsigned int r_type = elfcpp::elf_r_type<size>(r_info); typename elfcpp::Elf_types<size>::Elf_Swxword addend = Reloc_types<sh_type, size, big_endian>::get_reloc_addend_noerror(&reloc); + Object* dst_obj; + unsigned int dst_indx; + typename elfcpp::Elf_types<size>::Elf_Addr dst_off; if (r_sym < local_count) { @@ -246,6 +247,8 @@ gc_process_relocs( shndx = src_obj->adjust_sym_shndx(r_sym, shndx, &is_ordinary); dst_obj = src_obj; dst_indx = shndx; + dst_off = lsym.get_st_value(); + if (is_icf_tracked) { if (is_ordinary) @@ -288,11 +291,13 @@ gc_process_relocs( dst_obj = NULL; dst_indx = 0; + dst_off = 0; bool is_ordinary = false; if (gsym->source() == Symbol::FROM_OBJECT) { dst_obj = gsym->object(); dst_indx = gsym->shndx(&is_ordinary); + dst_off = static_cast<const Sized_symbol<size>*>(gsym)->value(); } // When doing safe folding, check to see if this relocation is that @@ -348,6 +353,10 @@ gc_process_relocs( if (parameters->options().gc_sections()) { symtab->gc()->add_reference(src_obj, src_indx, dst_obj, dst_indx); + dst_off += addend; + parameters->sized_target<size, big_endian>() + ->gc_add_reference(symtab, src_obj, src_indx, + dst_obj, dst_indx, dst_off); if (cident_section_name != NULL) { Garbage_collection::Cident_section_map::iterator ele = |