Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 May 1999 13:18:26 +0200
From:      Marcel Moolenaar <marcel@scc.nl>
To:        uday kiran <uday@aravalli.novalink.stpn.soft.net>, emulation@freebsd.org
Subject:   Re: [uday@aravalli.novalink.stpn.soft.net: linux-emulator]
Message-ID:  <374D2A02.1CE5364E@scc.nl>
References:  <19990526114240.A8555@cs.tu-berlin.de> <374C6895.7F73B916@scc.nl> <374CE4A1.125D1E3@encanto.stpn.soft.net>

next in thread | previous in thread | raw e-mail | index | archive | help
uday kiran wrote:

[I wrote:]
> > Upgrading the port should solve this problem or alternatively install
> > linux-base from http://www.scc.nl/~marcel/ instead of linux_lib. Note that
> > ldd won't work out of the box. This is because ldd executes a shared
> > library to do the work. FreeBSD doesn't allow execution of libaries. As a
> > work-around to that, use the FreebSD native ldd or search this mailing list
> > for a kernel-patch I once posted. I don't have the patch anymore, but it's
> > still on my TODO list...

> 3.Then i got    the  executable  "ls" from linux machine  and  did  brandelf  Linux on
> it . And did ./ls
> It  dumped core .

That can be explained if ls is not dynamic linked.

> So i  did "ldd-linux  ls ( both linux executables) " It said
> "/lib/ld-linux.so.2 not found .not a dynamic executable"
>  It seems the problem is here because in /compat/linux/lib the file actually exists and
> the emulator is
> not   finding it. It is searching is /lib.

No. The error is misleading. It *can* be found. It just can't be executed.

> 4. Then i made a symbolic link  /lib to /compat/linux/lib  then  after doing "ldd-linux
> ls"   it said  syntax error
> in the file /lib/ld-linux.so.2  '(" not expected.

This explains why you got this error and I didn't... Do not make the link!

>     I might have done something wrong some where but could'nt figure out.

The syntax error you gave was a bit misleading. I thought it was generated
by ldd-linux. I also don't have ldd-linux. That were the reasons I
suggested to upgrade.

The actual error was indeed "...not found... not a dynamic executable".
This is a known issue. The Linux kernel allows execution of ELF images that
are flagged as executable, but also as dynamic. This means that Linux
allows the execution of libraries. FreeBSD only allows the execution of ELF
images that are flagged as executable.

> In the mean time i am trying to install your  new port. linux-base and  will try with it.

As I said; Installing linux-base does not solve the actual error. The
following patch does:

Index: sys/kern/imgact_elf.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/imgact_elf.c,v
retrieving revision 1.12.2.2
diff -r1.12.2.2 imgact_elf.c
255c255
<       if (hdr->e_type != type)
---
>       if (hdr->e_type != type && hdr->e_type != ET_DYN)

> I did'nt understand your last sentence  where can i find yout TODO.

It's my list of things I need/want to do. It's everywhere :-)

-- 
Marcel Moolenaar                                  mailto:marcel@scc.nl
SCC Internetworking & Databases                     http://www.scc.nl/
Amsterdam, The Netherlands                         tel: +31 20 4200655


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-emulation" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?374D2A02.1CE5364E>