Hi Ericxu833,
gcc.exe -g -O0 -x c -fno-exceptions -fno-stack-protector -fno-ident test.c -o
test.exe
I used IDA pro to reverse engineer test.exe and found that gcc added "call __main" to the
front of the assembly code, and then executed "jmp __do_global_ctors". I guess this code
means to instantiate C++ objects.
My code is pure C language and does not need this code. How to remove the extra
assembly code.
Try adding -nostartfiles to your command line.
That extra code is coming from the startup file(s) that are added by
default when you use gcc to compile and then link your program.
Of course without those startup files you may not be able to run
your code, but I assume that that does not matter to you.
Cheers
Nick