From 8c60465154ed694fac2531f65e7ca1ae51093174 Mon Sep 17 00:00:00 2001 From: Craig Silverstein Date: Fri, 18 Sep 2009 20:03:22 +0000 Subject: * object.cc (Sized_relobj::do_count): Test should_retain_symbol map. * options.cc: Include and . (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. --- gold/symtab.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gold/symtab.cc') diff --git a/gold/symtab.cc b/gold/symtab.cc index 292a26275d..d5f699bf94 100644 --- a/gold/symtab.cc +++ b/gold/symtab.cc @@ -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; -- cgit v1.2.1