aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2007-08-25 13:20:41 +0000
committerAlan Modra <amodra@gmail.com>2007-08-25 13:20:41 +0000
commitb15fa79e3ab3598d2a985fdc24d3fe68700b85a9 (patch)
treed35162173cb0c28bd6629572ce7c11bdf8152200 /bfd/elf.c
parent043b877a95014ccb8ee27733dc1ced0d25531ae4 (diff)
downloadgdb-b15fa79e3ab3598d2a985fdc24d3fe68700b85a9.zip
gdb-b15fa79e3ab3598d2a985fdc24d3fe68700b85a9.tar.gz
gdb-b15fa79e3ab3598d2a985fdc24d3fe68700b85a9.tar.bz2
include/elf/
* common.h (NT_SPU): Define. bfd/ * elf.c (elfcore_grok_spu_note): New function. (elf_parse_notes): Call it. binutils/ * readelf.c (process_note): Recognize SPU core file notes.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index 27c55af..16dd4a0 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -7980,6 +7980,32 @@ elfcore_grok_nto_note (bfd *abfd, Elf_Internal_Note *note)
}
}
+static bfd_boolean
+elfcore_grok_spu_note (bfd *abfd, Elf_Internal_Note *note)
+{
+ char *name;
+ asection *sect;
+ size_t len;
+
+ /* Use note name as section name. */
+ len = note->namesz;
+ name = bfd_alloc (abfd, len);
+ if (name == NULL)
+ return FALSE;
+ memcpy (name, note->namedata, len);
+ name[len - 1] = '\0';
+
+ sect = bfd_make_section_anyway_with_flags (abfd, name, SEC_HAS_CONTENTS);
+ if (sect == NULL)
+ return FALSE;
+
+ sect->size = note->descsz;
+ sect->filepos = note->descpos;
+ sect->alignment_power = 1;
+
+ return TRUE;
+}
+
/* Function: elfcore_write_note
Inputs:
@@ -8280,6 +8306,11 @@ elf_parse_notes (bfd *abfd, char *buf, size_t size, file_ptr offset)
if (! elfcore_grok_nto_note (abfd, &in))
return FALSE;
}
+ else if (CONST_STRNEQ (in.namedata, "SPU/"))
+ {
+ if (! elfcore_grok_spu_note (abfd, &in))
+ return FALSE;
+ }
else
{
if (! elfcore_grok_note (abfd, &in))