]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Block library unloading on HP-UX 1455/head
authorMichael Osipov <michael.osipov@innomotics.com>
Thu, 18 Sep 2025 20:04:28 +0000 (22:04 +0200)
committerGreg Hudson <ghudson@mit.edu>
Fri, 26 Sep 2025 17:39:50 +0000 (13:39 -0400)
src/config/lib.in
src/config/libnover.in
src/config/shlib.conf
src/include/k5-platform.h

index 774e120a0d54d2a09c310f9bb46e098a61300d2c..25215eb05880573150629d98f3af82070ecb9e91 100644 (file)
@@ -75,12 +75,6 @@ osf1.exports: $(SHLIB_EXPORT_FILE) Makefile
 hpux.exports: $(SHLIB_EXPORT_FILE) Makefile
        $(RM) hpux.tmp hpux.exports
        sed "s/^/+e /" < $(SHLIB_EXPORT_FILE) > hpux.tmp
-       a=""; \
-       for f in . $(LIBFINIFUNC); do \
-         if test "$$f" != .; then \
-           a="+I $${f}__auxfini $$a"; \
-         else :; fi; \
-       done; echo "$$a" >> hpux.tmp
        echo "+e errno" >> hpux.tmp
        base=`echo "$(LIBBASE)" | sed -e 's/-/_/'`; \
        echo "+e _GLOBAL__FD_lib$${base}_$(LIBMAJOR)_$(LIBMINOR)" >> hpux.tmp; \
index ab6baea82840ef91b901dcb18c9e760555e111bb..bbac0cd17a64f2404ab965cb72f9ee83b8122152 100644 (file)
@@ -64,12 +64,6 @@ osf1.exports: $(SHLIB_EXPORT_FILE) Makefile
 hpux.exports: $(SHLIB_EXPORT_FILE) Makefile
        $(RM) hpux.tmp hpux.exports
        sed "s/^/+e /" < $(SHLIB_EXPORT_FILE) > hpux.tmp
-       a=""; \
-       for f in . $(LIBFINIFUNC); do \
-         if test "$$f" != .; then \
-           a="+I $${f}__auxfini $$a"; \
-         else :; fi; \
-       done; echo "$$a" >> hpux.tmp
        echo "+e errno" >> hpux.tmp
        mv -f hpux.tmp hpux.exports
 
index f838c2536dda1ae370475053b385bf9519f0bc37..d14ededab74a9c581c0ac9c5ab16a18edc1e4654 100644 (file)
@@ -93,12 +93,12 @@ case $krb5_cv_host in
                PICFLAGS=-fPIC
                SHLIB_RPATH_FLAGS='-Wl,+b,$(SHLIB_RDIRS)'
                SHLIB_EXPFLAGS='-Wl,+s $(SHLIB_RPATH_FLAGS) $(SHLIB_DIRS) $(SHLIB_EXPLIBS)'
-               LDCOMBINE='gcc -fPIC -shared -Wl,+h,$(LIBPREFIX)$(LIBBASE)$(SHLIBSEXT) -Wl,-c,hpux.exports'
+               LDCOMBINE='gcc -fPIC -shared -Wl,+h,$(LIBPREFIX)$(LIBBASE)$(SHLIBSEXT) -Wl,-c,hpux.exports -Wl,-B,nodelete'
        else
                PICFLAGS=+z
                SHLIB_RPATH_FLAGS='+b $(SHLIB_RDIRS)'
                SHLIB_EXPFLAGS='$(SHLIB_RPATH_FLAGS) $(SHLIB_DIRS) $(SHLIB_EXPLIBS)'
-               LDCOMBINE='ld -b +h $(LIBPREFIX)$(LIBBASE)$(SHLIBSEXT) -c hpux.exports'
+               LDCOMBINE='ld -b +h $(LIBPREFIX)$(LIBBASE)$(SHLIBSEXT) -c hpux.exports -B nodelete'
        fi
        MAKE_SHLIB_COMMAND="${LDCOMBINE} -o \$@ \$\$objlist \$(LDFLAGS) \$(SHLIB_EXPFLAGS) ${LDCOMBINE_TAIL}"
        PROG_RPATH_FLAGS='$(RPATH_FLAG)$(PROG_RPATH)'
@@ -112,12 +112,8 @@ case $krb5_cv_host in
        # Do *not* set use_linker_init_option=yes here, because in the
        # case where the library is specified at program link time, the
        # initialization function appears not to get called, only for
-       # shl_load.  But for finalization functions, the shl_load case
-       # is the one we care about.
-       #
-       # Not setting use_linker_init_option here should cause compilation
-       # failures if the user tries to disable delayed initialization.
-       use_linker_fini_option=yes
+       # shl_load.
+       lib_unload_prevented=yes
        ;;
 
 mips-*-netbsd*)
index 0a19b366874694245fe1438f9812c8d4d081c94b..18119f8918b1ea2a6c55783209ea293c920facf2 100644 (file)
@@ -376,35 +376,9 @@ typedef struct { int error; unsigned char did_run; } k5_init_t;
    matter what compiler we're using.  Do it the same way
    regardless.  */
 
-# ifdef __hpux
-
-     /* On HP-UX, we need this auxiliary function.  At dynamic load or
-        unload time (but *not* program startup and termination for
-        link-time specified libraries), the linker-indicated function
-        is called with a handle on the library and a flag indicating
-        whether it's being loaded or unloaded.
-
-        The "real" fini function doesn't need to be exported, so
-        declare it static.
-
-        As usual, the final declaration is just for syntactic
-        convenience, so the top-level invocation of this macro can be
-        followed by a semicolon.  */
-
-#  include <dl.h>
-#  define MAKE_FINI_FUNCTION(NAME)                                          \
-        static void NAME(void);                                             \
-        void JOIN__2(NAME, auxfini)(shl_t, int); /* silence gcc warnings */ \
-        void JOIN__2(NAME, auxfini)(shl_t h, int l) { if (!l) NAME(); }     \
-        static void NAME(void)
-
-# else /* not hpux */
-
 #  define MAKE_FINI_FUNCTION(NAME)      \
         void NAME(void)
 
-# endif
-
 #elif !defined(SHARED) || defined(LIB_UNLOAD_PREVENTED)
 
 /*