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] Set correct SHT_NOTE type for .note.spu_name


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

commit d1c86cff1ecdd1027bd224d38f2161196e9955fa
Author: Alan Modra <amodra@gmail.com>
Date:   Fri Oct 5 19:52:55 2018 +0930

    Set correct SHT_NOTE type for .note.spu_name
    
    	* elf32-spu.c (spu_elf_create_sections): Make .note.spu_name
    	SHT_NOTE.

Diff:
---
 bfd/ChangeLog   | 5 +++++
 bfd/elf32-spu.c | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index f5caffb..da2a4d2 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2018-10-05  Alan Modra  <amodra@gmail.com>
+
+	* elf32-spu.c (spu_elf_create_sections): Make .note.spu_name
+	SHT_NOTE.
+
 2018-10-05  Richard Henderson  <rth@twiddle.net>
 
 	* bfd-in2.h: Regenerated.
diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c
index c3bfbbd..bb3264f 100644
--- a/bfd/elf32-spu.c
+++ b/bfd/elf32-spu.c
@@ -580,11 +580,16 @@ spu_elf_create_sections (struct bfd_link_info *info)
       flagword flags;
 
       ibfd = info->input_bfds;
+      /* This should really be SEC_LINKER_CREATED, but then we'd need
+	 to write out the section ourselves.  */
       flags = SEC_LOAD | SEC_READONLY | SEC_HAS_CONTENTS | SEC_IN_MEMORY;
       s = bfd_make_section_anyway_with_flags (ibfd, SPU_PTNOTE_SPUNAME, flags);
       if (s == NULL
 	  || !bfd_set_section_alignment (ibfd, s, 4))
 	return FALSE;
+      /* Because we didn't set SEC_LINKER_CREATED we need to set the
+	 proper section type.  */
+      elf_section_type (s) = SHT_NOTE;
 
       name_len = strlen (bfd_get_filename (info->output_bfd)) + 1;
       size = 12 + ((sizeof (SPU_PLUGIN_NAME) + 3) & -4);


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