我的操作系统是 ubuntu 13.04 64 位
我浪费了很多时间来修复它真的需要你的帮助
这个 test.s 返回
Accessing a corrupted shared library
.code32
.section .data
par1:
.int 33
msg:
.asciz "%d\n"
.section .text
.globl _start
_start:
pushl $par1
pushl $msg
call printf
cikis:
movl $1,%eax
movl $1,%ebx
int $0x80
ldd test.out
ldd test.out
linux-vdso.so.1 => (0x00007fff615fe000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fbfb56f8000)
/lib32/libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x00007fbfb5ae0000)
生成文件
as test.s -o test.o
ld -dynamic-linker /lib/ld-linux.so.2 -lc test.o -o test.out
// 我也试过
ld -dynamic-linker /lib32/ld-linux.so.2 -lc test.o -o test.out
如何在 64 位 ubuntu 上的 gas 中使用 C 函数