Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Aug 1996 08:42:58 +0200 (MET DST)
From:      sos@FreeBSD.org
To:        bartol@salk.edu (Tom Bartol)
Cc:        hackers@FreeBSD.org
Subject:   Re: running linux-elf matlab
Message-ID:  <199608080642.IAA01368@ra.dkuug.dk>
In-Reply-To: <Pine.NEB.3.93.960807144619.278A-100000@pauling.salk.edu> from "Tom Bartol" at Aug 7, 96 03:39:08 pm

next in thread | previous in thread | raw e-mail | index | archive | help
In reply to Tom Bartol who wrote:
[snip snap]
> 
> I also added /lib/elf to /compat/linux/etc/ld.so.conf and rehashed
> ld.so.cache with ldconfig as per the section of the FreeBSD handbook on
> linux compat.  Now, one would hope that matlab would run but here's what
> results when I try:
> 
> /usr/local/pkgs/matlab-4.2c/bin/lnx86/matlab
> ELF interpreter /lib/elf/ld-linux.so.1 not known
> Abort
> 
> and
> 
> /compat/linux/usr/bin/ldd /usr/local/pkgs/matlab-4.2c/bin/lnx86/matlab
> ELF interpreter /lib/elf/ld-linux.so.1 not known

The problem here is that the ELF loader looks in a certain location
for the ELF interpreter. This is the most annoying problem with
Linux, they can't get a grip on where to put files, its a nightmare
to keep track of all the different places to look :( :(
However when one KNOWS where to look its easy fixable:
The patch is for -current, so you shouldn't have any troubles with
that, let me know if you get any further, it would be nice to have
matlab running...


*** sys/i386/linux/linux_sysvec.c.ORG	Thu Jun 20 04:38:08 1996
--- sys/i386/linux/linux_sysvec.c	Wed Aug  7 23:30:57 1996
***************
*** 409,414 ****
--- 409,419 ----
  					"/lib/ld-linux.so.1",
  					"/compat/linux"
  				 };
+ Elf32_Interp_info linux_interp_old = {
+ 					&elf_linux_sysvec,
+ 					"/lib/elf/ld-linux.so.1",
+ 					"/compat/linux"
+ 				 };
  
  #ifndef LKM
  /*
*** lkm/linux/linux.c.ORG	Wed Aug  7 23:34:44 1996
--- lkm/linux/linux.c	Wed Aug  7 23:34:35 1996
***************
*** 42,53 ****
--- 42,56 ----
  MOD_EXEC(linux, -1, (struct execsw*)&linux_execsw);
  
  extern Elf32_Interp_info linux_interp;
+ extern Elf32_Interp_info linux_interp_old;
  
  static int
  linux_load(struct lkm_table *lkmtp, int cmd)
  {
  	if (elf_insert_interp(&linux_interp))
  		uprintf("Could not install ELF interpreter entry\n");
+ 	if (elf_insert_interp(&linux_interp_old))
+ 		uprintf("Could not install ELF interpreter entry\n");
  	uprintf("Linux emulator installed\n");
  	return 0;
  }
***************
*** 56,61 ****
--- 59,66 ----
  linux_unload(struct lkm_table *lkmtp, int cmd)
  {
  	if (elf_remove_interp(&linux_interp))
+ 		uprintf("Could not deinstall ELF interpreter entry\n");
+ 	if (elf_remove_interp(&linux_interp_old))
  		uprintf("Could not deinstall ELF interpreter entry\n");
  	uprintf("Linux emulator removed\n");
  	return 0;


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Soren Schmidt             (sos@FreeBSD.org)             FreeBSD Core Team
               So much code to hack -- so little time.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199608080642.IAA01368>