Tue, 16 Jan 2018 04:18:53 -0500
8187045: [linux] Not all libraries in the VM are linked with -z,noexecstack
Reviewed-by: dholmes, erikj
common/autoconf/generated-configure.sh | file | annotate | diff | comparison | revisions | |
common/autoconf/toolchain.m4 | file | annotate | diff | comparison | revisions |
1.1 --- a/common/autoconf/generated-configure.sh Tue Jan 02 17:01:18 2018 -0800 1.2 +++ b/common/autoconf/generated-configure.sh Tue Jan 16 04:18:53 2018 -0500 1.3 @@ -3912,7 +3912,7 @@ 1.4 #CUSTOM_AUTOCONF_INCLUDE 1.5 1.6 # Do not change or remove the following line, it is needed for consistency checks: 1.7 -DATE_WHEN_GENERATED=1500960571 1.8 +DATE_WHEN_GENERATED=1515659624 1.9 1.10 ############################################################################### 1.11 # 1.12 @@ -30178,9 +30178,10 @@ 1.13 LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both " 1.14 fi 1.15 if test "x$OPENJDK_TARGET_OS" = xlinux; then 1.16 - # And since we now know that the linker is gnu, then add -z defs, to forbid 1.17 - # undefined symbols in object files. 1.18 - LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs" 1.19 + # And since we now know that the linker is gnu, then add: 1.20 + # -z defs, to forbid undefined symbols in object files 1.21 + # -z noexecstack, to mark stack regions as non-executable 1.22 + LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs -Xlinker -z -Xlinker noexecstack" 1.23 if test "x$DEBUG_LEVEL" = "xrelease"; then 1.24 # When building release libraries, tell the linker optimize them. 1.25 # Should this be supplied to the OSS linker as well?
2.1 --- a/common/autoconf/toolchain.m4 Tue Jan 02 17:01:18 2018 -0800 2.2 +++ b/common/autoconf/toolchain.m4 Tue Jan 16 04:18:53 2018 -0500 2.3 @@ -1,5 +1,5 @@ 2.4 # 2.5 -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. 2.6 +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. 2.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2.8 # 2.9 # This code is free software; you can redistribute it and/or modify it 2.10 @@ -1211,9 +1211,10 @@ 2.11 LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both " 2.12 fi 2.13 if test "x$OPENJDK_TARGET_OS" = xlinux; then 2.14 - # And since we now know that the linker is gnu, then add -z defs, to forbid 2.15 - # undefined symbols in object files. 2.16 - LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs" 2.17 + # And since we now know that the linker is gnu, then add: 2.18 + # -z defs, to forbid undefined symbols in object files 2.19 + # -z noexecstack, to mark stack regions as non-executable 2.20 + LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs -Xlinker -z -Xlinker noexecstack" 2.21 if test "x$DEBUG_LEVEL" = "xrelease"; then 2.22 # When building release libraries, tell the linker optimize them. 2.23 # Should this be supplied to the OSS linker as well?