N_("Treat warnings as errors"),
N_("Do not treat warnings as errors"));
+ DEFINE_string(fini, options::ONE_DASH, '\0', "_fini",
+ N_("Call SYMBOL at unload-time"), N_("SYMBOL"));
+
DEFINE_string(soname, options::ONE_DASH, 'h', NULL,
N_("Set shared library name"), N_("FILENAME"));
DEFINE_special(incremental_unknown, options::TWO_DASHES, '\0',
N_("Use timestamps to check files (default)"), NULL);
+ DEFINE_string(init, options::ONE_DASH, '\0', "_init",
+ N_("Call SYMBOL at load-time"), N_("SYMBOL"));
+
DEFINE_special(just_symbols, options::TWO_DASHES, '\0',
N_("Read only symbol values from FILE"), N_("FILE"));
+ DEFINE_bool(keep_files_mapped, options::TWO_DASHES, '\0',
+ sizeof(void*) >= 8,
+ N_("Map whole files to memory (default on 64-bit hosts)"),
+ N_("Map relevant file parts to memory (default on 32-bit "
+ "hosts)"));
+
DEFINE_special(library, options::TWO_DASHES, 'l',
N_("Search for library LIBNAME"), N_("LIBNAME"));
DEFINE_string(oformat, options::EXACTLY_TWO_DASHES, '\0', "elf",
N_("Set output format"), N_("[binary]"));
+ DEFINE_bool(pie, options::ONE_DASH, '\0', false,
+ N_("Create a position independent executable"), NULL);
+ DEFINE_bool_alias(pic_executable, pie, options::TWO_DASHES, '\0',
+ N_("Create a position independent executable"), NULL,
+ false);
+
#ifdef ENABLE_PLUGINS
DEFINE_special(plugin, options::TWO_DASHES, '\0',
N_("Load a plugin library"), N_("PLUGIN"));
DEFINE_special(static, options::ONE_DASH, '\0',
N_("Do not link against shared libraries"), NULL);
- DEFINE_bool(icf, options::TWO_DASHES, '\0', false,
- N_("Identical Code Folding (Fold identical functions)"),
- N_("Don't fold identical functions (default)"));
+ DEFINE_enum(icf, options::TWO_DASHES, '\0', "none",
+ N_("Identical Code Folding. "
+ "\'--icf=safe\' folds only ctors and dtors."),
+ ("[none,all,safe]"),
+ {"none", "all", "safe"});
DEFINE_uint(icf_iterations, options::TWO_DASHES , '\0', 0,
N_("Number of iterations of ICF (default 2)"), N_("COUNT"));
// the output is position-independent or not.
bool
output_is_position_independent() const
- { return this->shared(); }
+ { return this->shared() || this->pie(); }
// Return true if the output is something that can be exec()ed, such
// as a static executable, or a position-dependent or
// object file.
bool
output_is_executable() const
- { return !this->shared() || this->output_is_pie(); }
-
- // Return true if the output is a position-independent executable.
- // This is currently not supported.
- bool
- output_is_pie() const
- { return false; }
+ { return !this->shared() && !this->relocatable(); }
// This would normally be static(), and defined automatically, but
// since static is a keyword, we need to come up with our own name.
is_stack_executable() const
{ return this->execstack_status_ == EXECSTACK_YES; }
+ bool
+ icf_enabled() const
+ { return this->icf_status_ != ICF_NONE; }
+
+ bool
+ icf_safe_folding() const
+ { return this->icf_status_ == ICF_SAFE; }
+
// The --demangle option takes an optional string, and there is also
// a --no-demangle option. This is the best way to decide whether
// to demangle or not.
EXECSTACK_NO
};
+ enum Icf_status
+ {
+ // Do not fold any functions (Default or --icf=none).
+ ICF_NONE,
+ // All functions are candidates for folding. (--icf=all).
+ ICF_ALL,
+ // Only ctors and dtors are candidates for folding. (--icf=safe).
+ ICF_SAFE
+ };
+
+ void
+ set_icf_status(Icf_status value)
+ { this->icf_status_ = value; }
+
void
set_execstack_status(Execstack value)
{ this->execstack_status_ = value; }
bool printed_version_;
// Whether to mark the stack as executable.
Execstack execstack_status_;
+ // Whether to do code folding.
+ Icf_status icf_status_;
// Whether to do a static link.
bool static_;
// Whether to do demangling.