X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-api-so.c;h=acdb9b57342f364744e4321fab4947ba5df516c2;hb=214006b8633c6676a9f5ed2ab5c16e98829807d1;hp=cfa992e844753fd87d971ef66d3626ec80e3e586;hpb=8a4e3b4a91e6aaabd24127bbbff963e449e8deab;p=src%2Fapp-framework-binder.git diff --git a/src/afb-api-so.c b/src/afb-api-so.c index cfa992e8..acdb9b57 100644 --- a/src/afb-api-so.c +++ b/src/afb-api-so.c @@ -27,6 +27,7 @@ #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" @@ -65,12 +66,12 @@ static int load_binding(const char *path, int force, struct afb_apiset *apiset) // 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()); else - INFO("binding [%s] not loadable: %s", path, dlerror()); + WARNING("binding [%s] not loadable: %s", path, dlerror()); goto error; } @@ -83,6 +84,15 @@ static int load_binding(const char *path, int force, struct afb_apiset *apiset) 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) {