Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Apr 2000 13:51:26 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Anatoly Vorobey <mellon@pobox.com>
Cc:        Martin Cracauer <cracauer@cons.org>, bugs@FreeBSD.ORG
Subject:   Re: bin/18104: missing include file in sh(1)
Message-ID:  <Pine.BSF.4.21.0004211331510.15742-100000@alphplex.bde.org>
In-Reply-To: <20000420131840.A1964@happy.checkpoint.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 20 Apr 2000, Anatoly Vorobey wrote:

> On Thu, Apr 20, 2000 at 12:05:42PM +0200, Martin Cracauer wrote:
> > >  I've goofed here, in fact; sh(1) still won't build with DEBUG since --
> > >  get that! -- the function trace() defined in show.c conflicts with 
> > >  trace() in lib_trace.o of libtermcap.a of ncurses fame.

This seems to be just another bug in ncurses.

> > It appears that the ncurses trace() hijacks your sh-internal trace
> > where it should not and does not for me. 
> 
> Yes, this is apparently what happens, but I have no idea why.

This is because the linker doesn't detect multiply defined symbols except
in the -static case.  It is possible to override a symbol in a library if 
the object containing the symbol is not referenced, although this is
rarely what is wanted (overriding libcurses's trace() with sh's trace()
would break tracing in libcurses).  E.g., the following program
"successfully" overrides the library malloc() if it doesn't reference the
library free():

main()
{
#ifdef BROKEN
	free();
#endif
}

malloc()
{
}

When BROKEN is defined, "cc -static" detects the problem, but plain cc
doesn't.

Bruce



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0004211331510.15742-100000>