aboutsummaryrefslogtreecommitdiff
path: root/gold/symtab.cc
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2012-09-09 03:43:51 +0000
committerAlan Modra <amodra@gmail.com>2012-09-09 03:43:51 +0000
commite81fea4d172699b2e986bc541f812cac0995da6b (patch)
treef53406e2ad174c23989c3052f9f6367ff7967099 /gold/symtab.cc
parentb7099d964f9a5736272cadb6d19083d643005aa1 (diff)
downloadgdb-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/symtab.cc')
-rw-r--r--gold/symtab.cc31
1 files changed, 5 insertions, 26 deletions
diff --git a/gold/symtab.cc b/gold/symtab.cc
index e97f642..8fadd1d 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -577,14 +577,7 @@ Symbol_table::gc_mark_undef_symbols(Layout* layout)
if (sym->source() == Symbol::FROM_OBJECT
&& !sym->object()->is_dynamic())
{
- Relobj* obj = static_cast<Relobj*>(sym->object());
- bool is_ordinary;
- unsigned int shndx = sym->shndx(&is_ordinary);
- if (is_ordinary)
- {
- gold_assert(this->gc_ != NULL);
- this->gc_->worklist().push(Section_id(obj, shndx));
- }
+ this->gc_mark_symbol(sym);
}
}
@@ -601,14 +594,7 @@ Symbol_table::gc_mark_undef_symbols(Layout* layout)
&& sym->source() == Symbol::FROM_OBJECT
&& !sym->object()->is_dynamic())
{
- Relobj* obj = static_cast<Relobj*>(sym->object());
- bool is_ordinary;
- unsigned int shndx = sym->shndx(&is_ordinary);
- if (is_ordinary)
- {
- gold_assert(this->gc_ != NULL);
- this->gc_->worklist().push(Section_id(obj, shndx));
- }
+ this->gc_mark_symbol(sym);
}
}
@@ -622,14 +608,7 @@ Symbol_table::gc_mark_undef_symbols(Layout* layout)
if (sym->source() == Symbol::FROM_OBJECT
&& !sym->object()->is_dynamic())
{
- Relobj* obj = static_cast<Relobj*>(sym->object());
- bool is_ordinary;
- unsigned int shndx = sym->shndx(&is_ordinary);
- if (is_ordinary)
- {
- gold_assert(this->gc_ != NULL);
- this->gc_->worklist().push(Section_id(obj, shndx));
- }
+ this->gc_mark_symbol(sym);
}
}
}
@@ -638,14 +617,14 @@ void
Symbol_table::gc_mark_symbol(Symbol* sym)
{
// Add the object and section to the work list.
- Relobj* obj = static_cast<Relobj*>(sym->object());
bool is_ordinary;
unsigned int shndx = sym->shndx(&is_ordinary);
if (is_ordinary && shndx != elfcpp::SHN_UNDEF)
{
gold_assert(this->gc_!= NULL);
- this->gc_->worklist().push(Section_id(obj, shndx));
+ this->gc_->worklist().push(Section_id(sym->object(), shndx));
}
+ parameters->target().gc_mark_symbol(this, sym);
}
// When doing garbage collection, keep symbols that have been seen in