5 extern struct Foo imported
;
8 // LIB_NAME defined on commandline
9 std::string libname
{"./"};
12 void *handle
= dlopen(libname
.c_str(), RTLD_NOW
);
13 struct Foo
*foo
= (struct Foo
*)dlsym(handle
, "global_foo");
14 assert(foo
!= nullptr);
16 // Unload dylib (important on Linux so a program re-run loads
17 // an updated version of the dylib and destroys the old lldb module).