64비트 mingw gcc 컴파일러로 32비트 바이너리 생성시에는…
컴파일 타임이나.. 링크 타임시에.. -m32 옵션을 붙임.
$ gcc -m32 -c hello.c $ objdump -p hello.o hello.o: file format pe-i386 $ gcc hello.c $ file hello.exe hello.exe: PE32 executable for MS Windows (console) Intel 80386 32-bit
-m32 옵션을 붙이지 않으면 당연히 64비트 바이너리 생성.
$ gcc -c hello.c $ objdump -p hello.o hello.o: file format pe-x86-64 $ gcc hello.c $ file hello.exe hello.exe: PE32+ executable for MS Windows (console) Mono/.Net assembly
PE32 는 32bit executable file, PE32+ 는 64bit executable file에 대한 규악.
