/* BFD back-end for Intel 960 b.out binaries.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
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);
- return false;
- }
+ if (rawptr == NULL)
+ return false;
abfd->tdata.bout_data = rawptr;
exec_hdr (abfd) = &rawptr->e;
return false;
count = reloc_size / sizeof (struct relocation_info);
- relocs = (struct relocation_info *) malloc (reloc_size);
- if (!relocs && reloc_size != 0) {
- bfd_set_error (bfd_error_no_memory);
+ relocs = (struct relocation_info *) bfd_malloc (reloc_size);
+ if (!relocs && reloc_size != 0)
return false;
- }
- reloc_cache = (arelent *) malloc ((count+1) * sizeof (arelent));
+ reloc_cache = (arelent *) bfd_malloc ((count+1) * sizeof (arelent));
if (!reloc_cache) {
if (relocs != NULL)
free ((char*)relocs);
- bfd_set_error (bfd_error_no_memory);
return false;
}
- if (abfd->xvec->header_byteorder_big_p) {
+ if (bfd_header_big_endian (abfd)) {
/* big-endian bit field allocation order */
pcrel_mask = 0x80;
extern_mask = 0x10;
unsigned int symnum;
cache_ptr->address = bfd_h_get_32 (abfd, raw + 0);
cache_ptr->howto = 0;
- if (abfd->xvec->header_byteorder_big_p)
+ if (bfd_header_big_endian (abfd))
{
symnum = (raw[4] << 16) | (raw[5] << 8) | raw[6];
}
int extern_mask, pcrel_mask, len_2, callj_mask;
if (count == 0) return true;
generic = section->orelocation;
- native = ((struct relocation_info *) malloc (natsize));
- if (!native && natsize != 0) {
- bfd_set_error (bfd_error_no_memory);
+ native = ((struct relocation_info *) bfd_malloc (natsize));
+ if (!native && natsize != 0)
return false;
- }
- if (abfd->xvec->header_byteorder_big_p)
+ if (bfd_header_big_endian (abfd))
{
/* Big-endian bit field allocation order */
pcrel_mask = 0x80;
r_idx = output_section->target_index;
}
- if (abfd->xvec->header_byteorder_big_p) {
+ if (bfd_header_big_endian (abfd)) {
raw[4] = (unsigned char) (r_idx >> 16);
raw[5] = (unsigned char) (r_idx >> 8);
raw[6] = (unsigned char) (r_idx );
case bfd_mach_i960_xa:
case bfd_mach_i960_ca:
case bfd_mach_i960_ka_sa:
+ case bfd_mach_i960_jx:
+ case bfd_mach_i960_hx:
case 0:
return true;
default:
{
long reloc_count;
- reloc_vector = (arelent **) malloc (reloc_size);
+ reloc_vector = (arelent **) bfd_malloc (reloc_size);
if (reloc_vector == NULL && reloc_size != 0)
- {
- bfd_set_error (bfd_error_no_memory);
- goto error_return;
- }
+ goto error_return;
/* Get the relocs and think about them */
reloc_count =
data, relocateable,
symbols);
- reloc_vector = (arelent **) malloc (reloc_size);
+ reloc_vector = (arelent **) bfd_malloc (reloc_size);
if (reloc_vector == NULL && reloc_size != 0)
- {
- bfd_set_error (bfd_error_no_memory);
- goto error_return;
- }
+ goto error_return;
input_section->reloc_done = 1;
#define b_out_bfd_final_link _bfd_generic_final_link
#define b_out_bfd_link_split_section _bfd_generic_link_split_section
+#define aout_32_get_section_contents_in_window \
+ _bfd_generic_get_section_contents_in_window
const bfd_target b_out_vec_big_host =
{
"b.out.big", /* name */
bfd_target_aout_flavour,
- false, /* data byte order is little */
- true, /* hdr byte order is big */
+ BFD_ENDIAN_LITTLE, /* data byte order is little */
+ BFD_ENDIAN_BIG, /* hdr byte order is big */
(HAS_RELOC | EXEC_P | /* object flags */
HAS_LINENO | HAS_DEBUG |
HAS_SYMS | HAS_LOCALS | WP_TEXT | BFD_IS_RELAXABLE ),
'_', /* symbol leading char */
' ', /* ar_pad_char */
16, /* ar_max_namelen */
- 2, /* minumum alignment power */
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
{
"b.out.little", /* name */
bfd_target_aout_flavour,
- false, /* data byte order is little */
- false, /* header byte order is little */
+ BFD_ENDIAN_LITTLE, /* data byte order is little */
+ BFD_ENDIAN_LITTLE, /* header byte order is little */
(HAS_RELOC | EXEC_P | /* object flags */
HAS_LINENO | HAS_DEBUG |
HAS_SYMS | HAS_LOCALS | WP_TEXT | BFD_IS_RELAXABLE ),
'_', /* symbol leading char */
' ', /* ar_pad_char */
16, /* ar_max_namelen */
- 2, /* minum align */
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */