Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
8241996: on linux set full relro in the linker flags
Browse files Browse the repository at this point in the history
Reviewed-by: erikj, redestad
  • Loading branch information
MBaesken committed Apr 2, 2020
1 parent ed00873 commit fc9389c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions make/autoconf/flags-ldflags.m4
Expand Up @@ -69,9 +69,10 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
LIBJSIG_HASHSTYLE_LDFLAGS="-Wl,--hash-style=both" LIBJSIG_HASHSTYLE_LDFLAGS="-Wl,--hash-style=both"
fi fi
# Add -z defs, to forbid undefined symbols in object files. # Add -z,defs, to forbid undefined symbols in object files.
# add relro (mark relocations read only) for all libs # add -z,relro (mark relocations read only) for all libs
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-z,defs -Wl,-z,relro" # 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 # Linux : remove unused code+data in link step
if test "x$ENABLE_LINKTIME_GC" = xtrue; then if test "x$ENABLE_LINKTIME_GC" = xtrue; then
if test "x$OPENJDK_TARGET_CPU" = xs390x; then if test "x$OPENJDK_TARGET_CPU" = xs390x; then
Expand Down Expand Up @@ -129,10 +130,6 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
if test x$DEBUG_LEVEL = xrelease; then if test x$DEBUG_LEVEL = xrelease; then
DEBUGLEVEL_LDFLAGS_JDK_ONLY="$DEBUGLEVEL_LDFLAGS_JDK_ONLY -Wl,-O1" DEBUGLEVEL_LDFLAGS_JDK_ONLY="$DEBUGLEVEL_LDFLAGS_JDK_ONLY -Wl,-O1"
fi fi
if test x$DEBUG_LEVEL = xslowdebug; then
# do relocations at load
DEBUGLEVEL_LDFLAGS="-Wl,-z,now"
fi
fi fi
elif test "x$TOOLCHAIN_TYPE" = xxlc; then elif test "x$TOOLCHAIN_TYPE" = xxlc; then
Expand Down

0 comments on commit fc9389c

Please sign in to comment.