Date: | Thu, 28 May 2009 10:31:44 +0800 |
---|---|
From: | Ricky <rv.rvicky@xxxxxxxxx> |
Subject: | Re: [Gems-users] Link errors on Ruby |
You are correct, all malloc/free functions are overloaded by mm_* like functions.
for instance, in ruby/tester/test_framework.C line 140 there is
char *default_param = (char *) malloc( sizeof(char) * param_len );
and the link error is
tester/test_framework.C:140: undefined reference to `mm_malloc'
The reason why this happened is that in simics' include dir I have a header file simics/util/alloc.h in which the malloc/free is overloaded (see following codes).
==================================== /* take over any stray use of normal malloc()s */
#if !defined(IGNORE_VTMEM) #undef malloc
#undef calloc #undef realloc #undef free #undef strdup #define malloc(size) mm_malloc(size, 1, "char", __FILE__, __LINE__)
#define calloc(size, n) mm_zalloc((size) * (n), 1, "char", \ __FILE__, __LINE__) #define realloc(p, size) mm_realloc(p, size, 1, "char", __FILE__, __LINE__) #define free(p) mm_free(p, __FILE__, __LINE__) #define strdup(s) mm_strdup(s, __FILE__, __LINE__) #endif /* not IGNORE_VTMEM */
=====================================
Do you have any idea about the cause of my link error? BR
Ricky
On Thu, May 28, 2009 at 9:56 AM, Philip Garcia <pcgarcia@xxxxxxxx> wrote:
|
[← Prev in Thread] | Current Thread | [Next in Thread→] |
---|---|---|
|
Previous by Date: | Re: [Gems-users] Link errors on Ruby, Philip Garcia |
---|---|
Next by Date: | Re: [Gems-users] Link errors on Ruby, Philip Garcia |
Previous by Thread: | Re: [Gems-users] Link errors on Ruby, Philip Garcia |
Next by Thread: | Re: [Gems-users] Link errors on Ruby, Philip Garcia |
Indexes: | [Date] [Thread] |