gold patch committed: Clean up FreeBSD handling

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


There has been some ugliness in gold for a while in that the i386 and
x86_64 targets inherit from the FreeBSD target.  This is really a
confusion of processor and OS, and involved a rather ugly function in
freebsd.h.  This patch cleans it up somewhat.  The Target_selector in
i386 and x86_64 still inherits from Target_selector_freebsd, but at
least Target_i386 and Target_x86_64 are cleaner.  Committed to mainline.

Ian


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

	* target.h (class Target): Add osabi_ field.
	(Target::osabi): New function.
	(Target::set_osabi): New function.
	(Target::Target): Initialize osabi_.
	(Target::do_adjust_elf_header): Make pure virtual.
	(Sized_target::do_adjust_elf_header): Declare.
	* target.cc (Sized_target::do_adjust_elf_header): New function.
	(class Sized_target): Instantiate all versions.
	* freebsd.h (class Target_freebsd): Remove.
	(Target_selector_freebsd::do_recognize): Call set_osabi on
	Target.
	(Target_selector_freebsd::do_recognize_by_name): Likewise.
	(Target_selector_freebsd::set_osabi): Remove.
	* i386.cc (class Target_i386): Inherit from Sized_target rather
	than Target_freebsd.
	* x86_64.cc (class Target_x86_64): Likewise.


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


More information about the Binutils mailing list