I’ve used this as a reference, but it doesn’t appear to be complete. When I set /NODEFAULTLIB, I get linker errors about missing __except_list, __load_config_used, and a few other things apparently related to SEH. It’s easy enough to get _CxxThrowException and friends linked correctly, but I have no idea what __except_list is supposed to be and I don’t know where to start looking.
I’m using both MSC and IC. When using IC, the linker reports __except_list as missing, though this is not the case with MSC.
For those of you who’s favorite answer is “why?”: It’s because I want to know how this works, and I’m tired of do-nothing test applications starting life with 300kb committed for absolutely no reason.
If you want to get rid of
CRTdependency, then pass/Zloption to the compiler. Linker does not need any special options (compiler won’t insert/DEFAULTLIB:...into.drectvesection, so linker won’t bind yourEXEto anyCRT).Of course you shouldn’t be using
C++exceptions or heap in your code; or you need to provide your own version of library functions written inassemblylanguage.