[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
--wrap ld functionality does not work with Init RTEMS function
- Date: Tue, 8 Apr 2008 12:53:55 -0500
- From: joel.sherrill at OARcorp.com (Joel Sherrill)
- Subject: --wrap ld functionality does not work with Init RTEMS function
Thomas D?rfler wrote:
> Hi,
>
> Joel Sherrill schrieb:
>
>> Aitor.Viana.Sanchez at esa.int wrote:
>>
>>
>>> Hi all,
>>>
>>> does anybody knows why when trying to wrap the Init RTEMS function
>>> with the ld --wrap functionality everything compiles well but
>>> eventually the wrapper function is not executed?
>>>
>>> Maybe I am missing something, but is taking me a while to discover why.
>>>
>>>
>>>
>> Init is a task/thread and threads will not return to the wrapper.
>> They are entered but exit via rtems_task_delete or pthread_exit.
>>
>> I would expect the wrapper to be entered, then Init but no return
>> from Init.
>>
>>
> Normally Init will be referenced from within the same module: The
> "init.c" module contains the first task AND the default list in init
> tasks (somehwere deep down in system.h -> confdefs.h). And therefore I
> would expect that the pointer in the list of init tasks will point to
> the REAL function, no matter how it might have been renamed.
>
> Does this make sense?
>
Hmmm.. that is also a distinct possibility. I wonder if --wrap
takes into account indirect function pointers.
It does appear to work though. See the attachment I compiled
natively like this:
gcc -o wrapped wrapped.c -Wl,--wrap=malloc && ./wrapped
I think wrapping thread bodies is the issue. No execution flow
out of the body.
--joel
> wkr,
> Thomas.
>
>
>>> Regards,
>>>
>>> Aitor
>>>
>>>
>>
>>
>
>
> --
> --------------------------------------------
> embedded brains GmbH
> Thomas Doerfler Obere Lagerstr. 30
> D-82178 Puchheim Germany
> Tel. : +49-89-18 90 80 79-2
> Fax : +49-89-18 90 80 79-9
> email: Thomas.Doerfler at embedded-brains.de
> PGP public key available on request
>
> Diese Nachricht ist keine gesch?ftliche Mitteilung im Sinne des EHUG.
>
>
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wrapped.c
Type: text/x-csrc
Size: 584 bytes
Desc: not available
Url : http://rtems.rtems.org/pipermail/rtems-users/attachments/20080408/dfa1ada8/attachment.bin