From: Richard Levitte Date: Thu, 8 Sep 2016 18:48:30 +0000 (+0200) Subject: VMS: be less picky when loading DSOs X-Git-Tag: OpenSSL_1_1_1-pre1~3572 X-Git-Url: https://git.openssl.org/?p=openssl.git;a=commitdiff_plain;h=278a33da3cf10f0a9ab12c2a1f643f9027b06679 VMS: be less picky when loading DSOs The DSO API was picky about casing of symbol names on VMS. There's really no reason to be that picky, it's mostly just annoying. Therefore, we take away the possibility to flag for a choice, and will instead first try to find a symbol with exact case, and failing that, we try to find it in upper case. Reviewed-by: Rich Salz --- diff --git a/crypto/dso/dso_vms.c b/crypto/dso/dso_vms.c index 90d387eb53..2e0d84cb53 100644 --- a/crypto/dso/dso_vms.c +++ b/crypto/dso/dso_vms.c @@ -261,15 +261,13 @@ static int do_find_symbol(DSO_VMS_INTERNAL *ptr, symname_dsc, sym, 0, flags); } +# ifndef LIB$M_FIS_MIXEDCASE +# define LIB$M_FIS_MIXEDCASE (1 << 4); +# endif void vms_bind_sym(DSO *dso, const char *symname, void **sym) { DSO_VMS_INTERNAL *ptr; - int status; -# ifdef LIB$M_FIS_MIXEDCASE - int flags = LIB$M_FIS_MIXEDCASE; -# else - int flags = (1 << 4); -# endif + int status = 0; struct dsc$descriptor_s symname_dsc; /* Arrange 32-bit pointer to (copied) string storage, if needed. */ @@ -312,10 +310,10 @@ void vms_bind_sym(DSO *dso, const char *symname, void **sym) return; } - if (dso->flags & DSO_FLAG_UPCASE_SYMBOL) - flags = 0; + status = do_find_symbol(ptr, &symname_dsc, sym, LIB$M_FIS_MIXEDCASE); - status = do_find_symbol(ptr, &symname_dsc, sym, flags); + if (!$VMS_STATUS_SUCCESS(status)) + status = do_find_symbol(ptr, &symname_dsc, sym, 0); if (!$VMS_STATUS_SUCCESS(status)) { unsigned short length; diff --git a/include/internal/dso.h b/include/internal/dso.h index 970beeb195..79d98f4785 100644 --- a/include/internal/dso.h +++ b/include/internal/dso.h @@ -42,12 +42,6 @@ extern "C" { */ # define DSO_FLAG_NAME_TRANSLATION_EXT_ONLY 0x02 -/* - * The following flag controls the translation of symbol names to upper case. - * This is currently only being implemented for OpenVMS. - */ -# define DSO_FLAG_UPCASE_SYMBOL 0x10 - /* * This flag loads the library with public symbols. Meaning: The exported * symbols of this library are public to all libraries loaded after this