如何让编译生成的C程序小于1KB
程序代码:#include <windows.h>
void _start() {
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
const char msg[] = "Hello World\n";
DWORD written;
WriteFile(hOut, msg, 12, &written, NULL);
ExitProcess(0);
}
编译:
gcc -Os -ffunction-sections -fdata-sections -nostartfiles -fno-asynchronous-unwind-tables -fno-stack-protector -fomit-frame-pointer -Wl,--gc-sections,--entry=_start,--strip-all,--image-base=0x400000,--file-alignment=256 -lkernel32 main.c -o hello_win.exe
生成的文件还是无法在1KB之内,如何优化,可以让编译生成1KB以内?






