This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Tidy code setting PT_GNU_RELRO p_flags
- From: Alan Modra <amodra at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 13 Oct 2015 06:04:52 -0000
- Subject: [binutils-gdb] Tidy code setting PT_GNU_RELRO p_flags
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=341b8ee719163f7ae8528f2a7832381887fbf8d8
commit 341b8ee719163f7ae8528f2a7832381887fbf8d8
Author: Alan Modra <amodra@gmail.com>
Date: Tue Oct 13 16:18:56 2015 +1030
Tidy code setting PT_GNU_RELRO p_flags
No functional changes here.
* elf.c (_bfd_elf_map_sections_to_segments): Don't set
PT_GNU_RELRO p_flags.
(assign_file_positions_for_non_load_sections): Set PT_GNU_RELRO
flags to PF_R here.
Diff:
---
bfd/ChangeLog | 7 +++++++
bfd/elf.c | 5 +----
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index abcddc9..6cd68de 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2015-10-13 Alan Modra <amodra@gmail.com>
+
+ * elf.c (_bfd_elf_map_sections_to_segments): Don't set
+ PT_GNU_RELRO p_flags.
+ (assign_file_positions_for_non_load_sections): Set PT_GNU_RELRO
+ flags to PF_R here.
+
2015-10-12 H.J. Lu <hongjiu.lu@intel.com>
PR ld/19073
diff --git a/bfd/elf.c b/bfd/elf.c
index 6c878bd..7f38fa0 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -4646,9 +4646,6 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info)
goto error_return;
m->next = NULL;
m->p_type = PT_GNU_RELRO;
- m->p_flags = PF_R;
- m->p_flags_valid = 1;
-
*pm = m;
pm = &m->next;
}
@@ -5480,7 +5477,7 @@ assign_file_positions_for_non_load_sections (bfd *abfd,
if (!m->p_align_valid)
p->p_align = 1;
if (!m->p_flags_valid)
- p->p_flags = (lp->p_flags & ~PF_W);
+ p->p_flags = PF_R;
}
else
{