aboutsummaryrefslogtreecommitdiff
path: root/bfd/libaout.h
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 /bfd/libaout.h
parentfeddea4b466ce4f2bb2301fd2d4bef56e8d09ccc (diff)
downloadfsf-binutils-gdb-226f9f4fadb087875ef98a0a55d614236c6241b3.zip
fsf-binutils-gdb-226f9f4fadb087875ef98a0a55d614236c6241b3.tar.gz
fsf-binutils-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 'bfd/libaout.h')
-rw-r--r--bfd/libaout.h80
1 files changed, 40 insertions, 40 deletions
diff --git a/bfd/libaout.h b/bfd/libaout.h
index 20487af..5491d9b 100644
--- a/bfd/libaout.h
+++ b/bfd/libaout.h
@@ -619,46 +619,46 @@ extern bool NAME (aout, bfd_free_cached_info)
#endif
#ifndef WRITE_HEADERS
-#define WRITE_HEADERS(abfd, execp) \
- { \
- if (adata(abfd).magic == undecided_magic) \
- NAME (aout, adjust_sizes_and_vmas) (abfd); \
- \
- execp->a_syms = bfd_get_symcount (abfd) * EXTERNAL_NLIST_SIZE; \
- execp->a_entry = bfd_get_start_address (abfd); \
- \
- execp->a_trsize = ((obj_textsec (abfd)->reloc_count) * \
- obj_reloc_entry_size (abfd)); \
- execp->a_drsize = ((obj_datasec (abfd)->reloc_count) * \
- obj_reloc_entry_size (abfd)); \
- NAME (aout, swap_exec_header_out) (abfd, execp, & exec_bytes); \
- \
- if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 \
- || bfd_bwrite (& exec_bytes, (bfd_size_type) EXEC_BYTES_SIZE, \
- abfd) != EXEC_BYTES_SIZE) \
- return false; \
- /* Now write out reloc info, followed by syms and strings. */ \
- \
- if (bfd_get_outsymbols (abfd) != NULL \
- && bfd_get_symcount (abfd) != 0) \
- { \
- if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (execp)), SEEK_SET) != 0)\
- return false; \
- \
- if (! NAME (aout, write_syms) (abfd)) \
- return false; \
- } \
- \
- if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (execp)), SEEK_SET) != 0) \
- return false; \
- if (!NAME (aout, squirt_out_relocs) (abfd, obj_textsec (abfd))) \
- return false; \
- \
- if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (execp)), SEEK_SET) != 0) \
- return false; \
- if (!NAME (aout, squirt_out_relocs) (abfd, obj_datasec (abfd))) \
- return false; \
- }
+#define WRITE_HEADERS(abfd, execp) \
+ { \
+ if (adata(abfd).magic == undecided_magic) \
+ NAME (aout, adjust_sizes_and_vmas) (abfd); \
+ \
+ execp->a_syms = bfd_get_symcount (abfd) * EXTERNAL_NLIST_SIZE; \
+ execp->a_entry = bfd_get_start_address (abfd); \
+ \
+ execp->a_trsize = ((obj_textsec (abfd)->reloc_count) \
+ * obj_reloc_entry_size (abfd)); \
+ execp->a_drsize = ((obj_datasec (abfd)->reloc_count) \
+ * obj_reloc_entry_size (abfd)); \
+ NAME (aout, swap_exec_header_out) (abfd, execp, &exec_bytes); \
+ \
+ if (bfd_seek (abfd, 0, SEEK_SET) != 0 \
+ || bfd_write (&exec_bytes, EXEC_BYTES_SIZE, \
+ abfd) != EXEC_BYTES_SIZE) \
+ return false; \
+ /* Now write out reloc info, followed by syms and strings. */ \
+ \
+ if (bfd_get_outsymbols (abfd) != NULL \
+ && bfd_get_symcount (abfd) != 0) \
+ { \
+ if (bfd_seek (abfd, N_SYMOFF (execp), SEEK_SET) != 0) \
+ return false; \
+ \
+ if (! NAME (aout, write_syms) (abfd)) \
+ return false; \
+ } \
+ \
+ if (bfd_seek (abfd, N_TRELOFF (execp), SEEK_SET) != 0) \
+ return false; \
+ if (!NAME (aout, squirt_out_relocs) (abfd, obj_textsec (abfd))) \
+ return false; \
+ \
+ if (bfd_seek (abfd, N_DRELOFF (execp), SEEK_SET) != 0) \
+ return false; \
+ if (!NAME (aout, squirt_out_relocs) (abfd, obj_datasec (abfd))) \
+ return false; \
+ }
#endif
/* Test if a read-only section can be merged with .text. This is