This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fix remaining targets using wrong .interp conditions


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f5233a1611d7d459a762b5fa93d7594a6965971f

commit f5233a1611d7d459a762b5fa93d7594a6965971f
Author: Alan Modra <amodra@gmail.com>
Date:   Wed Oct 11 22:43:42 2017 +1030

    Fix remaining targets using wrong .interp conditions
    
    	* 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.

Diff:
---
 bfd/ChangeLog      | 7 +++++++
 bfd/elf32-nds32.c  | 2 +-
 bfd/elf32-score.c  | 2 +-
 bfd/elf32-score7.c | 2 +-
 4 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index eb81920..1af3560 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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'
diff --git a/bfd/elf32-nds32.c b/bfd/elf32-nds32.c
index ddf1465..4341007 100644
--- a/bfd/elf32-nds32.c
+++ b/bfd/elf32-nds32.c
@@ -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);
diff --git a/bfd/elf32-score.c b/bfd/elf32-score.c
index 5fc10b3..69a19ec 100644
--- a/bfd/elf32-score.c
+++ b/bfd/elf32-score.c
@@ -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);
diff --git a/bfd/elf32-score7.c b/bfd/elf32-score7.c
index 5554ccc..17f5f9d 100644
--- a/bfd/elf32-score7.c
+++ b/bfd/elf32-score7.c
@@ -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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]