aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorJordan Rupprecht via binutils <binutils@sourceware.org>2019-08-07 13:48:14 -0700
committerAlan Modra <amodra@gmail.com>2019-08-08 11:13:29 +0930
commit178d871928b99112a39e0ca1284d6bbdde50ab6e (patch)
tree5dfb47648da9edf9d906d02a41045b0aed8e3598 /binutils
parentb1791af06ec358d21dbe6a99129f11cc02438962 (diff)
downloadgdb-178d871928b99112a39e0ca1284d6bbdde50ab6e.zip
gdb-178d871928b99112a39e0ca1284d6bbdde50ab6e.tar.gz
gdb-178d871928b99112a39e0ca1284d6bbdde50ab6e.tar.bz2
readelf: mask unknown description data bytes.
When printing unknown note types, readelf prints the raw description section byte-by-byte. However, it does not mask appropriately, e.g. it prints the byte 'ba' as 'ffffffba'. * readelf.c (process_note): Mask unknown description data bytes.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog4
-rw-r--r--binutils/readelf.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index b60ae64..0498a0c 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,7 @@
+2019-08-08 Jordan Rupprecht <rupprecht@google.com>
+
+ * readelf.c (process_note): Mask unknown description data bytes.
+
2019-08-08 Alan Modra <amodra@gmail.com>
* readelf.c (get_data): Improve overflow checks.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 3e3e27d..3c8a9d4 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -19115,7 +19115,7 @@ process_note (Elf_Internal_Note * pnote,
printf (_(" description data: "));
for (i = 0; i < pnote->descsz; i++)
- printf ("%02x ", pnote->descdata[i]);
+ printf ("%02x ", pnote->descdata[i] & 0xff);
if (!do_wide)
printf ("\n");
}