Subject: Re: ELF compatibility in 1.2?
To: Jukka Marin <jmarin@pyy.jmp.fi>
From: Frank van der Linden <frank@fwi.uva.nl>
List: port-i386
Date: 11/23/1996 17:38:45
Quoting Jukka Marin,

> Trying to get Applix installed and running.  When I try to run the installer
> or any linux binary, I get

> linux/ls: Exec format error. Wrong Architecture.

> file says

> linux/ls: ELF 32-bit LSB executable, Intel 80386, version 1

This can either be one of:

	1. You don't have the loader/interpreter in the right place.
	   For ELF binaries this should usually be /emul/linux/lib/ld-linux.so.1
	2. The binary you're running is one of those (to my mind strange)
	   binaries that have just one loadable section, a shared text
	   and data section. In that case, the patch appended should help
	   you out.

- Frank

*** exec_elf.c.orig	Sat Feb 10 13:32:13 1996
--- exec_elf.c	Sun Oct 20 13:55:36 1996
***************
*** 405,412 ****
  				    (caddr_t) ph, phsize)) != 0)
  		goto bad;
  
! 	epp->ep_tsize = ELF32_NO_ADDR;
! 	epp->ep_dsize = ELF32_NO_ADDR;
  
  	interp[0] = '\0';
  
--- 405,412 ----
  				    (caddr_t) ph, phsize)) != 0)
  		goto bad;
  
! 	epp->ep_taddr = epp->ep_tsize = ELF32_NO_ADDR;
! 	epp->ep_daddr = epp->ep_dsize = ELF32_NO_ADDR;
  
  	interp[0] = '\0';
  
***************
*** 467,472 ****
--- 467,476 ----
  			if (eh->e_entry >= addr && eh->e_entry < (addr + size)){
  				epp->ep_taddr = addr;
  				epp->ep_tsize = size;
+ 				if (epp->ep_daddr == ELF32_NO_ADDR) {
+ 					epp->ep_daddr = addr;
+ 					epp->ep_dsize = size;
+ 				}
  			} else {
  				epp->ep_daddr = addr;
  				epp->ep_dsize = size;