strlenという関数を作成しました。
.section .text
.global strlen
.type strlen, @function
strlen:
... code ...
私はこれを次のように組み立てました:
as --32 strlen.asm -o strlen.o
次に、これにリンクしたいargvを出力するプログラムをasmで作成しました。同じように組み立てました。次に、実際のプログラムでstrlenを使用できるように、それらをリンクします。私は試した:
ld printnum.o strlen.o -m elf_i386 -o printnum
しかし、それは次のようになります。
printnum.o: In function `loop':
(.text+0x5): undefined reference to `strlen'
本当にシンプルなものが欠けているに違いありません。ありがとう!