2

We have 32 bit application on 64 bit rhel 6.4 . If I do ldd on the binary, it shows it is using 32 bit version of glibc. Is it possible to make it to point to 64 bit version of glibc? If yes, how can I do that?

I have compiled the binaries using the -m32 flag.

  • Must it point to the library, or is it sufficient that it use the library instead? – Ignacio Vazquez-Abrams Jul 3 '13 at 2:15
7

No it's not possible. They use different binary formats, use different calling conventions, different instruction set, different syscall methods, different ... everything.

root@el6 ~ # file /lib/libc-2.12.so 
/lib/libc-2.12.so: ELF 32-bit LSB shared object, Intel 80386, [...]

root@el6 ~ # file /lib64/libc-2.12.so 
/lib64/libc-2.12.so: ELF 64-bit LSB shared object, x86-64, [...]

32-bit binary needs 32-bit libs, 64-bit binaries need 64-bit libs. If you want your app to use the 64-bit libc compile it without -m32 as a 64-bit app.

0

No you cannot simply because incompatibility of 32 bit version with 64 bit version. 64 bit version uses 64 bit instruction set also addresses are in 64 bit format which support much more address space in physical memory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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