PATCH: Don't install bad ia64 trampoline

H. J. Lu
Wed Jan 7 20:30:00 GMT 2004

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)

My patch just extends it a little bit. elfNN_ia64_relax_section may not
have everything it needs to generate meaningful message.


More information about the Binutils mailing list