1 /* $OpenBSD: DEFS.h,v 1.3 2016/09/22 18:19:59 guenther Exp $ */ 2 3 #include <machine/asm.h> 4 5 /* 6 * We define a hidden alias with the prefix "_libc_" for each global symbol 7 * that may be used internally. By referencing _libc_x instead of x, other 8 * parts of libc prevent overriding by the application and avoid unnecessary 9 * relocations. 10 */ 11 #define _HIDDEN(x) _libc_##x 12 #define _HIDDEN_ALIAS(x,y) \ 13 STRONG_ALIAS(_HIDDEN(x),y); \ 14 .hidden _HIDDEN(x) 15 #define _HIDDEN_FALIAS(x,y) \ 16 _HIDDEN_ALIAS(x,y); \ 17 .type _HIDDEN(x),@function 18 19 /* 20 * For functions implemented in ASM that aren't syscalls. 21 * END_STRONG(x) Like DEF_STRONG() in C; for standard/reserved C names 22 * END_WEAK(x) Like DEF_WEAK() in C; for non-ISO C names 23 */ 24 #define END_STRONG(x) END(x); _HIDDEN_FALIAS(x,x); END(_HIDDEN(x)) 25 #define END_WEAK(x) END_STRONG(x); .weak x 26