/* $OpenBSD: DEFS.h,v 1.5 2023/12/11 22:24:15 kettenis Exp $ */ #include /* * We define a hidden alias with the prefix "_libc_" for each global symbol * that may be used internally. By referencing _libc_x instead of x, other * parts of libc prevent overriding by the application and avoid unnecessary * relocations. */ #define _HIDDEN(x) _libc_##x #define _HIDDEN_ALIAS(x,y) \ STRONG_ALIAS(_HIDDEN(x),y); \ .hidden _HIDDEN(x) #define _HIDDEN_FALIAS(x,y) \ _HIDDEN_ALIAS(x,y); \ .type _HIDDEN(x),@function /* * For functions implemented in ASM that aren't syscalls. * END_STRONG(x) Like DEF_STRONG() in C; for standard/reserved C names * END_WEAK(x) Like DEF_WEAK() in C; for non-ISO C names */ #define END_STRONG(x) END(x); _HIDDEN_FALIAS(x,x); END(_HIDDEN(x)) #define END_WEAK(x) END_STRONG(x); .weak x #define PINSYSCALL(sysno, label) \ .pushsection .openbsd.syscalls,"",@progbits; \ .p2align 2; \ .long label; \ .long sysno; \ .popsection;