diff options
author | Ian Lance Taylor <ian@airs.com> | 2009-01-15 18:10:54 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2009-01-15 18:10:54 +0000 |
commit | 99e9a495d54f59d91ec80973182c8832509274ee (patch) | |
tree | 77decc6fc0f551c6e2e3c8e48a574e341ab7bc57 /gold | |
parent | 91e22acdfab8ca330673117a7634ce8e09cd9992 (diff) | |
download | gdb-99e9a495d54f59d91ec80973182c8832509274ee.zip gdb-99e9a495d54f59d91ec80973182c8832509274ee.tar.gz gdb-99e9a495d54f59d91ec80973182c8832509274ee.tar.bz2 |
* object.cc (Sized_relobj::write_local_symbols): Don't write out
local symbols when stripping all symbols.
Diffstat (limited to 'gold')
-rw-r--r-- | gold/ChangeLog | 7 | ||||
-rw-r--r-- | gold/object.cc | 15 |
2 files changed, 15 insertions, 7 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog index 6a86fba..d929d8b 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,6 +1,11 @@ +2009-01-15 Ian Lance Taylor <iant@google.com> + + * object.cc (Sized_relobj::write_local_symbols): Don't write out + local symbols when stripping all symbols. + 2009-01-14 Cary Coutant <ccoutant@google.com> - * output.cc (Output_reloc): Add explicit instantiations. + * output.cc (Output_reloc): Add explicit instantiations. 2009-01-14 Cary Coutant <ccoutant@google.com> diff --git a/gold/object.cc b/gold/object.cc index b1f83e7..6a23a6f 100644 --- a/gold/object.cc +++ b/gold/object.cc @@ -1416,9 +1416,13 @@ Sized_relobj<size, big_endian>::write_local_symbols( Output_symtab_xindex* symtab_xindex, Output_symtab_xindex* dynsym_xindex) { - if (parameters->options().strip_all() - && this->output_local_dynsym_count_ == 0) - return; + const bool strip_all = parameters->options().strip_all(); + if (strip_all) + { + if (this->output_local_dynsym_count_ == 0) + return; + this->output_local_symbol_count_ = 0; + } gold_assert(this->symtab_shndx_ != -1U); if (this->symtab_shndx_ == 0) @@ -1487,7 +1491,7 @@ Sized_relobj<size, big_endian>::write_local_symbols( st_shndx = out_sections[st_shndx]->out_shndx(); if (st_shndx >= elfcpp::SHN_LORESERVE) { - if (lv.needs_output_symtab_entry()) + if (lv.needs_output_symtab_entry() && !strip_all) symtab_xindex->add(lv.output_symtab_index(), st_shndx); if (lv.needs_output_dynsym_entry()) dynsym_xindex->add(lv.output_dynsym_index(), st_shndx); @@ -1496,8 +1500,7 @@ Sized_relobj<size, big_endian>::write_local_symbols( } // Write the symbol to the output symbol table. - if (!parameters->options().strip_all() - && lv.needs_output_symtab_entry()) + if (!strip_all && lv.needs_output_symtab_entry()) { elfcpp::Sym_write<size, big_endian> osym(ov); |