This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PT_GNU_RELRO flags
- From: jose dot marchesi at oracle dot com (Jose E. Marchesi)
- To: binutils at sourceware dot org
- Cc: Mark Wielaard <mjw at redhat dot com>
- Date: Fri, 09 Oct 2015 18:54:16 +0200
- Subject: PT_GNU_RELRO flags
- Authentication-results: sourceware.org; auth=none
Hi hackers! The following commit:
commit 2d16d28e5c20aacc9637f589558c118d6fe1a17c
Author: Doug Kwan <dougkwan@google.com>
Date: Tue May 8 17:18:21 2012 +0000
2012-05-08 Ben Cheng <bccheng@google.com>
* bfd/elf.c: Preserve the original p_align and p_flags if they
are valid.
Makes ld to not derive the PT_GNU_RELRO segment flags from its covering
PT_LOAD segment when it already contains "valid" flags (bfd creates them
with "R" flags, whereas gold creates them with "RW"). As a result, it
is no longer generally true that `RELRO->p_flags & ~PF_W ==
LOAD->p_flags & ~PF_W'.
The thing is, eu-elflint checks precisely for that, and complains for
shared objects linked with -zrelro:
loadable segment [5] flags do not match GNU_RELRO [1] flags
Was this change intended? Does it makes sense to have RELRO=R/LOAD=RWE
pairs in elf files? (RELRO segments contain .plt sections in sparc, for
example, and I would expect these to be executable...).