X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gold%2Foptions.h;h=f0e9fbddcd5f77d6a78a405dcc5ecdbe4f786f17;hb=5233f39b8b999f2675fb9493149e878c281e1d60;hp=75b2f091ad0289436b79cc0264035eb9e3a2cda2;hpb=69a2af1016e03239f7af4e55268bd27fc500f800;p=deliverable%2Fbinutils-gdb.git diff --git a/gold/options.h b/gold/options.h index 75b2f091ad..f0e9fbddcd 100644 --- a/gold/options.h +++ b/gold/options.h @@ -1,6 +1,6 @@ // options.h -- handle command line options for gold -*- C++ -*- -// Copyright (C) 2006-2016 Free Software Foundation, Inc. +// Copyright (C) 2006-2020 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -471,7 +471,11 @@ struct Struct_special : public Struct_var \ options::String_set::const_iterator \ varname__##_end() const \ - { return this->varname__##_.value.end(); } + { return this->varname__##_.value.end(); } \ + \ + options::String_set::size_type \ + varname__##_size() const \ + { return this->varname__##_.value.size(); } \ // When you have a list of possible values (expressed as string) // After helparg__ should come an initializer list, like @@ -711,7 +715,7 @@ class General_options DEFINE_string(format, options::TWO_DASHES, 'b', "elf", N_("Set input format"), ("[elf,binary]")); - DEFINE_bool(be8,options::TWO_DASHES, '\0', false, + DEFINE_bool(be8, options::TWO_DASHES, '\0', false, N_("Output BE8 format image"), NULL); DEFINE_optional_string(build_id, options::TWO_DASHES, '\0', "tree", @@ -814,6 +818,10 @@ class General_options // e + DEFINE_bool(emit_stub_syms, options::TWO_DASHES, '\0', true, + N_("(PowerPC only) Label linker stubs with a symbol"), + N_("(PowerPC only) Do not label linker stubs with a symbol")); + DEFINE_string(entry, options::TWO_DASHES, 'e', NULL, N_("Set program start address"), N_("ADDRESS")); @@ -890,7 +898,7 @@ class General_options DEFINE_string(fuse_ld, options::ONE_DASH, '\0', "", N_("Ignored for GCC linker option compatibility"), - ""); + N_("[gold,bfd]")); // g @@ -921,7 +929,7 @@ class General_options N_("Min fraction of empty buckets in dynamic hash"), N_("FRACTION")); - DEFINE_enum(hash_style, options::TWO_DASHES, '\0', "sysv", + DEFINE_enum(hash_style, options::TWO_DASHES, '\0', DEFAULT_HASH_STYLE, N_("Dynamic hash style"), N_("[sysv,gnu,both]"), {"sysv", "gnu", "both"}); @@ -938,7 +946,7 @@ class General_options {"none", "all", "safe"}); DEFINE_uint(icf_iterations, options::TWO_DASHES , '\0', 0, - N_("Number of iterations of ICF (default 2)"), N_("COUNT")); + N_("Number of iterations of ICF (default 3)"), N_("COUNT")); DEFINE_special(incremental, options::TWO_DASHES, '\0', N_("Do an incremental link if possible; " @@ -1072,6 +1080,10 @@ class General_options DEFINE_uint(optimize, options::EXACTLY_ONE_DASH, 'O', 0, N_("Optimize output file size"), N_("LEVEL")); + DEFINE_enum(orphan_handling, options::TWO_DASHES, '\0', "place", + N_("Orphan section handling"), N_("[place,discard,warn,error]"), + {"place", "discard", "warn", "error"}); + // p DEFINE_bool(p, options::ONE_DASH, 'p', false, @@ -1093,9 +1105,13 @@ class General_options NULL, N_("(ARM only) Ignore for backward compatibility")); DEFINE_var(plt_align, options::TWO_DASHES, '\0', 0, "5", - N_("(PowerPC64 only) Align PLT call stubs to fit cache lines"), + N_("(PowerPC only) Align PLT call stubs to fit cache lines"), N_("[=P2ALIGN]"), true, int, int, options::parse_uint, false); + DEFINE_bool(plt_localentry, options::TWO_DASHES, '\0', false, + N_("(PowerPC64 only) Optimize calls to ELFv2 localentry:0 functions"), + N_("(PowerPC64 only) Don't optimize ELFv2 calls")); + DEFINE_bool(plt_static_chain, options::TWO_DASHES, '\0', false, N_("(PowerPC64 only) PLT call stubs should load r11"), N_("(PowerPC64 only) PLT call stubs should not load r11")); @@ -1109,6 +1125,12 @@ class General_options N_("Load a plugin library"), N_("PLUGIN")); DEFINE_special(plugin_opt, options::TWO_DASHES, '\0', N_("Pass an option to the plugin"), N_("OPTION")); +#else + DEFINE_special(plugin, options::TWO_DASHES, '\0', + N_("Load a plugin library (not supported)"), N_("PLUGIN")); + DEFINE_special(plugin_opt, options::TWO_DASHES, '\0', + N_("Pass an option to the plugin (not supported)"), + N_("OPTION")); #endif DEFINE_bool(posix_fallocate, options::TWO_DASHES, '\0', true, @@ -1152,14 +1174,15 @@ class General_options N_("Generate relocatable output"), NULL); DEFINE_bool(relax, options::TWO_DASHES, '\0', false, - N_("Relax branches on certain targets"), NULL); + N_("Relax branches on certain targets"), + N_("Do not relax branches")); DEFINE_string(retain_symbols_file, options::TWO_DASHES, '\0', NULL, N_("keep only symbols listed in this file"), N_("FILE")); DEFINE_bool(rosegment, options::TWO_DASHES, '\0', false, N_("Put read-only non-executable sections in their own segment"), - NULL); + N_("Do not put read-only non-executable sections in their own segment")); DEFINE_uint64(rosegment_gap, options::TWO_DASHES, '\0', -1U, N_("Set offset between executable and read-only segments"), @@ -1199,6 +1222,9 @@ class General_options DEFINE_special(section_start, options::TWO_DASHES, '\0', N_("Set address of section"), N_("SECTION=ADDRESS")); + DEFINE_bool(secure_plt, options::TWO_DASHES , '\0', true, + N_("(PowerPC only) Use new-style PLT"), NULL); + DEFINE_optional_string(sort_common, options::TWO_DASHES, '\0', NULL, N_("Sort common symbols by alignment"), N_("[={ascending,descending}]")); @@ -1219,9 +1245,10 @@ class General_options "stubs are always after the group. 1 means use default size"), N_("SIZE")); - DEFINE_bool(stub_group_multi, options::TWO_DASHES, '\0', false, + DEFINE_bool(stub_group_multi, options::TWO_DASHES, '\0', true, N_("(PowerPC only) Allow a group of stubs to serve multiple " - "output sections"), NULL); + "output sections"), + N_("(PowerPC only) Each output section has its own stubs")); DEFINE_uint(split_stack_adjust_size, options::TWO_DASHES, '\0', 0x4000, N_("Stack size when -fsplit-stack function calls non-split"), @@ -1275,6 +1302,13 @@ class General_options DEFINE_uint(thread_count_final, options::TWO_DASHES, '\0', 0, N_("Number of threads to use in final pass"), N_("COUNT")); + DEFINE_bool(tls_optimize, options::TWO_DASHES, '\0', true, + N_("(PowerPC/64 only) Optimize GD/LD/IE code to IE/LE"), + N_("(PowerPC/64 only) Don'\''t try to optimize TLS accesses")); + DEFINE_bool(tls_get_addr_optimize, options::TWO_DASHES, '\0', true, + N_("(PowerPC/64 only) Use a special __tls_get_addr call"), + N_("(PowerPC/64 only) Don't use a special __tls_get_addr call")); + DEFINE_bool(toc_optimize, options::TWO_DASHES, '\0', true, N_("(PowerPC64 only) Optimize TOC code sequences"), N_("(PowerPC64 only) Don't optimize TOC code sequences")); @@ -1327,6 +1361,10 @@ class General_options DEFINE_bool_ignore(warn_constructors, options::TWO_DASHES, '\0', N_("Ignored"), N_("Ignored")); + DEFINE_bool(warn_drop_version, options::TWO_DASHES, '\0', false, + N_("Warn when discarding version information"), + N_("Do not warn when discarding version information")); + DEFINE_bool(warn_execstack, options::TWO_DASHES, '\0', false, N_("Warn if the stack is executable"), N_("Do not warn if the stack is executable")); @@ -1399,6 +1437,9 @@ class General_options // The -z options. + DEFINE_bool(bndplt, options::DASH_Z, '\0', false, + N_("(x86-64 only) Generate a BND PLT for Intel MPX"), + N_("Generate a regular PLT")); DEFINE_bool(combreloc, options::DASH_Z, '\0', true, N_("Sort dynamic relocs"), N_("Do not sort dynamic relocs")); @@ -1459,12 +1500,26 @@ class General_options N_("Don't mark variables read-only after relocation")); DEFINE_uint64(stack_size, options::DASH_Z, '\0', 0, N_("Set PT_GNU_STACK segment p_memsz to SIZE"), N_("SIZE")); + 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"}); DEFINE_bool(text, options::DASH_Z, '\0', false, N_("Do not permit relocations in read-only segments"), N_("Permit relocations in read-only segments")); DEFINE_bool_alias(textoff, text, options::DASH_Z, '\0', N_("Permit relocations in read-only segments"), NULL, true); + DEFINE_bool(text_unlikely_segment, options::DASH_Z, '\0', false, + N_("Move .text.unlikely sections to a separate segment."), + N_("Do not move .text.unlikely sections to a separate " + "segment.")); + DEFINE_bool(keep_text_section_prefix, options::DASH_Z, '\0', false, + N_("Keep .text.hot, .text.startup, .text.exit and .text.unlikely " + "as separate sections in the final binary."), + N_("Merge all .text.* prefix sections.")); + public: typedef options::Dir_list Dir_list; @@ -1684,6 +1739,26 @@ class General_options discard_sec_merge() const { return this->discard_locals_ == DISCARD_SEC_MERGE; } + enum Orphan_handling + { + // Place orphan sections normally (default). + ORPHAN_PLACE, + // Discard all orphan sections. + ORPHAN_DISCARD, + // Warn when placing orphan sections. + ORPHAN_WARN, + // Issue error for orphan sections. + ORPHAN_ERROR + }; + + Orphan_handling + orphan_handling_enum() const + { return this->orphan_handling_enum_; } + + elfcpp::STV + start_stop_visibility_enum() const + { return this->start_stop_visibility_enum_; } + private: // Don't copy this structure. General_options(const General_options&); @@ -1739,6 +1814,14 @@ class General_options set_static(bool value) { static_ = value; } + void + set_orphan_handling_enum(Orphan_handling value) + { this->orphan_handling_enum_ = value; } + + void + set_start_stop_visibility_enum(elfcpp::STV value) + { this->start_stop_visibility_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) @@ -1804,6 +1887,10 @@ class General_options Discard_locals discard_locals_; // Stack of saved options for --push-state/--pop-state. std::vector options_stack_; + // Orphan handling option, decoded to an enum value. + Orphan_handling orphan_handling_enum_; + // Symbol visibility for __start_* / __stop_* magic symbols. + elfcpp::STV start_stop_visibility_enum_; }; // The position-dependent options. We use this to store the state of