From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 54628 invoked by alias); 19 Aug 2017 08:11:04 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 54578 invoked by uid 89); 19 Aug 2017 08:11:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.6 required=5.0 tests=BAYES_00,DATE_IN_PAST_06_12,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=doubts, H*M:stream X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00,DATE_IN_PAST_06_12,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 19 Aug 2017 08:11:00 +0000 Received: from stream.wildebeest.org (ADijon-357-1-27-209.w109-217.abo.wanadoo.fr [109.217.50.209]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 55E4F33138CE; Sat, 19 Aug 2017 10:10:57 +0200 (CEST) Received: by stream.wildebeest.org (Postfix, from userid 1000) id 70FD2101F85; Fri, 18 Aug 2017 22:29:28 +0200 (CEST) Date: Sat, 19 Aug 2017 08:11:00 -0000 From: Mark Wielaard To: Ulf Hermann Cc: elfutils-devel@sourceware.org Subject: Re: [PATCH v3] Check for -z,defs, -z,relro, -fPIC, -fPIE before using them Message-ID: <20170818202928.GA3169@stream> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) X-IsSubscribed: yes X-SW-Source: 2017-q3/txt/msg00086.txt.bz2 On Fri, Aug 18, 2017 at 12:41:11PM +0200, Ulf Hermann wrote: > Those flags are not available on all platforms, and omitting them when > not available will not cause any harm. In particular: > > -z,defs disallows undefined symbols in object files. This option is > unsupported if the target binary format enforces the same condition > already. Furthermore it is only a compile time sanity check. When it is > omitted, the same binary is produced. > > -z,relro instructs the loader to mark sections read-only after loading > the library, where possible. This is a hardening mechanism. If it is > unavailable, the functionality of the code is not affected in any way. > > -fPIC instructs the compiler to produce position independent code. While > this is preferable to relocatable code, relocatable code also works and > may even be faster. Relocatable code might just be loaded into memory > multiple times for different processes. > > -fPIE is the same thing as -fPIC for executables rather than shared > libraries. I am not a fan, because I have my doubts supporting systems which don't even support these are really worth the trouble. And I am slightly afraid the configure checks might silently fail while we really don't want that. But the patch is clean and makes the compile flags consistent. Applied. Thanks, Mark