http://d.puremagic.com/issues/show_bug.cgi?id=9816
Rainer Schuetze <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #7 from Rainer Schuetze <[email protected]> 2013-08-27 00:07:48 PDT --- A few random comments: - I think in a situation where you want to use the same code for static and dynamic linking, "export" is not usable. I'd propose to export every public symbol at module granularity depending on a compile switch. - but then, there is no easy way to tell whether symbols in a module are imported from a static or dynamic library. This distinction is necessary though, as the code is different for both situations. Maybe a versioned pragma at module level can control this. - Using TLS variables from other DLLs is possible, but probably not with the current tool chain. What needs to be exported is the offset of the symbol in the TLS section and the address of the _tls_index variable in the DLL that exports the symbol. The code to read the variable could then look like this mov EAX,[_imp_variable.tls_index]; // read address of tls_index in import table mov EAX,[EAX]; // read tls_index of DLL mov EBX,FS:[2C]; // tls_array mov EBX,[EBX+4*EAX]; // tls_start of DLL mov ECX,[_imp_variable.offset]; // read offset of variable in TLS of DLL mov EDX,[EBX+ECX]; // read variable If the offset is not exportable, _tls_start is also needed for the DLL. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
