Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!kithrup!sef From: sef@kithrup.COM (Sean Eric Fagan) Newsgroups: comp.sys.next Subject: Re: Redefining a symbol in /lib/libsys_s.a (bug in /bin/ld?) Message-ID: <1991Jun27.063740.9935@kithrup.COM> Date: 27 Jun 91 06:37:40 GMT References: <17859@helios.TAMU.EDU> Organization: Kithrup Enterprises, Ltd. Lines: 22 In article <17859@helios.TAMU.EDU> byron@archone.tamu.edu (Byron Rakitzis) writes: >malloc(){return 0;} >main(){return malloc();} >$ cc a.c >/bin/ld: multiple definitions of symbol _malloc >a.o definition of _malloc in section (__TEXT,__text) >/lib/libsys_s.a(malloc.o) definition of absolute _malloc (value 0x50028fa) Almost certainly because malloc.o has a definition for malloc, free, and probably realloc as well; other code that gets pulled in uses free, therefore that module gets pulled in. However, malloc is already defined in both a.o and malloc.o (which was pulled in because of free). Therefore, multiply-redefined error. The solution is to not to replace system routines unless you know what you're doing. -- Sean Eric Fagan | "What *does* that 33 do? I have no idea." sef@kithrup.COM | -- Chris Torek -----------------+ (torek@ee.lbl.gov) This article may not be distributed under any copyright without my consent.