Created
March 19, 2026 12:29
-
-
Save hmenke/e9a8528128d2b2123bdf1afb07f91a85 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // When a reference to SYMBOL is encountered, the linker will emit a warning | |
| // message MSG. We want the .gnu.warning.SYMBOL section to be unallocated. See | |
| // https://sourceware.org/git?p=glibc.git;a=blob;f=include/libc-symbols.h | |
| #if defined(__ELF__) && defined(__GNUC__) | |
| #define __sec_comment "\n\t#" | |
| #define link_warning(symbol, msg) \ | |
| __asm__(".section .gnu.warning." #symbol "\n\t.previous"); \ | |
| static const char __evoke_link_warning_##symbol[] \ | |
| __attribute__((used, section(".gnu.warning." #symbol __sec_comment))) = \ | |
| msg; | |
| #else | |
| #define link_warning(symbol, msg) | |
| #endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment