This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -zcombreloc-less shared libs from ld


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]