aboutsummaryrefslogtreecommitdiff
path: root/ld
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 /ld
parentfeddea4b466ce4f2bb2301fd2d4bef56e8d09ccc (diff)
downloadgdb-226f9f4fadb087875ef98a0a55d614236c6241b3.zip
gdb-226f9f4fadb087875ef98a0a55d614236c6241b3.tar.gz
gdb-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 'ld')
-rw-r--r--ld/emultempl/pe.em4
-rw-r--r--ld/emultempl/pep.em4
-rw-r--r--ld/ldelf.c4
-rw-r--r--ld/pdb.c108
-rw-r--r--ld/pe-dll.c20
5 files changed, 70 insertions, 70 deletions
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index a583b02..36f60d5 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -1355,7 +1355,7 @@ pecoff_checksum_contents (bfd *abfd,
if (bfd_seek (abfd, filepos, SEEK_SET) != 0)
return 0;
- status = bfd_bread (&b, (bfd_size_type) 1, abfd);
+ status = bfd_read (&b, 1, abfd);
if (status < 1)
{
break;
@@ -1446,7 +1446,7 @@ write_build_id (bfd *abfd)
if (bfd_seek (abfd, asec->filepos + link_order->offset, SEEK_SET) != 0)
return 0;
- if (bfd_bwrite (contents, sizeof (*ext), abfd) != sizeof (*ext))
+ if (bfd_write (contents, sizeof (*ext), abfd) != sizeof (*ext))
return 0;
#ifdef PDB_H
diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em
index 516d2af..1df959a 100644
--- a/ld/emultempl/pep.em
+++ b/ld/emultempl/pep.em
@@ -1353,7 +1353,7 @@ pecoff_checksum_contents (bfd *abfd,
if (bfd_seek (abfd, filepos, SEEK_SET) != 0)
return 0;
- status = bfd_bread (&b, (bfd_size_type) 1, abfd);
+ status = bfd_read (&b, 1, abfd);
if (status < 1)
{
break;
@@ -1444,7 +1444,7 @@ write_build_id (bfd *abfd)
if (bfd_seek (abfd, asec->filepos + link_order->offset, SEEK_SET) != 0)
return 0;
- if (bfd_bwrite (contents, sizeof (*ext), abfd) != sizeof (*ext))
+ if (bfd_write (contents, sizeof (*ext), abfd) != sizeof (*ext))
return 0;
#ifdef PDB_H
diff --git a/ld/ldelf.c b/ld/ldelf.c
index 23a014d..4212075 100644
--- a/ld/ldelf.c
+++ b/ld/ldelf.c
@@ -1482,7 +1482,7 @@ write_build_id (bfd *abfd)
position = i_shdr->sh_offset + asec->output_offset;
size = asec->size;
return (bfd_seek (abfd, position, SEEK_SET) == 0
- && bfd_bwrite (contents, size, abfd) == size);
+ && bfd_write (contents, size, abfd) == size);
}
/* Make .note.gnu.build-id section, and set up elf_tdata->build_id. */
@@ -1570,7 +1570,7 @@ write_package_metadata (bfd *abfd)
position = i_shdr->sh_offset + asec->output_offset;
size = asec->size;
return (bfd_seek (abfd, position, SEEK_SET) == 0
- && bfd_bwrite (contents, size, abfd) == size);
+ && bfd_write (contents, size, abfd) == size);
}
/* Make .note.package section.
diff --git a/ld/pdb.c b/ld/pdb.c
index 267da50..96fc3f1 100644
--- a/ld/pdb.c
+++ b/ld/pdb.c
@@ -220,7 +220,7 @@ create_old_directory_stream (bfd *pdb)
bfd_putl32 (0, buf);
- return bfd_bwrite (buf, sizeof (uint32_t), stream) == sizeof (uint32_t);
+ return bfd_write (buf, sizeof (uint32_t), stream) == sizeof (uint32_t);
}
/* Calculate the hash of a given string. */
@@ -288,7 +288,7 @@ populate_info_stream (bfd *pdb, bfd *info_stream, const unsigned char *guid)
bfd_putl16 (bfd_getb16 (&guid[6]), &h.guid[6]);
memcpy (&h.guid[8], &guid[8], 8);
- if (bfd_bwrite (&h, sizeof (h), info_stream) != sizeof (h))
+ if (bfd_write (&h, sizeof (h), info_stream) != sizeof (h))
return false;
/* Write hash list of named streams. This is a "rollover" hash, i.e.
@@ -344,7 +344,7 @@ populate_info_stream (bfd *pdb, bfd *info_stream, const unsigned char *guid)
bfd_putl32 (names_length, int_buf);
- if (bfd_bwrite (int_buf, sizeof (uint32_t), info_stream) !=
+ if (bfd_write (int_buf, sizeof (uint32_t), info_stream) !=
sizeof (uint32_t))
goto end;
@@ -355,7 +355,7 @@ populate_info_stream (bfd *pdb, bfd *info_stream, const unsigned char *guid)
size_t len = strlen (b->filename) + 1;
- if (bfd_bwrite (b->filename, len, info_stream) != len)
+ if (bfd_write (b->filename, len, info_stream) != len)
goto end;
}
@@ -363,13 +363,13 @@ populate_info_stream (bfd *pdb, bfd *info_stream, const unsigned char *guid)
bfd_putl32 (num_entries, int_buf);
- if (bfd_bwrite (int_buf, sizeof (uint32_t), info_stream) !=
+ if (bfd_write (int_buf, sizeof (uint32_t), info_stream) !=
sizeof (uint32_t))
goto end;
bfd_putl32 (num_buckets, int_buf);
- if (bfd_bwrite (int_buf, sizeof (uint32_t), info_stream) !=
+ if (bfd_write (int_buf, sizeof (uint32_t), info_stream) !=
sizeof (uint32_t))
goto end;
@@ -377,7 +377,7 @@ populate_info_stream (bfd *pdb, bfd *info_stream, const unsigned char *guid)
bfd_putl32 ((num_buckets + 31) / 32, int_buf);
- if (bfd_bwrite (int_buf, sizeof (uint32_t), info_stream) !=
+ if (bfd_write (int_buf, sizeof (uint32_t), info_stream) !=
sizeof (uint32_t))
goto end;
@@ -396,7 +396,7 @@ populate_info_stream (bfd *pdb, bfd *info_stream, const unsigned char *guid)
bfd_putl32 (v, int_buf);
- if (bfd_bwrite (int_buf, sizeof (uint32_t), info_stream) !=
+ if (bfd_write (int_buf, sizeof (uint32_t), info_stream) !=
sizeof (uint32_t))
goto end;
}
@@ -405,7 +405,7 @@ populate_info_stream (bfd *pdb, bfd *info_stream, const unsigned char *guid)
bfd_putl32 (0, int_buf);
- if (bfd_bwrite (int_buf, sizeof (uint32_t), info_stream) !=
+ if (bfd_write (int_buf, sizeof (uint32_t), info_stream) !=
sizeof (uint32_t))
goto end;
@@ -417,13 +417,13 @@ populate_info_stream (bfd *pdb, bfd *info_stream, const unsigned char *guid)
{
bfd_putl32 (buckets[i]->offset, int_buf);
- if (bfd_bwrite (int_buf, sizeof (uint32_t), info_stream) !=
+ if (bfd_write (int_buf, sizeof (uint32_t), info_stream) !=
sizeof (uint32_t))
goto end;
bfd_putl32 (buckets[i]->value, int_buf);
- if (bfd_bwrite (int_buf, sizeof (uint32_t), info_stream) !=
+ if (bfd_write (int_buf, sizeof (uint32_t), info_stream) !=
sizeof (uint32_t))
goto end;
}
@@ -431,13 +431,13 @@ populate_info_stream (bfd *pdb, bfd *info_stream, const unsigned char *guid)
bfd_putl32 (0, int_buf);
- if (bfd_bwrite (int_buf, sizeof (uint32_t), info_stream) !=
+ if (bfd_write (int_buf, sizeof (uint32_t), info_stream) !=
sizeof (uint32_t))
goto end;
bfd_putl32 (PDB_STREAM_VERSION_VC140, int_buf);
- if (bfd_bwrite (int_buf, sizeof (uint32_t), info_stream) !=
+ if (bfd_write (int_buf, sizeof (uint32_t), info_stream) !=
sizeof (uint32_t))
goto end;
@@ -529,7 +529,7 @@ populate_type_stream (bfd *pdb, bfd *stream, struct types *types)
&h.hash_adj_buffer_offset);
bfd_putl32 (0, &h.hash_adj_buffer_length);
- if (bfd_bwrite (&h, sizeof (h), stream) != sizeof (h))
+ if (bfd_write (&h, sizeof (h), stream) != sizeof (h))
return false;
/* Write the type definitions into the main stream, and the hashes
@@ -545,13 +545,13 @@ populate_type_stream (bfd *pdb, bfd *stream, struct types *types)
size = bfd_getl16 (e->data);
- if (bfd_bwrite (e->data, size + sizeof (uint16_t), stream)
+ if (bfd_write (e->data, size + sizeof (uint16_t), stream)
!= size + sizeof (uint16_t))
return false;
bfd_putl32 (e->cv_hash % NUM_TPI_HASH_BUCKETS, buf);
- if (bfd_bwrite (buf, sizeof (uint32_t), hash_stream)
+ if (bfd_write (buf, sizeof (uint32_t), hash_stream)
!= sizeof (uint32_t))
return false;
@@ -577,13 +577,13 @@ populate_type_stream (bfd *pdb, bfd *stream, struct types *types)
bfd_putl32 (TPI_FIRST_INDEX + e->index, buf);
- if (bfd_bwrite (buf, sizeof (uint32_t), hash_stream)
+ if (bfd_write (buf, sizeof (uint32_t), hash_stream)
!= sizeof (uint32_t))
return false;
bfd_putl32 (old_off, buf);
- if (bfd_bwrite (buf, sizeof (uint32_t), hash_stream)
+ if (bfd_write (buf, sizeof (uint32_t), hash_stream)
!= sizeof (uint32_t))
return false;
}
@@ -891,7 +891,7 @@ add_globals_ref (struct globals *glob, bfd *sym_rec_stream, const char *name,
glob->last = g;
- return bfd_bwrite (data, len, sym_rec_stream) == len;
+ return bfd_write (data, len, sym_rec_stream) == len;
}
/* Find the end of the current scope within symbols data. */
@@ -3870,7 +3870,7 @@ populate_module_stream (bfd *stream, bfd *mod, uint32_t *sym_byte_size,
bfd_putl32 (CV_SIGNATURE_C13, int_buf);
- if (bfd_bwrite (int_buf, sizeof (uint32_t), stream) != sizeof (uint32_t))
+ if (bfd_write (int_buf, sizeof (uint32_t), stream) != sizeof (uint32_t))
{
free (c13_info);
free (syms);
@@ -3879,7 +3879,7 @@ populate_module_stream (bfd *stream, bfd *mod, uint32_t *sym_byte_size,
if (syms)
{
- if (bfd_bwrite (syms, *sym_byte_size, stream) != *sym_byte_size)
+ if (bfd_write (syms, *sym_byte_size, stream) != *sym_byte_size)
{
free (c13_info);
free (syms);
@@ -3891,7 +3891,7 @@ populate_module_stream (bfd *stream, bfd *mod, uint32_t *sym_byte_size,
if (c13_info)
{
- if (bfd_bwrite (c13_info, *c13_info_size, stream) != *c13_info_size)
+ if (bfd_write (c13_info, *c13_info_size, stream) != *c13_info_size)
{
free (c13_info);
return false;
@@ -3904,7 +3904,7 @@ populate_module_stream (bfd *stream, bfd *mod, uint32_t *sym_byte_size,
bfd_putl32 (0, int_buf);
- if (bfd_bwrite (int_buf, sizeof (uint32_t), stream) != sizeof (uint32_t))
+ if (bfd_write (int_buf, sizeof (uint32_t), stream) != sizeof (uint32_t))
return false;
return true;
@@ -4187,7 +4187,7 @@ create_section_contrib_substream (bfd *abfd, void **data, uint32_t *size)
{
bfd_seek (abfd, offset, SEEK_SET);
- if (bfd_bread (sect_flags + (i * sizeof (uint32_t)), sizeof (uint32_t),
+ if (bfd_read (sect_flags + (i * sizeof (uint32_t)), sizeof (uint32_t),
abfd) != sizeof (uint32_t))
{
free (*data);
@@ -4435,7 +4435,7 @@ create_globals_stream (bfd *pdb, struct globals *glob, uint16_t *stream_num)
&h.entries_size);
bfd_putl32 (buckets_size, &h.buckets_size);
- if (bfd_bwrite (&h, sizeof (h), stream) != sizeof (h))
+ if (bfd_write (&h, sizeof (h), stream) != sizeof (h))
return false;
/* Write hash entries, sorted by hash. */
@@ -4447,7 +4447,7 @@ create_globals_stream (bfd *pdb, struct globals *glob, uint16_t *stream_num)
bfd_putl32 (sorted[i]->offset + 1, &hr.offset);
bfd_putl32 (sorted[i]->refcount, &hr.reference);
- if (bfd_bwrite (&hr, sizeof (hr), stream) != sizeof (hr))
+ if (bfd_write (&hr, sizeof (hr), stream) != sizeof (hr))
goto end;
}
@@ -4463,7 +4463,7 @@ create_globals_stream (bfd *pdb, struct globals *glob, uint16_t *stream_num)
v |= 1 << j;
}
- if (bfd_bwrite (&v, sizeof (v), stream) != sizeof (v))
+ if (bfd_write (&v, sizeof (v), stream) != sizeof (v))
goto end;
}
@@ -4471,7 +4471,7 @@ create_globals_stream (bfd *pdb, struct globals *glob, uint16_t *stream_num)
bfd_putl32 (0, int_buf);
- if (bfd_bwrite (int_buf, sizeof (uint32_t), stream) != sizeof (uint32_t))
+ if (bfd_write (int_buf, sizeof (uint32_t), stream) != sizeof (uint32_t))
goto end;
/* Write the bucket offsets. */
@@ -4484,7 +4484,7 @@ create_globals_stream (bfd *pdb, struct globals *glob, uint16_t *stream_num)
Microsoft's parser. */
bfd_putl32 (buckets[i]->index * 0xc, int_buf);
- if (bfd_bwrite (int_buf, sizeof (uint32_t), stream) !=
+ if (bfd_write (int_buf, sizeof (uint32_t), stream) !=
sizeof (uint32_t))
goto end;
}
@@ -4618,7 +4618,7 @@ populate_dbi_stream (bfd *stream, bfd *abfd, bfd *pdb,
bfd_putl16 (get_arch_number (abfd), &h.machine);
bfd_putl32 (0, &h.padding);
- if (bfd_bwrite (&h, sizeof (h), stream) != sizeof (h))
+ if (bfd_write (&h, sizeof (h), stream) != sizeof (h))
{
free (source_info);
free (sc);
@@ -4626,7 +4626,7 @@ populate_dbi_stream (bfd *stream, bfd *abfd, bfd *pdb,
return false;
}
- if (bfd_bwrite (mod_info, mod_info_size, stream) != mod_info_size)
+ if (bfd_write (mod_info, mod_info_size, stream) != mod_info_size)
{
free (source_info);
free (sc);
@@ -4636,7 +4636,7 @@ populate_dbi_stream (bfd *stream, bfd *abfd, bfd *pdb,
free (mod_info);
- if (bfd_bwrite (sc, sc_size, stream) != sc_size)
+ if (bfd_write (sc, sc_size, stream) != sc_size)
{
free (source_info);
free (sc);
@@ -4645,7 +4645,7 @@ populate_dbi_stream (bfd *stream, bfd *abfd, bfd *pdb,
free (sc);
- if (bfd_bwrite (source_info, source_info_size, stream) != source_info_size)
+ if (bfd_write (source_info, source_info_size, stream) != source_info_size)
{
free (source_info);
return false;
@@ -4665,7 +4665,7 @@ populate_dbi_stream (bfd *stream, bfd *abfd, bfd *pdb,
bfd_putl16 (0xffff, &opt.new_fpo_stream);
bfd_putl16 (0xffff, &opt.orig_section_header_stream);
- if (bfd_bwrite (&opt, sizeof (opt), stream) != sizeof (opt))
+ if (bfd_write (&opt, sizeof (opt), stream) != sizeof (opt))
return false;
return true;
@@ -4781,11 +4781,11 @@ populate_publics_stream (bfd *stream, bfd *abfd, bfd *sym_rec_stream)
bfd_putl32 (p->address, &ps.offset);
bfd_putl16 (p->section, &ps.section);
- if (bfd_bwrite (&ps, sizeof (struct pubsym), sym_rec_stream) !=
+ if (bfd_write (&ps, sizeof (struct pubsym), sym_rec_stream) !=
sizeof (struct pubsym))
goto end;
- if (bfd_bwrite (name, name_len + 1, sym_rec_stream) !=
+ if (bfd_write (name, name_len + 1, sym_rec_stream) !=
name_len + 1)
goto end;
@@ -4793,7 +4793,7 @@ populate_publics_stream (bfd *stream, bfd *abfd, bfd *sym_rec_stream)
{
uint8_t b = 0;
- if (bfd_bwrite (&b, sizeof (uint8_t), sym_rec_stream) !=
+ if (bfd_write (&b, sizeof (uint8_t), sym_rec_stream) !=
sizeof (uint8_t))
goto end;
}
@@ -4858,7 +4858,7 @@ populate_publics_stream (bfd *stream, bfd *abfd, bfd *sym_rec_stream)
bfd_putl32 (0, &header.thunk_table_offset);
bfd_putl32 (0, &header.num_sects);
- if (bfd_bwrite (&header, sizeof (header), stream) != sizeof (header))
+ if (bfd_write (&header, sizeof (header), stream) != sizeof (header))
goto end;
/* Output the global hash header. */
@@ -4869,7 +4869,7 @@ populate_publics_stream (bfd *stream, bfd *abfd, bfd *sym_rec_stream)
&hash_header.entries_size);
bfd_putl32 (buckets_size, &hash_header.buckets_size);
- if (bfd_bwrite (&hash_header, sizeof (hash_header), stream) !=
+ if (bfd_write (&hash_header, sizeof (hash_header), stream) !=
sizeof (hash_header))
goto end;
@@ -4882,7 +4882,7 @@ populate_publics_stream (bfd *stream, bfd *abfd, bfd *sym_rec_stream)
bfd_putl32 (sorted[i]->offset + 1, &hr.offset);
bfd_putl32 (1, &hr.reference);
- if (bfd_bwrite (&hr, sizeof (hr), stream) != sizeof (hr))
+ if (bfd_write (&hr, sizeof (hr), stream) != sizeof (hr))
goto end;
}
@@ -4898,7 +4898,7 @@ populate_publics_stream (bfd *stream, bfd *abfd, bfd *sym_rec_stream)
v |= 1 << j;
}
- if (bfd_bwrite (&v, sizeof (v), stream) != sizeof (v))
+ if (bfd_write (&v, sizeof (v), stream) != sizeof (v))
goto end;
}
@@ -4906,7 +4906,7 @@ populate_publics_stream (bfd *stream, bfd *abfd, bfd *sym_rec_stream)
bfd_putl32 (0, int_buf);
- if (bfd_bwrite (int_buf, sizeof (uint32_t), stream) != sizeof (uint32_t))
+ if (bfd_write (int_buf, sizeof (uint32_t), stream) != sizeof (uint32_t))
goto end;
/* Write the bucket offsets. */
@@ -4919,7 +4919,7 @@ populate_publics_stream (bfd *stream, bfd *abfd, bfd *sym_rec_stream)
Microsoft's parser. */
bfd_putl32 (buckets[i]->index * 0xc, int_buf);
- if (bfd_bwrite (int_buf, sizeof (uint32_t), stream) !=
+ if (bfd_write (int_buf, sizeof (uint32_t), stream) !=
sizeof (uint32_t))
goto end;
}
@@ -4937,7 +4937,7 @@ populate_publics_stream (bfd *stream, bfd *abfd, bfd *sym_rec_stream)
{
bfd_putl32 (sorted[i]->offset, int_buf);
- if (bfd_bwrite (int_buf, sizeof (uint32_t), stream) !=
+ if (bfd_write (int_buf, sizeof (uint32_t), stream) !=
sizeof (uint32_t))
goto end;
}
@@ -4998,13 +4998,13 @@ create_section_header_stream (bfd *pdb, bfd *abfd, uint16_t *num)
len = section_count * sizeof (struct external_scnhdr);
buf = xmalloc (len);
- if (bfd_bread (buf, len, abfd) != len)
+ if (bfd_read (buf, len, abfd) != len)
{
free (buf);
return false;
}
- if (bfd_bwrite (buf, len, stream) != len)
+ if (bfd_write (buf, len, stream) != len)
{
free (buf);
return false;
@@ -5027,25 +5027,25 @@ populate_names_stream (bfd *stream, struct string_table *strings)
bfd_putl32 (STRING_TABLE_SIGNATURE, &h.signature);
bfd_putl32 (STRING_TABLE_VERSION, &h.version);
- if (bfd_bwrite (&h, sizeof (h), stream) != sizeof (h))
+ if (bfd_write (&h, sizeof (h), stream) != sizeof (h))
return false;
bfd_putl32 (strings->strings_len, int_buf);
- if (bfd_bwrite (int_buf, sizeof (uint32_t), stream) != sizeof (uint32_t))
+ if (bfd_write (int_buf, sizeof (uint32_t), stream) != sizeof (uint32_t))
return false;
int_buf[0] = 0;
- if (bfd_bwrite (int_buf, 1, stream) != 1)
+ if (bfd_write (int_buf, 1, stream) != 1)
return false;
for (struct string *s = strings->strings_head; s; s = s->next)
{
- if (bfd_bwrite (s->s, s->len, stream) != s->len)
+ if (bfd_write (s->s, s->len, stream) != s->len)
return false;
- if (bfd_bwrite (int_buf, 1, stream) != 1)
+ if (bfd_write (int_buf, 1, stream) != 1)
return false;
num_strings++;
@@ -5073,7 +5073,7 @@ populate_names_stream (bfd *stream, struct string_table *strings)
bfd_putl32 (num_buckets, int_buf);
- if (bfd_bwrite (int_buf, sizeof (uint32_t), stream) != sizeof (uint32_t))
+ if (bfd_write (int_buf, sizeof (uint32_t), stream) != sizeof (uint32_t))
{
free (buckets);
return false;
@@ -5086,7 +5086,7 @@ populate_names_stream (bfd *stream, struct string_table *strings)
else
bfd_putl32 (0, int_buf);
- if (bfd_bwrite (int_buf, sizeof (uint32_t), stream) !=
+ if (bfd_write (int_buf, sizeof (uint32_t), stream) !=
sizeof (uint32_t))
{
free (buckets);
@@ -5098,7 +5098,7 @@ populate_names_stream (bfd *stream, struct string_table *strings)
bfd_putl32 (num_strings, int_buf);
- if (bfd_bwrite (int_buf, sizeof (uint32_t), stream) != sizeof (uint32_t))
+ if (bfd_write (int_buf, sizeof (uint32_t), stream) != sizeof (uint32_t))
return false;
return true;
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
index b45c530..65bb50b 100644
--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -3423,8 +3423,8 @@ pe_get16 (bfd *abfd, int where)
{
unsigned char b[2];
- bfd_seek (abfd, (file_ptr) where, SEEK_SET);
- bfd_bread (b, (bfd_size_type) 2, abfd);
+ bfd_seek (abfd, where, SEEK_SET);
+ bfd_read (b, 2, abfd);
return b[0] + (b[1] << 8);
}
@@ -3433,8 +3433,8 @@ pe_get32 (bfd *abfd, int where)
{
unsigned char b[4];
- bfd_seek (abfd, (file_ptr) where, SEEK_SET);
- bfd_bread (b, (bfd_size_type) 4, abfd);
+ bfd_seek (abfd, where, SEEK_SET);
+ bfd_read (b, 4, abfd);
return b[0] + (b[1] << 8) + (b[2] << 16) + ((unsigned) b[3] << 24);
}
@@ -3524,8 +3524,8 @@ pe_implied_import_dll (const char *filename)
bfd_vma vsize = pe_get32 (dll, secptr1 + 16);
bfd_vma fptr = pe_get32 (dll, secptr1 + 20);
- bfd_seek (dll, (file_ptr) secptr1, SEEK_SET);
- bfd_bread (sname, (bfd_size_type) 8, dll);
+ bfd_seek (dll, secptr1, SEEK_SET);
+ bfd_read (sname, 8, dll);
if (vaddr <= export_rva && vaddr + vsize > export_rva)
{
@@ -3547,8 +3547,8 @@ pe_implied_import_dll (const char *filename)
char sec_name[9];
sec_name[8] = '\0';
- bfd_seek (dll, (file_ptr) secptr1 + 0, SEEK_SET);
- bfd_bread (sec_name, (bfd_size_type) 8, dll);
+ bfd_seek (dll, secptr1 + 0, SEEK_SET);
+ bfd_read (sec_name, 8, dll);
if (strcmp(sec_name,".data") == 0)
{
@@ -3583,8 +3583,8 @@ pe_implied_import_dll (const char *filename)
}
expdata = xmalloc (export_size);
- bfd_seek (dll, (file_ptr) expptr, SEEK_SET);
- bfd_bread (expdata, (bfd_size_type) export_size, dll);
+ bfd_seek (dll, expptr, SEEK_SET);
+ bfd_read (expdata, export_size, dll);
erva = (char *) expdata - export_rva;
if (pe_def_file == 0)