diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2002-11-05 18:04:37 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2002-11-05 18:04:37 +0000 |
commit | 3fce989a20d32b00353a98594a33df05a96e0e75 (patch) | |
tree | 37a3da016498b6346c058edae1e608a21c6f217e /sys | |
parent | ad55f235f85b31b758e887ada54533a8f24dca3a (diff) |
Add a WEAK_ALIAS macro, to be used by libc/libc_r shortly.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/m68k/include/asm.h | 22 | ||||
-rw-r--r-- | sys/arch/vax/include/asm.h | 14 |
2 files changed, 33 insertions, 3 deletions
diff --git a/sys/arch/m68k/include/asm.h b/sys/arch/m68k/include/asm.h index d0035d409c2..98013dfa63f 100644 --- a/sys/arch/m68k/include/asm.h +++ b/sys/arch/m68k/include/asm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm.h,v 1.4 1997/07/06 07:46:22 downsj Exp $ */ +/* $OpenBSD: asm.h,v 1.5 2002/11/05 18:04:35 miod Exp $ */ /* $NetBSD: asm.h,v 1.13 1997/04/24 22:49:39 thorpej Exp $ */ /* @@ -46,11 +46,15 @@ #ifndef _ASM_H_ #define _ASM_H_ +#ifdef __ELF__ +#define _C_LABEL(name) name +#else #ifdef __STDC__ #define _C_LABEL(name) _ ## name #else #define _C_LABEL(name) _/**/name #endif /* __STDC__ */ +#endif #define _ASM_LABEL(name) name @@ -97,6 +101,22 @@ .asciz x ; \ .even +#ifdef __ELF__ +#define WEAK_ALIAS(alias,sym) \ + .weak alias; \ + alias = sym +#else +#ifdef __STDC__ +#define WEAK_ALIAS(alias,sym) \ + .weak _##alias; \ + _##alias = _##sym +#else +#define WEAK_ALIAS(alias,sym) \ + .weak _/**/alias; \ + _/**/alias = _/**/sym +#endif +#endif + /* * Global variables of whatever sort. */ diff --git a/sys/arch/vax/include/asm.h b/sys/arch/vax/include/asm.h index 353b49ad79d..4752c522991 100644 --- a/sys/arch/vax/include/asm.h +++ b/sys/arch/vax/include/asm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm.h,v 1.6 2001/04/09 01:01:25 hugh Exp $ */ +/* $OpenBSD: asm.h,v 1.7 2002/11/05 18:04:36 miod Exp $ */ /* $NetBSD: asm.h,v 1.9 1999/01/15 13:31:28 bouyer Exp $ */ /* * Copyright (c) 1982, 1993 @@ -102,10 +102,20 @@ #define ALTENTRY(x) .globl _C_LABEL(x); _C_LABEL(x): #define RCSID(x) .text; .asciz x -#ifdef __ELF__ +#ifdef __ELF__ #define WEAK_ALIAS(alias,sym) \ .weak alias; \ alias = sym +#else +#ifdef __STDC__ +#define WEAK_ALIAS(alias,sym) \ + .weak _##alias; \ + _##alias = _##sym +#else +#define WEAK_ALIAS(alias,sym) \ + .weak _/**/alias; \ + _/**/alias = _/**/sym +#endif #endif #ifdef __STDC__ |