Path: utzoo!attcan!uunet!munnari!bruce!conybear From: conybear@bruce.oz (Roland Conybeare) Newsgroups: comp.sys.mac.programmer Subject: Re: LSC 3.0, argc & argv, linking Message-ID: <528@bruce.oz> Date: 8 Sep 88 03:04:24 GMT References: <2391@pixar.UUCP> Organization: Comp Sci, Monash Uni, Australia Lines: 26 From article <2391@pixar.UUCP>, by upstill@pixar.UUCP (Steve Upstill): > > I say it's unfair to expect ThinkC to do something Unix C doesn't: allow > the user to supercede an arbitrary function from a library. The Unix > linker links in a whole module whenever it defines a single undefined symbol. > > Steve Upstill I disagree! :-) The unix linkers that I have used all link files left to right*, resolving references as they go. So if I wanted to redefine malloc, I could: 1. Write my own malloc 2. Link my version before the standard library e.g. cc myprogram.o mymalloc.o -lc In this case the linker will resolve all malloc's in myprogram.o when it comes across mymalloc.o. It will resolve malloc's in the standard library, using the original malloc defined there. P.S. Caveat Emptor Roland Conybeare * I mean in the order supplied to the linker