Solved Linux Compat: How to override ld-linux.so elf interperter path?

I have a 3rd party Linux binary which I downloaded which I'm trying to see if I can run under FreeBSD using Linux emulation.

This binary appears to have a hardcoded program interpreter path to /lib64/ld-linux-x86-64.so.2


Code:
readelf -l Appliance/check_bincompat

Elf file type is EXEC (Executable file)
Entry point 0x40065b
There are 8 program headers, starting at offset 64

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flg    Align
  PHDR           0x0000000000000040 0x0000000000400040 0x0000000000400040
                 0x00000000000001c0 0x00000000000001c0  R E    0x8
  INTERP         0x0000000000000200 0x0000000000400200 0x0000000000400200
                 0x000000000000001c 0x000000000000001c  R      0x1
      [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]

This causes the binary to fail when I try to run it.

Code:
Appliance/check_bincompat
ELF interpreter /lib64/ld-linux-x86-64.so.2 not found, error 2
Abort trap

How can I change it to use /compat/linux/lib/ld-linux.so.2 instead? Preferably through an environment variable or some method other than modifying the elf binary?

EDIT:

I actually completely misdiagnosed the problem. All that needed here is to build linux_base_c7 from ports. I was using the package version and it doesn't install 64 bit Linux support.
 
Last edited by a moderator:
Back
Top