/* BFD back-end for a.out.adobe binaries.
- Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
Written by Cygnus Support. Based on bout.c.
This file is part of BFD, the Binary File Descriptor library.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "aout/stab_gnu.h"
#include "libaout.h" /* BFD a.out internal data structures */
-extern bfd_target a_out_adobe_vec; /* Forward decl */
+extern const bfd_target a_out_adobe_vec; /* Forward decl */
-PROTO (static bfd_target *, aout_adobe_callback, (bfd *));
+static const bfd_target *aout_adobe_callback PARAMS ((bfd *));
-PROTO (boolean, aout_32_slurp_symbol_table, (bfd *abfd));
-PROTO (boolean , aout_32_write_syms, ());
-PROTO (static void, aout_adobe_write_section, (bfd *abfd, sec_ptr sect));
+extern boolean aout_32_slurp_symbol_table PARAMS ((bfd *abfd));
+extern boolean aout_32_write_syms PARAMS ((bfd *));
+static void aout_adobe_write_section PARAMS ((bfd *abfd, sec_ptr sect));
/* Swaps the information in an executable header taken from a raw byte
stream memory image, into the internal exec_header structure. */
-PROTO(void, aout_adobe_swap_exec_header_in,
- (bfd *abfd,
- struct external_exec *raw_bytes,
- struct internal_exec *execp));
+void aout_adobe_swap_exec_header_in
+ PARAMS ((bfd *abfd, struct external_exec *raw_bytes,
+ struct internal_exec *execp));
void
aout_adobe_swap_exec_header_in (abfd, raw_bytes, execp)
}
-static bfd_target *
+static const bfd_target *
aout_adobe_object_p (abfd)
bfd *abfd;
{
/* Finish up the opening of a b.out file for reading. Fill in all the
fields that are not handled by common code. */
-static bfd_target *
+static const bfd_target *
aout_adobe_callback (abfd)
bfd *abfd;
{
goto no_more_sections;
default:
- fprintf (stderr, "Unknown section type in a.out.adobe file: %x\n",
- ext->e_type[0]);
+ (*_bfd_error_handler)
+ ("%s: Unknown section type in a.out.adobe file: %x\n",
+ bfd_get_filename (abfd), ext->e_type[0]);
goto no_more_sections;
}
/* Fix the name, if it is a sprintf'd name. */
if (sect->name == try_again) {
newname = (char *) bfd_zalloc(abfd, strlen (sect->name));
- if (newname == NULL) {
- bfd_set_error (bfd_error_no_memory);
+ if (newname == NULL)
return 0;
- }
strcpy (newname, sect->name);
sect->name = newname;
}
struct bout_data_struct *rawptr;
rawptr = (struct bout_data_struct *) bfd_zalloc (abfd, sizeof (struct bout_data_struct));
- if (rawptr == NULL) {
- bfd_set_error (bfd_error_no_memory);
+ if (rawptr == NULL)
return false;
- }
abfd->tdata.bout_data = rawptr;
exec_hdr (abfd) = &rawptr->e;
static boolean
aout_adobe_set_section_contents (abfd, section, location, offset, count)
bfd *abfd;
- sec_ptr section;
- unsigned char *location;
+ asection *section;
+ PTR location;
file_ptr offset;
- int count;
+ bfd_size_type count;
{
file_ptr section_start;
sec_ptr sect;
enum bfd_architecture arch;
unsigned long machine;
{
- bfd_default_set_arch_mach(abfd, arch, machine);
+ if (! bfd_default_set_arch_mach (abfd, arch, machine))
+ return false;
- if (arch == bfd_arch_unknown) /* Unknown machine arch is OK */
+ if (arch == bfd_arch_unknown
+ || arch == bfd_arch_m68k)
return true;
return false;
((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr)
#define aout_32_bfd_reloc_type_lookup \
- ((CONST struct reloc_howto_struct *(*) \
+ ((reloc_howto_type *(*) \
PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr)
#define aout_32_set_arch_mach aout_adobe_set_arch_mach
#define aout_32_sizeof_headers aout_adobe_sizeof_headers
#define aout_32_bfd_get_relocated_section_contents \
bfd_generic_get_relocated_section_contents
+#define aout_32_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
#define aout_32_bfd_relax_section bfd_generic_relax_section
#define aout_32_bfd_link_hash_table_create \
_bfd_generic_link_hash_table_create
#define aout_32_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define aout_32_bfd_final_link _bfd_generic_final_link
+#define aout_32_bfd_link_split_section _bfd_generic_link_split_section
-bfd_target a_out_adobe_vec =
+const bfd_target a_out_adobe_vec =
{
"a.out.adobe", /* name */
bfd_target_aout_flavour,
'_', /* symbol leading char */
' ', /* ar_pad_char */
16, /* ar_max_namelen */
- 2, /* minumum alignment power */
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
BFD_JUMP_TABLE_RELOCS (aout_32),
BFD_JUMP_TABLE_WRITE (aout_32),
BFD_JUMP_TABLE_LINK (aout_32),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
(PTR) 0
};