* 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:
Craig Silverstein
2009-09-18 20:03:22 +00:00
parent f43030c448
commit 8c60465154
8 changed files with 157 additions and 6 deletions

View File

@@ -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;