Subject: bin/10067: strip -K fails
To: None <gnats-bugs@gnats.netbsd.org>
From: John Hawkinson <jhawk@mit.edu>
List: netbsd-bugs
Date: 05/07/2000 23:46:10
>Number:         10067
>Category:       bin
>Synopsis:       strip -K fails
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 07 23:47:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     John Hawkinson
>Release:        NetBSD-1.4 as well as -current
>Organization:
	MIT
>Environment:
	
System: NetBSD zorkmid.mit.edu 1.4.2 NetBSD 1.4.2 (ZORKMID) #101: Wed Apr 19 22:29:43 EDT 2000 jhawk@zorkmid.mit.edu:/usr/src/sys/arch/i386/compile/ZORKMID i386


>Description:
	strip -K fails to preserve symbols when run on a.out-i386-netbsd;
it appears to just strip all symbols.

	objcopy -S seems to fail similarly; it's not clear what
the interaction between -K and "strip-all" is supposed to be, however.

	Mycroft reports this fails under -current with ELF as well.
>How-To-Repeat:
	strip -K _pcic_isa_alloc_mask /netbsd
	nm /netbsd


Observe no symbols.
>Fix:
	A workaround appears to be to use objcopy, i.e.
	objcopy --strip-unneeded -K _pcic_isa_alloc_mask /netbsd

	Err, it seems that strip has a --strip-unneeded flag as well.
	Perhaps that's necessary as well.

	I guess it could be argued that this behavior is intentional,
	but if so, the docs should probably be clarified. But it sure
	seems that -K should imply --strip-unneeded or suchlike.
>Release-Note:
>Audit-Trail:
>Unformatted: