This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: -zcombreloc-less shared libs from ld
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Andreas Jaeger <aj at suse dot de>
- Cc: Jack Howarth <howarth at bromo dot msbb dot uc dot edu>, binutils at sources dot redhat dot com
- Date: Sun, 29 Sep 2002 23:19:27 +0930
- Subject: Re: -zcombreloc-less shared libs from ld
- References: <200209281519.LAA93058@bromo.msbb.uc.edu> <u8y99lsz6x.fsf@gromit.moeb>
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