Bug 10318 - Linker should remove static ctors for linked away types
Summary: Linker should remove static ctors for linked away types
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: 6.3.x
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Sebastien Pouliot
Depends on:
Reported: 2013-02-15 08:14 UTC by Marek Safar
Modified: 2013-02-15 09:31 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Marek Safar 2013-02-15 08:14:59 UTC
When there is a static constructor and type is linked away. We replace .cctor with exception throw which causes TypeInitialization error and could be worse based on where the .cctor is invoked
Comment 1 Sebastien Pouliot 2013-02-15 08:54:16 UTC
Yup, that's not correct - I'll remove them.
Comment 2 Sebastien Pouliot 2013-02-15 09:31:36 UTC
Fixed in 1ded0b14ecaf5138494ff99d86dbd3ddb26c4a07 (master)

No real size impact (but this was done for correctness)

linksdk       mscorlib.dll       binary
w/.cctors    624640             9645216
wo cctors    624640             9645200