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: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: Binutils Development <binutils at sourceware dot org>
- Cc: 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 14:42:57 -0200
- Subject: Re: [PATCH 1/3] Implement new Linux target vectors on BFD
- References: <email@example.com> <20130130091631.GM3244@bubble.grove.modra.org>
On Wednesday, January 30 2013, Alan Modra wrote:
> 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!
Hm, thank you for the explanation, it didn't occurred to me.
> 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.
Right. Now I am stuck with this, then. While Pedro wants this feature
to be Linux-specific, now there is this problem with target duplication.
I will look for other solutions here, but if you alreay have some idea
on how to handle it, I'd be glad to read.
Thanks a lot,