elfcpp/
[binutils-gdb.git] / gold / options.h
index 998e8505b31415b213dc0933961b171679a3c776..534df26623f248cdb1d009e5f4d7a20d179e126a 100644 (file)
@@ -63,6 +63,11 @@ class Script_info;
 
 enum Incremental_disposition
 {
+  // Startup files that appear before the first disposition option.
+  // These will default to INCREMENTAL_CHECK unless the
+  // --incremental-startup-unchanged option is given.
+  // (For files added implicitly by gcc before any user options.)
+  INCREMENTAL_STARTUP,
   // Determine the status from the timestamp (default).
   INCREMENTAL_CHECK,
   // Assume the file changed from the previous build.
@@ -97,6 +102,9 @@ parse_uint64(const char* option_name, const char* arg, uint64_t* retval);
 extern void
 parse_double(const char* option_name, const char* arg, double* retval);
 
+extern void
+parse_percent(const char* option_name, const char* arg, double* retval);
+
 extern void
 parse_string(const char* option_name, const char* arg, const char** retval);
 
@@ -372,6 +380,12 @@ struct Struct_special : public Struct_var
             #default_value__, helpstring__, helparg__, false,           \
             double, double, options::parse_double)
 
+#define DEFINE_percent(varname__, dashes__, shortname__, default_value__, \
+                      helpstring__, helparg__)                           \
+  DEFINE_var(varname__, dashes__, shortname__, default_value__ / 100.0,          \
+            #default_value__, helpstring__, helparg__, false,            \
+            double, double, options::parse_percent)
+
 #define DEFINE_string(varname__, dashes__, shortname__, default_value__, \
                       helpstring__, helparg__)                           \
   DEFINE_var(varname__, dashes__, shortname__, default_value__,          \
@@ -529,7 +543,7 @@ class Search_directory
   { }
 
   // This is the usual constructor.
-  Search_directory(const char* name, bool put_in_sysroot)
+  Search_directory(const std::string& name, bool put_in_sysroot)
     : name_(name), put_in_sysroot_(put_in_sysroot), is_in_sysroot_(false)
   {
     if (this->name_.empty())
@@ -629,6 +643,9 @@ class General_options
   DEFINE_bool_alias(dn, Bdynamic, options::ONE_DASH, '\0',
                    N_("alias for -Bstatic"), NULL, true);
 
+  DEFINE_bool(Bgroup, options::ONE_DASH, '\0', false,
+             N_("Use group name lookup rules for shared library"), NULL);
+
   DEFINE_bool(Bsymbolic, options::ONE_DASH, '\0', false,
               N_("Bind defined symbols locally"), NULL);
 
@@ -725,16 +742,24 @@ class General_options
   DEFINE_special(EB, options::ONE_DASH, '\0',
                 N_("Link big-endian objects."), NULL);
 
-  DEFINE_bool(eh_frame_hdr, options::TWO_DASHES, '\0', false,
-              N_("Create exception frame header"), NULL);
-
   DEFINE_special(EL, options::ONE_DASH, '\0',
                 N_("Link little-endian objects."), NULL);
 
+  DEFINE_bool(eh_frame_hdr, options::TWO_DASHES, '\0', false,
+              N_("Create exception frame header"), NULL);
+
   DEFINE_bool(enum_size_warning, options::TWO_DASHES, '\0', true, NULL,
              N_("(ARM only) Do not warn about objects with incompatible "
                 "enum sizes"));
 
+  DEFINE_set(auxiliary, options::TWO_DASHES, 'f',
+            N_("Auxiliary filter for shared object symbol table"),
+            N_("SHLIB"));
+
+  DEFINE_string(filter, options::TWO_DASHES, 'F', NULL,
+               N_("Filter for shared object symbol table"),
+               N_("SHLIB"));
+
   DEFINE_bool(fatal_warnings, options::TWO_DASHES, '\0', false,
              N_("Treat warnings as errors"),
              N_("Do not treat warnings as errors"));
@@ -746,6 +771,10 @@ class General_options
              N_("(ARM only) Fix binaries for Cortex-A8 erratum."),
              N_("(ARM only) Do not fix binaries for Cortex-A8 erratum."));
 
+  DEFINE_bool(fix_arm1176, options::TWO_DASHES, '\0', true,
+             N_("(ARM only) Fix binaries for ARM1176 erratum."),
+             N_("(ARM only) Do not fix binaries for ARM1176 erratum."));
+
   DEFINE_bool(merge_exidx_entries, options::TWO_DASHES, '\0', true,
              N_("(ARM only) Merge exidx entries in debuginfo."),
              N_("(ARM only) Do not merge exidx entries in debuginfo."));
@@ -762,6 +791,10 @@ class General_options
   DEFINE_bool(g, options::EXACTLY_ONE_DASH, '\0', false,
              N_("Ignored"), NULL);
 
+  DEFINE_bool(gnu_unique, options::TWO_DASHES, '\0', true,
+             N_("Enable STB_GNU_UNIQUE symbol binding (default)"),
+             N_("Disable STB_GNU_UNIQUE symbol binding"));
+
   DEFINE_string(soname, options::ONE_DASH, 'h', NULL,
                 N_("Set shared library name"), N_("FILENAME"));
 
@@ -805,6 +838,14 @@ class General_options
   DEFINE_special(incremental_unknown, options::TWO_DASHES, '\0',
                  N_("Use timestamps to check files (default)"), NULL);
 
+  DEFINE_special(incremental_startup_unchanged, options::TWO_DASHES, '\0',
+                 N_("Assume startup files unchanged "
+                   "(files preceding this option)"), NULL);
+
+  DEFINE_percent(incremental_patch, options::TWO_DASHES, '\0', 10,
+                N_("Amount of extra space to allocate for patches"),
+                N_("PERCENT"));
+
   DEFINE_string(init, options::ONE_DASH, '\0', "_init",
                 N_("Call SYMBOL at load-time"), N_("SYMBOL"));
 
@@ -894,6 +935,9 @@ class General_options
   DEFINE_bool(preread_archive_symbols, options::TWO_DASHES, '\0', false,
               N_("Preread archive symbols when multi-threaded"), NULL);
 
+  DEFINE_bool(print_output_format, options::TWO_DASHES, '\0', false,
+             N_("Print default output format"), NULL);
+
   DEFINE_string(print_symbol_counts, options::TWO_DASHES, '\0', NULL,
                N_("Print symbols defined and used for each input"),
                N_("FILENAME"));
@@ -1039,6 +1083,13 @@ class General_options
   DEFINE_set(undefined, options::TWO_DASHES, 'u',
             N_("Create undefined reference to SYMBOL"), N_("SYMBOL"));
 
+  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-all", "report-all", "ignore-in-object-files",
+                 "ignore-in-shared-libs"});
+
   DEFINE_bool(verbose, options::TWO_DASHES, '\0', false,
               N_("Synonym for --debug=files"), NULL);
 
