I need to run relatively new package on not-so-new RHEL 5.6.
I have 3rd party library (lib3rdparty.so
) which is compiled against glibc 2.6 while RHEL 5.6 have only 2.5 installed. But in the library there is only a couple of references to sched_getcpu@@GLIBC_2.6
. I've checked it like this
readelf -s lib3rdparty.so | egrep "@GLIBC_2.[6-9]"
to find references to something newer than GLIBC_2.5
which is installed. The output is
0 FUNC GLOBAL DEFAULT UND sched_getcpu@GLIBC_2.6 (62)
0 FUNC GLOBAL DEFAULT UND sched_getcpu@@GLIBC_2.6
So, I have only one function from GLIBC_2.6
. Now I want to make library think, that I have this function. For that purpose I forged small library (libcheat.so
) like it mentioned here. Now I have libcheat.so
file which, if run through readelf
, will show this string:
10 FUNC GLOBAL DEFAULT 11 sched_getcpu@@GLIBC_2.6
With this library I managed to succesfully build executable which is dynamically linked with lib3rdparty.so
. Without this library I can't build anything, because ld
can't find reference to sched_getcpu
.
But the problem is with running this file: when I try to run it I have a following error:
./hello_world: version `GLIBC_2.6' not found (required by ./lib3rdparty.so)
So, I believe there is one last step to make it work, but I don't know what to do. I've tried to use /etc/ld.conf.preload
and exporting LD_LIBRARY_PATH
so it would point to my library to load before others. But it won't run. Tried to run it through strace
but have no meaningful output.
Any ideas?