程式語言 - MinGW - 如何編譯出最小Size的PE檔案



參考資訊:
https://stackoverflow.com/questions/42022132/how-to-create-tiny-pe-win32-executables-using-mingw

參數如下:

$ i686-w64-mingw32-gcc \
    -s -Os \
    -fno-ident -fno-stack-protector -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables \
    -falign-jumps=1 -falign-loops=1 -falign-functions=1 \
    -mpreferred-stack-boundary=2 -mconsole \
    -nostdlib -nodefaultlibs -nostartfiles \
    -lkernel32 -lmsvcrt \
    main.c -o main.exe