/* Compile this with gcc -shared -fPIC -o libfoo.so foo.c */ #include static void woot(void) __attribute__((constructor)); static void woot(void) { fprintf(stderr, "HELLO!\n"); }