diff options
author | Alan Modra <amodra@gmail.com> | 2020-07-23 10:35:56 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-07-27 22:31:37 +0930 |
commit | afd2ea23626c43886ab8b028b68b7b663d6de3c6 (patch) | |
tree | 655c431b1a433cdb530774e781b47077633e740e /gold/options.cc | |
parent | 608d61c20245aa71875f8631bb799ee2d0372d40 (diff) | |
download | gdb-afd2ea23626c43886ab8b028b68b7b663d6de3c6.zip gdb-afd2ea23626c43886ab8b028b68b7b663d6de3c6.tar.gz gdb-afd2ea23626c43886ab8b028b68b7b663d6de3c6.tar.bz2 |
[GOLD] Power10 stub selection
gold version of commit e10a07b32dc1.
* options.h (DEFINE_enum): Add optional_arg__ param, adjust
all uses.
(General_options): Add --power10-stubs and --no-power10-stubs.
* options.cc (General_options::finalize): Handle --power10-stubs.
* powerpc.cc (set_power10_stubs): Don't set when --power10-stubs=no.
(power10_stubs_auto): New.
(struct Plt_stub_ent): Add toc_ and tocoff_. Don't use a bitfield
for indx_.
(struct Branch_stub_ent): Add toc_and tocoff_. Use bitfields for
iter_, notoc_ and save_res_.
(add_plt_call_entry): Set toc_. Adjust resizing conditions for
--power10-stubs=auto.
(add_long_branch_entry): Set toc_.
(add_eh_frame, define_stub_syms): No longer use const_iterators
for plt and long branch stub iteration.
(build_tls_opt_head, build_tls_opt_tail): Change parameters and
return value. Move tests for __tls_get_addr to callers.
(plt_call_size): Handle --power10-stubs=auto.
(branch_stub_size): Likewise.
(Stub_table::do_write): Likewise.
(relocate): Likewise.
Diffstat (limited to 'gold/options.cc')
-rw-r--r-- | gold/options.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gold/options.cc b/gold/options.cc index b13ae71..6b19437 100644 --- a/gold/options.cc +++ b/gold/options.cc @@ -465,6 +465,14 @@ General_options::parse_plugin_opt(const char*, const char* arg, } void +General_options::parse_no_power10_stubs(const char*, const char*, + Command_line*) +{ + this->set_power10_stubs("no"); + this->set_user_set_power10_stubs(); +} + +void General_options::parse_R(const char* option, const char* arg, Command_line* cmdline) { @@ -1183,6 +1191,27 @@ General_options::finalize() this->set_start_stop_visibility_enum(elfcpp::STV_PROTECTED); } + // Parse the --power10-stubs argument. + if (!this->user_set_power10_stubs()) + { + // --power10-stubs without an arg is equivalent to --power10-stubs=yes + // but not specifying --power10-stubs at all should be equivalent to + // --power10-stubs=auto. This doesn't fit into the notion of + // "default_value", used both as a static initializer and to provide + // a missing optional arg. Fix it here. + this->set_power10_stubs("auto"); + this->set_power10_stubs_enum(POWER10_STUBS_AUTO); + } + else + { + if (strcmp(this->power10_stubs(), "auto") == 0) + this->set_power10_stubs_enum(POWER10_STUBS_AUTO); + else if (strcmp(this->power10_stubs(), "no") == 0) + this->set_power10_stubs_enum(POWER10_STUBS_NO); + else if (strcmp(this->power10_stubs(), "yes") == 0) + this->set_power10_stubs_enum(POWER10_STUBS_YES); + } + // -M is equivalent to "-Map -". if (this->print_map() && !this->user_set_Map()) { |