This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: __malloc_lock
- From: Jeff Johnston <jjohnstn at redhat dot com>
- To: "Franzi Edo." <edo dot franzi at ukos dot ch>
- Cc: newlib at sourceware dot org
- Date: Tue, 02 Jan 2007 15:35:25 -0500
- Subject: Re: __malloc_lock
- References: <F53B7D48-4F4A-4E29-A00B-CEEF84587D80@ukos.ch>
Franzi Edo. wrote:
Hi,
I am working on the porting of the reentrant version of newlib on my OS.
The problem I have is with __maloc_lock and __maloc_unlock functions.
In a separate library I have written all the stubs (xyz_r) necessary to
work (I put in this place my implementation of __malloc_lock and
__malloc_unlock).
Now, when I link my application the linker indicate to me a multiple
definition problem:
../../../../../../../../GCC/gcc-4.1.1/newlib/libc/stdlib/mlock.c:49:
multiple definition of `__malloc_lock'
How can I proceed to overwrite my __malloc_lock implementation over the
standard one?
If you already have code in the libc/sys/YOUROS or
libc/machine/YOURPLATFORM directory, simply add your lock/unlock
implementation in a file called mlock.c. This uses the standard newlib
override mechanism.
-- Jeff J.