aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Carter <jcarter@mips.com>2014-02-18 16:23:48 -0800
committerJack Carter <jcarter@mips.com>2014-02-18 16:23:48 -0800
commit5db3e65d39c4018e88c3e7bba089fa9df11e7617 (patch)
tree4f0097b5d75c4772fc949b8a32322e423d90317d
parentc17ef0d5d26a5374b70f33689042ec2f6a77e4fa (diff)
downloadgdb-5db3e65d39c4018e88c3e7bba089fa9df11e7617.zip
gdb-5db3e65d39c4018e88c3e7bba089fa9df11e7617.tar.gz
gdb-5db3e65d39c4018e88c3e7bba089fa9df11e7617.tar.bz2
The PT_DYNAMIC segment was being hard coded to have read, write, and
execute permission regardless of the underlying PT_LOAD segment permissions. Deleting this code allows the default linker behavior which is to set the dynamic segment to the same permissions as the sections that make it up. This change alters one existing test case to check the segment flags for PT_DYNAMIC. bfd/ChangeLog * elfxx-mips.c(_bfd_mips_elf_modify_segment_map): Deleted hard coding of PT_DYNAMIC segment flags. ld/testsuite/ChangeLog * ld-mips-elf/pic-and-nonpic-3a.sd: Check DYNAMIC segment flags.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elfxx-mips.c12
-rw-r--r--ld/testsuite/ChangeLog4
-rw-r--r--ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.sd2
4 files changed, 10 insertions, 13 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index eaf7d32..88e042e 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2014-02-18 Jack Carter <jack.carter@imgtec.com>
+
+ * elfxx-mips.c(_bfd_mips_elf_modify_segment_map): Deleted hard coding of
+ PT_DYNAMIC segment flags.
+
2014-02-17 Jan Kratochvil <jan.kratochvil@redhat.com>
PR binutils/16595
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index f51845b..9011b6d 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -11919,18 +11919,6 @@ _bfd_mips_elf_modify_segment_map (bfd *abfd,
if ((*pm)->p_type == PT_DYNAMIC)
break;
m = *pm;
- if (m != NULL && IRIX_COMPAT (abfd) == ict_none)
- {
- /* For a normal mips executable the permissions for the PT_DYNAMIC
- segment are read, write and execute. We do that here since
- the code in elf.c sets only the read permission. This matters
- sometimes for the dynamic linker. */
- if (bfd_get_section_by_name (abfd, ".dynamic") != NULL)
- {
- m->p_flags = PF_R | PF_W | PF_X;
- m->p_flags_valid = 1;
- }
- }
/* GNU/Linux binaries do not need the extended PT_DYNAMIC section.
glibc's dynamic linker has traditionally derived the number of
tags from the p_filesz field, and sometimes allocates stack
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 337cbf0..4b37b0d 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2014-02-18 Jack Carter <jack.carter@imgtec.com>
+
+ * ld-mips-elf/pic-and-nonpic-3a.sd: Check DYNAMIC segment flags.
+
2014-02-16 Thomas Schwinge <thomas@codesourcery.com>
* ld-elfweak/elfweak.exp (setup_xfail_gnu_hurd): Remove function
diff --git a/ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.sd b/ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.sd
index 58b50c3..b178bdf 100644
--- a/ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.sd
+++ b/ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.sd
@@ -8,7 +8,7 @@ Program Headers:
* REGINFO * [^ ]+ * 0x0+00000 * 0x0+00000 [^ ]+ * [^ ]+ * R * 0x.*
* LOAD * [^ ]+ * 0x0+00000 * 0x0+00000 [^ ]+ * [^ ]+ * R E * 0x.*
* LOAD * [^ ]+ * 0x0+10000 * 0x0+10000 [^ ]+ * [^ ]+ * RW * 0x.*
- * DYNAMIC * [^ ]+ * 0x0+00400 * 0x0+00400 .*
+ * DYNAMIC * [^ ]+ * 0x0+00400 * 0x0+00400 [^ ]+ * [^ ]+ * R * 0x.*
* NULL * .*
*Section to Segment mapping: