aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2019-10-01 11:10:28 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2019-10-01 11:18:36 +0200
commit6f42df1ed42331d115991bbb1937df15b160bdfc (patch)
treeb896c2ebc6ba255218d16d67548be0c17ffc3e11
parent84d1859e9b64cc100251370c0412241108dd5b10 (diff)
Improve detection of the bindings
The symbol 'afbBindingV3root' may be defined in shared libraries that are not bindings. Using it to detect bindings v3 can lead to false detection and errors. Bug-AGL: SPEC-2841 Signed-off-by: José Bollo <jose.bollo@iot.bzh> Change-Id: Ib2bc77d95e3306e7b4a883136ce27c92f8524a8d
-rw-r--r--src/afb-api-so-v3.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/afb-api-so-v3.c b/src/afb-api-so-v3.c
index 230a93fc..bef27e2e 100644
--- a/src/afb-api-so-v3.c
+++ b/src/afb-api-so-v3.c
@@ -75,16 +75,16 @@ int afb_api_so_v3_add(const char *path, void *handle, struct afb_apiset *declare
struct afb_api_v3 *api;
struct afb_export *export;
- /* retrieves the register function */
- a.root = dlsym(handle, afb_api_so_v3_root);
+ /* retrieves important exported symbols */
a.desc = dlsym(handle, afb_api_so_v3_desc);
a.entry = dlsym(handle, afb_api_so_v3_entry);
- if (!a.root && !a.desc && !a.entry)
+ if (!a.desc && !a.entry)
return 0;
INFO("binding [%s] looks like an AFB binding V3", path);
/* basic checks */
+ a.root = dlsym(handle, afb_api_so_v3_root);
if (!a.root) {
ERROR("binding [%s] incomplete symbol set: %s is missing",
path, afb_api_so_v3_root);