21,497
社区成员




.section .rodata
msg:
.ascii "Hello, world.\n"
.section .text
.globl main
main:
movl $4, %eax
movl $1, %ebx
movl $msg, %ecx
movl $14, %edx
int $0x80
movl $1, %eax
movl $0, %ebx
int $0x80
$ gcc hello.s
/usr/bin/ld: /tmp/ccjICv40.o: relocation R_X86_64_32 against `.data' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
gcc -no-pie hello.s
wj@wj:~/study/asm$ ./a.out
Segmentation fault (core dumped)