Skip to content
Advertisement

Using uclibc linker for glibc compiled binary?

I have a binary which I need to get working on an embedded system which uses uclibc, the binary was compiled against glibc, should this work?

I get an error saying that the binary doesn’t exist when I try to run it, so I checked what libraries were missing.

JavaScript

I was able to symlink all of these but one to the version I have on my system (older versions but I would expect it to work as the binary should not need these new versions):

JavaScript

ld-linux-x86-64.so.2 does not exist (nor any library for me to point to such as ld-2.19.so, which is what it points to on my host pc) , is this a glibc specific linker? I have /lib/ld64-uClibc.so.0/ / /lib/ld64-uClibc-0.9.33.2.so but symlinking to that has no effect (Still get No such file or directory), is that even the right thing to do or do I need to get ld-linux-x86-64.so.2 built into the system somehow?

Advertisement

Answer

should this work?

No.

ld-linux-x86-64.so.2 does not exist … is this a glibc specific linker?

Yes: ld-linux is part of GLIBC. The path to it is hard-coded into the binary (see readelf -l a.out output).

do I need to get ld-linux-x86-64.so.2 built into the system somehow?

You have two choices:

  1. Rebuild your binary against uClibc, or
  2. Install complete GLIBC (it’s not just ld-linux that you need; you’ll also need libc.so.6, libdl.so.2, etc.)
Advertisement