我在以下代码中遇到分段错误。
.section .data
myarray:
.int 10,20,30,40,50,60
format:
.ascii "%d\n"
.section .text
.globl _start
_start:
movl $2, %ebx
movl myarray(,%ebx,4) , %ecx
pushl %ecx
pushl $format
addl $8,%esp
call printf
movl $1,%eax
movl $0,%ebx
int $0x80
在 gdb 中运行时,我得到
Program received signal SIGSEGV, Segmentation fault.
strchrnul () at ../sysdeps/i386/strchrnul.S:68
68 ../sysdeps/i386/strchrnul.S: No such file or directory.
in ../sysdeps/i386/strchrnul.S
请指出我哪里出错了。