diff options
| author | 2002-08-11 12:13:16 +0000 | |
|---|---|---|
| committer | 2002-08-11 12:13:16 +0000 | |
| commit | 96020122e32def14a782e7948ca40030ce56f2e9 (patch) | |
| tree | d68c90d3a8538fba6b8e6ac9d51c7f4b3c03b360 /sys/arch/sparc/include/asm.h | |
| parent | SCARG cleanup; okay millert@ (diff) | |
| download | wireguard-openbsd-96020122e32def14a782e7948ca40030ce56f2e9.tar.xz wireguard-openbsd-96020122e32def14a782e7948ca40030ce56f2e9.zip | |
Prepare for ELF.
Diffstat (limited to 'sys/arch/sparc/include/asm.h')
| -rw-r--r-- | sys/arch/sparc/include/asm.h | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/sys/arch/sparc/include/asm.h b/sys/arch/sparc/include/asm.h index d1f4082b5f0..d3382f94cda 100644 --- a/sys/arch/sparc/include/asm.h +++ b/sys/arch/sparc/include/asm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm.h,v 1.2 1997/08/08 08:26:02 downsj Exp $ */ +/* $OpenBSD: asm.h,v 1.3 2002/08/11 12:13:16 art Exp $ */ /* $NetBSD: asm.h,v 1.5 1997/07/16 15:16:43 christos Exp $ */ /* @@ -45,13 +45,36 @@ #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 +#endif #define _ASM_LABEL(name) name +/* + * WEAK_ALIAS: create a weak alias (ELF only) + */ +#ifdef __ELF__ +#define WEAK_ALIAS(alias,sym) \ + .weak alias; \ + alias = sym +#endif + +/* + * WARN_REFERENCES: create a warning if the specified symbol is referenced + * (ELF only). + */ +#ifdef __ELF__ +#define WARN_REFERENCES(_sym,_msg) \ + .section .gnu.warning. ## _sym ; .ascii _msg ; .text +#endif /* __ELF__ */ + + #ifdef PIC /* * PIC_PROLOGUE() is akin to the compiler generated function prologue for @@ -61,8 +84,8 @@ */ #define PIC_PROLOGUE(dest,tmp) \ mov %o7,tmp; 3: call 4f; nop; 4: \ - sethi %hi(__GLOBAL_OFFSET_TABLE_-(3b-.)),dest; \ - or dest,%lo(__GLOBAL_OFFSET_TABLE_-(3b-.)),dest; \ + sethi %hi(_C_LABEL(_GLOBAL_OFFSET_TABLE_)-(3b-.)),dest; \ + or dest,%lo(_C_LABEL(_GLOBAL_OFFSET_TABLE_)-(3b-.)),dest; \ add dest,%o7,dest; mov tmp,%o7 /* |
