大多数情况下,编译共享库后执行它是没有意义的,这样做不会产生任何有用的东西。
然而,GNU的开发人员已经能够在执行glibc时插入一些输出:
虽然这个用法对我来说似乎只是简单的膨胀,但他们是如何实现将共享库作为可执行文件使用的呢?
$ ./libfoobarbaz.so
Segmentation fault
然而,GNU的开发人员已经能够在执行glibc时插入一些输出:
$ /lib/libc.so.6
GNU C Library (Debian EGLIBC 2.11.2-10) stable release version 2.11.2, by Roland McGrath et al.
Copyright (C) 2009 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.4.5.
Compiled on a Linux 2.6.32 system on 2011-01-23.
Available extensions:
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
For bug reporting instructions, please see:
<http://www.debian.org/Bugs/>.
虽然这个用法对我来说似乎只是简单的膨胀,但他们是如何实现将共享库作为可执行文件使用的呢?