From cd3c333f43f03d6e41668a82a68a99c14000a681 Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Thu, 4 Jun 2015 20:58:08 -0700 Subject: Change default to discard temporary local symbols in merge sections. Add --discard-none to keep all local symbols. gold/ PR gold/17498 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard temporary locals in merge sections. * options.cc (General_options::parse_discard_all): New method. (General_options::parse_discard_locals): New method. (General_options::parse_discard_none): New method. (General_options::General_options): Initialize discard_locals_. * options.h (--discard-all): Convert to special option. (--discard-locals): Likewise. (--discard-none): New option. (General_options::discard_all): New method. (General_options::discard_locals): New method. (General_options::discard_sec_merge): New method. (General_options::Discard_locals): New enum. (General_options::discard_locals_): New data member. --- gold/options.cc | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'gold/options.cc') diff --git a/gold/options.cc b/gold/options.cc index 39dc311..c42623f 100644 --- a/gold/options.cc +++ b/gold/options.cc @@ -346,6 +346,27 @@ General_options::parse_defsym(const char*, const char* arg, } void +General_options::parse_discard_all(const char*, const char*, + Command_line*) +{ + this->discard_locals_ = DISCARD_ALL; +} + +void +General_options::parse_discard_locals(const char*, const char*, + Command_line*) +{ + this->discard_locals_ = DISCARD_LOCALS; +} + +void +General_options::parse_discard_none(const char*, const char*, + Command_line*) +{ + this->discard_locals_ = DISCARD_NONE; +} + +void General_options::parse_incremental(const char*, const char*, Command_line*) { @@ -927,7 +948,8 @@ General_options::General_options() symbols_to_retain_(), section_starts_(), fix_v4bx_(FIX_V4BX_NONE), - endianness_(ENDIANNESS_NOT_SET) + endianness_(ENDIANNESS_NOT_SET), + discard_locals_(DISCARD_SEC_MERGE) { // Turn off option registration once construction is complete. gold::options::ready_to_register = false; -- cgit v1.1