Binary Size: function-sections, data-sections, etc.

Kagamin spam at here.lot
Wed Dec 21 08:42:33 PST 2011


> Could you elaborate?

As I remember, these features rely heavily on linker support, 
namely on how it merges sections. Each pointer to static ctor 
(and unittest) is placed in a section, then these sections are 
merged by linker and you get an array of pointers to all static 
ctors and unittests. The startup code reads the pointers in 
sequence and executes them. If some section is removed, the 
corresponding static ctor won't be run.

> Real code, that i was testing with previously, contained static 
> module ctors which
> worked, and i just tried a simple two module test w/ multiple 
> shared_[cd]tors +
> static_[cd]tors + unittests -- all of them are called as 
> expected.

If so then ok.


More information about the Digitalmars-d mailing list