0

Yes, I know about this question but this is not a duplicate.

I try to run my app in an older system where glibc 2.12 is installed. What I need is glibc 2.19 and I have installed it and I give its location as rpath. Fine! But there is a special case with ld-linux.so.2 and I want to understand what is going on.

My app finds every thing it needs in rpath except ld-linux.so.2. When I check with ldd I see that it insists to locate it from the system:

/lib/ld-linux.so.2 (0x002ca000)

This makes my app not working with this error:

relocation error: /usr/local/lib32/libc.so.6: symbol _dl_find_dso_for_object, version GLIBC_PRIVATE not defined in file ld-linux.so.2 with link time reference

Then, I give this flag to linker to use my own dynamic-linker and not from the system:

-Wl,--dynamic-linker=/usr/local/lib32/ld-linux.so.2

When I check again with ldd, I see that finally it points to the same ld-linux:

/usr/local/lib32/ld-linux.so.2 => /lib/ld-linux.so.2 (0x002ca000)

Normally /usr/local/lib32/ld-linux.so.2 is not pointing to /lib/ld-linux.so.2, it points to ld-2.19.so, and ld-2.19.so is not a link, it is the lib itself to use.

Finally, although ldd shows me that in these two cases it uses the same ld-linux.so.2, my app do works in the second case!

What I would expect is that in the second case ldd shows me this:

/usr/local/lib32/ld-linux.so.2 => /usr/local/lib32/ld-2.19.so

What is going on? Does ldd shows me the same, but then in the second case in runtime, it locates to where I would expect?

0 Answers0