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