Skip to content

Instantly share code, notes, and snippets.

@simonask
Created March 16, 2009 08:55
Show Gist options
  • Save simonask/79797 to your computer and use it in GitHub Desktop.
Save simonask/79797 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <dlfcn.h>
extern "C" int foo() {
puts("LOOOOOL");
}
int main() {
void* handle = dlopen(NULL, RTLD_NOW);
int(*my_foo)() = dlsym(handle, "foo");
my_foo();
dlclose(handle);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment