static void __attribute__((constructor)) init(void) { char handle[128]; find_or_make_array_variable("DLHANDLES", 3); // RTLD_NEXT and RTLD_DEFAULT are special handles for dlsym. These are // stored as strings rather than integers, as otherwise they can // be interpreted as flags (they are small negative integers cast to // void*). snprintf(handle, sizeof handle, "%p", RTLD_NEXT); bind_variable("RTLD_NEXT", handle, 0); snprintf(handle, sizeof handle, "%p", RTLD_DEFAULT); bind_variable("RTLD_DEFAULT", handle, 0); }
static void __attribute__((constructor)) init(void) { find_or_make_array_variable("DLHANDLES", 3); bind_int_variable("RTLD_NEXT", "-1"); bind_int_variable("RTLD_DEFAULT", "0"); }