This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Dynamic Loading of Class Implementation at Runtime.


On Dec 10, 1998, Ruslan Shevchenko <Ruslan@Shevchenko.Kiev.UA> wrote:

>> I don't quite understand.  There's no important difference between the
>> implementation of C functions and C++ methods, from the point of view
>> of a shared library.  The only relevant difference is that C++

>   mangling.

>    in C I know, that object symbol name is '_' + C-source name.

Do you?  Can you enumerate on which platforms every symbol starts with 
a `_'?

>  in C++ -- not.

I think the only portable solution is to define wrappers with "C"
linkage for interfacing with the library.  One such wrapper could be
used to access containers of Functors or pointers to member functions
with "C" linkage, and use them as starting points for searching C++
methods in the library.

Other than that, you might use the mangling/unmangling functions that
have been recently integrated into libiberty (have they?) to get
symbol names, but this will be restricted to GNU C++.

-- 
Alexandre Oliva  http://www.dcc.unicamp.br/~oliva  aoliva@{acm.org}
oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org}
Universidade Estadual de Campinas, SP, Brasil


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]