Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

libgcc_s.so: undefined reference to `__stack_chk_fail@GLIBC_2.4'

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:

/usr/bin/make -f ins_precomp.mk relink ORACLE_HOME=/u01/oracle/OraHome_1 EXENAME=proc/Linking /u01/oracle/OraHome_1/precomp/lib/proc
libgcc_s.so: undefined reference to
__stack_chk_fail@GLIBC_2.4'`

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_fail
00000000 DF *UND* 00000000 GLIBC_2.4 __stack_chk_fail

and

ldd /lib/libgcc_s.so.1.ORG
linux-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_fail
00c52f80 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)

when I put older library libgcc_s.so.1 without symbol __stack_chk_fail

objdump -T /lib/libgcc_s.so.1 |grep __stack_chk_fail
empty 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?

like image 382
martin Avatar asked Feb 23 '11 12:02

martin


2 Answers

The problem is:

libgcc_s.so is having the dependency on libc.so.6. This problem starts with glibc 2.4 version.

You should add -lc in the link line.

This question will give you more information. In Linux stubs are used for standard libraries. Why are stubs required?

like image 154
sunmoon Avatar answered Sep 27 '22 18:09

sunmoon


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.

like image 25
Conrad Meyer Avatar answered Sep 27 '22 17:09

Conrad Meyer