From nobody@FreeBSD.ORG Tue Mar  2 20:35:13 1999
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 9357314E4A; Tue,  2 Mar 1999 20:35:13 -0800 (PST)
Message-Id: <19990303043513.9357314E4A@hub.freebsd.org>
Date: Tue,  2 Mar 1999 20:35:13 -0800 (PST)
From: g3d@graphix.g3d.com
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@freebsd.org
Subject: /usr/libexec/ld-elf.so.1: Invalid File Format
X-Send-Pr-Version: www-1.0

>Number:         10366
>Category:       bin
>Synopsis:       /usr/libexec/ld-elf.so.1: Invalid File Format
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar  2 20:40:00 PST 1999
>Closed-Date:    Sun Jun 20 20:30:27 CDT 1999
>Last-Modified:  Fri Jul  9 11:50:02 PDT 1999
>Originator:     Hisham Elshahawi
>Release:        3.1-RELEASE
>Organization:
ELCO Integrated Solutions
>Environment:
FreeBSD graphix.g3D.com 3.1-RELEASE FreeBSD 3.1-RELEASE #5: Mon Mar  1 21:25:22 EST 1999     root@graphix.g3D.com:/usr/src/sys/compile/GRAPHIX  i386
>Description:
Previous to 3.1, I had been running 3.0-RELEASE.  ELF was already
installed and running on the system.  After upgrading via CDROM to 
3.1-RELEASE, a few X ELF applications, specifically window manager-related
applications such as KDE's kwm, or the enlightenment binary, etc. Would 
refuse to run reporting  '/usr/libexec/ld-elf.so.1: Invalid File Format'.
This puzzled me since it has never happened before and ELF was not foreign
to my system prior to 3.1.  Mind you, this is with the KDE and enlightenment 
precompiled packages off of the CDROM.  

I tried going into /usr/src/libexec/rtld-elf/ and remaking the library but 
the problem persists.  Not all X/ELF binaries are affected.  I've successfully
ran many other ELF binaries.  It just so happens that for some reason these 
window manager binaries refuse to run correctly.
>How-To-Repeat:
Run /usr/local/bin/kwm from the KDE-1.0 or 1.1 version ELF from package
Run /usr/X11R6/bin/enlightenment in ELF format from the package

>Fix:


>Release-Note:
>Audit-Trail:

From: John Polstra <jdp@polstra.com>
To: freebsd-gnats-submit@FreeBSD.ORG
Cc: g3d@graphix.g3d.com
Subject: Re: bin/10366: /usr/libexec/ld-elf.so.1: Invalid File Format
Date: Sat, 13 Mar 1999 18:57:30 -0800 (PST)

 Please grab "src/sys/i386/include/elf.h" revision 1.5.2.2, build a
 new kernel, and let me know if it solves the problem for you.  (Make
 sure that "src/sys/kern/imgact_elf.c" gets recompiled.)  You can get
 the file from <http://www.freebsd.org/cgi/cvsweb.cgi/>.  Here are the
 diffs relative to 3.1-RELEASE, in case that's more convenient.
 
 Index: elf.h
 ===================================================================
 RCS file: /home/ncvs/src/sys/i386/include/elf.h,v
 retrieving revision 1.5.2.1
 retrieving revision 1.5.2.2
 diff -u -r1.5.2.1 -r1.5.2.2
 --- elf.h	1999/02/08 18:58:36	1.5.2.1
 +++ elf.h	1999/02/19 01:36:29	1.5.2.2
 @@ -23,7 +23,7 @@
   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   *
 - *      $Id: elf.h,v 1.5.2.1 1999/02/08 18:58:36 jdp Exp $
 + *      $Id: elf.h,v 1.5.2.2 1999/02/19 01:36:29 jdp Exp $
   */
  
  #ifndef _MACHINE_ELF_H_
 @@ -121,11 +121,13 @@
  #ifdef KERNEL
  
  /*
 - * On the i386 we load the dynamic linker at a fixed address,
 - * below where the executable itself is loaded.  This is the
 - * standard SVR4 location for it.
 + * On the i386 we load the dynamic linker where a userland call
 + * to mmap(0, ...) would put it.  The rationale behind this
 + * calculation is that it leaves room for the heap to grow to
 + * its maximum allowed size.
   */
 -#define ELF_RTLD_ADDR(vmspace)	0x08000000
 +#define ELF_RTLD_ADDR(vmspace) \
 +    (round_page((vm_offset_t)(vmspace)->vm_daddr + MAXDSIZ))
  
  #endif /* KERNEL */
  #endif /* !_MACHINE_ELF_H_ */
 
 
 John
 -- 
   John Polstra                                               jdp@polstra.com
   John D. Polstra & Co., Inc.                        Seattle, Washington USA
   "Self-interest is the aphrodisiac of belief."           -- James V. DeLong
 

