Executable shared libraries

后端 未结 3 1291
后悔当初
后悔当初 2021-01-03 02:58

Most of the time, when you compile a shared library, executing it is meaningless and doing so produces nothing useful:

$ ./libfoobarbaz.so
Segmentation fault         


        
3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-03 03:46

    There is a howto about this subject here. The principle is to define an entry point in the library and populate the interp section of the ELF file with the interpreter's pathname (e.g. /lib/ld-linux.so.2).

提交回复
热议问题