了解x86汇编文件
# test1.s
.section .data
.section .text
.globl _start
_start:
movl $1, %eax
movl $3, %ebx
int $0x80 gcc -c test1.s -o test1.o gcc test1.o -o test1Last updated
# test1.s
.section .data
.section .text
.globl _start
_start:
movl $1, %eax
movl $3, %ebx
int $0x80 gcc -c test1.s -o test1.o gcc test1.o -o test1Last updated
/usr/bin/ld: test1.o: in function `_start':
(.text+0x0): multiple definition of `_start'; /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o:(.text+0x0): first defined here
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status njucs> ld test1.o -o test1
njucs> ./test1
njucs> echo $?
3