dead code removal

Daniel Murphy via D.gnu d.gnu at puremagic.com
Mon Dec 1 21:02:53 PST 2014


"Johannes Pfau"  wrote in message news:m5enbm$2t0e$1 at digitalmars.com...

> The linker scripts also know about some details of the C/C++ codegen.
> For example attribute(constructor) needs support from linker scripts.
> (KEEP, SORT_NONE, PROVIDE_HIDDEN or similar) Without this support
> constructor calls would be eliminated by these optimization flags as
> well. So it's kinda reasonable.

And in theory that C++ support (or the C support) can be abused to prevent 
moduleinfo stripping by adding dummy references to the moduleinfo from 
.ctors sections, forcing it to be linked in. 



More information about the D.gnu mailing list