delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/07/11:25:12

From: Andrew Crabtree <andrewc AT typhoon DOT rose DOT hp DOT com>
Message-Id: <199707071524.AA299059083@typhoon.rose.hp.com>
Subject: Re: Debugging version of C library
To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
Date: Mon, 07 Jul 1997 8:24:43 PDT
Cc: djgpp AT delorie DOT com
In-Reply-To: <Pine.SUN.3.91.970706174526.8624N-100000@is>; from "Eli Zaretskii" at Jul 6, 97 5:46 pm

> Beware of such shortcuts!  I have been burned by subtle bugs and
> crashes in programs when I tried to use this technique.  In some
> cases, I even inserted `printf' statement into the modified library
> function and saw for sure that the linker still links in the old
> version from the library (the `printf' didn't work)!  Don't ask me
> how can this be, but the facts are indisputable.

Stories like this really, really scare me.  I have never heard of this
happening.  The only guess I would have to this behaviour is
libgcc (or some other library or file ) needed another print type function
that was declared in the same .o file as printf, so that was brought in.  
But why the linker wouldn't give duplicate symbols I don't know.  Did you
try (can't remeber exact switch here) the switch to tell the linker to
spit out all the details for resolving symbols.  Like which symbol brought
in which .o file.  The reason I ask is I too use the replace one file 
method from libc, but I haven't run into any problems yet.  I am not just
changing the -g flag, but actually stubbing out or modifying code, so I 
keep my original Libc intact.

Andrew


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019