[ECOS] Using Malloc inside kernel code.

Ruchika Singh rusingh@ecs.umass.edu
Sun Feb 6 23:42:00 GMT 2005


Hi Everyone:

I am new to ecos and am involved with a small exercise where in I need to 
allocate and use some memory from inside the kernel code.
I am using the malloc function call for this purpose and am using the call 
inside the Cyg_Scheduler_Implementation class's constructor in bitmap.cxx 
file with following line of code:
ptr = (int *)malloc(20480)
where ptr is a class member.

although the code compiles correctly I get the following error when I link 
it to my hello world application.

 /home1/rusingh/ecos/build/install/lib/libtarget.a
(kernel_bitmap.o):/home1/rusingh/ecos/packages/kernel/current/src/sched/bitma
p.cxx:91:undefined reference to `malloc(unsigned long)'

/home1/rusingh/ecos/build/install/lib/libtarget.a
kernel_bitmap.o):/home1/rusingh/ecos/packages/kernel/current/src/sched/bitma
 p.cxx:91:relocation truncated to fit: R_ARM_PC24 malloc(unsigned long)
collect2: ld returned 1 exit status

I would really appreciate if someone can give me some insight to whats going 
on here and how can i resolve this problem.

Thank you.
-R.



-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list