1 /* $OpenBSD: DEFS.h,v 1.1 2016/09/12 19:47:02 guenther Exp $ */ 2 3 /* 4 * Written by Philip Guenther <guenther@openbsd.org> 5 */ 6 7 #include <machine/asm.h> 8 9 /* 10 * We define a hidden alias with the prefix "_libm_" for each global symbol 11 * that may be used internally. By referencing _libm_x instead of x, other 12 * parts of libm prevent overriding by the application and avoid unnecessary 13 * relocations. 14 */ 15 #define _HIDDEN(x) _libm_##x 16 #define _HIDDEN_ALIAS(x,y) \ 17 STRONG_ALIAS(_HIDDEN(x),y); \ 18 .hidden _HIDDEN(x) 19 #define _HIDDEN_FALIAS(x,y) \ 20 _HIDDEN_ALIAS(x,y); \ 21 .type _HIDDEN(x),@function 22 23 /* 24 * For functions implemented in ASM that are used internally 25 * END_STD(x) Like DEF_STD() in C; for standard/reserved C names 26 * END_NONSTD(x) Like DEF_NONSTD() in C; for non-ISO C names 27 */ 28 #define END_STD(x) END(x); _HIDDEN_FALIAS(x,x); END(_HIDDEN(x)) 29 #define END_NONSTD(x) END_STD(x); .weak x 30