This is the mail archive of the binutils@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]

Correct .note.spu_name sh_type


.note.spu_name was SHT_PROGBITS.  According to the ABI it ought to be
SHT_NOTE.

	* elf32-spu.c (spu_elf_fake_sections): New function.
	(elf_backend_fake_sections): Define.

Index: bfd/elf32-spu.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-spu.c,v
retrieving revision 1.18
diff -u -p -r1.18 elf32-spu.c
--- bfd/elf32-spu.c	27 Jun 2007 07:12:54 -0000	1.18
+++ bfd/elf32-spu.c	29 Jun 2007 01:21:52 -0000
@@ -3024,6 +3024,18 @@ spu_elf_check_vma (bfd *abfd, bfd_vma lo
   return NULL;
 }
 
+/* Tweak the section type of .note.spu_name.  */
+
+static bfd_boolean
+spu_elf_fake_sections (bfd *obfd ATTRIBUTE_UNUSED,
+		       Elf_Internal_Shdr *hdr,
+		       asection *sec)
+{
+  if (strcmp (sec->name, SPU_PTNOTE_SPUNAME) == 0)
+    hdr->sh_type = SHT_NOTE;
+  return TRUE;
+}
+
 /* Tweak phdrs before writing them out.  */
 
 static int
@@ -3135,6 +3147,7 @@ spu_elf_modify_program_headers (bfd *abf
 #define elf_backend_modify_segment_map		spu_elf_modify_segment_map
 #define elf_backend_modify_program_headers	spu_elf_modify_program_headers
 #define elf_backend_post_process_headers        spu_elf_post_process_headers
+#define elf_backend_fake_sections		spu_elf_fake_sections
 #define elf_backend_special_sections		spu_elf_special_sections
 #define bfd_elf32_bfd_final_link		spu_elf_final_link
 

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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