Dynamic Libraries

Till Straumann strauman at slac.stanford.edu
Tue Sep 5 17:27:44 UTC 2006


Marek Prochazka wrote:
> Hi Till,
>
> thanks for your quick response. So, after I call cexpInit() 
This initializes the library but before you can use 'cexpModuleLoad' you
must have the application's symbol table loaded (aka 'system symbol table').
You can either (see README)
  a) compile this in: E.g., using the 'xsyms' or 'ldep' tool you create a
     symbol table '.c' file which is then compiled and linked with the
    application.
  b) use 'cexpModuleLoad()' to load symbols from an object (ELF) file.
     If no system symbol table is present when cexpModuleLoad is
     executed then cexpModuleLoad assumes it should just use the symbol
     table of the argument file to construct the system symbol table.
> and load a
> module using cexpModuleLoad(),
yes
>  I can look for a function symbol using
> cexpSymLookup().
yes
>  This way I get CexpSym. Given that the symbol was a
> function, is the way to call this function to consider 
> CexpSymRec_.value.tv as TFuncP (or TDFuncP?),
you should use cexpSymValue(CexpSym) to obtain the value
of the symbol (function or variable address). You then cast
the void* returned by cexpSymValue() to the correct type
(up to you to know what type that is).
>  cast this value to a
> function pointer and call it?
Yes.

HTH
-- Till
>  Or is there a cext_ function which I
> missed to be used?
>
> Many thanks,
> Marek
>
>
>   
>> -----Original Message-----
>> From: Till Straumann [mailto:strauman at slac.stanford.edu] 
>> Sent: 05 September 2006 16:25
>> To: Marek Prochazka
>> Cc: Chris Johns; rtems-users at rtems.com
>> Subject: Re: Dynamic Libraries
>>
>> Marek Prochazka wrote:
>>
>>     
>>> Hi,
>>>
>>> cexp seems quite interesting, but I do not see any guide how 
>>>       
>> to use the
>>     
>>> dynamic loader without the interpreter. I want to run my 
>>>       
>> code and then
>>     
>>> at some point use cexpModuleLoad etc. To do that I need some 
>>>       
>> basic cexp
>>     
>>> API documentation.
>>>
>>>       
>> Consult the header 'cexp.h'. You can call cexpModuleLoad() etc. from 
>> ordinary C-code.
>>
>>     
>>> Thanks,
>>> Marek
>>>
>>>  
>>>
>>>       
>>>> Check out cexp:
>>>>
>>>> http://www.slac.stanford.edu/comp/unix/package/rtems/src/ssrlA
>>>> pps/cexp/README
>>>>
>>>> The code can be found here:
>>>>
>>>> ftp://www.rtems.org/pub/rtems/4.6.99.3/contrib/cexp
>>>>
>>>>         
>> You should always download from the cexp home page (i.e., the stanford
>> site) to make sure you got the latest version. rtems.org 
>> usually lags a bit
>> behind...
>>
>> HTH
>> -- Till
>>
>>     
>>>> Regards
>>>> Chris
>>>>
>>>>    
>>>>
>>>>         
>>>  
>>>
>>>       
>>
>>     
>
>   




More information about the users mailing list