This is the mail archive of the
mailing list for the binutils project.
- 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:
Author: Doug Kwan <email@example.com>
Date: Tue May 8 17:18:21 2012 +0000
2012-05-08 Ben Cheng <firstname.lastname@example.org>
* bfd/elf.c: Preserve the original p_align and p_flags if they
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  flags do not match GNU_RELRO  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...).