Automatic date update in version.in
[deliverable/binutils-gdb.git] / gold / options.h
index 0aba4b73616e1ecf0037d545dda3c9de6ab25ee0..feb60cc18f855fdd183a110719eefec736c2c089 100644 (file)
@@ -1,6 +1,6 @@
 // options.h -- handle command line options for gold  -*- C++ -*-
 
-// Copyright (C) 2006-2016 Free Software Foundation, Inc.
+// Copyright (C) 2006-2018 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -711,7 +711,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 +814,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 +894,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 +925,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"});
 
@@ -1072,6 +1076,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,
@@ -1096,6 +1104,10 @@ class General_options
             N_("(PowerPC64 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"));
@@ -1133,6 +1145,11 @@ class General_options
                N_("Print symbols defined and used for each input"),
                N_("FILENAME"));
 
+  DEFINE_special(push_state, options::TWO_DASHES, '\0',
+                N_("Save the state of flags related to input files"), NULL);
+  DEFINE_special(pop_state, options::TWO_DASHES, '\0',
+                N_("Restore the state of flags related to input files"), NULL);
+
   // q
 
   DEFINE_bool(emit_relocs, options::TWO_DASHES, 'q', false,
@@ -1147,7 +1164,8 @@ 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"));
@@ -1194,6 +1212,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}]"));
@@ -1211,10 +1232,14 @@ class General_options
   DEFINE_int(stub_group_size, options::TWO_DASHES , '\0', 1,
             N_("(ARM, PowerPC only) The maximum distance from instructions "
                "in a group of sections to their stubs. Negative values mean "
-               "stubs are always after (PowerPC before) the group. 1 means "
-               "use default size"),
+               "stubs are always after the group. 1 means use default size"),
             N_("SIZE"));
 
+  DEFINE_bool(stub_group_multi, options::TWO_DASHES, '\0', true,
+             N_("(PowerPC only) Allow a group of stubs to serve multiple "
+                "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"),
              N_("SIZE"));
@@ -1267,6 +1292,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"));
@@ -1391,6 +1423,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"));
@@ -1457,6 +1492,11 @@ class General_options
   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."));
+
 
  public:
   typedef options::Dir_list Dir_list;
@@ -1516,6 +1556,10 @@ class General_options
   static Object_format
   string_to_object_format(const char* arg);
 
+  // Convert an Object_format to string.
+  static const char*
+  object_format_to_string(Object_format);
+
   // Note: these functions are not very fast.
   Object_format format_enum() const;
   Object_format oformat_enum() const;
@@ -1609,6 +1653,10 @@ class General_options
   incremental_disposition() const
   { return this->incremental_disposition_; }
 
+  void
+  set_incremental_disposition(Incremental_disposition disp)
+  { this->incremental_disposition_ = disp; }
+
   // The disposition to use for startup files (those that precede the
   // first --incremental-changed, etc. option).
   Incremental_disposition
@@ -1668,6 +1716,22 @@ 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_; }
+
  private:
   // Don't copy this structure.
   General_options(const General_options&);
@@ -1723,6 +1787,10 @@ class General_options
   set_static(bool value)
   { static_ = value; }
 
+  void
+  set_orphan_handling_enum(Orphan_handling value)
+  { this->orphan_handling_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)
@@ -1740,6 +1808,9 @@ class General_options
   void
   add_plugin_option(const char* opt);
 
+  void
+  copy_from_posdep_options(const Position_dependent_options&);
+
   // Whether we printed version information.
   bool printed_version_;
   // Whether to mark the stack as executable.
@@ -1783,6 +1854,10 @@ class General_options
   Endianness endianness_;
   // What local symbols to discard.
   Discard_locals discard_locals_;
+  // Stack of saved options for --push-state/--pop-state.
+  std::vector<Position_dependent_options*> options_stack_;
+  // Orphan handling option, decoded to an enum value.
+  Orphan_handling orphan_handling_enum_;
 };
 
 // The position-dependent options.  We use this to store the state of
@@ -1813,7 +1888,8 @@ class Position_dependent_options
                             = Position_dependent_options::default_options_)
   { copy_from_options(options); }
 
-  void copy_from_options(const General_options& options)
+  void
+  copy_from_options(const General_options& options)
   {
     this->set_as_needed(options.as_needed());
     this->set_Bdynamic(options.Bdynamic());
This page took 0.031172 seconds and 4 git commands to generate.