From e1c0eca8177319e39c48a453acaf2858b9d6df2e Mon Sep 17 00:00:00 2001 From: Rob Johnston Date: Fri, 1 Mar 2019 02:53:56 +0000 Subject: Update topo_mod_load() to load the correct plugin version based on the process isa --- usr/src/lib/fm/topo/libtopo/common/topo_mod.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/usr/src/lib/fm/topo/libtopo/common/topo_mod.c b/usr/src/lib/fm/topo/libtopo/common/topo_mod.c index cecb147f21..76f733c2ec 100644 --- a/usr/src/lib/fm/topo/libtopo/common/topo_mod.c +++ b/usr/src/lib/fm/topo/libtopo/common/topo_mod.c @@ -93,6 +93,7 @@ #include #include #include +#include #include #include #include @@ -117,7 +118,7 @@ topo_mod_t * topo_mod_load(topo_mod_t *pmod, const char *name, topo_version_t version) { - char *path; + char *path, isa[257]; char file[PLUGIN_PATH_LEN]; topo_mod_t *mod = NULL; topo_hdl_t *thp; @@ -135,9 +136,14 @@ topo_mod_load(topo_mod_t *pmod, const char *name, } return (mod); } - - (void) snprintf(file, PLUGIN_PATH_LEN, "%s/%s.so", - PLUGIN_PATH, name); +#if __x86_64__ + if (sysinfo(SI_ARCHITECTURE_64, isa, sizeof (isa)) < 0) + isa[0] = '\0'; +#else + isa[0] = '\0'; +#endif + (void) snprintf(file, PLUGIN_PATH_LEN, "%s/%s/%s.so", + PLUGIN_PATH, isa, name); path = topo_search_path(pmod, thp->th_rootdir, (const char *)file); if (path == NULL || (mod = topo_modhash_load(thp, name, path, &topo_rtld_ops, version)) -- cgit v1.2.3