@@ -1170,7 +1221,7 @@ class General_options
              N_("Don't mark variables read-only after relocation"));
   DEFINE_bool(text, options::DASH_Z, '\0', false,
              N_("Do not permit relocations in read-only segments"),
-             NULL);
+             N_("Permit relocations in read-only segments (default)"));
   DEFINE_bool_alias(textoff, text, options::DASH_Z, '\0',
                    N_("Permit relocations in read-only segments (default)"),
                    NULL, true);
@@ -1321,6 +1372,12 @@ class General_options
   incremental_disposition() const
   { return this->incremental_disposition_; }
 
+  // The disposition to use for startup files (those that precede the
+  // first --incremental-changed, etc. option).
+  Incremental_disposition
+  incremental_startup_disposition() const
+  { return this->incremental_startup_disposition_; }
+
   // Return true if S is the name of a library excluded from automatic
   // symbol export.
   bool
@@ -1332,6 +1389,11 @@ class General_options
   bool
   section_start(const char* secname, uint64_t* paddr) const;
 
+  // Return whether any --section-start option was used.
+  bool
+  any_section_start() const
+  { return !this->section_starts_.empty(); }
+
   enum Fix_v4bx
   {
     // Leave original instruction.
@@ -1401,7 +1463,7 @@ class General_options
 
   // These are called by finalize() to set up the search-path correctly.
   void
-  add_to_library_path_with_sysroot(const char* arg)
+  add_to_library_path_with_sysroot(const std::string& arg)
   { this->add_search_directory_to_library_path(Search_directory(arg, true)); }
 
   // Apply any sysroot to the directory lists.
@@ -1438,9 +1500,12 @@ class General_options
   // --incremental-unchanged or --incremental-unknown option.  The
   // value may change as we proceed parsing the command line flags.
   Incremental_disposition incremental_disposition_;
+  // The disposition to use for startup files (those marked
+  // INCREMENTAL_STARTUP).
+  Incremental_disposition incremental_startup_disposition_;
   // Whether we have seen one of the options that require incremental
-  // build (--incremental-changed, --incremental-unchanged or
-  // --incremental-unknown)
+  // build (--incremental-changed, --incremental-unchanged,
+  // --incremental-unknown, or --incremental-startup-unchanged).
   bool implicit_incremental_;
   // Libraries excluded from automatic export, via --exclude-libs.
   Unordered_set<std::string> excluded_libs_;