This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH 1/3] Implement new Linux target vectors on BFD
- From: Alan Modra <amodra at gmail dot com>
- To: Sergio Durigan Junior <sergiodj at redhat dot com>
- Cc: Binutils Development <binutils at sourceware dot org>, GDB Patches <gdb-patches at sourceware dot org>, Pedro Alves <palves at redhat dot com>, Jan Kratochvil <jan dot kratochvil at redhat dot com>, "H. J. Lu" <hongjiu dot lu at intel dot com>
- Date: Wed, 30 Jan 2013 19:46:31 +1030
- Subject: Re: [PATCH 1/3] Implement new Linux target vectors on BFD
- References: <firstname.lastname@example.org>
On Wed, Jan 30, 2013 at 04:52:46AM -0200, Sergio Durigan Junior wrote:
> 1) Add new target vectors on the BFD configury system in order to handle
> Linux targets, which will then make it possible to use certain functions
> only on such targets, and
Duplicating targets isn't a really good idea.
If on my x86_64 linux box I want to build a native binutils that also
supports powerpc64, I can configure binutils with
--enable-targets=powerpc64-linux, or get all targets with
--enable-targets=all. The problem with adding bfd targets as you've
done is that now you have two bfd targets that give equally good
matches for powerpc64 objects. So instead of one "best" match we now
have two. elf64-big will also match, and by a quirk of the way
bfd_check_format_matches operates (giving priority to targets
appearing in config.bfd targ_selvec), this match will be chosen over
the better elf64-powerpc-* matches. That means a worse user
experience for say, "objdump -d". A file that used to happily
disassemble now gives you
some_file: file format elf64-big
binutils/objdump: can't disassemble for architecture UNKNOWN!
You may have noticed that we've already made a mess of targets for
ARM, i386, x86_64 and powerpc. I'd rather not see the same happen for
powerpc64 without a really good reason.
Australia Development Lab, IBM