#include "afb-api-so.h"
#include "afb-api-so-v1.h"
#include "afb-api-so-v2.h"
+#include "afb-api-so-vdyn.h"
#include "verbose.h"
#include "sig-monitor.h"
// This is a loadable library let's check if it's a binding
rc = -!!force;
- handle = safe_dlopen(path, RTLD_NOW | RTLD_LOCAL);
+ handle = safe_dlopen(path, RTLD_NOW | RTLD_LOCAL | RTLD_DEEPBIND);
if (handle == NULL) {
if (force)
ERROR("binding [%s] not loadable: %s", path, dlerror());
if (rc)
return 0; /* yes version 2 */
+ /* try the version dyn */
+ rc = afb_api_so_vdyn_add(path, handle, apiset);
+ if (rc < 0) {
+ /* error when loading a valid dyn binding */
+ goto error2;
+ }
+ if (rc)
+ return 0; /* yes version dyn */
+
/* try the version 1 */
rc = afb_api_so_v1_add(path, handle, apiset);
if (rc < 0) {