binutils/binutils-2.25.1-ihex-parsing.patch

56 lines
1.9 KiB
Diff
Raw Normal View History

diff -rup binutils-2.25.1.orig/bfd/ihex.c binutils-2.25.1/bfd/ihex.c
--- binutils-2.25.1.orig/bfd/ihex.c 2015-08-04 17:10:24.766693094 +0100
+++ binutils-2.25.1/bfd/ihex.c 2015-08-04 17:10:44.824807881 +0100
@@ -219,7 +219,7 @@ ihex_bad_byte (bfd *abfd, unsigned int l
char buf[10];
if (! ISPRINT (c))
- sprintf (buf, "\\%03o", (unsigned int) c);
+ sprintf (buf, "\\%03o", (unsigned int) c & 0xff);
else
{
buf[0] = c;
@@ -276,7 +276,7 @@ ihex_scan (bfd *abfd)
else
{
file_ptr pos;
- char hdr[8];
+ unsigned char hdr[8];
unsigned int i;
unsigned int len;
bfd_vma addr;
@@ -553,7 +553,7 @@ ihex_read_section (bfd *abfd, asection *
error = FALSE;
while ((c = ihex_get_byte (abfd, &error)) != EOF)
{
- char hdr[8];
+ unsigned char hdr[8];
unsigned int len;
unsigned int type;
unsigned int i;
diff -rup binutils-2.25.1.orig/bfd/srec.c binutils-2.25.1/bfd/srec.c
--- binutils-2.25.1.orig/bfd/srec.c 2015-08-04 17:10:24.774693139 +0100
+++ binutils-2.25.1/bfd/srec.c 2015-08-04 17:10:44.824807881 +0100
@@ -249,7 +249,7 @@ srec_bad_byte (bfd *abfd,
char buf[40];
if (! ISPRINT (c))
- sprintf (buf, "\\%03o", (unsigned int) c);
+ sprintf (buf, "\\%03o", (unsigned int) c & 0xff);
else
{
buf[0] = c;
diff -rup binutils-2.25.1.orig/binutils/readelf.c binutils-2.25.1/binutils/readelf.c
--- binutils-2.25.1.orig/binutils/readelf.c 2015-08-04 17:10:24.856693609 +0100
+++ binutils-2.25.1/binutils/readelf.c 2015-08-04 17:10:44.829807910 +0100
@@ -13838,7 +13838,7 @@ process_mips_specific (FILE * file)
len = sizeof (* eopt);
while (len < option->size)
{
- char datum = * ((char *) eopt + offset + len);
+ unsigned char datum = * ((unsigned char *) eopt + offset + len);
if (ISPRINT (datum))
printf ("%c", datum);
Only in binutils-2.25.1/binutils: readelf.c.orig