make/autoconf/flags-ldflags.m4
changeset 59287 c04fa10636fd
parent 59286 a2441ac23eeb
--- a/make/autoconf/flags-ldflags.m4	Tue Nov 26 13:55:11 2019 +0100
+++ b/make/autoconf/flags-ldflags.m4	Wed Nov 27 10:07:29 2019 +0100
@@ -72,6 +72,11 @@
     # Add -z defs, to forbid undefined symbols in object files.
     # add relro (mark relocations read only) for all libs
     BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-z,defs -Wl,-z,relro"
+    # s390x : remove unused code+data in link step
+    if test "x$OPENJDK_TARGET_CPU" = xs390x; then
+      BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,--gc-sections -Wl,--print-gc-sections"
+    fi
+
     BASIC_LDFLAGS_JVM_ONLY="-Wl,-O1"
 
   elif test "x$TOOLCHAIN_TYPE" = xclang; then