]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/dso/dso_dl.c
Remove several unused undocumented functions.
[thirdparty/openssl.git] / crypto / dso / dso_dl.c
index 72ca4544aa596fc9447012bc4cc1795cd4f02802..5a138b3082122daca8dc85172423161467b2c2c7 100644 (file)
 
 static int dl_load(DSO *dso);
 static int dl_unload(DSO *dso);
-static void *dl_bind_var(DSO *dso, const char *symname);
 static DSO_FUNC_TYPE dl_bind_func(DSO *dso, const char *symname);
 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",
     dl_load,
     dl_unload,
-    dl_bind_var,
     dl_bind_func,
     NULL,                       /* ctrl */
     dl_name_converter,
     dl_merger,
     NULL,                       /* init */
     NULL,                       /* finish */
-    dl_pathbyaddr,
     dl_globallookup
 };
 
@@ -164,32 +160,6 @@ static int dl_unload(DSO *dso)
     return (1);
 }
 
-static void *dl_bind_var(DSO *dso, const char *symname)
-{
-    shl_t ptr;
-    void *sym;
-
-    if ((dso == NULL) || (symname == NULL)) {
-        DSOerr(DSO_F_DL_BIND_VAR, ERR_R_PASSED_NULL_PARAMETER);
-        return (NULL);
-    }
-    if (sk_num(dso->meth_data) < 1) {
-        DSOerr(DSO_F_DL_BIND_VAR, DSO_R_STACK_ERROR);
-        return (NULL);
-    }
-    ptr = (shl_t) sk_value(dso->meth_data, sk_num(dso->meth_data) - 1);
-    if (ptr == NULL) {
-        DSOerr(DSO_F_DL_BIND_VAR, DSO_R_NULL_HANDLE);
-        return (NULL);
-    }
-    if (shl_findsym(&ptr, symname, TYPE_UNDEFINED, &sym) < 0) {
-        DSOerr(DSO_F_DL_BIND_VAR, DSO_R_SYM_FAILURE);
-        ERR_add_error_data(4, "symname(", symname, "): ", strerror(errno));
-        return (NULL);
-    }
-    return (sym);
-}
-
 static DSO_FUNC_TYPE dl_bind_func(DSO *dso, const char *symname)
 {
     shl_t ptr;
@@ -310,38 +280,6 @@ static char *dl_name_converter(DSO *dso, const char *filename)
     return (translated);
 }
 
-static int dl_pathbyaddr(void *addr, char *path, int sz)
-{
-    struct shl_descriptor inf;
-    int i, len;
-
-    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++) {
-        if (((size_t)addr >= inf.tstart && (size_t)addr < inf.tend) ||
-            ((size_t)addr >= inf.dstart && (size_t)addr < inf.dend)) {
-            len = (int)strlen(inf.filename);
-            if (sz <= 0)
-                return len + 1;
-            if (len >= sz)
-                len = sz - 1;
-            memcpy(path, inf.filename, len);
-            path[len++] = 0;
-            return len;
-        }
-    }
-
-    return -1;
-}
-
 static void *dl_globallookup(const char *name)
 {
     void *ret;