[parisc-linux] Re: Fix for hppa-linux ld.so with newer binutils

Alan Modra amodra@bigpond.net.au
Mon, 22 Oct 2001 13:14:18 +0930


On Sun, Oct 21, 2001 at 12:04:43AM +0930, Alan Modra wrote:
> alan@tea:~$ /lib/ld.so.1 
> Usage: ld.so [OPTION]... EXECUTABLE-FILE [ARGS-FOR-PROGRAM...]
> You have invoked `ld.so', the helper program for shared library executables.
> [snip]
> 
> no problems here.
> 
> sourceware CVS binutils as of a few minutes ago, debian glibc-2.2.4-3
> with willy's patch (ftp://ftp.parisc-linux.org/patches/glibc22-hppa.dpatch)
> + mine, gcc from pehc 3.0.2 20010829.

Confession time.  I had one little patch in ld which disabled Jakub's
combreloc code as a side-effect.  (I had ldmain.c:main,
link_info.spare_dynamic_tags = 0; to minimise differences between objects
generated by new vs. old binutils).  Setting this back to 5 gives me the
segv you reported.  :-(

The reason is that binutils/bfd/elf32_hppa.c:elf32_hppa_reloc_type_class

  if (ELF32_R_SYM (rela->r_info) == 0)
    return reloc_class_relative;

disagrees with glibc/sysdeps/hppa/dl-machine.h:elf_machine_rela_relative

/* XXX Nothing to do.  There is no relative relocation, right?  */

The net result of this disagreement is that ld.so doesn't relocate any
of the relocs in reloc_class_relative.  Testing an implementation of
elf_machine_rela_relative now.

Alan