From: jsg Date: Wed, 23 Feb 2022 07:16:26 +0000 (+0000) Subject: unifdef __ELF__ X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7ba425bace9003a822c92ac240fb5e3e1151315d;p=openbsd unifdef __ELF__ ok guenther@ --- diff --git a/sys/arch/arm64/include/asm.h b/sys/arch/arm64/include/asm.h index c970de2a680..643a19c9889 100644 --- a/sys/arch/arm64/include/asm.h +++ b/sys/arch/arm64/include/asm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm.h,v 1.6 2019/05/04 16:18:35 kettenis Exp $ */ +/* $OpenBSD: asm.h,v 1.7 2022/02/23 07:16:26 jsg Exp $ */ /* $NetBSD: asm.h,v 1.4 2001/07/16 05:43:32 matt Exp $ */ /* @@ -38,16 +38,8 @@ #ifndef _MACHINE_ASM_H_ #define _MACHINE_ASM_H_ -#ifdef __ELF__ -# define _C_LABEL(x) x -#else -# ifdef __STDC__ -# define _C_LABEL(x) _ ## x -# else -# define _C_LABEL(x) _/**/x -# endif -#endif -#define _ASM_LABEL(x) x +#define _C_LABEL(x) x +#define _ASM_LABEL(x) x #ifdef __STDC__ # define __CONCAT(x,y) x ## y @@ -139,7 +131,7 @@ #define EENTRY(sym) .globl sym; sym: #define EEND(sym) -#if defined(__ELF__) && defined(__PIC__) +#ifdef __PIC__ #ifdef __STDC__ #define PIC_SYM(x,y) x ## ( ## y ## ) #else @@ -149,27 +141,21 @@ #define PIC_SYM(x,y) x #endif -#ifdef __ELF__ #define STRONG_ALIAS(alias,sym) \ .global alias; \ alias = sym #define WEAK_ALIAS(alias,sym) \ .weak alias; \ alias = sym -#endif #ifdef __STDC__ #define WARN_REFERENCES(sym,msg) \ .stabs msg ## ,30,0,0,0 ; \ .stabs __STRING(_C_LABEL(sym)) ## ,1,0,0,0 -#elif defined(__ELF__) -#define WARN_REFERENCES(sym,msg) \ - .stabs msg,30,0,0,0 ; \ - .stabs __STRING(sym),1,0,0,0 #else #define WARN_REFERENCES(sym,msg) \ .stabs msg,30,0,0,0 ; \ - .stabs __STRING(_/**/sym),1,0,0,0 -#endif /* __STDC__ */ + .stabs __STRING(sym),1,0,0,0 +#endif #endif /* !_MACHINE_ASM_H_ */ diff --git a/sys/arch/riscv64/include/asm.h b/sys/arch/riscv64/include/asm.h index 156f7dfc932..746c35531d0 100644 --- a/sys/arch/riscv64/include/asm.h +++ b/sys/arch/riscv64/include/asm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm.h,v 1.2 2021/05/12 01:20:52 jsg Exp $ */ +/* $OpenBSD: asm.h,v 1.3 2022/02/23 07:16:26 jsg Exp $ */ /* * Copyright (c) 2020 Brian Bamsch @@ -38,16 +38,8 @@ #ifndef _MACHINE_ASM_H_ #define _MACHINE_ASM_H_ -#ifdef __ELF__ -# define _C_LABEL(x) x -#else -# ifdef __STDC__ -# define _C_LABEL(x) _ ## x -# else -# define _C_LABEL(x) _/**/x -# endif -#endif -#define _ASM_LABEL(x) x +#define _C_LABEL(x) x +#define _ASM_LABEL(x) x #ifdef __STDC__ # define __CONCAT(x,y) x ## y @@ -99,7 +91,7 @@ #define EENTRY(sym) .globl sym; sym: #define EEND(sym) -#if defined(__ELF__) && defined(__PIC__) +#ifdef __PIC__ #ifdef __STDC__ #define PIC_SYM(x,y) x ## ( ## y ## ) #else @@ -109,28 +101,22 @@ #define PIC_SYM(x,y) x #endif -#ifdef __ELF__ #define STRONG_ALIAS(alias,sym) \ .global alias; \ alias = sym #define WEAK_ALIAS(alias,sym) \ .weak alias; \ alias = sym -#endif #ifdef __STDC__ #define WARN_REFERENCES(sym,msg) \ .stabs msg ## ,30,0,0,0 ; \ .stabs __STRING(_C_LABEL(sym)) ## ,1,0,0,0 -#elif defined(__ELF__) -#define WARN_REFERENCES(sym,msg) \ - .stabs msg,30,0,0,0 ; \ - .stabs __STRING(sym),1,0,0,0 #else #define WARN_REFERENCES(sym,msg) \ .stabs msg,30,0,0,0 ; \ - .stabs __STRING(_/**/sym),1,0,0,0 -#endif /* __STDC__ */ + .stabs __STRING(sym),1,0,0,0 +#endif #define WEAK_REFERENCE(sym, alias) \ .weak alias; \