6

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?

2 Answers 2

4

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?

4
  • Much better answer than mine! +1 Commented Feb 23, 2011 at 12:33
  • so where I should add -lc at the beginning or the end?
    – martin
    Commented Feb 23, 2011 at 13:39
  • Add lc after lgcc_s in the link line.
    – sunmoon
    Commented Feb 23, 2011 at 16:48
  • I'm affraid that due to reason that installation scripts from Oracle are very complex, I don't know in which one I should put lc. I tried set LD_PRELOAD but it's not possible due to security, next i set LD_LIBRARY_PATH to /lib but it's not working. So I don't understand if linker can find libgcc_so.1 from /lib path why it can't find glibc inside the same directory?
    – martin
    Commented Feb 25, 2011 at 8:27
2

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.

2
  • could you explain where It should be defined because when execute on failed so: objdump -T /lib/libgcc_s.so.1 |grep UND, I obtain much more, like: 00000000 DF UND 00000000 GLIBC_2.0 realloc
    – martin
    Commented Feb 23, 2011 at 13:14
  • of course symbol __stack_chk_fail is undefined in libgcc_so.1 but it's defined inside libc.so.6 so I don't understand why the warning occur
    – martin
    Commented Feb 24, 2011 at 21:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.