Shared libraries, symbol visibilities, Posix vs. Windows

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Thu May 16 13:16:15 UTC 2024


Over all a very good write up of compiler + platform specific under the 
hood details!

On 17/05/2024 1:00 AM, kinke wrote:
> There's no concept of object-file visibilities in COFF. Instead, what 
> happens is that the compiler embeds linker directives in the object file 
> if a symbol defined in that object file is to be exported 
> (|/EXPORT:foo|). AFAIK, you can't override or tweak this at link-time 
> later (as possible on Posix via |--export-dynamic…|), so this is all 
> controlled at compile-time already. If there are exported symbols/linker 
> directives, the linker automatically generates an import library for the 
> linked executable/DLL.

You can add exports later with the help of a linker script.

I don't think you can go the other way however.

 > With many smaller DLLs, the 64K symbols-limit should be manageable.

Can confirm, as long as templates are not exported we are talking around 
200k LOC. More than enough for a single (sub)package.


More information about the Digitalmars-d mailing list