Index: b/Makefile
===================================================================
--- a/Makefile
+++ b/Makefile
@@ -35,6 +35,9 @@
 ARCH = $(shell uname -m | sed -e s/i.86/i386/)
 CC = gcc
 
+LDLIBS = -ldl
+SOVERSION = 0
+
 CUSTOM_LDSCRIPTS = yes
 
 ifeq ($(ARCH),ppc64le)
@@ -305,11 +308,13 @@
 
 obj32/libhugetlbfs.so: $(LIBOBJS32)
 	@$(VECHO) LD32 "(shared)" $@
-	$(CC32) $(LDFLAGS) -Wl,--version-script=version.lds -Wl,-soname,$(notdir $@) -shared -o $@ $^ $(LDLIBS)
+	$(CC32) $(LDFLAGS) -Wl,--version-script=version.lds -Wl,-soname,$(notdir $@).$(SOVERSION) -shared -o $@.$(SOVERSION) $^ $(LDLIBS)
+	ln -sf $(notdir $@).$(SOVERSION) $@
 
 obj64/libhugetlbfs.so: $(LIBOBJS64)
 	@$(VECHO) LD64 "(shared)" $@
-	$(CC64) $(LDFLAGS) -Wl,--version-script=version.lds -Wl,-soname,$(notdir $@) -shared -o $@ $^ $(LDLIBS)
+	$(CC64) $(LDFLAGS) -Wl,--version-script=version.lds -Wl,-soname,$(notdir $@).$(SOVERSION) -shared -o $@.$(SOVERSION) $^ $(LDLIBS)
+	ln -sf $(notdir $@).$(SOVERSION) $@
 
 #obj32/libhugetlbfs_privutils.a: $(LIBPUOBJS:%=obj32/%)
 #	@$(VECHO) AR32 $@
@@ -325,11 +330,13 @@
 
 obj32/libhugetlbfs_privutils.so: $(LIBPUOBJS:%=obj32/%)
 	@$(VECHO) LD32 "(shared)" $@
-	$(CC32) $(LDFLAGS) -Wl,--version-script=privutils.lds -Wl,-soname,$(notdir $@) -shared -o $@ $^ $(LDLIBS)
+	$(CC32) $(LDFLAGS) -Wl,--version-script=privutils.lds -Wl,-soname,$(notdir $@).$(SOVERSION) -shared -o $@.$(SOVERSION) $^ $(LDLIBS)
+	ln -sf $(notdir $@).$(SOVERSION) $@
 
 obj64/libhugetlbfs_privutils.so: $(LIBPUOBJS:%=obj64/%)
 	@$(VECHO) LD64 "(shared)" $@
-	$(CC64) $(LDFLAGS) -Wl,--version-script=privutils.lds -Wl,-soname,$(notdir $@) -shared -o $@ $^ $(LDLIBS)
+	$(CC64) $(LDFLAGS) -Wl,--version-script=privutils.lds -Wl,-soname,$(notdir $@).$(SOVERSION) -shared -o $@.$(SOVERSION) $^ $(LDLIBS)
+	ln -sf $(notdir $@).$(SOVERSION) $@
 
 obj32/%.i:	%.c
 	@$(VECHO) CPP $@
@@ -396,12 +403,26 @@
 obj32/install:
 	@$(VECHO) INSTALL-LIB32 $(LIBDIR32)
 	$(INSTALL) -d $(DESTDIR)$(LIBDIR32)
-	$(INSTALL) $(INSTALL_OBJ_LIBS:%=obj32/%) $(DESTDIR)$(LIBDIR32)
+#	$(INSTALL) $(INSTALL_OBJ_LIBS:%=obj32/%) $(DESTDIR)$(LIBDIR32)
+	for x in $(INSTALL_OBJ_LIBS); do \
+		$(INSTALL) obj32/$$x $(DESTDIR)$(LIBDIR32)/; \
+		if [ -f obj32/$$x.$(SOVERSION) ]; then \
+		  $(INSTALL) obj32/$$x.$(SOVERSION) $(DESTDIR)$(LIBDIR32)/; \
+		  ln -sf $$x.$(SOVERSION) $(DESTDIR)$(LIBDIR32)/$$x; \
+		fi; \
+	done
 
 obj64/install:
 	@$(VECHO) INSTALL-LIB64 $(LIBDIR64)
 	$(INSTALL) -d $(DESTDIR)$(LIBDIR64)
-	$(INSTALL) $(INSTALL_OBJ_LIBS:%=obj64/%) $(DESTDIR)$(LIBDIR64)
+#	$(INSTALL) $(INSTALL_OBJ_LIBS:%=obj64/%) $(DESTDIR)$(LIBDIR64)
+	for x in $(INSTALL_OBJ_LIBS); do \
+		$(INSTALL) obj64/$$x $(DESTDIR)$(LIBDIR64)/; \
+		if [ -f obj64/$$x.$(SOVERSION) ]; then \
+		  $(INSTALL) obj64/$$x.$(SOVERSION) $(DESTDIR)$(LIBDIR64)/; \
+		  ln -sf $$x.$(SOVERSION) $(DESTDIR)$(LIBDIR64)/$$x; \
+		fi; \
+	done
 
 objscript.%: %
 	@$(VECHO) OBJSCRIPT $*
