# HG changeset patch # User dbuck # Date 1517507631 0 # Node ID f8f11c61855441c2d2ec1f87ba76e379fb371cd5 # Parent 5a80fc5b9697a10ff1430b6a8e0e35aa04d76344 8187045: [linux] Not all libraries in the VM are linked with -z,noexecstack Reviewed-by: dholmes, erikj diff -r 5a80fc5b9697 -r f8f11c618554 common/autoconf/generated-configure.sh --- a/common/autoconf/generated-configure.sh Mon Jan 22 13:28:40 2018 -0800 +++ b/common/autoconf/generated-configure.sh Thu Feb 01 17:53:51 2018 +0000 @@ -3776,7 +3776,7 @@ # -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -3912,7 +3912,7 @@ #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1501170108 +DATE_WHEN_GENERATED=1517507181 ############################################################################### # @@ -30178,9 +30178,10 @@ LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both " fi if test "x$OPENJDK_TARGET_OS" = xlinux; then - # And since we now know that the linker is gnu, then add -z defs, to forbid - # undefined symbols in object files. - LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs" + # And since we now know that the linker is gnu, then add: + # -z defs, to forbid undefined symbols in object files + # -z noexecstack, to mark stack regions as non-executable + LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs -Xlinker -z -Xlinker noexecstack" if test "x$DEBUG_LEVEL" = "xrelease"; then # When building release libraries, tell the linker optimize them. # Should this be supplied to the OSS linker as well? diff -r 5a80fc5b9697 -r f8f11c618554 common/autoconf/toolchain.m4 --- a/common/autoconf/toolchain.m4 Mon Jan 22 13:28:40 2018 -0800 +++ b/common/autoconf/toolchain.m4 Thu Feb 01 17:53:51 2018 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -1211,9 +1211,10 @@ LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both " fi if test "x$OPENJDK_TARGET_OS" = xlinux; then - # And since we now know that the linker is gnu, then add -z defs, to forbid - # undefined symbols in object files. - LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs" + # And since we now know that the linker is gnu, then add: + # -z defs, to forbid undefined symbols in object files + # -z noexecstack, to mark stack regions as non-executable + LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs -Xlinker -z -Xlinker noexecstack" if test "x$DEBUG_LEVEL" = "xrelease"; then # When building release libraries, tell the linker optimize them. # Should this be supplied to the OSS linker as well?