Tidy code setting PT_GNU_RELRO p_flags
authorAlan Modra <amodra@gmail.com>
Tue, 13 Oct 2015 05:48:56 +0000 (16:18 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 13 Oct 2015 05:53:13 +0000 (16:23 +1030)
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
bfd/elf.c

index abcddc931577629e559a2f511f2be2172eabebaf..6cd68de5a2b0dd2e6125830ae1af3b2b2ba22595 100644 (file)
@@ -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
index 6c878bdf46b2454fae45ae021a6041694d96e343..7f38fa0c62c8c09f6465b2097269e1f938a899da 100644 (file)
--- 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
            {
This page took 0.031472 seconds and 4 git commands to generate.