Subject: misc/7314: machine/asm.h should indicate if underscores used in C labels.
To: None <gnats-bugs@gnats.netbsd.org>
From: Simon J. Gerraty <sjg@quick.com.au>
List: netbsd-bugs
Date: 04/04/1999 01:03:04
>Number: 7314
>Category: misc
>Synopsis: machine/asm.h should indicate if underscores used in C labels.
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: misc-bug-people (Misc Bug People)
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Sat Apr 3 07:05:00 1999
>Last-Modified:
>Originator: Simon J. Gerraty
>Organization:
Zen Programming...
>Release: 99-04-01
>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:
>Audit-Trail:
>Unformatted: