Forked from mgalgs/hacking-your-ELF-for-fun-and-profit.c
Created
June 10, 2020 09:40
-
-
Save jubnzv/1890988f08a47a646cba5f6b61f0fcc4 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