From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17960 invoked by alias); 21 Mar 2002 11:56:36 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 17861 invoked from network); 21 Mar 2002 11:56:31 -0000 Received: from unknown (HELO localhost.localdomain) (202.102.94.82) by sources.redhat.com with SMTP; 21 Mar 2002 11:56:31 -0000 Received: (from zhenggen@localhost) by localhost.localdomain (8.9.3/8.8.7) id TAA01143; Thu, 21 Mar 2002 19:56:20 +0800 Date: Thu, 21 Mar 2002 03:56:00 -0000 Message-Id: <200203211156.TAA01143@localhost.localdomain> X-Authentication-Warning: localhost.localdomain: zhenggen set sender to zhenggen@localhost.localdomain using -f From: zhenglonggen To: MynamVS@nsc-msg01.network.com CC: kayvan@sylvan.com, gcc-help@gcc.gnu.org In-reply-to: <5B7014A44B89494E830AD32859FBC858EEA5ED@nsc-msg01.network.com> (MynamVS@nsc-msg01.network.com) Subject: Re: Help Needed: How to overwrite library functions. References: <5B7014A44B89494E830AD32859FBC858EEA5ED@nsc-msg01.network.com> X-SW-Source: 2002-03/txt/msg00161.txt.bz2 I have a library named libmem.a which contains a file named mem.o, which has functions named malloc() free() memPartFree() etc. Now i want to replace memPartFree90, but want to use malloc() and free(). How can do that? You should put the object file containing memPartFree90() in front of libmem.a in the option list of ld command so that ld will first link your memPartFree90 into object file, and when it finds malloc() free() missing, it will look for them in other object files ; My experience tells me it will work.