x86 GNU Assembler Strange Change Seg Fault

只谈情不闲聊 提交于 2019-12-01 09:50:15

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).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!