summaryrefslogtreecommitdiff
path: root/bfd/i386os9k.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2006-06-19 13:17:44 +0000
committerAlan Modra <amodra@bigpond.net.au>2006-06-19 13:17:44 +0000
commitea895c5cd35086047fac9fb6cc15d91e257cf9a7 (patch)
tree9984a69cde591a2c9ff4f4e018c67a1a0e933d62 /bfd/i386os9k.c
parent0351302c2c07ddc7e145ba491d72dd27ecbca41b (diff)
downloadgdb-ea895c5cd35086047fac9fb6cc15d91e257cf9a7.tar.gz
bfd/
* elf-bfd.h (struct elf_backend_data): Add bfd_link_info pointer parameter. (_bfd_elf_sizeof_headers): Replace bfd_boolean param with bfd_link_info pointer. * targets.c (struct bfd_target <_bfd_sizeof_headers>): Likewise. * bfd.c (bfd_sizeof_headers): Tweak param name. * aout-adobe.c (aout_adobe_sizeof_headers): Adjust. * aoutx.h (NAME (aout, sizeof_headers)): Adjust. * binary.c (binary_sizeof_headers): Adjust. * bout.c (b_out_sizeof_headers): Adjust. * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Adjust. * coff64-rs6000.c (xcoff64_sizeof_headers): Adjust. * coffgen.c (coff_sizeof_headers): Adjust. * ecoff.c (_bfd_ecoff_sizeof_headers): Adjust. (ecoff_compute_section_file_positions): Adjust. (_bfd_ecoff_write_object_contents): Adjust. * elf.c (get_program_header_size, _bfd_elf_sizeof_headers): Adjust. * elf32-arm.c (elf32_arm_additional_program_headers): Adjust. * elf32-i370.c (elf_backend_additional_program_headers): Adjust. * elf32-ppc.c (ppc_elf_additional_program_headers): Adjust. * elf64-hppa.c (elf64_hppa_additional_program_headers): Adjust. * elf64-x86-64.c (elf64_x86_64_additional_program_headers): Adjust. * elfxx-ia64.c (elfNN_ia64_additional_program_headers): Adjust. * elfxx-mips.c (_bfd_mips_elf_additional_program_headers): Adjust. * elfxx-mips.h (_bfd_mips_elf_additional_program_headers): Adjust. * i386msdos.c: Convert to ISO C. (msdos_sizeof_headers): Adjust. * i386os9k.c: Convert to ISO C. (os9k_sizeof_headers): Adjust. * ieee.c (ieee_sizeof_headers): Adjust. * ihex.c (ihex_sizeof_headers): Adjust. * libaout.h (NAME (aout, sizeof_headers)): Adjust. * libbfd-in.h (_bfd_nolink_sizeof_headers): Adjust. * libcoff-in.h (coff_sizeof_headers): Adjust. * libecoff.h (_bfd_ecoff_sizeof_headers): Adjust. * mach-o.c (bfd_mach_o_sizeof_headers): Adjust. * mmo.c (mmo_sizeof_headers): Adjust. * oasys.c (oasys_sizeof_headers): Adjust. * pdp11.c (NAME (aout, sizeof_headers)): Adjust. * pef.c (bfd_pef_sizeof_headers): Adjust. * ppcboot.c (ppcboot_sizeof_headers): Adjust. * som.c (som_sizeof_headers): Adjust. * srec.c (srec_sizeof_headers): Adjust. * tekhex.c (tekhex_sizeof_headers): Adjust. * versados.c (versados_sizeof_headers): Adjust. * vms.c (vms_sizeof_headers): Adjust. * xcoff-target.h (_bfd_xcoff_sizeof_headers): Adjust. * xsym.c (bfd_sym_sizeof_headers): Adjust. * xsym.h (bfd_sym_sizeof_headers): Adjust. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. ld/ * ldexp.c (fold_name): Adjust bfd_sizeof_headers call.
Diffstat (limited to 'bfd/i386os9k.c')
-rw-r--r--bfd/i386os9k.c89
1 files changed, 38 insertions, 51 deletions
diff --git a/bfd/i386os9k.c b/bfd/i386os9k.c
index f825bc62073..062f39b278d 100644
--- a/bfd/i386os9k.c
+++ b/bfd/i386os9k.c
@@ -1,6 +1,6 @@
/* BFD back-end for os9000 i386 binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, 2002,
- 2004, 2005 Free Software Foundation, Inc.
+ 2004, 2005, 2006 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -27,22 +27,12 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
#include "libaout.h" /* BFD a.out internal data structures */
#include "os9k.h"
-static const bfd_target * os9k_callback
- PARAMS ((bfd *));
-static const bfd_target * os9k_object_p
- PARAMS ((bfd *));
-static int os9k_sizeof_headers
- PARAMS ((bfd *, bfd_boolean));
-bfd_boolean os9k_swap_exec_header_in
- PARAMS ((bfd *, mh_com *, struct internal_exec *));
-
/* Swaps the information in an executable header taken from a raw byte
stream memory image, into the internal exec_header structure. */
-bfd_boolean
-os9k_swap_exec_header_in (abfd, raw_bytes, execp)
- bfd *abfd;
- mh_com *raw_bytes;
- struct internal_exec *execp;
+static bfd_boolean
+os9k_swap_exec_header_in (bfd *abfd,
+ mh_com *raw_bytes,
+ struct internal_exec *execp)
{
mh_com *bytes = (mh_com *) raw_bytes;
unsigned int dload, dmemsize, dmemstart;
@@ -77,44 +67,12 @@ os9k_swap_exec_header_in (abfd, raw_bytes, execp)
return TRUE;
}
-static const bfd_target *
-os9k_object_p (abfd)
- bfd *abfd;
-{
- struct internal_exec anexec;
- mh_com exec_bytes;
-
- if (bfd_bread ((PTR) &exec_bytes, (bfd_size_type) MHCOM_BYTES_SIZE, abfd)
- != MHCOM_BYTES_SIZE)
- {
- if (bfd_get_error () != bfd_error_system_call)
- bfd_set_error (bfd_error_wrong_format);
- return 0;
- }
-
- anexec.a_info = H_GET_16 (abfd, exec_bytes.m_sync);
- if (N_BADMAG (anexec))
- {
- bfd_set_error (bfd_error_wrong_format);
- return 0;
- }
-
- if (! os9k_swap_exec_header_in (abfd, &exec_bytes, &anexec))
- {
- if (bfd_get_error () != bfd_error_system_call)
- bfd_set_error (bfd_error_wrong_format);
- return NULL;
- }
- return aout_32_some_aout_object_p (abfd, &anexec, os9k_callback);
-}
-
/* Finish up the opening of a b.out file for reading. Fill in all the
fields that are not handled by common code. */
static const bfd_target *
-os9k_callback (abfd)
- bfd *abfd;
+os9k_callback (bfd *abfd)
{
struct internal_exec *execp = exec_hdr (abfd);
unsigned long bss_start;
@@ -156,10 +114,39 @@ os9k_callback (abfd)
return abfd->xvec;
}
+static const bfd_target *
+os9k_object_p (bfd *abfd)
+{
+ struct internal_exec anexec;
+ mh_com exec_bytes;
+
+ if (bfd_bread ((PTR) &exec_bytes, (bfd_size_type) MHCOM_BYTES_SIZE, abfd)
+ != MHCOM_BYTES_SIZE)
+ {
+ if (bfd_get_error () != bfd_error_system_call)
+ bfd_set_error (bfd_error_wrong_format);
+ return 0;
+ }
+
+ anexec.a_info = H_GET_16 (abfd, exec_bytes.m_sync);
+ if (N_BADMAG (anexec))
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return 0;
+ }
+
+ if (! os9k_swap_exec_header_in (abfd, &exec_bytes, &anexec))
+ {
+ if (bfd_get_error () != bfd_error_system_call)
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+ return aout_32_some_aout_object_p (abfd, &anexec, os9k_callback);
+}
+
static int
-os9k_sizeof_headers (ignore_abfd, ignore)
- bfd *ignore_abfd ATTRIBUTE_UNUSED;
- bfd_boolean ignore ATTRIBUTE_UNUSED;
+os9k_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
return sizeof (struct internal_exec);
}