Skip to content

Instantly share code, notes, and snippets.

@smokku
Created December 28, 2015 17:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smokku/c0b64ec60c95736df7e1 to your computer and use it in GitHub Desktop.
Save smokku/c0b64ec60c95736df7e1 to your computer and use it in GitHub Desktop.
ELF .init_array example
static void my_cool_main(int argc, char* argv[], char* envp[])
{
// your code goes here
}
__attribute__((section(".init_array"))) void (* p_my_cool_main)(int,char*[],char*[]) = &my_cool_main;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment