aboutsummaryrefslogtreecommitdiff
path: root/gold/options.h
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@gmail.com>2015-06-04 20:58:08 -0700
committerCary Coutant <ccoutant@gmail.com>2015-06-04 20:58:08 -0700
commitcd3c333f43f03d6e41668a82a68a99c14000a681 (patch)
tree111fa29f0aff6318e7df16f84d90003775adc8f0 /gold/options.h
parentdc302c00611b6973fbc55e9fdd643ad24c370bd1 (diff)
downloadfsf-binutils-gdb-cd3c333f43f03d6e41668a82a68a99c14000a681.zip
fsf-binutils-gdb-cd3c333f43f03d6e41668a82a68a99c14000a681.tar.gz
fsf-binutils-gdb-cd3c333f43f03d6e41668a82a68a99c14000a681.tar.bz2
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.
Diffstat (limited to 'gold/options.h')
-rw-r--r--gold/options.h37
1 files changed, 33 insertions, 4 deletions
diff --git a/gold/options.h b/gold/options.h
index 67eb1b2..658ad42 100644
--- a/gold/options.h
+++ b/gold/options.h
@@ -739,10 +739,12 @@ class General_options
N_("Look for violations of the C++ One Definition Rule"),
N_("Do not look for violations of the C++ One Definition Rule"));
- DEFINE_bool(discard_all, options::TWO_DASHES, 'x', false,
- N_("Delete all local symbols"), NULL);
- DEFINE_bool(discard_locals, options::TWO_DASHES, 'X', false,
- N_("Delete all temporary local symbols"), NULL);
+ DEFINE_special(discard_all, options::TWO_DASHES, 'x',
+ N_("Delete all local symbols"), NULL);
+ DEFINE_special(discard_locals, options::TWO_DASHES, 'X',
+ N_("Delete all temporary local symbols"), NULL);
+ DEFINE_special(discard_none, options::TWO_DASHES, '\0',
+ N_("Keep all local symbols"), NULL);
DEFINE_bool(dynamic_list_data, options::TWO_DASHES, '\0', false,
N_("Add data symbols to dynamic symbols"), NULL);
@@ -1526,11 +1528,36 @@ class General_options
endianness() const
{ return this->endianness_; }
+ bool
+ discard_all() const
+ { return this->discard_locals_ == DISCARD_ALL; }
+
+ bool
+ discard_locals() const
+ { return this->discard_locals_ == DISCARD_LOCALS; }
+
+ bool
+ discard_sec_merge() const
+ { return this->discard_locals_ == DISCARD_SEC_MERGE; }
+
private:
// Don't copy this structure.
General_options(const General_options&);
General_options& operator=(const General_options&);
+ // What local symbols to discard.
+ enum Discard_locals
+ {
+ // Locals in merge sections (default).
+ DISCARD_SEC_MERGE,
+ // None (--discard-none).
+ DISCARD_NONE,
+ // Temporary locals (--discard-locals/-X).
+ DISCARD_LOCALS,
+ // All locals (--discard-all/-x).
+ DISCARD_ALL
+ };
+
// Whether to mark the stack as executable.
enum Execstack
{
@@ -1626,6 +1653,8 @@ class General_options
Fix_v4bx fix_v4bx_;
// Endianness.
Endianness endianness_;
+ // What local symbols to discard.
+ Discard_locals discard_locals_;
};
// The position-dependent options. We use this to store the state of