Re: Creating and using a .DLL/.SO?
- Posted by jimcbrown (admin) Dec 26, 2008
- 1097 views
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???
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.