oracle libgcc_s.so:未定义对`__stack_chk_fail@GLIBC_2.4'的引用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5090881/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
libgcc_s.so: undefined reference to `__stack_chk_fail@GLIBC_2.4'
提问by martin
At first I warn that I/m not programmer, but administrator only I try to understand some actions
起初我警告说我/不是程序员,但只有管理员我试图理解一些动作
When I installed program made by Oracle, I got log message:
当我安装 Oracle 制作的程序时,我收到日志消息:
/usr/bin/make -f ins_precomp.mk relink ORACLE_HOME=/u01/oracle/OraHome_1 EXENAME=proc/Linking /u01/oracle/OraHome_1/precomp/lib/proc
__stack_chk_fail@GLIBC_2.4'`
libgcc_s.so: undefined reference to
/usr/bin/make -f ins_precomp.mk relink ORACLE_HOME=/u01/oracle/OraHome_1 EXENAME=proc/Linking /u01/oracle/OraHome_1/precomp/lib/proc
__stack_chk_fail@GLIBC_2.4'`
libgcc_s.so: undefined reference to
ls -l
../libgcc_s.so -> /lib/libgcc_s.so.1
ls -l
../libgcc_s.so -> /lib/libgcc_s.so.1
so next I tried to diagnose by:
所以接下来我尝试通过以下方式进行诊断:
objdump -T /lib/libgcc_s.so.1 | grep __stack_chk_fail00000000 DF *UND* 00000000 GLIBC_2.4 __stack_chk_fail
objdump -T /lib/libgcc_s.so.1 | grep __stack_chk_fail00000000 DF *UND* 00000000 GLIBC_2.4 __stack_chk_fail
and
和
ldd /lib/libgcc_s.so.1.ORGlinux-gate.so.1 => (0x00fc5000)
libc.so.6 => /lib/libc.so.6 (0x00110000)
/lib/ld-linux.so.2 (0x00b39000)
ldd /lib/libgcc_s.so.1.ORGlinux-gate.so.1 => (0x00fc5000)
libc.so.6 => /lib/libc.so.6 (0x00110000)
/lib/ld-linux.so.2 (0x00b39000)
and
和
objdump -T /lib/libc.so.6 |grep __stack_chk_fail00c52f80 g DF .text 0000001a GLIBC_2.4 __stack_chk_fail
objdump -T /lib/libc.so.6 |grep __stack_chk_fail00c52f80 g DF .text 0000001a GLIBC_2.4 __stack_chk_fail
1) I don't know why this problem occured if all symbols are inside shared libraries (mabye it isn't, please correct me, or how to check it)
1)如果所有符号都在共享库中,我不知道为什么会出现此问题(可能不是,请纠正我,或如何检查)
when I put older library libgcc_s.so.1 without symbol __stack_chk_fail
当我把没有符号 __stack_chk_fail 的旧库 libgcc_s.so.1
objdump -T /lib/libgcc_s.so.1 |grep __stack_chk_failempty output
objdump -T /lib/libgcc_s.so.1 |grep __stack_chk_failempty output
everything was ok
一切正常
2) Do linker not check reference to __stack_chk_fail, because there isn't inside libgcc_s.so.1 in that case?
2) 链接器是否不检查对 __stack_chk_fail 的引用,因为在这种情况下 libgcc_s.so.1 中没有?
回答by sunmoon
The problem is:
问题是:
libgcc_s.so is having the dependency on libc.so.6. This problem starts with glibc 2.4 version.
libgcc_s.so 依赖于 libc.so.6。这个问题从 glibc 2.4 版本开始。
You should add -lc in the link line.
您应该在链接行中添加 -lc。
This question will give you more information. In Linux stubs are used for standard libraries. Why are stubs required?
这个问题会给你更多的信息。 在 Linux 中,存根用于标准库。为什么需要存根?
回答by Conrad Meyer
The *UND*
in 00000000 DF *UND* 00000000 GLIBC_2.4 __stack_chk_fail
indicates that the section is referenced but not defined. So yes, you're missing the symbol.
在*UND*
在00000000 DF *UND* 00000000 GLIBC_2.4 __stack_chk_fail
表明部分引用但没有定义。所以是的,你错过了这个符号。