79592456

Date: 2025-04-25 11:54:42
Score: 1
Natty:
Report link

The standard C files are already compiled and are part of the stdc++ library and other libraries linked to it.
In my case, it was there in
/usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30.

A sample test to check whether a .so contains a function or not.
I just checked whether printf is present in this libstdc++.so.6.
readelf -a libstdc++.so.6 | grep printf

000000226468 001f00000007 R_X86_64_JUMP_SLO 0000000000000000 __fprintf_chk@GLIBC_2.3.4 + 0

000000226ec0 005b00000007 R_X86_64_JUMP_SLO 0000000000000000 sprintf@GLIBC_2.2.5 + 0

000000227448 007900000007 R_X86_64_JUMP_SLO 0000000000000000 vsnprintf@GLIBC_2.2.5 + 0

000000227bb8 009f00000007 R_X86_64_JUMP_SLO 0000000000000000 __sprintf_chk@GLIBC_2.3.4 + 0

Each gcc version has a corresponding version of libstdc++.so of it , hence why you cannot run a executable built with higher version of gcc run in lower version of it. It misses the runtime symbols required for it.

Hope it answers your question.

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Filler text (0.5): 0000000000000000
  • Filler text (0): 0000000000000000
  • Filler text (0): 0000000000000000
  • Filler text (0): 0000000000000000
  • Low reputation (1):
Posted by: sairaman g