-zcombreloc-less shared libs from ld

Andreas Jaeger aj@suse.de
Sun Sep 29 07:10:00 GMT 2002


Jack Howarth <howarth@bromo.msbb.uc.edu> writes:

> Hello,
>    Does anyone have any insights into this issue. One ppclinux under
> glibc cvs while testing prelinking I discovered that the resulting
> binary for /usr/bin/hesinfo was unprelinkable due to an error...
>
> prelink: /usr/lib/libhesiod.so.0: DT_JMPREL tag not adjacent to DT_RELA relocations
>
> which Jakub says is because /usr/lib/libhesiod.so.0 isn't properly
> -zcombreloc. I find this odd since the binutils is -zcombreloc enabled.
> The rawhide srpm for hesiod is using a patch for creating sharedlibs.
> If I make the following change to this patch...
>
> --- hesiod-3.0.2-shlib.patch	Fri Oct 26 09:52:02 2001
> +++ hesiod-3.0.2-shlib.patch.new	Sat Sep 28 01:19:19 2002
> @@ -13,7 +13,7 @@
>  +all: libhesiod.a hesinfo hestest libhesiod.so.$(SOVERSION)
>  +
>  +libhesiod.so.$(SOVERSION): ${OBJS}

You're not using -shared here:

> -+	$(LD) -G -o $@ -soname=$@ ${OBJS} ${LIBS} -lc

but here:

> ++	$(CC) -shared -Wl,-soname,$@ -o $@ ${OBJS} ${LIBS} 


>   
>   libhesiod.a: ${OBJS}
>   	ar cru $@ ${OBJS}
>
> The resulting shared lib for /usr/lib/libhesiod.so.0 appears properly
> -zcombreloc and is prelinkable. Is this expected behavior? Shouldn't
> it be sufficient to pass -soname= to ld to get -zcombreloc shared libs
> from it? Thanks in advance for any clarifications.

Nevertheless you should always link with gcc.  Compare the command
lines that gcc uses for ld with the direct invocation, there're some
small - but important - differences.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj



More information about the Binutils mailing list