Created
January 27, 2015 09:35
-
-
Save iwagaki/f9e1d26560f941362617 to your computer and use it in GitHub Desktop.
gcc hello world
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
#include <stdio.h> | |
__attribute__((section(".plt"))) main; | |
__attribute__((constructor, destructor)) void _() { | |
if (main) { | |
__attribute__((cleanup(puts))) char _[] = "world!"; | |
} else { | |
__attribute__((cleanup(printf))) char _[] = "Hello, "; | |
main = 0xc3; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment