Subject: bin/218: no subject (file transmission)
To: None <gnats-admin>
From: Bob Kemp <rsk@ecs.soton.ac.uk>
List: netbsd-bugs
Date: 04/09/1994 15:05:01
>Number:         218
>Category:       bin
>Synopsis:       "ldd /usr/libexec/ld.so" core dumps with signal 11
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Apr  9 15:05:01 1994
>Originator:     Bob Kemp
>Organization:
	ECS Dept, Southampton University, UK
>Release:        
>Environment:
	-current 05Mar94
System: NetBSD allegory 0.9a ALLEGORY#0 i386


>Description:

	The shared library dynamic loader will happily try to
	execute shared libraries if they have execute permissions
	set.  It then core dumps with a signal 11 (segmentation
	violation).

	The prime example of this is /usr/libexec/ld.so but after
	chmod'ing (say) /usr/lib/libc.so.* to add execute bits,
	ldd core dumps when run on these too.  The "ldd" program
	needs an extra test.

>How-To-Repeat:

	ldd /usr/libexec/ld.so

>Fix:

If I've understood it right, this fixes things.

*** ldd.c.orig	Sat Jan 29 10:24:53 1994
--- ldd.c	Fri Apr  8 23:52:04 1994
***************
*** 96,102 ****
  			continue;
  		}
  		if (read(fd, &hdr, sizeof hdr) != sizeof hdr ||
! 					!(N_GETFLAG(hdr) & EX_DYNAMIC)) {
  			fprintf(stderr, "%s: not a dynamic executable\n",
  						*argv);
  			(void)close(fd);
--- 96,103 ----
  			continue;
  		}
  		if (read(fd, &hdr, sizeof hdr) != sizeof hdr ||
! 					!(N_GETFLAG(hdr) & EX_DYNAMIC) ||
! 					hdr.a_entry < 4096) {
  			fprintf(stderr, "%s: not a dynamic executable\n",
  						*argv);
  			(void)close(fd);


>Audit-Trail:
>Unformatted:

------------------------------------------------------------------------------