gold patch committed: More support for -m option

Ian Lance Taylor iant@google.com
Tue Jun 28 23:15:00 GMT 2011


Until now gold has been ignoring the -m option, which for GNU ld selects
the linker emulation.  PR 12934 reports that the Linux kernel build
relies on -m working, when using -m with -r and no real input files.
This patch implements support for -m along the lines of --oformat: each
target may specify the -m names which it matches.  This is not an exact
match of what GNU ld does, nor does it accept nearly all the names that
GNU ld accepts, but it is probably good enough for actual uses.
Committed to mainline.

Ian


2011-06-28  Ian Lance Taylor  <iant@google.com>

	PR gold/12934
	* target-select.cc (Target_selector::Target_selector): Add
	emulation parameter.  Change all callers.
	(select_target_by_bfd_name): Rename from select_target_by_name.
	Change all callers.
	(select_target_by_emulation): New function.
	(supported_emulation_names): New function.
	* target-select.h (class Target_selector): Add emulation_ field.
	Update declarations.
	(Target_selector::recognize_by_bfd_name): Rename from
	recognize_by_name.  Change all callers.
	(Target_selector::supported_bfd_names): Rename from
	supported_names.  Change all callers.
	(Target_selector::recognize_by_emulation): New function.
	(Target_selector::supported_emulations): New function.
	(Target_selector::emulation): New function.
	(Target_selector::do_recognize_by_bfd_name): Rename from
	do_recognize_by_name.  Change all callers.
	(Target_selector::do_supported_bfd_names): Rename from
	do_supported_names.  Change all callers.
	(Target_selector::do_recognize_by_emulation): New function.
	(Target_selector::do_supported_emulations): New function.
	(select_target_by_bfd_name): Change name in declaration.
	(select_target_by_emulation): Declare.
	(supported_emulation_names): Declare.
	* parameters.cc (parameters_force_valid_target): Try to find
	target based on emulation from -m option.
	* options.h (class General_options): Change doc string for -m.
	* options.cc (help): Print emulations.
	(General_options::parse_V): Likewise.
	* freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
	Add emulation parameter.  Change all callers.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-diff
Size: 18473 bytes
Desc: patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20110628/c127061a/attachment.bin>


More information about the Binutils mailing list