This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Help Needed: How to overwrite library functions.
- From: "Mynampati, Venkata S." <MynamVS at nsc-msg01 dot network dot com>
- To: "'Kayvan A. Sylvan'" <kayvan at sylvan dot com>
- Cc: "'gcc-help at gcc dot gnu dot org'" <gcc-help at gcc dot gnu dot org>
- Date: Wed, 20 Mar 2002 14:16:20 -0600
- Subject: RE: Help Needed: How to overwrite library functions.
>
>
> On Wed, Mar 20, 2002 at 01:56:38PM -0600, Mynampati, Venkata S. wrote:
> > > On Wed, Mar 20, 2002 at 10:38:52AM -0600, Mynampati,
> Venkata S. wrote:
> > > > Hi,
> > > > I have this issue where i have an archive, whose member
> > > > "1.o" contains functions named A(), B(), C().
> > > > Now, i want to write a module, in which i want to use A() , BUT
> > > > overwrite B() and C() and YET link both "1.o" and my own module
> > > > together with rest of the system.
> > > >
> > > > i.e
> > > > 1.o contains A(), B() and C()
> > > > say 2.o contains my_A(), B(), C(), where
> > > > my_A()
> > > > {
> > > > /*do something*/;
> > > > A(); => linked from 1.o
> > > > }
> > > >
> > > > Thanks for your time and help.
> > > > Regards,
> > > > Venkat
> > > > Worry about chances you miss when you don't even try.
> > > >
> > >
> > > This is probably a job for the preprocessor.
> > >
> > > #define B my_replacement_B
> > > #define C my_replacement_C
> > >
> > > Then code up my_replacement_B() and my_replacement_C()
> with the same
> > > API as B() and C()
> > >
> > Nope, my file's fucntion names are in conflict with a library (*.a)
> > and it spews out error while linking.
>
> I don't see how. Can you send a short example file?
>
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?