Reputation: 2433
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.
Upvotes: 4
Views: 597
Reputation: 1
linker option /safeseh:no (look at IMAGE_LOAD_CONFIG_DIRECTORY in PE image info).
Upvotes: 0
Reputation: 308
If you want to get rid of CRT
dependency, then pass /Zl
option to the compiler. Linker does not need any special options (compiler won't insert
/DEFAULTLIB:...
into .drectve
section, so linker won't bind your EXE
to any CRT
).
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 in assembly
language.
Upvotes: 2