#define MY_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
#define MY_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#define MY_final_link_callback unused
#define MY_bfd_final_link _bfd_generic_final_link
/* Until and unless we convert the slurp_reloc and slurp_symtab
#define MY_callback MY(callback)
+#define MY_exec_hdr_flags 0x2
+
#define NAME_swap_exec_header_in NAME(hp300hpux_32_,swap_exec_header_in)
#define HP_SYMTYPE_UNDEFINED 0x00
#define NAME(x,y) CAT3(hp300hpux,_32_,y)
#define ARCH_SIZE 32
+
+/* aoutx.h requires definitions for BMAGIC and QMAGIC. */
+#define BMAGIC 0415
+#define QMAGIC 0314
+
#include "aoutx.h"
/* Since the hpux symbol table has nlist elements interspersed with
#endif
if (adata (abfd).magic == undecided_magic)
- NAME (aout, adjust_sizes_and_vmas) (abfd, &text_size, &text_end);
+ NAME (aout,adjust_sizes_and_vmas) (abfd, &text_size, &text_end);
execp->a_syms = 0;
execp->a_entry = bfd_get_start_address (abfd);
obj_reloc_entry_size (abfd));
N_SET_MACHTYPE (*execp, 0xc);
- N_SET_FLAGS (*execp, 0x2);
+ N_SET_FLAGS (*execp, aout_backend_info (abfd)->exec_hdr_flags);
- NAME (aout, swap_exec_header_out) (abfd, execp, &exec_bytes);
+ NAME (aout,swap_exec_header_out) (abfd, execp, &exec_bytes);
/* update fields not covered by default swap_exec_header_out */
/* this is really the sym table size but we store it in drelocs */
bfd_h_put_32 (abfd, bfd_get_symcount (abfd) * 12, exec_bytes.e_drelocs);
- bfd_seek (abfd, 0L, false);
- bfd_write ((PTR) & exec_bytes, 1, EXEC_BYTES_SIZE, abfd);
+ if (bfd_seek (abfd, 0L, false) != 0
+ || (bfd_write ((PTR) & exec_bytes, 1, EXEC_BYTES_SIZE, abfd)
+ != EXEC_BYTES_SIZE))
+ return false;
/* Write out the symbols, and then the relocs. We must write out
the symbols first so that we know the symbol indices. */
if (bfd_get_symcount (abfd) != 0)
{
- bfd_seek (abfd, (long) (N_TRELOFF (*execp)), false);
-
- if (!NAME (aout, squirt_out_relocs) (abfd, obj_textsec (abfd)))
+ if (bfd_seek (abfd, (long) (N_TRELOFF (*execp)), false) != 0)
return false;
- bfd_seek (abfd, (long) (N_DRELOFF (*execp)), false);
-
- if (!NAME (aout, squirt_out_relocs) (abfd, obj_datasec (abfd)))
+ if (!NAME (aout,squirt_out_relocs) (abfd, obj_textsec (abfd)))
+ return false;
+ if (bfd_seek (abfd, (long) (N_DRELOFF (*execp)), false) != 0)
+ return false;
+ if (!NAME (aout,squirt_out_relocs) (abfd, obj_datasec (abfd)))
return false;
}
*/
void
- NAME (aout, swap_exec_header_in) (abfd, raw_bytes, execp)
+NAME (aout,swap_exec_header_in) (abfd, raw_bytes, execp)
bfd *abfd;
struct external_exec *raw_bytes;
struct internal_exec *execp;
return false;
}
syms = (struct external_nlist *) (strings + SYM_EXTRA_BYTES);
- bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET);
- if (bfd_read ((PTR) syms, symbol_bytes, 1, abfd) != symbol_bytes)
+ if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
+ || bfd_read ((PTR) syms, symbol_bytes, 1, abfd) != symbol_bytes)
{
bfd_release (abfd, syms);
return false;
cache_save = *cache_ptr;
convert_sym_type (sym_pointer, cache_ptr, abfd);
- if (!translate_from_native_sym_flags (sym_pointer, cache_ptr, abfd))
+ if (!translate_from_native_sym_flags (abfd, cache_ptr))
return false;
/********************************************************/
strings += length + 10;
cache_ptr2->type &= ~HP_SECONDARY_SYMBOL; /* clear secondary */
convert_sym_type (sym_pointer, cache_ptr2, abfd);
- if (!translate_from_native_sym_flags (sym_pointer, cache_ptr2,
- abfd))
+ if (!translate_from_native_sym_flags (abfd, cache_ptr2))
return false;
}
return false;
doit:
- bfd_seek (abfd, asect->rel_filepos, SEEK_SET);
+ if (bfd_seek (abfd, asect->rel_filepos, SEEK_SET) != 0)
+ return false;
each_size = obj_reloc_entry_size (abfd);
count = reloc_size / each_size;
reloc_cache = (arelent *) bfd_zalloc (abfd, (size_t) (count * sizeof
(arelent)));
- if (!reloc_cache)
+ if (!reloc_cache && count != 0)
{
nomem:
bfd_set_error (bfd_error_no_memory);
}
relocs = (PTR) bfd_alloc (abfd, reloc_size);
- if (!relocs)
+ if (!relocs && reloc_size != 0)
{
bfd_release (abfd, reloc_cache);
goto nomem;
else
{
tblptr = section->relocation;
- if (!tblptr)
- return -1;
for (count = 0; count++ < section->reloc_count;)
{