Subject: pkg/15141: Leading underscores trimmed by bfd-crunchide
To: None <gnats-bugs@gnats.netbsd.org>
From: David Querbach <querbach@realtime.bc.ca>
List: netbsd-bugs
Date: 01/04/2002 14:14:22
>Number:         15141
>Category:       pkg
>Synopsis:       Leading underscores trimmed by bfd-crunchide
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 04 14:15:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     David Querbach
>Release:        NetBSD-20020103, NetBSD-1-5-2
>Organization:
Real-Time Systems Inc.
	
>Environment:
	
System: NetBSD qingdao 1.5.1 NetBSD 1.5.1 (RAID) #0: Tue Jul 17 22:25:40 PDT 2001 root@qingdao:/usr/src/sys/arch/i386/compile/RAID i386


>Description:
	bfd-crunchide trims leading underscores from symbol names before it
	hides them.  This conflicts with the makefiles generated by
	crunchgen, which assumes the underscores are still there.
>How-To-Repeat:
	Use bfd-crunchide to hide symbols in a two or more programs, say
	"foo" and "bar".  Use crunchgen to crunch the programs together. 
	Note unresolved symbols for "_crunched_foo_stub" and
	"_crunched_bar_stub".  
>Fix:
	Apply the following patch:

*** crunchide.c~        Fri Jan  4 12:22:19 2002
--- crunchide.c Fri Jan  4 12:22:42 2002
***************
*** 297,304 ****
                        continue;
  
                symname = bfd_asymbol_name(new_symtable[i]);
-               if (symname[0] == '_')
-                       symname++;
                if (in_keep_list(symname))
                        continue;
  
--- 297,302 ----
>Release-Note:
>Audit-Trail:
>Unformatted: