|
发表于 2004-8-3 09:56:23
|
显示全部楼层
需要节省空间的时候,往往会考虑不用系统的crt库里面默认的初始化代码。这个时候就可以自定义程序入口,VC里面,通常是用#pragma comment(linker, "/ENTRY:EntryPoint"),在EntryPoint这个函数里面可以自己做需要的初始化,或者直接去调用main之类。如果用gnu的toolchain的话,可以用ld -e entry
-e entry
--entry=entry
Use entry as the explicit symbol for beginning execu-
tion of your program, rather than the default entry
point. If there is no symbol named entry, the linker
will try to parse entry as a number, and use that as
the entry address (the number will be interpreted in
base 10; you may use a leading 0x for base 16, or a
leading 0 for base 8). |
|