forked from Imagelibrary/binutils-gdb
* object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
* options.cc: Include <cerrno> and <fstream>. (General_options::finalize): Parse -retain-symbols-file tag. * options.h: New flag. (General_options): New method should_retain_symbol, new variable symbols_to_retain. * symtab.cc (Symbol_table::sized_finalize_symbol): Test should_retain_symbol map. * testsuite/Makefile.am (retain_symbols_file_test): New test. * testsuite/Makefile.in: Regenerate. * testsuite/retain_symbols_file_test.sh: New file.
This commit is contained in:
@@ -2521,7 +2521,8 @@ Symbol_table::sized_finalize_symbol(Symbol* unsized_sym)
|
||||
|
||||
sym->set_value(value);
|
||||
|
||||
if (parameters->options().strip_all())
|
||||
if (parameters->options().strip_all()
|
||||
|| !parameters->options().should_retain_symbol(sym->name()))
|
||||
{
|
||||
sym->set_symtab_index(-1U);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user