-zcombreloc-less shared libs from ld
Alan Modra
amodra@bigpond.net.au
Sun Sep 29 07:41:00 GMT 2002
On Sun, Sep 29, 2002 at 03:27:50PM +0200, Andreas Jaeger wrote:
> Jack Howarth <howarth@bromo.msbb.uc.edu> writes:
> You're not using -shared here:
>
> > -+ $(LD) -G -o $@ -soname=$@ ${OBJS} ${LIBS} -lc
Well, yes. But -G is an alias for -shared.
> 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.
I suspect this one is a ld bug, avoided somehow when gcc links in
crt* files.
--
Alan Modra
IBM OzLabs - Linux Technology Centre
More information about the Binutils
mailing list