081b653
Remove unnecessary .gnu_debuglink sections from libjvm
081b653
081b653
The .gnu_debuglink section indicates which file contains the debuginfo. This
081b653
is not needed if we not stripping the shared object.
081b653
081b653
RPM's debuginfo extraction code will add the right file links automatically. As
081b653
it is, RPM copies over the .gnu_debuglink link to the debug info file. Without
081b653
this patch, the debug info file also ends up containing the .gnu_debuglink
081b653
section pointing to a missing (and not needed) file.
081b653
081b653
diff --git a/make/linux/makefiles/jsig.make b/make/linux/makefiles/jsig.make
081b653
--- openjdk/hotspot/make/linux/makefiles/jsig.make
081b653
+++ openjdk/hotspot/make/linux/makefiles/jsig.make
081b653
@@ -57,14 +57,15 @@
081b653
                          $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) $(EXTRA_CFLAGS) -o $@ $< -ldl
081b653
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
081b653
 	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO)
081b653
+  ifeq ($(STRIP_POLICY),all_strip)
081b653
 	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@
081b653
-  ifeq ($(STRIP_POLICY),all_strip)
081b653
 	$(QUIETLY) $(STRIP) $@
081b653
   else
081b653
     ifeq ($(STRIP_POLICY),min_strip)
081b653
+	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@
081b653
 	$(QUIETLY) $(STRIP) -g $@
081b653
+    endif
081b653
     # implied else here is no stripping at all
081b653
-    endif
081b653
   endif
081b653
   ifeq ($(ZIP_DEBUGINFO_FILES),1)
081b653
 	$(ZIPEXE) -q -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO)
081b653
diff --git a/make/linux/makefiles/saproc.make b/make/linux/makefiles/saproc.make
081b653
--- openjdk/hotspot/make/linux/makefiles/saproc.make
081b653
+++ openjdk/hotspot/make/linux/makefiles/saproc.make
081b653
@@ -99,14 +99,15 @@
081b653
 	           -lthread_db
081b653
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
081b653
 	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO)
081b653
+  ifeq ($(STRIP_POLICY),all_strip)
081b653
 	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@
081b653
-  ifeq ($(STRIP_POLICY),all_strip)
081b653
 	$(QUIETLY) $(STRIP) $@
081b653
   else
081b653
     ifeq ($(STRIP_POLICY),min_strip)
081b653
+	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@
081b653
 	$(QUIETLY) $(STRIP) -g $@
081b653
+    endif
081b653
     # implied else here is no stripping at all
081b653
-    endif
081b653
   endif
081b653
   ifeq ($(ZIP_DEBUGINFO_FILES),1)
081b653
 	$(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO)
081b653
diff --git a/make/linux/makefiles/vm.make b/make/linux/makefiles/vm.make
081b653
--- openjdk/hotspot/make/linux/makefiles/vm.make
081b653
+++ openjdk/hotspot/make/linux/makefiles/vm.make
081b653
@@ -358,14 +358,15 @@
081b653
 
081b653
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
081b653
 	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DEBUGINFO)
081b653
-	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@
081b653
   ifeq ($(STRIP_POLICY),all_strip)
081b653
 	$(QUIETLY) $(STRIP) $@
081b653
+	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@
081b653
   else
081b653
     ifeq ($(STRIP_POLICY),min_strip)
081b653
 	$(QUIETLY) $(STRIP) -g $@
081b653
+	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@
081b653
+    endif
081b653
     # implied else here is no stripping at all
081b653
-    endif
081b653
   endif
081b653
   ifeq ($(ZIP_DEBUGINFO_FILES),1)
081b653
 	$(ZIPEXE) -q -y $(LIBJVM_DIZ) $(LIBJVM_DEBUGINFO)