This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Don't install bad ia64 trampoline
- From: "H. J. Lu" <hjl at lucon dot org>
- To: Jim Wilson <wilson at specifixinc dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 7 Jan 2004 12:30:42 -0800
- Subject: Re: PATCH: Don't install bad ia64 trampoline
- References: <20031212193606.GA17432@lucon.org> <1071274835.1023.11.camel@leaf.tuliptree.org> <20031213032627.GF8167@bubble.sa.bigpond.net.au> <20040106184056.GA11476@lucon.org> <1073456265.1134.60.camel@leaf.tuliptree.org>
On Tue, Jan 06, 2004 at 10:17:45PM -0800, Jim Wilson wrote:
> On Tue, 2004-01-06 at 10:40, H. J. Lu wrote:
> > The problem is linker won't warn which symbols it can't relax. It is
> > not very useful to fix the problem.
>
> That is a reasonable point, but that doesn't rule out the bfd_set_error
> solution. We just need to add a call to bfd_error_handler that prints a
> useful message. There is one in elf32-sparc.c that looks like a
> reasonable candidate to copy from.
> (*_bfd_error_handler)
> (_("%s(%s+0x%lx): unresolvable relocation against symbol
> `%s'"),
> ...
>
Calling bfd_set_error only tells linker which message to print out. It
doesn't tell where and how it fails.
> I think this solution is cleaner than your approach. With your
> approach, we mysteriously return without resolving some relocs, without
> explaining why in a comment. And then some other place in the compiler
Wityh my patch, linker will complain where and against which symbols
relocations won't fit later.
> will generate an error. At that point, there is no info explaining why
> this reloc is unresolved. It is better to generate the error at the
> point where we know that we have an error. This makes the code easier
> to understand for the next person looking at it. We can do this with
> bfd_error_handler and bfd_set_error calls.
elfNN_ia64_relax_section already does
/* If the branch and target are in the same section, you've
got one honking big section and we can't help you. You'll
get an error message later. */
if (tsec == sec)
continue;
My patch just extends it a little bit. elfNN_ia64_relax_section may not
have everything it needs to generate meaningful message.
H.J.