From: Andrew Crabtree 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: ; from "Eli Zaretskii" at Jul 6, 97 5:46 pm Precedence: bulk > 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