[root@xx test]# cat /usr/lib64/libc.so /* GNU ld script Use the shared library,but some functions are only in the static library,so try that secondarily. */ OUTPUT_FORMAT(elf64-x86-64) GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) )
任何人都知道这种东西是如何产生的?
如何链接glibc的iconv的实现?
符号errno,版本GLIBC_2.0未定义,在opensuse Linux 11.4中
未知的HZ值
我如何build立一个旧的Linux发行版的应用程序,并避免FATAL:内核太旧的错误?
这是在使用Make实用程序编译glibc时生成的。
在glibc的Makefile中有一个规则(由make install启动),它只是将需要的行回显到临时文件[email protected] :
(echo '/* GNU ld script'; echo ' Use the shared library,but some functions are only in'; echo ' the static library,so try that secondarily. */'; cat $<; echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))' ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' ) > [email protected]
mv -f [email protected] $@
# What we install as libc.so for programs to link against is in fact a # link script. It contains references for the varIoUs libraries we need. # The libc.so object is not complete since some functions are only defined # in libc_nonshared.a. # We need to use absolute paths since otherwise local copies (if they exist) # of the files are taken by the linker.
我理解为: libc.so.6不完整,需要一些不能存储在共享库中的东西。 所以,glibc开发者把这个东西移到了glibc的静态部分 – libc_nonshared.a 。 为了强制总是链接libc.so.6和libc_nonstared.a ,他们创建了一个特殊的链接脚本,它指示ld链接器在要求-lc (libc)
非共享部分是什么? 让我们检查:
$ objdump -t /usr/lib/libc_nonshared.a |grep " F "|grep -v __ 00000000 g F .text 00000058 .hidden atexit 00000000 w F .text 00000050 .hidden stat 00000000 w F .text 00000050 .hidden fstat 00000000 w F .text 00000050 .hidden lstat 00000000 g F .text 00000050 .hidden stat64 00000000 g F .text 00000050 .hidden fstat64 00000000 g F .text 00000050 .hidden lstat64 00000000 g F .text 00000050 .hidden fstatat 00000000 g F .text 00000050 .hidden fstatat64 00000000 w F .text 00000058 .hidden mknod 00000000 g F .text 00000050 .hidden mknodat 00000000 l F .text 00000001 nop
有atexit() , *stat*() , mknod函数。 为什么? 真的不知道,但这是glibc的事实。
下面是一些长篇解释http://giraffe-data.com/~bryanh/giraffehome/d/note/proglib ,我引用它的开始:
The stat() family of functions and mknod() are special. Their interfaces are tied so tightly to the underlying operating system that they change occasionally.
在托管系统上,您可能需要安装glibc-devel和/或glibc-devel.i686。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。