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.h | |
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.h')
-rw-r--r-- | gold/options.h | 48 |
1 files changed, 37 insertions, 11 deletions
diff --git a/gold/options.h b/gold/options.h index 3c8d25a..bc21115 100644 --- a/gold/options.h +++ b/gold/options.h @@ -481,9 +481,9 @@ struct Struct_special : public Struct_var // After helparg__ should come an initializer list, like // {"foo", "bar", "baz"} #define DEFINE_enum(varname__, dashes__, shortname__, default_value__, \ - helpstring__, helparg__, ...) \ + helpstring__, helparg__, optional_arg__, ...) \ DEFINE_var(varname__, dashes__, shortname__, default_value__, \ - default_value__, helpstring__, helparg__, false, \ + default_value__, helpstring__, helparg__, optional_arg__, \ const char*, const char*, parse_choices_##varname__, false) \ private: \ static void parse_choices_##varname__(const char* option_name, \ @@ -703,7 +703,7 @@ class General_options N_("Use DT_NEEDED for all shared libraries")); DEFINE_enum(assert, options::ONE_DASH, '\0', NULL, - N_("Ignored"), N_("[ignored]"), + N_("Ignored"), N_("[ignored]"), false, {"definitions", "nodefinitions", "nosymbolic", "pure-text"}); // b @@ -761,7 +761,7 @@ class General_options DEFINE_enum(compress_debug_sections, options::TWO_DASHES, '\0', "none", N_("Compress .debug_* sections in the output file"), - ("[none,zlib,zlib-gnu,zlib-gabi]"), + ("[none,zlib,zlib-gnu,zlib-gabi]"), false, {"none", "zlib", "zlib-gnu", "zlib-gabi"}); DEFINE_bool(copy_dt_needed_entries, options::TWO_DASHES, '\0', false, @@ -934,7 +934,7 @@ class General_options N_("FRACTION")); DEFINE_enum(hash_style, options::TWO_DASHES, '\0', DEFAULT_HASH_STYLE, - N_("Dynamic hash style"), N_("[sysv,gnu,both]"), + N_("Dynamic hash style"), N_("[sysv,gnu,both]"), false, {"sysv", "gnu", "both"}); // i @@ -946,7 +946,7 @@ class General_options N_("Identical Code Folding. " "\'--icf=safe\' Folds ctors, dtors and functions whose" " pointers are definitely not taken"), - ("[none,all,safe]"), + ("[none,all,safe]"), false, {"none", "all", "safe"}); DEFINE_uint(icf_iterations, options::TWO_DASHES , '\0', 0, @@ -1086,7 +1086,7 @@ class General_options DEFINE_enum(orphan_handling, options::TWO_DASHES, '\0', "place", N_("Orphan section handling"), N_("[place,discard,warn,error]"), - {"place", "discard", "warn", "error"}); + false, {"place", "discard", "warn", "error"}); // p @@ -1141,6 +1141,12 @@ class General_options N_("Use posix_fallocate to reserve space in the output file"), N_("Use fallocate or ftruncate to reserve space")); + DEFINE_enum(power10_stubs, options::TWO_DASHES, '\0', "yes", + N_("(PowerPC64 only) stubs use power10 insns"), + N_("[=auto,no,yes]"), true, {"auto", "no", "yes"}); + DEFINE_special(no_power10_stubs, options::TWO_DASHES, '\0', + N_("(PowerPC64 only) stubs do not use power10 insns"), NULL); + DEFINE_bool(preread_archive_symbols, options::TWO_DASHES, '\0', false, N_("Preread archive symbols when multi-threaded"), NULL); @@ -1236,7 +1242,7 @@ class General_options DEFINE_enum(sort_section, options::TWO_DASHES, '\0', "none", N_("Sort sections by name. \'--no-text-reorder\'" " will override \'--sort-section=name\' for .text"), - N_("[none,name]"), + N_("[none,name]"), false, {"none", "name"}); DEFINE_uint(spare_dynamic_tags, options::TWO_DASHES, '\0', 5, @@ -1287,7 +1293,7 @@ class General_options NULL); DEFINE_enum(target2, options::TWO_DASHES, '\0', NULL, N_("(ARM only) Set R_ARM_TARGET2 relocation type"), - N_("[rel, abs, got-rel"), + N_("[rel, abs, got-rel"), false, {"rel", "abs", "got-rel"}); DEFINE_bool(text_reorder, options::TWO_DASHES, '\0', true, @@ -1344,7 +1350,7 @@ class General_options DEFINE_enum(unresolved_symbols, options::TWO_DASHES, '\0', NULL, N_("How to handle unresolved symbols"), ("ignore-all,report-all,ignore-in-object-files," - "ignore-in-shared-libs"), + "ignore-in-shared-libs"), false, {"ignore-all", "report-all", "ignore-in-object-files", "ignore-in-shared-libs"}); @@ -1507,7 +1513,7 @@ class General_options DEFINE_enum(start_stop_visibility, options::DASH_Z, '\0', "protected", N_("ELF symbol visibility for synthesized " "__start_* and __stop_* symbols"), - ("[default,internal,hidden,protected]"), + ("[default,internal,hidden,protected]"), false, {"default", "internal", "hidden", "protected"}); DEFINE_bool(text, options::DASH_Z, '\0', false, N_("Do not permit relocations in read-only segments"), @@ -1763,6 +1769,20 @@ class General_options start_stop_visibility_enum() const { return this->start_stop_visibility_enum_; } + enum Power10_stubs + { + // Use Power10 insns on @notoc calls/branches, non-Power10 elsewhere. + POWER10_STUBS_AUTO, + // Don't use Power10 insns + POWER10_STUBS_NO, + // Always use Power10 insns + POWER10_STUBS_YES + }; + + Power10_stubs + power10_stubs_enum() const + { return this->power10_stubs_enum_; } + private: // Don't copy this structure. General_options(const General_options&); @@ -1826,6 +1846,10 @@ class General_options set_start_stop_visibility_enum(elfcpp::STV value) { this->start_stop_visibility_enum_ = value; } + void + set_power10_stubs_enum(Power10_stubs value) + { this->power10_stubs_enum_ = value; } + // These are called by finalize() to set up the search-path correctly. void add_to_library_path_with_sysroot(const std::string& arg) @@ -1895,6 +1919,8 @@ class General_options Orphan_handling orphan_handling_enum_; // Symbol visibility for __start_* / __stop_* magic symbols. elfcpp::STV start_stop_visibility_enum_; + // Power10 stubs option + Power10_stubs power10_stubs_enum_; }; // The position-dependent options. We use this to store the state of |