(struct bfd_hash_table): Change memory field to PTR.
* bfd.c (struct _bfd): Change memory field to PTR.
* bfd-in2.h: Rebuild.
* libbfd-in.h (bfd_release): Declare as function, don't define as
macro.
* libbfd.h: Rebuild.
* opncls.c: Include "objalloc.h" rather than "obstack.h". Use
objalloc routines rather than obstack routines.
(obstack_chunk_alloc, obstack_chunk_free): Don't define.
(getpagesize): Don't define.
(_bfd_new_bfd): Don't set _bfd_chunksize.
(bfd_openr): Free new bfd and objalloc on failure.
(bfd_fdopenr, bfd_openstreamr, bfd_openw): Likewise.
(bfd_alloc_size): Remove.
(bfd_release): New function.
* hash.c: Include "objalloc.h" rather than "obstack.h". Use
objalloc routines rather than obstack routines.
(obstack_chunk_alloc, obstack_chunk_free): Don't define.
* ecofflink.c: Include "objalloc.h" rather than "obstack.h". Use
objalloc routines rather than obstack routines.
(obstack_chunk_alloc, obstack_chunk_free): Don't define.
(struct accumulate): Change memory to struct objalloc *.
* liboasys.h (oasys_data_type): Remove oasys_obstack field.
* dep-in.sed: Don't remove obstack.h from dependency list.
* Makefile.in: Rebuild dependencies.
(BFD_H_DEPS): Remove obstack.h.
(install): Don't install obstack.h.
* Many files: Don't include "obstack.h".
* VERSION: Bump.
(bfd_zmalloc): Return PTR, not char *. Take size_t, not
bfd_size_type.
* libbfd-in.h (bfd_malloc, bfd_realloc): Declare.
(bfd_zmalloc): Change declaration.
* libbfd.h: Rebuild.
* Many files: Use bfd_malloc and bfd_realloc rather than malloc
and realloc. Don't set bfd_error_no_memory if they fail.
obstack_alloc fails.
(bfd_alloc_finish): Set bfd_error_no_memory if obstack_finish
fails.
* libbfd.c (bfd_zmalloc): Set bfd_error_no_memory if malloc fails.
* Many files: don't set bfd_error_no_memory if one of the above
routines fails.
use a five instruction sequence for funtion calls which are out of
range of the bal instruction.
* libecoff.h (struct ecoff_section_tdata): Define.
(ecoff_section_data): Define.
(ecoff_bfd_relax_section): Don't define.
* ecoff.c (ecoff_final_link_debug_accumulate): Don't read or free
the debugging information if it has already been read.
(ecoff_indirect_link_order): Handle _cooked_size being different
from _raw_size. Don't reread the contents or the relocs if they
have already been read in.
* coff-mips.c (mips_howto_table): Change bitsize of PCREL16 from
18 to 16.
(PCREL16_EXPANSION_ADJUSTMENT): Define.
(mips_relocate_refhi): Take adjust argument.
(mips_relocate_section): Handle reloc offsets stored in section
used_by_bfd field. Call mips_relax_pcrel16 to handle details of
expanding an out of range PCREL16. Keep trace of adjustments
required by expansions. Set s and unset h when converting a reloc
from undefined to section. Change handling of PC relative relocs:
if against a section, they are correct in the object file, if
against an external symbol they are pcrel_offset.
(mips_relax_section): New function.
(mips_relax_pcrel16): New function.
(ecoff_bfd_relax_section): Define.
* coff-alpha.c (ecoff_bfd_relax_section): Define.
* ecofflink.c (bfd_ecoff_debug_accumulate): Handle adjustments
built by mips_relax_section when writing out addresses.
* elf32-mips.c (mips_elf_read_ecoff_info): Clear adjust field.
* ecoff.c, ecofflink.c, ecoffswap.h, srec.c: Likewise.
* elf32-i386.c: Likewise.
* elfcode.h (bfd_section_from_shdr): Make i unsigned; remove old
#if 0 code.
(elf_write_phdrs): Make i unsigned.
(map_program_segments): Make i and n_left unsigned.
(assign_file_positions_except_relocs): Make i unsigned.
(write_shdrs_and_ehdr): Make count unsigned.
(assign_file_positions_for_relocs): Make i unsigned.
(NAME(bfd,elf_write_object_contents)): Make count unsigned.
(section_from_elf_index): Make index argument unsigned.
operation to avoid OSF 1.3 cc bug.
* ecoff.c (ecoff_write_object_contents): Make text_size, data_size
and bss_size bfd_size_type instead of unsigned long. Make
text_start and data_start bfd_vma instead of unsigned long.
* ecofflink.c (ecoff_add_string): Remove incorrect cast of return
value.
(bfd_xmalloc, bfd_xmalloc_by_size_t): Functions deleted.
* libbfd-in.h: Define them as macros calling xmalloc and declare
xmalloc.
* libbfd.h: Rebuilt.
* ecofflink.c hash.c ieee.c opncls.c (obstack_chunk_alloc): Define
to be xmalloc, not bfd_xmalloc_by_size_t.
information, and to write some of out directly rather than saving
it in memory. Several new functions and structures, and new
arguments to existing functions.
* ecoff.c (ecoff_compute_reloc_file_positions): Compute
sym_filepos as well.
(ecoff_get_extr): Use ifdmap instead of ifdbase.
(ecoff_write_object_contents): Don't compute sym_filepos here.
Only output symbols if outsymbols is not NULL.
(ecoff_bfd_final_link): Adjust for changes in ecoff_debug_info and
bfd_ecoff_debug functions. Write out debugging information here.
(ecoff_final_link_debug_accumulate): Adjust for changes in
bfd_ecoff_debug functions.
(ecoff_link_write_external): Use ifdmap rather than ifdbase.
* elf32-mips.c (mips_elf_read_ecoff_info): Read external symbols
first, to put them in the first memory buffer. Clear fdr field.
(mips_elf_get_extr): Use pointer to unswapped external symbol.
(mips_elf_final_link): Adjust for changes in bfd_ecoff functions.
Preserve .text, .data and .bss even if they are empty. Save
pointer to unswapped external symbol rather than copying it.
Don't free up the external symbols.
* libelf.h (elf_symbol_type): Change mips_extr to PTR.
* bfd-in.h (bfd_ecoff_debug_init, bfd_ecoff_debug_free): Declare.
(bfd_ecoff_debug_accumulate): Update declaration.
(bfd_ecoff_debug_accumulate_other): Rename declaration from
bfd_ecoff_debug_link_other and update.
(bfd_ecoff_write_accumulated_debug): Declare.
* bfd-in2.h: Rebuilt.
* Makefile.in: Rebuilt dependencies.
ECOFF--added a bunch of functions. Also:
(ecoff_sec_to_styp_flags): Set flags for .pdata and .xdata.
(ecoff_slurp_symbolic_header): New function.
(ecoff_slurp_symbolic_info): Call ecoff_slurp_symbolic_header.
(ecoff_compute_reloc_file_positions): New function.
(ecoff_set_section_contents): Get out quickly if count is zero.
Check errors better.
(ecoff_write_object_contents): Put .xdata section in data segment.
Call ecoff_compute_reloc_file_positions. Don't output relocs or
external symbols if outsymbols is NULL.
(ecoff_bfd_final_link): Completely rewritten.
* libecoff.h: Include bfdlink.h.
(struct ecoff_backend_data): Add relocate_section field.
(ecoff_data_type): Add sym_hashes and symndx_to_section fields.
(struct ecoff_link_hash_entry): Define.
(struct ecoff_link_hash_table): Define.
(ecoff_bfd_link_add_symbols): Declare as function, not macro.
(ecoff_bfd_link_hash_table_create): Likewise.
* ecofflink.c (bfd_ecoff_debug_one_external): New function.
(bfd_ecoff_debug_externals): Call bfd_ecoff_debug_one_external.
* bfd-in.h (bfd_ecoff_debug_one_external): Declare.
* bfd-in2.h: Rebuilt.
* coff-alpha.c (alpha_howto_table): Mark BRADDR as
partial_inplace, and set the src_mask to 0x1fffff.
(alpha_ecoff_get_relocated_section_contents): Remove unused
variable gp_warned.
(alpha_convert_external_reloc): New static function.
(alpha_relocate_section): New static function.
(alpha_ecoff_backend_data): Initialize relocate_section field.
* coff-mips.c (mips_relocate_refhi): New static function.
(mips_relocate_section): New static function.
(mips_ecoff_backend_data): Initialize relocate_section field.