aboutsummaryrefslogtreecommitdiff
path: root/bfd/bout.c
AgeCommit message (Collapse)AuthorFilesLines
1994-06-20 * Many files: change all bfd_target vectors to be const. ChangeIan Lance Taylor1-14/+10
all uses of bfd_target * to be const bfd_target *. Change bfd_target_vector and bfd_default_vector arrays to be const bfd_target * const *.
1994-04-07 * All backends: Added BFD_JUMP_TABLE_DYNAMIC to target vector.Ian Lance Taylor1-1/+3
1994-04-06 * targets.c (bfd_target): Rearranged fields in target vector.Ian Lance Taylor1-43/+32
Removed _bfd_debug_info_start, _bfd_debug_info_end and _bfd_debug_info_accumulate, which were never used. (BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined. (BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined. (BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined. (BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined. * All backends: Changed to use the new BFD_JUMP_TABLE_* macros rather than the single JUMP_TABLE macro. Removed many of the weird macro definitions needed to support the monolithic JUMP_TABLE. * bfd-in.h (JUMP_TABLE): Removed. * libbfd-in.h: Define a bunch of macros, and declare a few functions, for use with the new BFD_JUMP_TABLE_* macros. * libbfd.c (_bfd_dummy_new_section_hook): Removed. (bfd_false): Set bfd_error_invalid_operation. (bfd_nullvoidptr): Likewise. (bfd_n1): New function. (_bfd_nocore_core_file_matches_executable_p): Renamed from _bfd_dummy_core_file_matches_executable_p. (_bfd_nocore_core_file_failing_command): Similar rename. Set bfd_error_invalid_operation. (_bfd_nocore_core_file_failing_signal): Likewise. (_bfd_generic_get_section_contents): Renamed from bfd_generic_get_section_contents. Changed all callers. (_bfd_generic_set_section_contents): Similar rename. * ieee.c: #if 0 out ieee_bfd_debug_info_start, ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate. They were never called. * bfd-in2.h: Rebuilt. * libbfd.h: Rebuilt.
1994-04-05 * aoutx.h (NAME(aout,canonicalize_reloc)): Don't error out ifIan Lance Taylor1-4/+2
section->relocation is NULL; malloc might have returned NULL when given a zero size if there were no relocations. * bout.c (b_out_canonicalize_reloc): Likewise. * coffcode.h (coff_canonicalize_reloc): Likewise. * ecoff.c (ecoff_canonicalize_reloc): Likewise. * elfcode.h (elf_canonicalize_reloc): Likewise. * mipsbsd.c (MY(canonicalize_reloc)): Likewise. * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise. * nlmcode.h (nlm_canonicalize_reloc): Likewise. * som.c (som_canonicalize_reloc): Likewise. * hp300hpux.c (MY(slurp_reloc_table)): Likewise. Also, if malloc returns NULL, don't report an error if we asked for zero bytes. * i386lynx.c (NAME(lynx,slurp_reloc_table)): If malloc returns NULL, don't report an error if we asked for zero bytes. * nlmcode.h (nlm_slurp_reloc_fixups): Likewise.
1994-04-04 Made sure that every call to bfd_read, bfd_write, and bfd_seekIan Lance Taylor1-7/+16
checks the return value and handled bfd_error correctly. These changes are not itemised.
1994-04-01 Add bfd_free_cached_info support to a.out backends.Ian Lance Taylor1-4/+7
* aoutx.h (aout_get_external_symbols): Renamed from aout_link_get_symbols. Read strings even if symbols have been read. Store string size in obj_aout_string_size. (NAME(aout,slurp_symbol_table)): Call aout_get_external_symbols to read the symbols. Allocate the cached symbols with malloc, not bfd_alloc. (NAME(aout,slurp_reloc_table)): Allocate the cached relocs with malloc, not bfd_alloc. (NAME(aout,bfd_free_cached_info)): New function; free cached symbols and relocs. * libaout.h (struct aoutdata): Add external_string_size field. (obj_aout_external_string_size): New accessor macro. (NAME(aout,close_and_cleanup)): Don't declare. (NAME(aout,bfd_free_cached_info)): Declare. (aout_32_close_and_cleanup): Don't define. (aout_64_close_and_cleanup): Don't define. * aout-target.h (MY_bfd_free_cached_info): If not already defined, define as NAME(aout,free_cached_info). (MY_close_and_cleanup): If not already defined, define as MY_bfd_free_cached_info. * aout-adobe.c (aout_32_close_and_cleanup): Define. (aout_32_bfd_free_cached_info): Don't define. * bout.c (aout_32_close_and_cleanup): Define. (aout_32_bfd_free_cached_info): Don't define. * hp300hpux.c (MY_bfd_free_cached_info): Define as bfd_true. (MY_close_and_cleanup): Don't define. * i386lynx.c (NAME(lynx,slurp_reloc_table)): Allocate the cached relocs with malloc, not bfd_alloc. * i386os9k.c (aout_32_close_and_cleanup): Define. (aout_32_bfd_free_cached_info): Don't define.
1994-04-01 * targets.c (bfd_target): Add _bfd_free_cached_info field.Ian Lance Taylor1-0/+1
* bfd.c (bfd_free_cached_info): Define. * bfd-in.h (JUMP_TABLE): Add _bfd_free_cached_info. * bfd-in2.h: Rebuilt. * All backends: Initialize bfd_free_cached_info entry point to bfd_true.
1994-03-30Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)Ian Lance Taylor1-16/+34
Changes to let BFD return an error indication from get_symtab_upper_bound, bfd_canonicalize_symtab, bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now return long instead of unsigned int, and use -1 to indicate an error. Along the way, rename get_symtab_upper_bound to bfd_get_symtab_upper_bound. * bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on errors. (bfd_canonicalize_reloc): Likewise. * syms.c (bfd_get_symtab_upper_bound): Renamed from get_symtab_upper_bound. * targets.c (bfd_target): Renamed _get_symtab_upper_bound to _bfd_get_symtab_upper_bound, and changed it and _bfd_canonicalize_symtab and _get_reloc_upper_bound and _bfd_canonicalize_reloc to all return long. * aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. (NAME(aout,get_symtab_upper_bound)): Likewise. * bout.c (b_out_canonicalize_reloc): Likewise. (b_out_get_reloc_upper_bound): Likewise. * coffcode.h (coff_canonicalize_reloc): Likewise. * coffgen.c (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * ecoff.c (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * elfcode.h (elf_get_symtab_upper_bound): Likewise. (elf_get_reloc_upper_bound): Likewise. (elf_canonicalize_reloc): Likewise. (elf_get_symtab): Likewise. * hp300hpux.c (MY(get_symtab)): Likewise. (MY(get_symtab_upper_bound)): Likewise. (MY(canonicalize_reloc)): Likewise. * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise. * ieee.c (ieee_slurp_external_symbols): Change return type to boolean. Check for errors from get_symbol. (ieee_slurp_symbol_table): Change return type to boolean. Check for errors from ieee_slurp_external_symbols. (ieee_get_symtab_upper_bound): Return long, and -1 on errors. (ieee_get_symtab): Likewise. (ieee_get_reloc_upper_bound): Likewise. (ieee_canonicalize_reloc): Likewise. * mipsbsd.c (MY(canonicalize_reloc)): Likewise. * nlmcode.h (nlm_get_symtab_upper_bound): Likewise. (nlm_get_symtab): Likewise. (nlm_get_reloc_upper_bound): Likewise. (nlm_canonicalize_reloc): Likewise. * oasys.c (oasys_get_symtab_upper_bound): Likewise. (oasys_get_symtab): Likewise. (oasys_get_reloc_upper_bound): Likewise. (oasys_canonicalize_reloc): Likewise. * som.c (som_get_symtab_upper_bound): Likewise. (som_get_symtab): Likewise. (som_get_reloc_upper_bound): Likewise. (som_canonicalize_reloc): Likewise. * srec.c (srec_get_symtab_upper_bound): Likewise. (srec_get_symtab): Likewise. (srec_get_reloc_upper_bound): Define as bfd_0l. (srec_canonicalize_reloc): Likewise. * tekhex.c (tekhex_get_symtab): Return long, and -1 on errors. (tekhex_get_symtab_upper_bound): Likewise. (tekhex_get_reloc_upper_bound): Define as bfd_0l. (tekhex_canonicalize_reloc): Likewise. * libaout.h (NAME(aout,get_symtab_upper_bound)): Change declaration to return long. (NAME(aout,get_symtab)): Likewise. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. * libcoff-in.h (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * libecoff.h (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise. (bfd_elf32_get_symtab): Likewise. (bfd_elf32_get_reloc_upper_bound): Likewise. (bfd_elf32_canonicalize_reloc): Likewise. (bfd_elf64_get_symtab_upper_bound): Likewise. (bfd_elf64_get_symtab): Likewise. (bfd_elf64_get_reloc_upper_bound): Likewise. (bfd_elf64_canonicalize_reloc): Likewise. * libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise. (nlmNAME(get_symtab)): Likewise. (nlmNAME(get_reloc_upper_bound)): Likewise. (nlmNAME(canonicalize_reloc)): Likewise. * archive.c (compute_and_write_armap): Use error_return and no_memory_return labels rather than freeing information in various places. Change storage, symcount and src_count to long. Check errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * bout.c (b_out_relax_section): Change reloc_size to long. Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. (b_out_get_relocated_section_contents): Likewise. * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Likewise. * elf32-mips.c: Likewise. * elf32-hppa.c (hppa_elf_stub_finish): Likewise. (hppa_look_for_stubs_in_section): Check for errors from bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and bfd_canonicalize_reloc. * ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * linker.c (generic_link_read_symbols): Likewise. (_bfd_generic_final_link): Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. * reloc16.c (bfd_coff_reloc16_relax_section): Likewise. (bfd_coff_reloc16_get_relocated_section_contents): Likewise. * libbfd.c (bfd_0l): New function. * libbfd-in.h (bfd_0l): Declare. * aix386-core.c: Change get_symtab_upper_bound, get_symtab, get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather than bfd_0u. * cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise. * irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise. * bfd-in2.h: Rebuilt. * libbfd.h: Rebuilt. * libcoff.h: Rebuilt. * nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables temp and name.
1994-03-26 * libbfd.c (bfd_read): Set bfd_error as appropriate for a shortJeff Law1-43/+60
read. (bfd_error_system_call or bfd_error_file_truncated). * som.c: Do not blindly set bfd_error_system_call after a failing bfd_read, bfd_write, or bfd_seek. In a few places (like som_object_p) override the error status set by bfd_read. * aix386-core.c, aout-encap,c archive.c, bout.c: Likewise. * coff-rs6000.c, coffgen.c ecoff.c, elf.c: Likewise. * elf32-hppa.c, elfcode.h, hp300hpux.c, i386lynx.c: Likewise. * nlm32-alpha.c, nlm32-i386.c, nlm32-sparc.c: Likewise. * som.c: Check return values from several bfd_{seek,read,write} calls that we just assumed were not failing.
1994-03-10 * libbfd-in.h: Remove alloca cruft. It was missing some necessaryJim Kingdon1-13/+38
cruft (like the #pragma alloca for AIX). In addition to that problem, the C alloca calls xmalloc, which means checking for being out of memory can't work right. The following changes remove all uses of alloca from BFD. * hosts/solaris2.h: Remove alloca cruft. * som.c: Replace alloca with a fixed size auto array. * aoutx.h, elfcode.h, nlmcode.h, bout.c, coff-alpha.c, ecoff.c, ecofflink.c, elf32-hppa.c, elf32-mips.c, linker.c, reloc.c, som.c: Replace alloca with malloc and appropriate error checking and freeing. * linker.c: Replace alloca with obstack_alloc. * libbfd.h: Rebuilt.
1994-02-16(b_out_get_reloc_upper_bound): For BSS section, just return 0.Ken Raeburn1-285/+279
(aligncode): When shrinking, the addend should be set to the current offset in the section plus the number of bytes of padding that will actually be retained. (b_out_relax_section): If a section contains no relocations, don't bother processing them. (b_out_get_relocated_section_contents): Set reloc_done. Assert that bfd_get_section_contents returns true. Check that relocs are properly ordered. (b_out_get_relocated_section_contents, case ALIGNDONE): Assert that reloc's addend falls between the current source offset and the raw size of the input section. Changed some indentation, deleted trailing whitespace, fixed some comments, removed some "#if 1" lines. (output_addr): New macro. (calljx_callback, callj_callback, get_value, abs32code, aligncode, b_out_get_relocated_section_contents): Use it for readability.
1994-01-24 * bout.c (calljx_callback, callj_callback): Use get_value to getIan Lance Taylor1-155/+183
the symbol value and check for undefined symbols. (get_value): If the symbol is undefined, look it up in the linker hash table. (b_out_get_relocated_section_contents): For PCREL24 and PCREL13 use get_value to get the symbol value and check for undefined symbols. * reloc16.c (bfd_coff_reloc16_get_value): If the symbol is undefined, look it up in the linker hash table.
1993-02-23 * bfd-in.h (JUMP_TABLE): Added bfd_reloc_type_lookup andIan Lance Taylor1-19/+32
bfd_make_debug_symbol; they were already in the target structure. * Adjusted all uses of JUMP_TABLE. * coffgen.c, libcoff-in.h (coff_bfd_make_debug_symbol): Renamed from coff_make_debug_symbol. * libcoff.h: Updated accordingly.
1993-01-26Tue Jan 26 11:43:14 1993 Ian Lance Taylor (ian@cygnus.com)Ian Lance Taylor1-3/+3
* section.c (SEC_IS_COMMON): New section flag, needed for MIPS ECOFF which has two common sections. (bfd_com_section): Set SEC_IS_COMMON flag. * bfd-in.h (bfd_is_com_section): New macro to test SEC_IS_COMMON. * aoutx.h, archive.c, bout.c, coff-a29k.c, coff-m88k.c, coff-mips.c, coffgen.c, ieee.c, oasys.c, reloc.c, syms.: Use bfd_is_com_section macro rather than checking for equality to bfd_com_section.
1993-01-19Tue Jan 19 09:06:14 1993 Ian Lance Taylor (ian@cygnus.com)Ian Lance Taylor1-2/+2
* aoutx.h (swap_ext_reloc_in, swap_std_reloc_in), bout.c (b_out_slurp_reloc_table), coff-mips.c (ecoff_swap_reloc_in), coff-msym.c (ecoff_swap_sym_in, ecoff_swap_rndx_in, ecoff_swap_opt_in): Added casts to int to avoid muttering by MIPS compiler.
1993-01-12Mon Jan 11 18:32:22 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)Ian Lance Taylor1-18/+64
* targets.c (bfd_target): Added relocateable argument to _bfd_get_relocated_section_contents. Added _bfd_seclet_link target vector for linker use. * bfd.c (bfd_seclet_link): New macro. * bfd-in.h (JUMP_TABLE): Added _bfd_seclet_link. * seclet.c (rel, seclet_dump_seclet): Added relocateable argument and boolean return value. Made static. (bfd_generic_seclet_link): Renamed from seclet_dump. Added relocateable argument. * reloc.c (bfd_generic_get_relocated_section_contents): Added relocateable argument (if relocateable, saves relocs). * bout.c (b_out_get_relocated_section_contents), reloc16.c (bfd_coff_reloc16_get_relocated_section_contents): Added relocateable argument (if relocateable, just calls bfd_generic_get_relocated_section_contents). * libcoff-in.h (bfd_coff_reloc16_get_value): Added relocateable argument to prototype. * All targets: Set new _bfd_seclet_link vector to bfd_generic_seclet_link.
1992-10-15* aout-adobe.c, aoutf1.h, aoutx.h, bout.c coff-m68k.c, coff-z8k.c,John Gilmore1-15/+5
coffcode.h, elf.c, libaout.h, libbfd.h, srec.c: Lint.
1992-10-15* aout-adobe.c, aoutf1.h, archive.c, bout.c, coff-rs6000.c,John Gilmore1-6/+5
coffcode.h, elf.c, ieee.c, libaout.h, libbfd.c, oasys.c, sco-core.c: Lint: Second argument of bfd_seek is always file_ptr. Third argument is SEEK_SET or SEEK_CUR. Result is always 0 or -1.
1992-10-09* bout.c (ALIGN): Rename to ALIGNER, since system header filesJohn Gilmore1-6/+6
on BSD 4.4 define ALIGN (sigh!).
1992-10-08Some of these are guesses, if you know different, just yell.Steve Chamberlain1-45/+54
Thu Oct 8 08:52:48 1992 Steve Chamberlain (sac@thepub.cygnus.com) Now a bfd knows whether underscores are normally prepended to symbols in its file format. Helps with error messages. * aout-adobe.c, aout-target.h, bout.c, coff-a29k.c, coff-h8300.c, coff-z8k.c: targets set so they have leading underscore * coff-i386.c, coff-i960.c, coff-m68k.c, coff-mips.c, coff-m88k.c, coff-rs6000.c, coff-we32k.c, elf.c, ieee.c, srec.c: targets set without leading underscore flag * targets.c: add symbol leading char to xvec description * bfd-in.h (bfd_get_symbol_leading_char): new macro.
1992-08-27 * bout.c: added support for relaxable alignment relocs.Steve Chamberlain1-14/+117
* seclet.c (rel, seclet_dump_seclet, seclet_dump): get the app to pass down pointer to play area rather than use alloca
1992-08-09 * bout.c (bfd_reloc_status_type, callj_callback): Cast void*Fred Fish1-110/+550
pointers to bfd_byte* before performing arithmetic on them. Such use with bare void* pointers is a gcc extension. * cache.c (bfd_cache_delete): Forward decl with prototype form. * archive (normalize): Add to CONST to match actual usages with CONST.
1992-04-29Fix a typo (missing ||) in b_out_squirt_out_relocs.Michael Tiemann1-1/+1
1992-04-29 * aoutx.h (aout_swap_ext_reloc_out, aout_swap_std_reloc_out)Steve Chamberlain1-17/+9
bout.c (b_out_squirt_out_relocs): treat abs sumbols the right way. * reloc.c (bfd_perform-relocation): don't relocate refs to absolute symbols if doing a partial link.
1992-03-17More bitrotSteve Chamberlain1-1/+1
1992-03-16Remove i960 b.out bitrot.Steve Chamberlain1-179/+183
1992-01-24Uses the new small reloc type now.Steve Chamberlain1-18/+30
Currently self hosts on sun4 and sun3
1991-12-01 * aout-encap.c, aoutf1.h, aoutx.h, archive.c, bout.c, coff-a29k.c,Steve Chamberlain1-13/+11
coff-h8300.c, coff-i386.c, coff-i960.c, coff-m68k.c, coff-m88k.c, coff-mips.c, coff-rs6000.c, cpu-h300.c, elf.c, i386aout.c, newos3.c, stab-syms.c, syms.c: All these files have had their #includes altered to point to the new places.
1991-10-11Include bfd.h before sysdep.h, so ansidecl and PROTO() get defined first.John Gilmore1-94/+97
1991-10-05* bfd.c: Remove strerror() to libiberty.John Gilmore1-10/+10
* elf.c: Remove elf_set_section_contents, use generic one. Lint. * libbfd-in.h, libbfd.c: Add bfd_generic_set_section_contents. * libbfd.c (bfd_generic_{get,set}_section_contents): Check that last byte of transfer, not first byte, is within the section. * host-aout.c: Remove `BSD' archive support. Lint. * archures.c: Rename `struct bfd_arch_info_struct' to `struct bfd_arch_info'. Rename `typedef bfd_arch_info_struct_type' to `bfd_arch_info_type'. All uses changed. * reloc.c: Rename `bfd_reloc_status_enum_type' to `bfd_reloc_status_type'. Rename `bfd_reloc_code_enum_real_type' to `bfd_reloc_code_real_type'. (This seems to be a misnomer, it needs a better name.) All uses changed. * targets.c: Rename `enum target_flavour_enum' to `enum target_flavour', and remove the `_enum' from all of the enum values themselves. All uses changed. * configure.in, config/h-i386mach: i386 mach host. * config/t-i386-aout: Use host-aout.c. * trad-core.c: Give it its own xvec's to make it independent of other file formats. * ecoff.c, host-aout.c: Remove refs to trad-core. * config/t-dec3100, t-hp300bsd, t-tahoe, t-vax: Define TRAD_CORE. * targets.c: #ifdef TRAD_CORE, include it in the vector.
1991-09-26Lint (saber actually).John Gilmore1-24/+16
1991-07-27*** empty log message ***Steve Chamberlain1-1/+2
1991-07-27*** empty log message ***Steve Chamberlain1-5/+5
1991-07-27*** empty log message ***Steve Chamberlain1-44/+51
1991-05-29Rename liba.out.h to libaout.h for brain death file systems. Change callers.John Gilmore1-1/+1
1991-05-21*** empty log message ***Steve Chamberlain1-0/+754