* 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.
+2007-08-25 Ulrich Weigand <uweigand@de.ibm.com>
+ Alan Modra <amodra@bigpond.net.au>
+
+ * elf.c (elfcore_grok_spu_note): New function.
+ (elf_parse_notes): Call it.
+
2007-08-24 H.J. Lu <hongjiu.lu@intel.com>
* elf64-x86-64.c (elf64_x86_64_relocate_section): Adjust
}
}
+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:
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))
+2007-08-25 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * readelf.c (process_note): Recognize SPU core file notes.
+
2007-08-24 Daniel Jacobowitz <dan@codesourcery.com>
* configure.in: Install embedspu on powerpc*-*-eabi* also.
static int
process_note (Elf_Internal_Note *pnote)
{
+ const char *name = pnote->namesz ? pnote->namedata : "(NONE)";
const char *nt;
if (pnote->namesz == 0)
/* NetBSD-specific core file notes. */
nt = get_netbsd_elfcore_note_type (pnote->type);
+ else if (strneq (pnote->namedata, "SPU/", 4))
+ {
+ /* SPU-specific core file notes. */
+ nt = pnote->namedata + 4;
+ name = "SPU";
+ }
+
else
/* Don't recognize this note name; just use the default set of
note type strings. */
nt = get_note_type (pnote->type);
- printf (" %s\t\t0x%08lx\t%s\n",
- pnote->namesz ? pnote->namedata : "(NONE)",
- pnote->descsz, nt);
+ printf (" %s\t\t0x%08lx\t%s\n", name, pnote->descsz, nt);
return 1;
}
+2007-08-25 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * common.h (NT_SPU): Define.
+
2007-08-16 H.J. Lu <hongjiu.lu@intel.com>
* common.h: Revert last change.
#define NT_NETBSDCORE_PROCINFO 1 /* Has a struct procinfo */
#define NT_NETBSDCORE_FIRSTMACH 32 /* start of machdep note types */
+/* Note segments for core files on SPU systems. Note name
+ must start with "SPU/". */
+
+#define NT_SPU 1
/* Values of note segment descriptor types for object files. */