-zcombreloc-less shared libs from ld

Jakub Jelinek jakub@redhat.com
Sun Sep 29 14:36:00 GMT 2002


On Sun, Sep 29, 2002 at 11:37:18PM +0930, Alan Modra wrote:
> On Sun, Sep 29, 2002 at 09:07:19AM -0400, Jack Howarth wrote:
> >   Tag        Type                         Name/Value
> >  0x00000001 (NEEDED)                     Shared library: [libresolv.so.2]
> >  0x00000001 (NEEDED)                     Shared library: [libc.so.6]
> >  0x0000000e (SONAME)                     Library soname: [libhesiod.so.0]
> >  0x00000004 (HASH)                       0x94
> >  0x00000005 (STRTAB)                     0x75c
> >  0x00000006 (SYMTAB)                     0x2cc
> >  0x0000000a (STRSZ)                      712 (bytes)
> >  0x0000000b (SYMENT)                     16 (bytes)
> >  0x00000003 (PLTGOT)                     0x12fc8
> >  0x00000002 (PLTRELSZ)                   444 (bytes)
> >  0x00000014 (PLTREL)                     RELA
> >  0x00000017 (JMPREL)                     0xb38
> >  0x00000007 (RELA)                       0xb38
> >  0x00000008 (RELASZ)                     756 (bytes)
> >  0x00000009 (RELAENT)                    12 (bytes)
> >  0x6ffffffe (VERNEED)                    0xab8
> >  0x6fffffff (VERNEEDNUM)                 2
> >  0x6ffffff0 (VERSYM)                     0xa24
> >  0x00000000 (NULL)                       0x0
> 
> This is somewhat perplexing.  We have DT_JMPREL (ie. .rela.plt) and
> DT_RELA at the same address.  ppc includes plt relocs in DT_RELASZ,
> so we actually have
> 
>  .rela.plt at 0xb38, 444 = 0x1bc bytes long.
>  .rela.* (other reloc sections) at 0xcf4, 756-444 = 0x138 bytes long.
> 
> But elf32ppc.xsc should ensure the other relocs sections come
> before .rela.plt.  What is going on here?

Just from looking at readelf -Sd I think it may be wrong section placement
for .rela.* sections not named in the linker script (.rela.got2 in
this case) if there is just .rela.plt and no other .rela.* sections.
That could explain why linking with gcc -shared works - it links in some
crt* objects which have some .rela.data, .rela.got etc. relocs.
Debugging should show.
Certainly I wonder why .got2 and .rela.got2 is not in the linker script on
PPC, but even if it is not, it should work of course.

	Jakub



More information about the Binutils mailing list