Subject: asm line separators
To: None <tech-toolchain@netbsd.org>
From: Matt Fredette <fredette@theory.lcs.mit.edu>
List: tech-toolchain
Date: 06/10/2002 10:59:05
Hi. In keeping with HP tradition, gas for hppa recognizes ; as a comment
character, not as a line separator. ! is the line separator.
For now, I'm using the following uncommitted patch to sys/sys/cdefs_elf.h.
It allows the MD cdefs.h to define __ASM_DELIMITER, otherwise it defaults
to ;. Seems like a kludge, looking for comments. Thanks -
Matt
--
Matt Fredette
[snip]
Index: sys/sys/cdefs_elf.h
===================================================================
RCS file: /cvsroot/syssrc/sys/sys/cdefs_elf.h,v
retrieving revision 1.11
diff -u -r1.11 cdefs_elf.h
--- sys/sys/cdefs_elf.h 2002/01/27 07:19:25 1.11
+++ sys/sys/cdefs_elf.h 2002/06/10 13:44:03
@@ -38,6 +38,14 @@
#define _C_LABEL_STRING(x) x
#endif
+#ifdef __ASM_DELIMITER
+#ifndef __STDC__
+#error "__ASM_DELIMITER needs __STDC__"
+#endif
+#else
+#define __ASM_DELIMITER " ; "
+#endif
+
#if __STDC__
#define ___RENAME(x) __asm__(___STRING(_C_LABEL(x)))
#else
@@ -59,13 +67,13 @@
#ifndef __DO_NOT_DO_WEAK__
#define __weak_alias(alias,sym) \
- __asm__(".weak " _C_LABEL_STRING(#alias) " ; " \
+ __asm__(".weak " _C_LABEL_STRING(#alias) __ASM_DELIMITER \
_C_LABEL_STRING(#alias) " = " _C_LABEL_STRING(#sym));
#endif /* !__DO_NOT_DO_WEAK__ */
#define __weak_extern(sym) \
__asm__(".weak " _C_LABEL_STRING(#sym));
#define __warn_references(sym,msg) \
- __asm__(".section .gnu.warning." #sym " ; .ascii \"" msg "\" ; .text");
+ __asm__(".section .gnu.warning." #sym __ASM_DELIMITER ".ascii \"" msg "\"" __ASM_DELIMITER ".text");
#else /* !__STDC__ */
@@ -94,7 +102,7 @@
#if __STDC__
#define __SECTIONSTRING(_sec, _str) \
- __asm__(".section " #_sec " ; .asciz \"" _str "\" ; .text")
+ __asm__(".section " #_sec __ASM_DELIMITER ".asciz \"" _str "\"" __ASM_DELIMITER ".text")
#else
#define __SECTIONSTRING(_sec, _str) \
__asm__(".section _sec ; .asciz _str ; .text")
[snip]