Search code examples
linkershared-librariescross-platformglibclibc

How can I debug program linking specific version of shared library?


helloworld.c:

int main(){}

[1] 9845 illegal hardware instruction (core dumped) LD_PRELOAD=./libc.so.6 ./helloworld

This preload libc is an old version of glibc

Can I debug helloworld linking it on my system?

Or is there a fast way to deploy a virtual machine with the specific version of shared libraries?


Solution

  • Can I debug helloworld linking it on my system?

    Yes, but you need to do it correctly. This answer provides details, and an explanation for why your LD_PRELOAD didn't work.