Re: Creating and using a .DLL/.SO?

new topic     » goto parent     » topic index » view thread      » older message » newer message
jeremy said...
mattlewis said...

There's also the issue of possibly conflicting names.

We run that risk right now on Windows, because an export.def file is created that looks like this:

EXPORTS 
hello = _1hello 

and you could presumably have:

EXPORTS 
hello = _1hello 
hello = _2hello 
hello = _3hello 

And this actually works???

jeremy said...
mattlewis said...

And I believe that gcc prefixes an underscore (though maybe not in all situations).

So far that has not been the case with the .so files I have created on Linux. However, none have been extensive, they have been simple tests. We are outputting _1hello and that's what is being "exported" from the .so.

The way ELF works, the prefix _ is appended to all C symbols by default - so when C code interacts the prefix is invisible. It is only when you are dealing with assembly language and linking that you have to worry about it (I guess dlopen() and dlsym() handle this transparently). I think Watcom behaves similarly.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu