This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: Make check failure: ARM in ld-bootstrap/bootstrap.exp...
Ok, thanks for the tips. I'll investigate next week and post my
findings.
Ian Lance Taylor wrote:
>
> Date: Fri, 3 Sep 1999 18:04:26 -0400
> From: Roland McGrath <roland@frob.com>
>
> > There is no immediately obvious linker bug here. The error messages
> > mean that a 24 bit PC relative relocation is being used to call a
> > symbol which is more than 24 bits away. You, or somebody, will need
> > to investigate further to see whether the relocation should success,
> > or whether the linker is using some bogus linker script which places
> > some code at a bad address, or whether the libraries should not be
> > assuming that a 24 bit PC relative relocation is always enough.
>
> Given the context of those messages, I suspect that the issue here is that
> those symbols (_pthread_*) are weak references that found no definition (in
> the absence of -lpthread) and so resolve to value zero. If the load
> address is above 0x01000000 (I think it's 0x02000000 on ARM), then the PC
> in question is more than 24 bits away from zero.
>
> This doesn't come up in the shared library, since the relocation is of a
> 32-bit element in the GOT rather than a 26-bit field in a jump instruction.
>
> That makes sense.
>
> Probably you need to resort to something like this in the libc sources:
>
> rettype (*volatile foo_ptr) (argtypes) = &foo;
> (*foo_ptr) (args...);
>
> so that the relocation that's produced is for 32-bit immediate data.
> I don't know the ARM details to suggest in further detail.
>
> We can simply change the ARM linker so that it does not complain about
> an overflow in a PC relative relocation to an undefined weak symbol.
> That's what we did for the PowerPC:
>
> 1999-06-04 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
>
> * elf32-ppc.c (ppc_elf_relocate_section): Don't barf on out of
> range undefweak symbols.
>
> else if (r == bfd_reloc_overflow)
> {
> const char *name;
>
> if (h != NULL)
> {
> if (h->root.type == bfd_link_hash_undefweak
> && howto->pc_relative)
> {
> /* Assume this is a call protected by other code that
> detect the symbol is undefined. If this is the case,
> we can safely ignore the overflow. If not, the
> program is hosed anyway, and a little warning isn't
> going to help. */
>
> continue;
> }
>
> name = h->root.root.string;
> }
>
> Ian