From 341b8ee719163f7ae8528f2a7832381887fbf8d8 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 13 Oct 2015 16:18:56 +1030 Subject: 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. --- bfd/ChangeLog | 7 +++++++ bfd/elf.c | 5 +---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'bfd') 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 + + * 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 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 { -- cgit v1.1