From 04e62ae6350e30e6293be8e62cff169cd4509b2a Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Thu, 17 May 2007 18:20:16 +0000 Subject: r22974: enable relro with PIE if available, this gives extra protection to the ELF segment (This used to be commit 708a9cb08ea8ffd0aee8ed5d8d8d14193306ce9a) --- source3/configure.in | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/source3/configure.in b/source3/configure.in index 2f763b0c02..592fc6a1f6 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -1763,6 +1763,29 @@ EOF fi fi +#Check if we can enable relro as well +if test x"${samba_cv_fpie}" = x"yes" +then + AC_CACHE_CHECK(for relro, samba_cv_fpie_relro, + [ + cat > conftest.c <&AS_MESSAGE_LOG_FD]) + then + samba_cv_fpie_relro=yes + else + samba_cv_fpie_relro=no + fi + rm -f conftest* + ]) + if test x"${samba_cv_fpie_relro}" = x"yes" + then + PIE_LDFLAGS="-pie -Wl,z,relro" + fi +fi + # Assume non-shared by default and override below BLDSHARED="false" -- cgit