public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Ulf Hermann <ulf.hermann@qt.io>
Cc: elfutils-devel@sourceware.org
Subject: Re: [PATCH v3] Check for -z,defs, -z,relro, -fPIC, -fPIE before using them
Date: Sat, 19 Aug 2017 08:11:00 -0000	[thread overview]
Message-ID: <20170818202928.GA3169@stream> (raw)
In-Reply-To: <d9927f91-1eaa-ee4b-7ae5-344523bfb49c@qt.io>

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

      reply	other threads:[~2017-08-19  8:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-18 10:48 Ulf Hermann
2017-08-19  8:11 ` Mark Wielaard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170818202928.GA3169@stream \
    --to=mark@klomp.org \
    --cc=elfutils-devel@sourceware.org \
    --cc=ulf.hermann@qt.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).