aboutsummaryrefslogtreecommitdiff
path: root/gold/options.h
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2021-05-14 15:51:16 -0700
committerFangrui Song <maskray@google.com>2021-05-14 15:51:17 -0700
commit823241a27c03235229ff0b9e12a141fc35007dec (patch)
tree19fdc0cdb655d63abf1b9d78cff4601f804567ae /gold/options.h
parentf8eec398fb705d6d6f76451288abd5d38f9d07fc (diff)
downloadgdb-823241a27c03235229ff0b9e12a141fc35007dec.zip
gdb-823241a27c03235229ff0b9e12a141fc35007dec.tar.gz
gdb-823241a27c03235229ff0b9e12a141fc35007dec.tar.bz2
gold: Add -Bno-symbolic
gold/ PR 27834 * options.h (General_options): Make -Bsymbolic and -Bsymbolic-functions special and adjust the help messages. Add enum Bsymbolic_kind and -Bno-symbolic. * options.cc (General_options): Define parse_Bno_symbolic, parse_Bsymbolic_functions, and parse_Bsymbolic.
Diffstat (limited to 'gold/options.h')
-rw-r--r--gold/options.h34
1 files changed, 30 insertions, 4 deletions
diff --git a/gold/options.h b/gold/options.h
index 927e073..757ebf1 100644
--- a/gold/options.h
+++ b/gold/options.h
@@ -747,11 +747,20 @@ class General_options
DEFINE_bool(Bshareable, options::ONE_DASH, '\0', false,
N_("Generate shared library (alias for -G/-shared)"), NULL);
- DEFINE_bool(Bsymbolic, options::ONE_DASH, '\0', false,
- N_("Bind defined symbols locally"), NULL);
+ DEFINE_special (Bno_symbolic, options::ONE_DASH, '\0',
+ N_ ("Don't bind default visibility defined symbols locally "
+ "for -shared (default)"),
+ NULL);
- DEFINE_bool(Bsymbolic_functions, options::ONE_DASH, '\0', false,
- N_("Bind defined function symbols locally"), NULL);
+ DEFINE_special (Bsymbolic_functions, options::ONE_DASH, '\0',
+ N_ ("Bind default visibility defined function symbols "
+ "locally for -shared"),
+ NULL);
+
+ DEFINE_special (
+ Bsymbolic, options::ONE_DASH, '\0',
+ N_ ("Bind default visibility defined symbols locally for -shared"),
+ NULL);
// c
@@ -1740,6 +1749,21 @@ class General_options
endianness() const
{ return this->endianness_; }
+ enum Bsymbolic_kind
+ {
+ BSYMBOLIC_NONE,
+ BSYMBOLIC_FUNCTIONS,
+ BSYMBOLIC_ALL,
+ };
+
+ bool
+ Bsymbolic() const
+ { return this->bsymbolic_ == BSYMBOLIC_ALL; }
+
+ bool
+ Bsymbolic_functions() const
+ { return this->bsymbolic_ == BSYMBOLIC_FUNCTIONS; }
+
bool
discard_all() const
{ return this->discard_locals_ == DISCARD_ALL; }
@@ -1873,6 +1897,8 @@ class General_options
void
copy_from_posdep_options(const Position_dependent_options&);
+ // Whether we bind default visibility defined symbols locally for -shared.
+ Bsymbolic_kind bsymbolic_;
// Whether we printed version information.
bool printed_version_;
// Whether to mark the stack as executable.