aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-08-07 14:40:35 +0930
committerAlan Modra <amodra@gmail.com>2023-08-09 08:48:09 +0930
commit226f9f4fadb087875ef98a0a55d614236c6241b3 (patch)
treee6c63b104143dd86acf739d5633649582668224e /sim
parentfeddea4b466ce4f2bb2301fd2d4bef56e8d09ccc (diff)
downloadbinutils-226f9f4fadb087875ef98a0a55d614236c6241b3.zip
binutils-226f9f4fadb087875ef98a0a55d614236c6241b3.tar.gz
binutils-226f9f4fadb087875ef98a0a55d614236c6241b3.tar.bz2
Rename bfd_bread and bfd_bwrite
These were renamed from bfd_read and bfd_write back in 2001 when they lost an unnecessary parameter. Rename them back, and get rid of a few casts that are only needed without prototyped functions (K&R C).
Diffstat (limited to 'sim')
-rw-r--r--sim/bfin/interp.c8
-rw-r--r--sim/cris/sim-if.c4
-rw-r--r--sim/rl78/load.c2
-rw-r--r--sim/rx/load.c2
4 files changed, 8 insertions, 8 deletions
diff --git a/sim/bfin/interp.c b/sim/bfin/interp.c
index 02920de..8ad6769 100644
--- a/sim/bfin/interp.c
+++ b/sim/bfin/interp.c
@@ -771,7 +771,7 @@ bfin_fdpic_load (SIM_DESC sd, SIM_CPU *cpu, struct bfd *abfd, bu32 *sp,
goto skip_fdpic_init;
if (bfd_seek (abfd, 0, SEEK_SET) != 0)
goto skip_fdpic_init;
- if (bfd_bread (&ehdr, sizeof (ehdr), abfd) != sizeof (ehdr))
+ if (bfd_read (&ehdr, sizeof (ehdr), abfd) != sizeof (ehdr))
goto skip_fdpic_init;
iehdr = elf_elfheader (abfd);
if (!(iehdr->e_flags & EF_BFIN_FDPIC))
@@ -810,7 +810,7 @@ bfin_fdpic_load (SIM_DESC sd, SIM_CPU *cpu, struct bfd *abfd, bu32 *sp,
if (bfd_seek (abfd, iehdr->e_phoff, SEEK_SET) != 0)
goto skip_fdpic_init;
data = xmalloc (phdr_size);
- if (bfd_bread (data, phdr_size, abfd) != phdr_size)
+ if (bfd_read (data, phdr_size, abfd) != phdr_size)
goto skip_fdpic_init;
*sp -= phdr_size;
elf_addrs[1] = *sp;
@@ -844,7 +844,7 @@ bfin_fdpic_load (SIM_DESC sd, SIM_CPU *cpu, struct bfd *abfd, bu32 *sp,
memset (data + filesz, 0, memsz - filesz);
if (bfd_seek (abfd, p->p_offset, SEEK_SET) == 0
- && bfd_bread (data, filesz, abfd) == filesz)
+ && bfd_read (data, filesz, abfd) == filesz)
sim_write (sd, paddr, data, memsz);
free (data);
@@ -870,7 +870,7 @@ bfin_fdpic_load (SIM_DESC sd, SIM_CPU *cpu, struct bfd *abfd, bu32 *sp,
*ldso_path = xmalloc (len);
if (bfd_seek (abfd, off, SEEK_SET) != 0
- || bfd_bread (*ldso_path, len, abfd) != len)
+ || bfd_read (*ldso_path, len, abfd) != len)
{
free (*ldso_path);
*ldso_path = NULL;
diff --git a/sim/cris/sim-if.c b/sim/cris/sim-if.c
index 5c220ff..cad7169 100644
--- a/sim/cris/sim-if.c
+++ b/sim/cris/sim-if.c
@@ -262,7 +262,7 @@ cris_load_elf_file (SIM_DESC sd, struct bfd *abfd, sim_write_fn do_write)
(uint64_t) lma, (uint64_t) phdr[i].p_filesz);
if (bfd_seek (abfd, phdr[i].p_offset, SEEK_SET) != 0
- || (bfd_bread (buf, phdr[i].p_filesz, abfd) != phdr[i].p_filesz))
+ || (bfd_read (buf, phdr[i].p_filesz, abfd) != phdr[i].p_filesz))
{
sim_io_eprintf (sd,
"%s: could not read segment at 0x%" PRIx64 ", "
@@ -530,7 +530,7 @@ cris_handle_interpreter (SIM_DESC sd, struct bfd *abfd)
/* Read in the name. */
if (bfd_seek (abfd, phdr[i].p_offset, SEEK_SET) != 0
- || (bfd_bread (interp + strlen (simulator_sysroot), interplen, abfd)
+ || (bfd_read (interp + strlen (simulator_sysroot), interplen, abfd)
!= interplen))
goto interpname_failed;
diff --git a/sim/rl78/load.c b/sim/rl78/load.c
index 85d0fcf..86211d6 100644
--- a/sim/rl78/load.c
+++ b/sim/rl78/load.c
@@ -149,7 +149,7 @@ rl78_load (bfd *prog, host_callback *callbacks, const char * const simname)
continue;
}
- if (bfd_bread (buf, size, prog) != size)
+ if (bfd_read (buf, size, prog) != size)
{
fprintf (stderr, "%s: Failed to read %" PRIx64 " bytes\n",
simname, (uint64_t) size);
diff --git a/sim/rx/load.c b/sim/rx/load.c
index 2378094..ffb262f 100644
--- a/sim/rx/load.c
+++ b/sim/rx/load.c
@@ -153,7 +153,7 @@ rx_load (bfd *prog, host_callback *callback)
fprintf (stderr, "Failed to seek to offset %lx\n", (long) offset);
continue;
}
- if (bfd_bread (buf, size, prog) != size)
+ if (bfd_read (buf, size, prog) != size)
{
fprintf (stderr, "Failed to read %" PRIx64 " bytes\n",
(uint64_t) size);