From dada@freepass.tu-graz.ac.at  Mon Apr 14 03:33:17 1997
Received: from freepass.tu-graz.ac.at (freepass.tu-graz.ac.at [129.27.193.133])
          by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id DAA02103
          for <FreeBSD-gnats-submit@freebsd.org>; Mon, 14 Apr 1997 03:33:14 -0700 (PDT)
Received: (from dada@localhost) by freepass.tu-graz.ac.at (8.6.11/8.6.9) id MAA14101; Mon, 14 Apr 1997 12:32:35 +0200
Message-Id: <199704141032.MAA14101@freepass.tu-graz.ac.at>
Date: Mon, 14 Apr 1997 12:32:35 +0200
From: Martin Kammerhofer <dada@freepass.tu-graz.ac.at>
Reply-To: dada@sbox.tu-graz.ac.at
To: FreeBSD-gnats-submit@freebsd.org
Subject: symorder(1): -t option does not work at all
X-Send-Pr-Version: 3.2

>Number:         3284
>Category:       bin
>Synopsis:       [PATCH] symorder(1): -t option doesnt work at all
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    mikeh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 14 03:40:09 PDT 1997
>Closed-Date:    Fri Dec 20 16:11:39 PST 2002
>Last-Modified:  Fri Dec 20 16:11:39 PST 2002
>Originator:     Martin Kammerhofer
>Release:        FreeBSD 2.2.1-RELEASE i386
>Organization:
Graz University of Technology
>Environment:

	

>Description:
	Option -t of symorder(1) doesnt work.
	Furthermore if the table of excluded symbols specified by
	the -x command line option or the mandatory "symlist" overflow
	(static size SPACE) extra symbols are silently ignored!
	I didnt fix the latter, only increased SPACE.

>How-To-Repeat:

cat >hello.c
#include <stdio.h>

void
main()
{
	printf("Hello wonderful world\n");
}
^D
cc -o hello hello.c
ldd -v hello | grep a_syms
echo start >start
symorder -t start hello
ldd -v hello | grep a_syms	

>Fix:
--- /usr/src/usr.bin/symorder/symorder.c	Fri Nov  3 19:27:18 1995
+++ ./symorder.c	Thu Mar 27 13:26:56 1997
@@ -31,6 +31,8 @@
  * SUCH DAMAGE.
  */
 
+/* $Id$ */
+
 #ifndef lint
 char copyright[] =
 "@(#) Copyright (c) 1980 The Regents of the University of California.\n\
@@ -55,7 +57,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#define SPACE		500
+#define SPACE		0x2000
 
 #define	OKEXIT		0
 #define	NOTFOUNDEXIT	1
@@ -203,6 +205,7 @@
 	if (newstrings == NULL)
 		error(NULL);
 	t = newstrings;
+	i = symkept;
 	for (symp = symtab; --i >= 0; symp++) {
 		if (symp->n_un.n_strx == 0)
 			continue;
@@ -314,6 +317,8 @@
 	register char *nam;
 	register int x;
 
+	if (small && inlist(p) == -1)
+		return (1);
 	if (p->n_type & N_STAB || p->n_un.n_strx == 0)
 		return (0);
 	if (p->n_un.n_strx < sizeof(int) || p->n_un.n_strx >= strtabsize)
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->mikeh 
Responsible-Changed-By: mikeh 
Responsible-Changed-When: Sun Dec 23 00:09:08 PST 2001 
Responsible-Changed-Why:  
I'll take a look at this. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=3284 
State-Changed-From-To: open->closed 
State-Changed-By: mikeh 
State-Changed-When: Fri Dec 20 16:09:53 PST 2002 
State-Changed-Why:  
Submitter request, notes that it is unlikely that this will be used on 
aout binaries. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=3284 
>Unformatted:
