diff options
author | Craig Silverstein <csilvers@google.com> | 2009-09-18 20:03:22 +0000 |
---|---|---|
committer | Craig Silverstein <csilvers@google.com> | 2009-09-18 20:03:22 +0000 |
commit | 8c60465154ed694fac2531f65e7ca1ae51093174 (patch) | |
tree | 5b1e1c166e0d5f50c40988974cf4a87e9dfcb216 /gold/object.cc | |
parent | f43030c448dc1938d6fc7a6072f1a76853b1b70d (diff) | |
download | gdb-8c60465154ed694fac2531f65e7ca1ae51093174.zip gdb-8c60465154ed694fac2531f65e7ca1ae51093174.tar.gz gdb-8c60465154ed694fac2531f65e7ca1ae51093174.tar.bz2 |
* 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.
Diffstat (limited to 'gold/object.cc')
-rw-r--r-- | gold/object.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gold/object.cc b/gold/object.cc index be6294c..1256284 100644 --- a/gold/object.cc +++ b/gold/object.cc @@ -1562,6 +1562,14 @@ Sized_relobj<size, big_endian>::do_count_local_symbols(Stringpool* pool, continue; } + // Discard the local symbol if -retain_symbols_file is specified + // and the local symbol is not in that file. + if (!parameters->options().should_retain_symbol(name)) + { + lv.set_no_output_symtab_entry(); + continue; + } + // Add the symbol to the symbol table string pool. pool->add(name, true, NULL); ++count; |