The following x86 assembly code assembles fine, and it used to run flawlessly on my school\'s linux server, but when applying the same code to my linux virtual machine (ubun
I'm guessing that you have a 64-bit machine, while your program is obviously 32-bit.
I have a 64-bit machine, if I compile it with this command, it fails, same line as you:
$ gcc -nostdlib test.s
However, if I compile a 32-bit executable:
$ gcc -nostdlib -m32 test.s
And all is fine.
Note that you may need some packages to be able to compile a 32-bit program in a 64-bit machine (g++-multilib
or whatever they call it these days).