2016-03-15 3 views
6

私は、このコマンドで.Sとの.o作成するように、アセンブリ言語で関数を作成し、動的ライブラリに入れしよう:
nasm -f elf64 hello.S -o hello.o
が、私は作成したいとき
gcc -fPIC -shared hello.o -o libasm.so
をし、それが私にこのエラーが表示されます:gccではlib
/usr/bin/ld: hello.o: relocation R_X86_64_PC32 against undefined symbol [email protected]@GLIBC_2.2.5 can not be used when making a shared object; recompile with -fPICコンパイルエラー:未定義のシンボルに対して再配置R_X86_64_PC32

+2

を参照してください。http://www.nasm.us/xdoc/2.10rc8/html/nasmdoc9.html#section-9.2.5(_ライブラリ外の_呼び出し手順_) – Michael

答えて

関連する問題