Skip to content
Permalink
Browse files

8241996: on linux set full relro in the linker flags

Reviewed-by: erikj, redestad
  • Loading branch information
Matthias Baesken committed Apr 2, 2020
1 parent ed00873 commit fc9389c164a14ffbf8ca4f6cc07e2f6bef03d3f0
Showing with 4 additions and 7 deletions.
  1. +4 −7 make/autoconf/flags-ldflags.m4
@@ -69,9 +69,10 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
LIBJSIG_HASHSTYLE_LDFLAGS="-Wl,--hash-style=both"
fi
# 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"
# Add -z,defs, to forbid undefined symbols in object files.
# add -z,relro (mark relocations read only) for all libs
# add -z,now ("full relro" - more of the Global Offset Table GOT is marked read only)
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-z,defs -Wl,-z,relro -Wl,-z,now"
# Linux : remove unused code+data in link step
if test "x$ENABLE_LINKTIME_GC" = xtrue; then
if test "x$OPENJDK_TARGET_CPU" = xs390x; then
@@ -129,10 +130,6 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
if test x$DEBUG_LEVEL = xrelease; then
DEBUGLEVEL_LDFLAGS_JDK_ONLY="$DEBUGLEVEL_LDFLAGS_JDK_ONLY -Wl,-O1"
fi
if test x$DEBUG_LEVEL = xslowdebug; then
# do relocations at load
DEBUGLEVEL_LDFLAGS="-Wl,-z,now"
fi
fi
elif test "x$TOOLCHAIN_TYPE" = xxlc; then

0 comments on commit fc9389c

Please sign in to comment.