Remove fipscanister build functionality from makefiles.
[openssl.git] / crypto / dso / dso_dl.c
index 2de01b09e1cd93710a1e92ac4ad6c13c9d783866..0a6986745335c0988fc39b001630808e8d520854 100644 (file)
@@ -86,6 +86,7 @@ static int dl_ctrl(DSO *dso, int cmd, long larg, void *parg);
 static char *dl_name_converter(DSO *dso, const char *filename);
 static char *dl_merger(DSO *dso, const char *filespec1, const char *filespec2);
 static int dl_pathbyaddr(void *addr,char *path,int sz);
+static void *dl_globallookup(const char *name);
 
 static DSO_METHOD dso_meth_dl = {
        "OpenSSL 'dl' shared library method",
@@ -103,7 +104,8 @@ static DSO_METHOD dso_meth_dl = {
        dl_merger,
        NULL, /* init */
        NULL, /* finish */
-       dl_pathbyaddr
+       dl_pathbyaddr,
+       dl_globallookup
        };
 
 DSO_METHOD *DSO_METHOD_dl(void)
@@ -122,7 +124,7 @@ static int dl_load(DSO *dso)
        shl_t ptr = NULL;
        /* We don't do any fancy retries or anything, just take the method's
         * (or DSO's if it has the callback set) best translation of the
-        * platform-independant filename and try once with that. */
+        * platform-independent filename and try once with that. */
        char *filename= DSO_convert_filename(dso, NULL);
 
        if(filename == NULL)
@@ -130,7 +132,8 @@ static int dl_load(DSO *dso)
                DSOerr(DSO_F_DL_LOAD,DSO_R_NO_FILENAME);
                goto err;
                }
-       ptr = shl_load(filename, BIND_IMMEDIATE|DYNAMIC_PATH, 0L);
+       ptr = shl_load(filename, BIND_IMMEDIATE |
+               (dso->flags&DSO_FLAG_NO_NAME_TRANSLATION?0:DYNAMIC_PATH), 0L);
        if(ptr == NULL)
                {
                DSOerr(DSO_F_DL_LOAD,DSO_R_LOAD_FAILED);
@@ -312,7 +315,7 @@ static char *dl_merger(DSO *dso, const char *filespec1, const char *filespec2)
  * unlikely that both the "dl" *and* "dlfcn" variants are being compiled at the
  * same time, there's no great duplicating the code. Figuring out an elegant 
  * way to share one copy of the code would be more difficult and would not
- * leave the implementations independant. */
+ * leave the implementations independent. */
 #if defined(__hpux)
 static const char extension[] = ".sl";
 #else
@@ -356,7 +359,12 @@ static int dl_pathbyaddr(void *addr,char *path,int sz)
        struct shl_descriptor inf;
        int i,len;
 
-       if (addr == NULL) addr = dl_pathbyaddr;
+       if (addr == NULL)
+               {
+               union   { int(*f)(void*,char*,int); void *p; } t =
+                       { dl_pathbyaddr };
+               addr = t.p;
+               }
 
        for (i=-1;shl_get_r(i,&inf)==0;i++)
                {
@@ -374,4 +382,12 @@ static int dl_pathbyaddr(void *addr,char *path,int sz)
 
        return -1;
        }
+
+static void *dl_globallookup(const char *name)
+       {
+       void *ret;
+       shl_t h = NULL;
+
+       return shl_findsym(&h,name,TYPE_UNDEFINED,&ret) ? NULL : ret;
+       }
 #endif /* DSO_DL */