Increment the ABIVERSION to 5 for MIPS objects with non-executable stacks.
authorFaraz Shahbazker <faraz.shahbazker@imgtec.com>
Tue, 23 Feb 2016 12:58:03 +0000 (12:58 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 23 Feb 2016 12:58:03 +0000 (12:58 +0000)
* bfd/elfxx-mips.c (_bfd_mips_post_process_headers): Increment
ABIVERSION for non-executable stack.

bfd/ChangeLog
bfd/elfxx-mips.c

index 5ec3b934c83c3db6114af2c98f32d5db3698e1f1..d7bc5fab9ce9528f9e98c63b78a76fe1f6b1941a 100644 (file)
@@ -1,3 +1,8 @@
+2016-02-23  Faraz Shahbazker  <faraz.shahbazker@imgtec.com>
+
+       * bfd/elfxx-mips.c (_bfd_mips_post_process_headers): Increment
+       ABIVERSION for non-executable stack.
+
 2016-02-23  Rich Felker  <bugdal@aerifal.cx>
 
        PR target/19516
index fa14e8dd343f95d0bc7a68cb835628b9678b296c..e4996fa90939e9d0a1c50cae13fc8649613c3718 100644 (file)
@@ -16140,6 +16140,9 @@ _bfd_mips_post_process_headers (bfd *abfd, struct bfd_link_info *link_info)
   if (mips_elf_tdata (abfd)->abiflags.fp_abi == Val_GNU_MIPS_ABI_FP_64
       || mips_elf_tdata (abfd)->abiflags.fp_abi == Val_GNU_MIPS_ABI_FP_64A)
     i_ehdrp->e_ident[EI_ABIVERSION] = 3;
+
+  if (elf_stack_flags (abfd) && !(elf_stack_flags (abfd) & PF_X))
+    i_ehdrp->e_ident[EI_ABIVERSION] = 5;
 }
 
 int