gluck / il-repack

Open-source alternative to ILMerge
Apache License 2.0
1.19k stars 217 forks source link

Module initializers are DuplicateIgnored away #312

Open bwoebi opened 2 years ago

bwoebi commented 2 years ago

Given two modules with each a ModuleInitializer defined, one assembly will win, the other ModuleInitializer will be ignored.

The static constructor of the root <Module> class should never be ignored, but appended to each other (i.e. truncate the trailing ret instruction, then append the other modules <Module> class static constructor).