+static const char *
+get_v850_elf_note_type (enum v850_notes n_type)
+{
+ static char buff[64];
+
+ switch (n_type)
+ {
+ case V850_NOTE_ALIGNMENT: return _("Alignment of 8-byte objects");
+ case V850_NOTE_DATA_SIZE: return _("Sizeof double and long double");
+ case V850_NOTE_FPU_INFO: return _("Type of FPU support needed");
+ case V850_NOTE_SIMD_INFO: return _("Use of SIMD instructions");
+ case V850_NOTE_CACHE_INFO: return _("Use of cache");
+ case V850_NOTE_MMU_INFO: return _("Use of MMU");
+ default:
+ snprintf (buff, sizeof (buff), _("Unknown note type: (0x%08x)"), n_type);
+ return buff;
+ }
+}
+
+static int
+print_v850_note (Elf_Internal_Note * pnote)
+{
+ unsigned int val;
+
+ if (pnote->descsz != 4)
+ return 0;
+ val = byte_get ((unsigned char *) pnote->descdata, pnote->descsz);
+
+ if (val == 0)
+ {
+ printf (_("not set\n"));
+ return 1;
+ }
+
+ switch (pnote->type)
+ {
+ case V850_NOTE_ALIGNMENT:
+ switch (val)
+ {
+ case EF_RH850_DATA_ALIGN4: printf (_("4-byte\n")); return 1;
+ case EF_RH850_DATA_ALIGN8: printf (_("8-byte\n")); return 1;
+ }
+ break;
+
+ case V850_NOTE_DATA_SIZE:
+ switch (val)
+ {
+ case EF_RH850_DOUBLE32: printf (_("4-bytes\n")); return 1;
+ case EF_RH850_DOUBLE64: printf (_("8-bytes\n")); return 1;
+ }
+ break;
+
+ case V850_NOTE_FPU_INFO:
+ switch (val)
+ {
+ case EF_RH850_FPU20: printf (_("FPU-2.0\n")); return 1;
+ case EF_RH850_FPU30: printf (_("FPU-3.0\n")); return 1;
+ }
+ break;
+
+ case V850_NOTE_MMU_INFO:
+ case V850_NOTE_CACHE_INFO:
+ case V850_NOTE_SIMD_INFO:
+ if (val == EF_RH850_SIMD)
+ {
+ printf (_("yes\n"));
+ return 1;
+ }
+ break;
+
+ default:
+ /* An 'unknown note type' message will already have been displayed. */
+ break;
+ }
+
+ printf (_("unknown value: %x\n"), val);
+ return 0;
+}
+
+static int
+process_netbsd_elf_note (Elf_Internal_Note * pnote)
+{
+ unsigned int version;
+
+ switch (pnote->type)
+ {
+ case NT_NETBSD_IDENT:
+ version = byte_get ((unsigned char *) pnote->descdata, sizeof (version));
+ if ((version / 10000) % 100)
+ printf (" NetBSD\t\t0x%08lx\tIDENT %u (%u.%u%s%c)\n", pnote->descsz,
+ version, version / 100000000, (version / 1000000) % 100,
+ (version / 10000) % 100 > 26 ? "Z" : "",
+ 'A' + (version / 10000) % 26);
+ else
+ printf (" NetBSD\t\t0x%08lx\tIDENT %u (%u.%u.%u)\n", pnote->descsz,
+ version, version / 100000000, (version / 1000000) % 100,
+ (version / 100) % 100);
+ return 1;
+
+ case NT_NETBSD_MARCH:
+ printf (" NetBSD\t0x%08lx\tMARCH <%s>\n", pnote->descsz,
+ pnote->descdata);
+ return 1;
+
+ default:
+ break;
+ }
+
+ printf (" NetBSD\t0x%08lx\tUnknown note type: (0x%08lx)\n", pnote->descsz,
+ pnote->type);
+ return 1;
+}
+
+static const char *
+get_freebsd_elfcore_note_type (unsigned e_type)
+{
+ switch (e_type)
+ {
+ case NT_FREEBSD_THRMISC:
+ return _("NT_THRMISC (thrmisc structure)");
+ case NT_FREEBSD_PROCSTAT_PROC:
+ return _("NT_PROCSTAT_PROC (proc data)");
+ case NT_FREEBSD_PROCSTAT_FILES:
+ return _("NT_PROCSTAT_FILES (files data)");
+ case NT_FREEBSD_PROCSTAT_VMMAP:
+ return _("NT_PROCSTAT_VMMAP (vmmap data)");
+ case NT_FREEBSD_PROCSTAT_GROUPS:
+ return _("NT_PROCSTAT_GROUPS (groups data)");
+ case NT_FREEBSD_PROCSTAT_UMASK:
+ return _("NT_PROCSTAT_UMASK (umask data)");
+ case NT_FREEBSD_PROCSTAT_RLIMIT:
+ return _("NT_PROCSTAT_RLIMIT (rlimit data)");
+ case NT_FREEBSD_PROCSTAT_OSREL:
+ return _("NT_PROCSTAT_OSREL (osreldate data)");
+ case NT_FREEBSD_PROCSTAT_PSSTRINGS:
+ return _("NT_PROCSTAT_PSSTRINGS (ps_strings data)");
+ case NT_FREEBSD_PROCSTAT_AUXV:
+ return _("NT_PROCSTAT_AUXV (auxv data)");
+ }
+ return get_note_type (e_type);
+}
+