一部の共有ライブラリは、コマンドラインから呼び出すと、実行可能ファイルのように出力を提供します。たとえば、
$ /lib/libc.so.6
GNU C Library stable release version 2.13, by Roland McGrath et al.
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.5.2.
Compiled on a Linux 2.6.37 system on 2011-01-18.
[...]
Cで書かれた共有ライブラリにこの出力をどのように提供できますか?今作成したライブラリを実装しましたsegment fault
。
ベストアンサー1
void __libc_main()
またはを定義してみてくださいvoid _init()
。