From nobody@FreeBSD.ORG Mon Sep 13 09:27:19 1999
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 9248414CAC; Mon, 13 Sep 1999 09:27:19 -0700 (PDT)
Message-Id: <19990913162719.9248414CAC@hub.freebsd.org>
Date: Mon, 13 Sep 1999 09:27:19 -0700 (PDT)
From: papowell@astart.com
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@freebsd.org
Subject: strip(1) exits with an error on script file - causes severe portability problems
X-Send-Pr-Version: www-1.0

>Number:         13729
>Category:       gnu
>Synopsis:       strip(1) exits with an error on script file - causes severe portability problems
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 13 09:30:01 PDT 1999
>Closed-Date:    Fri Jul 20 20:47:41 PDT 2001
>Last-Modified:  Fri Jul 20 20:49:20 PDT 2001
>Originator:     Patrick Powell
>Release:        3.2-Release, 4-Current
>Organization:
Astart Technologies
>Environment:
>Description:
strip(1) fails with an error when asked to strip shell
scripts.  This behavior is documented as follows:

DESCRIPTION
       GNU strip discards all symbols from the object files
       objfile.  The list of object files may include archives.
       At least one object file must be given.


       strip modifies the files named in its argument, rather
       than writing modified copies under different names.

In many install scripts for code you have:
  $(INSTALL) -s .... 
              ^^^ -s specified for ALL installable executable
              objects including perl scripts, shell, scripts,
              etc.


This requires a huge amount of effort when porting to FreeBSD because
you now have to determine which executables can or cannot be stripped.

I strongly recommend you do a test in the strip code for ALLOWABLE
magic numbers,  strip those,  and ignore the rest.I 
>How-To-Repeat:
strip a shell script - you get an error.
More seri
>Fix:
1. modify man page to indicate that strip only works on object
    files or executable files,  and ignores others
2. modify action so that it checks to see if it has an allowable
     item to strip and then does it.

In the strip code,  find the place where it checks for 'magic numbers'
of allowable executables,  and rather than exiting with a non-zero
error code, simply exit with a 0 error code or continue to the
next file to strip.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports->freebsd-bugs 
Responsible-Changed-By: cpiazza 
Responsible-Changed-When: Mon Sep 13 11:17:37 PDT 1999 
Responsible-Changed-Why:  
Misfiled PR 
State-Changed-From-To: open->feedback 
State-Changed-By: mike 
State-Changed-When: Fri Jul 20 18:07:02 PDT 2001 
State-Changed-Why:  

Does this problem still occur in newer versions of FreeBSD, 
such as 4.3-RELEASE? 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=13729 
State-Changed-From-To: feedback->closed 
State-Changed-By: mike 
State-Changed-When: Fri Jul 20 20:47:41 PDT 2001 
State-Changed-Why:  

After taking a closer look it appears this is expected behaviour 
and furthermore is documented in the strip(1) man page. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=13729 
>Unformatted:
