NetBSD Problem Report #7314

Received: (qmail 24368 invoked from network); 3 Apr 1999 15:02:52 -0000
Message-Id: <199904031503.BAA17837@zen.quick.com.au>
Date: Sun, 4 Apr 1999 01:03:04 +1000 (EST)
From: "Simon J. Gerraty" <sjg@quick.com.au>
Reply-To: sjg@netbsd.org
To: gnats-bugs@gnats.netbsd.org
Subject: machine/asm.h should indicate if underscores used in C labels.
X-Send-Pr-Version: 3.95

>Number:         7314
>Category:       toolchain
>Synopsis:       machine/asm.h should indicate if underscores used in C labels.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Apr 03 07:05:00 +0000 1999
>Closed-Date:    Sat Apr 03 07:07:25 +0000 2004
>Last-Modified:  Sat Apr 03 07:07:25 +0000 2004
>Originator:     Simon J. Gerraty
>Release:        99-04-01
>Organization:
Zen Programming...
>Environment:

System: NetBSD zen.quick.com.au 1.3.2 NetBSD 1.3.2 (ZEN-PUC) #4: Thu Feb 11 17:34:27 EST 1999 root@zen.quick.com.au:/u3/NetBSD/1.3.2/src/sys/arch/i386/compile/ZEN-PUC i386


>Description:

Sorry, Category should really be port-* but I figured that would cause
problems :-)

src/sys/arch/*/include/asm.h defines macros like _C_LABEL() that hide 
the fact that _ is used on some architectures and not others.  
But since one cannot do:

__STRING(_C_LABEL(write)), to get "write" or "_write" as the case may be,
it would be very handy if there were a #define somewhere that simply 
indicated that _ is needed.

Why? I'm hacking on the JDK 1.2 sources and trying to make as much of it as 
possible - simply "work" on various architectures.  In so doing I'd
prefer to avoid the JDK having to track for itself whether i386 uses _
this week or not (since we know it will change soon).

Adding something like:

#define _C_LABEL_UNDERSCORE "_"

to src/sys/arch/*/include/asm.h (where appropriate) would make life much 
easier.  As I could then use

#ifndef _C_LABEL_UNDERSCORE
# define _C_LABEL_UNDERSCORE ""
#endif
...
	_C_LABEL_UNDERSCORE "read",
	_C_LABEL_UNDERSCORE "write",

etc in the list of lables that the JDK needs to lookup in libc.
An equivalent macro that allowed one to produce the string "_read" or "read"
as appropriate would be eqally useful.

--sjg

>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:

From: Klaus Klein <kleink@ira.uka.de>
To: sjg@quick.com.au
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: misc/7314: machine/asm.h should indicate if underscores used in C 
         labels.
Date: 03 Apr 1999 18:28:36 +0200

 Simon J Gerraty <sjg@quick.com.au> writes:

 > Adding something like:

 > #define _C_LABEL_UNDERSCORE "_"

 If this functionality gets added, I'd strongly prefer calling it
 _C_LABEL_PREFIX rather than _C_LABEL_UNDERSCORE; the former name fits
 semantically better.

From: "Simon J. Gerraty" <sjg@quick.com.au>
To: Klaus Klein <kleink@ira.uka.de>
Cc: sjg@quick.com.au, gnats-bugs@gnats.netbsd.org
Subject: Re: misc/7314: machine/asm.h should indicate if underscores used in C labels. 
Date: Sun, 04 Apr 1999 19:24:02 +1000

 > If this functionality gets added, I'd strongly prefer calling it
 > _C_LABEL_PREFIX rather than _C_LABEL_UNDERSCORE; the former name fits
 > semantically better.

 Yes, that sounds better.

 --sjg
State-Changed-From-To: open->feedback 
State-Changed-By: mrg 
State-Changed-When: Fri Apr 2 07:32:57 UTC 2004 
State-Changed-Why:  
this appears to be solvable via: 

#if !defined(__ELF__) || defined(__LEADING_UNDERSCORE) 
... has leading underscore 
#else 
... 
#endif 

for netbsd.  is that sufficient? 

thanks. 

From: Simon Gerraty <sjg@juniper.net>
To: gnats-bugs@gnats.netbsd.org
Cc: mrg@netbsd.org, misc-bug-people@netbsd.org
Subject: Re: toolchain/7314 
Date: Fri, 02 Apr 2004 13:22:06 -0800

 Sounds good to me - thanks
 --sjg

 On 2 Apr 2004 07:34:41 -0000, mrg@netbsd.org writes:
 >Synopsis: machine/asm.h should indicate if underscores used in C labels.
 >
 >State-Changed-From-To: open->feedback
 >State-Changed-By: mrg
 >State-Changed-When: Fri Apr 2 07:32:57 UTC 2004
 >State-Changed-Why: 
 >this appears to be solvable via:
 >
 >#if !defined(__ELF__) || defined(__LEADING_UNDERSCORE)
 >... has leading underscore
 >#else
 >...
 >#endif
 >
 >for netbsd.  is that sufficient?
 >
 >thanks.
State-Changed-From-To: feedback->closed 
State-Changed-By: mrg 
State-Changed-When: Sat Apr 3 07:06:57 UTC 2004 
State-Changed-Why:  
NetBSD CPP solution provided :-) 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.