changeset 8872:5ba59d58d976

8206425: .gnu_debuglink sections added unconditionally when no debuginfo is stripped Summary: Only add .gnu_debuglink sections when there is some stripping done. Reviewed-by: erikj, dholmes
author sgehwolf
date Thu, 05 Jul 2018 18:27:02 +0200
parents ad057f2e3211
children 06dcd58caf4a
files make/linux/makefiles/jsig.make make/linux/makefiles/saproc.make make/linux/makefiles/vm.make
diffstat 3 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/make/linux/makefiles/jsig.make	Wed Jul 04 03:02:43 2018 -0400
+++ b/make/linux/makefiles/jsig.make	Thu Jul 05 18:27:02 2018 +0200
@@ -57,14 +57,15 @@
                          $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) $(EXTRA_CFLAGS) -o $@ $< -ldl
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO)
+  ifeq ($(STRIP_POLICY),all_strip)
 	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@
-  ifeq ($(STRIP_POLICY),all_strip)
 	$(QUIETLY) $(STRIP) $@
   else
     ifeq ($(STRIP_POLICY),min_strip)
+	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@
 	$(QUIETLY) $(STRIP) -g $@
+    endif
     # implied else here is no stripping at all
-    endif
   endif
   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 	$(ZIPEXE) -q -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO)
--- a/make/linux/makefiles/saproc.make	Wed Jul 04 03:02:43 2018 -0400
+++ b/make/linux/makefiles/saproc.make	Thu Jul 05 18:27:02 2018 +0200
@@ -100,14 +100,15 @@
 	           -lthread_db
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO)
+  ifeq ($(STRIP_POLICY),all_strip)
 	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@
-  ifeq ($(STRIP_POLICY),all_strip)
 	$(QUIETLY) $(STRIP) $@
   else
     ifeq ($(STRIP_POLICY),min_strip)
+	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@
 	$(QUIETLY) $(STRIP) -g $@
+    endif
     # implied else here is no stripping at all
-    endif
   endif
   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 	$(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO)
--- a/make/linux/makefiles/vm.make	Wed Jul 04 03:02:43 2018 -0400
+++ b/make/linux/makefiles/vm.make	Thu Jul 05 18:27:02 2018 +0200
@@ -358,14 +358,15 @@
 
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DEBUGINFO)
+  ifeq ($(STRIP_POLICY),all_strip)
 	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@
-  ifeq ($(STRIP_POLICY),all_strip)
 	$(QUIETLY) $(STRIP) $@
   else
     ifeq ($(STRIP_POLICY),min_strip)
+	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@
 	$(QUIETLY) $(STRIP) -g $@
+    endif
     # implied else here is no stripping at all
-    endif
   endif
   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 	$(ZIPEXE) -q -y $(LIBJVM_DIZ) $(LIBJVM_DEBUGINFO)