On 29.08.2013 11:33, Kagamin wrote:
On Thursday, 29 August 2013 at 06:43:39 UTC, Rainer Schuetze wrote:
How is this done on linux right now? It does not need
"export"/"import" to build against a shared phobos library. Is
"import" assumed for any data access and later removed by some magic
in the linker?
I guess, it adds missing functions which jump to the actual
implementation in so. This is done on windows too in import libraries,
but export qualifier makes code a little faster because you make one
indirect call instead of a direct call + indirect jump (it can be
direct, but for this loader should be able to write to the code section
to relocate the jump). You also only need an import table for such call.
That's how it works for functions, but what about accesses to data in
another DLL?
Suppose phobos being built as a shared library, how do you access
typeid(Object) from another DLL, both from code or inside data, e.g. as
the base class member of a class info struct?