Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Apr 2006 00:16:23 +0200
From:      Jeremie Le Hen <jeremie@le-hen.org>
To:        Kostik Belousov <kostikbel@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: [fbsd] Re: Symbol weirdness with static linking
Message-ID:  <20060420221623.GD68951@obiwan.tataz.chchile.org>
In-Reply-To: <20060420124829.GA1446@deviant.kiev.zoral.com.ua>
References:  <20060420114822.GB35261@obiwan.tataz.chchile.org> <20060420124829.GA1446@deviant.kiev.zoral.com.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi, Kostik,

> > For the sake of completeness, I added the output of some objdump(1)
> > outputs here :
> > 
> > /usr/obj/usr/src/bin/echo/echo.o:
> > http://tataz.chchile.org/~tataz/symbol_weirdness/objdump-t_echo.txt.gz
> > 
> > /usr/obj/usr/src/tmp/usr/lib/libc.a:
> > http://tataz.chchile.org/~tataz/symbol_weirdness/objdump-t_libc.txt.gz
> > 
> > /usr/obj/usr/src/tmp/usr/lib/libssp.a:
> > http://tataz.chchile.org/~tataz/symbol_weirdness/objdump-t_libssp.txt.gz
> 
> It seems that you rebuilt world with CFLAGS -fstack-protector,
> since your libc has references to the symbols like __stack_smash_handler.
> As result, when linking with sequence -lgcc -lssp -lc -lgcc -lssp,
> and no references from the main object,
> references from libc causes objects from _second_ instance of -lssp to
> be pulled into the link. Since libraries are scanned sequentially,
> this object from libssp has no way to get required dependencies
> from libc.

Yes, I understand that.  But I can't see what's the difference between
"syslog" and "sigfillset" symbols from this standpoint.  The fact the
former requires ProPolice/SSP doesn't interfere IMHO.

> What makes syslog(3) special is that corresponding object from libc,
> syslog.o, requires __stack_smash_handler, while objects for mentioned
> syscalls do not.

How does it prevent the "syslog" symbol from being found ?  Libc
undefined symbols implies the second libssp to be pulled in which in
turn has undefined symbol.  But since there is no more libc after this,
"sigfillset" should be missing either.

I would understand if echo.o needed some symbols provided by the same
archive than "sigfillset" (sigsetops.o) but this is not the case.

Regards,
-- 
Jeremie Le Hen
< jeremie at le-hen dot org >< ttz at chchile dot org >



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060420221623.GD68951>