Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
8241996: on linux set full relro in the linker flags
Reviewed-by: erikj, redestad
- Loading branch information
Showing
with
4 additions
and
7 deletions.
-
+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 |
|
|