--- config/shlib.conf.orig	2025-08-05 14:15:15 UTC
+++ config/shlib.conf
@@ -168,14 +168,15 @@ mips-*-netbsd*)
 			PICFLAGS=-fpic
 			;;
 	esac
-	SHLIBVEXT='.so.$(LIBMAJOR)'
-	RPATH_FLAG='-Wl,--enable-new-dtags -Wl,-rpath -Wl,'
+	SHLIBVEXT='.so.$(LIBMAJOR).$(LIBMINOR)'
+	SHLIBSEXT='.so.$(LIBMAJOR)'
+	LDCOMBINE='libtool --tag=CC --mode=link cc -Xcompiler -shared -Wl,-soname=$(LIBPREFIX)$(LIBBASE)$(SHLIBVEXT)'
+	RPATH_FLAG='-Wl,-rpath -Wl,'
 	PROG_RPATH_FLAGS='$(RPATH_FLAG)$(PROG_RPATH)'
 	CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) $(PROG_RPATH_FLAGS) $(CFLAGS) $(LDFLAGS)'
 	CXX_LINK_SHARED='$(CXX) $(PROG_LIBPATH) $(PROG_RPATH_FLAGS) $(CXXFLAGS) $(LDFLAGS)'
 	SHLIBEXT=.so
-	LDCOMBINE='ld -Bshareable -z nodelete'
-	SHLIB_RPATH_FLAGS='--enable-new-dtags -rpath $(SHLIB_RDIRS)'
+	SHLIB_RPATH_FLAGS='-rpath $(SHLIB_RDIRS)'
 	SHLIB_EXPFLAGS='$(SHLIB_RPATH_FLAGS) $(SHLIB_DIRS) $(SHLIB_EXPLIBS)'
 	CC_LINK_STATIC='$(CC) $(PROG_LIBPATH) $(CFLAGS) $(LDFLAGS)'
 	CXX_LINK_STATIC='$(CXX) $(PROG_LIBPATH) $(CXXFLAGS) $(LDFLAGS)'
