Forked from mgalgs/hacking-your-ELF-for-fun-and-profit.c
Created
August 27, 2020 09:49
-
-
Save uttaravadina/d8eb159d4b2154d7129cc8c04e708e64 to your computer and use it in GitHub Desktop.
This file contains 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
#define __define_initcall(level,fn,id) \ | |
static initcall_t __initcall_##fn##id __used \ | |
__attribute__((__section__(".initcall" level ".init"))) = fn | |
#define core_initcall(fn) __define_initcall("1",fn,1) | |
#define subsys_initcall(fn) __define_initcall("4",fn,4) | |
#define late_initcall(fn) __define_initcall("7",fn,7) | |
/* trimmed, obviously... */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment