projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH]: aarch64: Refactor representation of system registers
[deliverable/binutils-gdb.git]
/
bfd
/
ihex.c
diff --git
a/bfd/ihex.c
b/bfd/ihex.c
index 09149089bebed811b5c462eff9b01426a7ecedad..4055d47e3d9efdcd1b0c594f91b7e0ced090277b 100644
(file)
--- a/
bfd/ihex.c
+++ b/
bfd/ihex.c
@@
-1,5
+1,5
@@
/* BFD back-end for Intel Hex objects.
/* BFD back-end for Intel Hex objects.
- Copyright (C) 1995-20
19
Free Software Foundation, Inc.
+ Copyright (C) 1995-20
20
Free Software Foundation, Inc.
Written by Ian Lance Taylor of Cygnus Support <ian@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
Written by Ian Lance Taylor of Cygnus Support <ian@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
@@
-357,7
+357,7
@@
ihex_scan (bfd *abfd)
{
char secbuf[20];
char *secname;
{
char secbuf[20];
char *secname;
-
bfd_size_type
amt;
+
size_t
amt;
flagword flags;
sprintf (secbuf, ".sec%d", bfd_count_sections (abfd) + 1);
flagword flags;
sprintf (secbuf, ".sec%d", bfd_count_sections (abfd) + 1);
@@
-381,8
+381,7
@@
ihex_scan (bfd *abfd)
/* An end record. */
if (abfd->start_address == 0)
abfd->start_address = addr;
/* An end record. */
if (abfd->start_address == 0)
abfd->start_address = addr;
- if (buf != NULL)
- free (buf);
+ free (buf);
return TRUE;
case 2:
return TRUE;
case 2:
@@
-474,20
+473,17
@@
ihex_scan (bfd *abfd)
if (error)
goto error_return;
if (error)
goto error_return;
- if (buf != NULL)
- free (buf);
-
+ free (buf);
return TRUE;
error_return:
return TRUE;
error_return:
- if (buf != NULL)
- free (buf);
+ free (buf);
return FALSE;
}
/* Try to recognize an Intel Hex file. */
return FALSE;
}
/* Try to recognize an Intel Hex file. */
-static
const bfd_target *
+static
bfd_cleanup
ihex_object_p (bfd *abfd)
{
void * tdata_save;
ihex_object_p (bfd *abfd)
{
void * tdata_save;
@@
-538,7
+534,7
@@
ihex_object_p (bfd *abfd)
return NULL;
}
return NULL;
}
- return
abfd->xvec
;
+ return
_bfd_no_cleanup
;
}
/* Read the contents of a section in an Intel Hex file. */
}
/* Read the contents of a section in an Intel Hex file. */
@@
-603,8
+599,7
@@
ihex_read_section (bfd *abfd, asection *section, bfd_byte *contents)
if ((bfd_size_type) (p - contents) >= section->size)
{
/* We've read everything in the section. */
if ((bfd_size_type) (p - contents) >= section->size)
{
/* We've read everything in the section. */
- if (buf != NULL)
- free (buf);
+ free (buf);
return TRUE;
}
return TRUE;
}
@@
-621,14
+616,11
@@
ihex_read_section (bfd *abfd, asection *section, bfd_byte *contents)
goto error_return;
}
goto error_return;
}
- if (buf != NULL)
- free (buf);
-
+ free (buf);
return TRUE;
error_return:
return TRUE;
error_return:
- if (buf != NULL)
- free (buf);
+ free (buf);
return FALSE;
}
return FALSE;
}
@@
-811,16
+803,15
@@
ihex_write_object_contents (bfd *abfd)
if (count > CHUNK)
now = CHUNK;
if (count > CHUNK)
now = CHUNK;
- if (where > segbase + extbase + 0xffff)
+ if (where < extbase
+ || where - extbase < segbase
+ || where - extbase - segbase > 0xffff)
{
bfd_byte addr[2];
/* We need a new base address. */
{
bfd_byte addr[2];
/* We need a new base address. */
- if (where <= 0xfffff)
+ if (
extbase == 0 &&
where <= 0xfffff)
{
{
- /* The addresses should be sorted. */
- BFD_ASSERT (extbase == 0);
-
segbase = where & 0xf0000;
addr[0] = (bfd_byte)(segbase >> 12) & 0xff;
addr[1] = (bfd_byte)(segbase >> 4) & 0xff;
segbase = where & 0xf0000;
addr[0] = (bfd_byte)(segbase >> 12) & 0xff;
addr[1] = (bfd_byte)(segbase >> 4) & 0xff;
This page took
0.024676 seconds
and
4
git commands to generate.