diff options
Diffstat (limited to 'gold/symtab.cc')
-rw-r--r-- | gold/symtab.cc | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/gold/symtab.cc b/gold/symtab.cc index e97f642254..8fadd1ddcf 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 |