Skip to content

Instantly share code, notes, and snippets.

@kateinoigakukun
Last active January 28, 2020 11:43
Show Gist options
  • Save kateinoigakukun/cf4de60310ac7be30b69fbc3a5500e0d to your computer and use it in GitHub Desktop.
Save kateinoigakukun/cf4de60310ac7be30b69fbc3a5500e0d to your computer and use it in GitHub Desktop.
#include <dlfcn.h>
#include <stdio.h>
int main(void) {
void *handle = dlopen("/home/katei/.swiftenv/versions/5.1.3-RELEASE/usr/lib/swift/linux/libswiftCore.so", RTLD_LAZY);
char *start = dlsym(handle, "__start_swift5_protocols");
printf("start = %p", start);
return 0;
}
@kateinoigakukun
Copy link
Author

$ SWIFT_LIBS=/home/katei/.swiftenv/versions/5.1.3-RELEASE/usr/lib/swift/linux
$ clang main.c -ldl -L$SWIFT_LIBS -lswiftCore -rpath $SWIFT_LIBS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment