On 06/04/2021 09:33, LacaK via fpc-pascal wrote:
> So we see that classes like TComponent and also interfaces are touched,
> but they are used only in conjuction with initilizing some global
> variables like InitHandlerList, GlobalNameSpace.
> 
> But these variables are never used in my library. Only again in
> finalization sections of above mentioned units.

They are used in your library as far as the linker is concerned, because
the init and finalisation sections are code like any other code.

> Does it means, that smart-linking can not remove this code due to usage
> of this global variables in finalization section (resp. initialization
> sections)?

Indeed.

> Probably it is too hard task for linker to determine which code is realy
> not needed ... WPO in this regard can not help?

No. There is no way for WPO to know what side effects the initialisation
of those variables could have.


Jonas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to