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,
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,
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', false,
+ N_("(PowerPC only) Allow a group of stubs to serve multiple "
+ "output sections"), NULL);
+
DEFINE_uint(split_stack_adjust_size, options::TWO_DASHES, '\0', 0x4000,
N_("Stack size when -fsplit-stack function calls non-split"),
N_("SIZE"));
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;
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
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&);
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)
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.
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
= 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());