NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: LD_PRELOAD and mixed architectures

Dave Vitek <> writes:

> Looks like things loaded due to LD_PRELOAD don't search /emul.  Here
> is a short experiment:
> $ echo "int main(){ return 0; }" > nop.c
> $ gcc -m32 nop.c -o nop
> $ LD_PRELOAD=app/lib64/ ./nop
> app/lib64/ unrecognized file format2 [2 != 1]
> $ LD_PRELOAD=app/lib/ ./nop
> $ ls /emul/netbsd32/
> $ ./nop
> Cannot open ""
> $ gcc -m64 nop.c -o nop
> $ ./nop
> Cannot open ""
> It occurs to me that linux emulation processes may have similar challenges.
> There is an existing problem report here:
> Relevant code from ld.so_elf confirms that it just does a straight up
> open() of the values in the environment variable and doesn't search
> anywhere:


  You are showing something looking for app/lib/, and then
  failing to find it as  That's not a surprise.

  I suggest first using absolute paths for libraries.  That's the normal
  case and more likely to work. doesn't do any searching.   The process of looking in
  /emul/netbsd32 is built into namei and thus works at the system call

  Use ktrace to see what's happening with system calls.

Attachment: pgpqHjXy6BCG7.pgp
Description: PGP signature

Home | Main Index | Thread Index | Old Index