Fix remaining targets using wrong .interp conditions
authorAlan Modra <amodra@gmail.com>
Wed, 11 Oct 2017 12:13:42 +0000 (22:43 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 12 Oct 2017 02:28:11 +0000 (12:58 +1030)
* elf32-nds32.c (nds32_elf_size_dynamic_sections): Set .interp
when executable rather than non-PIC.
* elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
* elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.

bfd/ChangeLog
bfd/elf32-nds32.c
bfd/elf32-score.c
bfd/elf32-score7.c

index eb819200fe2871bf5b7ae4a5b2610002ab75e8b8..1af35606f7c6d63627cf93389721cdb7d789d7d6 100644 (file)
@@ -1,3 +1,10 @@
+2017-10-12  Alan Modra  <amodra@gmail.com>
+
+       * elf32-nds32.c (nds32_elf_size_dynamic_sections): Set .interp
+       when executable rather than non-PIC.
+       * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
+       * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
+
 2017-10-11  Maciej W. Rozycki  <macro@imgtec.com>
 
        * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo64_ugid16'
index ddf14650cd3be66c738ab68c1d0f7c27ef437c31..4341007a0838bbd457ef3d43f61154e81a8bcae4 100644 (file)
@@ -3943,7 +3943,7 @@ nds32_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
   if (htab->root.dynamic_sections_created)
     {
       /* Set the contents of the .interp section to the interpreter.  */
-      if (!bfd_link_pic (info) && !info->nointerp)
+      if (bfd_link_executable (info) && !info->nointerp)
        {
          s = bfd_get_section_by_name (dynobj, ".interp");
          BFD_ASSERT (s != NULL);
index 5fc10b35d2f94d503e42a57e0bd6ed54565867fd..69a19ec4d2069a117ce967a4fd44c1dcac80c020 100644 (file)
@@ -3263,7 +3263,7 @@ s3_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *i
   if (elf_hash_table (info)->dynamic_sections_created)
     {
       /* Set the contents of the .interp section to the interpreter.  */
-      if (!bfd_link_pic (info) && !info->nointerp)
+      if (bfd_link_executable (info) && !info->nointerp)
         {
           s = bfd_get_linker_section (dynobj, ".interp");
           BFD_ASSERT (s != NULL);
index 5554cccbb5b9d6a0607a7e16d8f92e7cf5dea1f9..17f5f9d2900c01acb4587297a9e4347b07c055d4 100644 (file)
@@ -3071,7 +3071,7 @@ s7_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *i
   if (elf_hash_table (info)->dynamic_sections_created)
     {
       /* Set the contents of the .interp section to the interpreter.  */
-      if (!bfd_link_pic (info) && !info->nointerp)
+      if (bfd_link_executable (info) && !info->nointerp)
         {
           s = bfd_get_linker_section (dynobj, ".interp");
           BFD_ASSERT (s != NULL);