+ static int dlopen_flags = 0;
+
+ /* compute the dlopen flags */
+ if (dlopen_flags == 0) {
+ /* For ASan mode, export AFB_NO_RTLD_DEEPBIND=1, to disable RTLD_DEEPBIND */
+ char *string = secure_getenv("AFB_NO_RTLD_DEEPBIND");
+ if (string && string[0] == '1' && string[1] == 0)
+ dlopen_flags = RTLD_NOW | RTLD_LOCAL;
+ else
+ dlopen_flags = RTLD_NOW | RTLD_LOCAL | RTLD_DEEPBIND;
+ }