aboutsummaryrefslogtreecommitdiff
path: root/gold/object.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gold/object.cc')
-rw-r--r--gold/object.cc8
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;