aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2007-07-09 21:19:51 +0000
committerRoland McGrath <roland@gnu.org>2007-07-09 21:19:51 +0000
commit1118d2524ea7960e230fc137d56b63e5600d1948 (patch)
tree565e50c5ec48385824cbf678c7ba5df5d839941b /binutils
parent1d81b01501aec99e26db96cbe22bf652c10cf7ed (diff)
downloadgdb-1118d2524ea7960e230fc137d56b63e5600d1948.zip
gdb-1118d2524ea7960e230fc137d56b63e5600d1948.tar.gz
gdb-1118d2524ea7960e230fc137d56b63e5600d1948.tar.bz2
2007-07-09 Roland McGrath <roland@redhat.com>
* readelf.c (get_gnu_elf_note_type): New function. (process_note): Use it for "GNU" name.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/readelf.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 9305d04..7910836 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -2792,7 +2792,7 @@ usage (FILE *stream)
@<file> Read options from <file>\n\
-H --help Display this information\n\
-v --version Display the version number of readelf\n"));
-
+
if (REPORT_BUGS_TO[0] && stream == stdout)
fprintf (stdout, _("Report bugs to %s\n"), REPORT_BUGS_TO);
@@ -7710,7 +7710,7 @@ dump_section (Elf_Internal_Shdr *section, FILE *file)
printf (_(" NOTE: This section has relocations against it, but these have NOT been applied to this dump.\n"));
break;
}
-
+
data = start;
while (bytes)
@@ -9128,6 +9128,27 @@ get_note_type (unsigned e_type)
}
static const char *
+get_gnu_elf_note_type (unsigned e_type)
+{
+ static char buff[64];
+
+ switch (e_type)
+ {
+ case NT_GNU_ABI_TAG:
+ return _("NT_GNU_ABI_TAG (ABI version tag)");
+ case NT_GNU_HWCAP:
+ return _("NT_GNU_HWCAP (DSO-supplied software HWCAP info)");
+ case NT_GNU_BUILD_ID:
+ return _("NT_GNU_BUILD_ID (unique build ID bitstring)");
+ default:
+ break;
+ }
+
+ snprintf (buff, sizeof (buff), _("Unknown note type: (0x%08x)"), e_type);
+ return buff;
+}
+
+static const char *
get_netbsd_elfcore_note_type (unsigned e_type)
{
static char buff[64];
@@ -9204,6 +9225,10 @@ process_note (Elf_Internal_Note *pnote)
note type strings. */
nt = get_note_type (pnote->type);
+ else if (const_strneq (pnote->namedata, "GNU"))
+ /* GNU-specific object file notes. */
+ nt = get_gnu_elf_note_type (pnote->type);
+
else if (const_strneq (pnote->namedata, "NetBSD-CORE"))
/* NetBSD-specific core file notes. */
nt = get_netbsd_elfcore_note_type (pnote->type);