From: Guy Helmer <ghelmer@cs.iastate.edu>
To: freebsd-gnats-submit@freebsd.org, g3d@graphix.g3d.com
Cc:  
Subject: Re: bin/10366: /usr/libexec/ld-elf.so.1: Invalid File Format
Date: Thu, 03 Jun 1999 21:39:35 -0500

 Did the patches supplied by jdp (or upgrading to a newer release of
 FreeBSD) solve the problem?
 
 Guy Helmer
 ghelmer@freebsd.org
 
State-Changed-From-To: open->closed 
State-Changed-By: ghelmer 
State-Changed-When: Sun Jun 20 20:30:27 CDT 1999 
State-Changed-Why:  
Pr author didn't respond to query whether the problem still exists; 
jdp probably fixed the problem. 

From: jbrody2@umbc.edu
To: freebsd-gnats-submit@freebsd.org, g3d@graphix.g3d.com
Cc:  
Subject: Re: bin/10366: /usr/libexec/ld-elf.so.1: Invalid File Format
Date: Fri, 09 Jul 1999 14:49:37 -0400

 I've been getting this error also.  I upgraded to the bin distribution from 3.2-RELEASE and built a new kernel from this version also.  I've also tried
 replacing elf.h with the suggested version.  None of these have seemed to help.  Just thought I'd let you know (and hope for a fix :) ).  Thanks!
 
 > [Navigation Bar]
 >
 > Problem Report bin/10366
 >
 > /usr/libexec/ld-elf.so.1: Invalid File Format
 >
 > Confidential
 >      no
 > Severity
 >      serious
 > Priority
 >      medium
 > Responsible
 >      freebsd-bugs@freebsd.org
 > State
 >      closed
 > Class
 >      sw-bug
 > Submitter-Id
 >      current-users
 > Arrival-Date
 >      Tue Mar 2 20:40:00 PST 1999
 > Closed-Date
 >      Sun Jun 20 20:32:14 CDT 1999
 > Last-Modified
 >      Sun Jun 20 20:32:14 CDT 1999
 > Originator
 >      Hisham Elshahawi g3d@graphix.g3d.com
 > Release
 >      3.1-RELEASE
 > Organization
 >
 >      ELCO Integrated Solutions
 >
 > Environment
 >
 >      FreeBSD graphix.g3D.com 3.1-RELEASE FreeBSD 3.1-RELEASE #5: Mon Mar  1 21:25:22 EST 1999     root@graphix.g3D.com:/usr/src/sys/compile/GRAPHIX  i386
 >
 > Description
 >
 >      Previous to 3.1, I had been running 3.0-RELEASE.  ELF was already
 >      installed and running on the system.  After upgrading via CDROM to
 >      3.1-RELEASE, a few X ELF applications, specifically window manager-related
 >      applications such as KDE's kwm, or the enlightenment binary, etc. Would
 >      refuse to run reporting  '/usr/libexec/ld-elf.so.1: Invalid File Format'.
 >      This puzzled me since it has never happened before and ELF was not foreign
 >      to my system prior to 3.1.  Mind you, this is with the KDE and enlightenment
 >      precompiled packages off of the CDROM.
 >
 >      I tried going into /usr/src/libexec/rtld-elf/ and remaking the library but
 >      the problem persists.  Not all X/ELF binaries are affected.  I've successfully
 >      ran many other ELF binaries.  It just so happens that for some reason these
 >      window manager binaries refuse to run correctly.
 >
 > How-To-Repeat
 >
 >      Run /usr/local/bin/kwm from the KDE-1.0 or 1.1 version ELF from package
 >      Run /usr/X11R6/bin/enlightenment in ELF format from the package
 >
 > Audit-Trail
 >
 >      From: John Polstra <jdp@polstra.com>
 >      To: freebsd-gnats-submit@FreeBSD.ORG
 >      Cc: g3d@graphix.g3d.com
 >      Subject: Re: bin/10366: /usr/libexec/ld-elf.so.1: Invalid File Format
 >      Date: Sat, 13 Mar 1999 18:57:30 -0800 (PST)
 >
 >       Please grab "src/sys/i386/include/elf.h" revision 1.5.2.2, build a
 >       new kernel, and let me know if it solves the problem for you.  (Make
 >       sure that "src/sys/kern/imgact_elf.c" gets recompiled.)  You can get
 >       the file from <http://www.freebsd.org/cgi/cvsweb.cgi/>;.  Here are the
 >       diffs relative to 3.1-RELEASE, in case that's more convenient.
 >
 >       Index: elf.h
 >       ===================================================================
 >       RCS file: /home/ncvs/src/sys/i386/include/elf.h,v
 >       retrieving revision 1.5.2.1
 >       retrieving revision 1.5.2.2
 >       diff -u -r1.5.2.1 -r1.5.2.2
 >       --- elf.h      1999/02/08 18:58:36     1.5.2.1
 >       +++ elf.h      1999/02/19 01:36:29     1.5.2.2
 >       @@ -23,7 +23,7 @@
 >         * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 >         * SUCH DAMAGE.
 >         *
 >       - *      $Id: elf.h,v 1.5.2.1 1999/02/08 18:58:36 jdp Exp $
 >       + *      $Id: elf.h,v 1.5.2.2 1999/02/19 01:36:29 jdp Exp $
 >         */
 >
 >        #ifndef _MACHINE_ELF_H_
 >       @@ -121,11 +121,13 @@
 >        #ifdef KERNEL
 >
 >        /*
 >       - * On the i386 we load the dynamic linker at a fixed address,
 >       - * below where the executable itself is loaded.  This is the
 >       - * standard SVR4 location for it.
 >       + * On the i386 we load the dynamic linker where a userland call
 >       + * to mmap(0, ...) would put it.  The rationale behind this
 >       + * calculation is that it leaves room for the heap to grow to
 >       + * its maximum allowed size.
 >         */
 >       -#define ELF_RTLD_ADDR(vmspace)        0x08000000
 >       +#define ELF_RTLD_ADDR(vmspace) \
 >       +    (round_page((vm_offset_t)(vmspace)->vm_daddr + MAXDSIZ))
 >
 >        #endif /* KERNEL */
 >        #endif /* !_MACHINE_ELF_H_ */
 >
 >
 >       John
 >       --
 >         John Polstra                                               jdp@polstra.com
 >         John D. Polstra & Co., Inc.                        Seattle, Washington USA
 >         "Self-interest is the aphrodisiac of belief."           -- James V. DeLong
 >
 >
 >      From: Guy Helmer <ghelmer@cs.iastate.edu>
 >      To: freebsd-gnats-submit@freebsd.org, g3d@graphix.g3d.com
 >      Cc:
 >      Subject: Re: bin/10366: /usr/libexec/ld-elf.so.1: Invalid File Format
 >      Date: Thu, 03 Jun 1999 21:39:35 -0500
 >
 >       Did the patches supplied by jdp (or upgrading to a newer release of
 >       FreeBSD) solve the problem?
 >
 >       Guy Helmer
 >       ghelmer@freebsd.org
 >
 >      State-Changed-From-To: open->closed
 >      State-Changed-By: ghelmer
 >      State-Changed-When: Sun Jun 20 20:30:27 CDT 1999
 >      State-Changed-Why:
 >      Pr author didn't respond to query whether the problem still exists;
 >      jdp probably fixed the problem.
 >
 > Submit Followup
 >   ------------------------------------------------------------------------
 > www@freebsd.org
 
 
>Unformatted:
