aboutsummaryrefslogtreecommitdiff
path: root/bfd/targets.c
AgeCommit message (Collapse)AuthorFilesLines
1993-12-30 Extensive changes to move the bulk of the linker into BFD so thatIan Lance Taylor1-7/+21
more efficient backend code can be written for specific object files. Only existing efficient backend is a.out. * seclet.c, seclet.h: Removed. * hash.c, linker.c, genlink.h: New files. * bfd-in.h: Removed bfd_error_vector. Declared hash table structures and functions. (JUMP_TABLE): Removed bfd_seclet_link, added bfd_link_hash_table_create, bfd_link_add_symbols and bfd_final_link. * All backends: Changed accordingly. * bfd-in2.h: Rebuilt. * bfd.c (struct _bfd): Added link_next and archive_pass fields. Removed ld_symbols field. (bfd_nonrepresentable_section, bfd_undefined_symbol, bfd_reloc_value_truncated, bfd_reloc_is_dangerous, bfd_error_vector): Removed. (bfd_default_error_trap, bfd_error_trap, bfd_error_nonrepresentabltrap): Removed. (bfd_get_relocated_section_contents): Pass link_info. Pass link_order instead of seclet. Pass symbols. (bfd_relax_section): Pass link_info. (bfd_seclet_link): Removed. (bfd_link_hash_table_create, bfd_link_add_symbols, bfd_final_link): New macros. * libbfd-in.h: If __GNUC__ is defined and alloca is not, define alloca as __builtin_alloca. Declare internal linking functions. * libbfd.h: Rebuilt. * libbfd.c (bfd_seek): Comment out fseek assertion. It's worked for months. * reloc.c (reloc_howto_type): Added error_message argument to special_function field. Changed all callers and all definitions. (bfd_get_reloc_size): Make argument a const pointer. (bfd_perform_relocation): Add error_message argument to hold string set if return value if bfd_reloc_dangerous. Changed all callers. (_bfd_final_link_relocate, _bfd_relocate_contents): New functions. * section.c (asection): Renamed seclets_head and seclets_tail to link_order_head and link_order_tail. * targets.c (bfd_target): Replaced seclet argument with link_info and link_order and symbols arguments in bfd_get_relocated_section_contents. Added symbols argument to bfd_relax_section. Removed bfd_seclet_link. Added bfd_link_hash_table_create, bfd_link_add_symbols and bfd_final_link. * libaout.h (struct aoutdata): Added external_syms, external_sym_count, external_strings, sym_hashes fields. (obj_aout_external_syms, obj_aout_external_sym_count, obj_aout_external_strings, obj_aout_sym_hashes): New accessor macros. (WRITE_HEADERS): Only output symbols if outsymbols is not NULL. * aoutx.h: Wrote new back end linker routines. (translate_to_native_sym_flags): Return boolean value. Don't use bfd_error_vector. (NAME(aout,write_syms)): Return boolean value. Check return value of translate_to_native_sym_flags and bfd_write. * aout-target.h (final_link_callback): New function. (MY_bfd_final_link): New function. * aout-adobe.c (aout_adobe_write_object_contents): Check return value of aout_32_write_syms. * hp300hpux.c (MY(write_object_contents)): Likewise. * i386lynx.c (WRITE_HEADERS): Likewise. * libaout.h (WRITE_HEADERS): Likewise. * bout.c: Changed functions to use link_info->callbacks rather than bfd_error_vector, and link_orders rather than seclets. * coff-alpha.c: Likewise. * coff-h8300.c: Likewise. * coff-h8500.c: Likewise. * coff-sh.c: Likewise. * coff-z8k.c: Likewise. * elf32-hppa.c: Likewise. * reloc16.c: Likewise. * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look up _gp in the hash table rather than in outsymbols. * coff-a29k.c (a29k_reloc): Pass errors back in new error_message argument rather than printing them. * coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and link_order arguments rather than seclet. Changed all uses and definitions. (bfd_coff_reloc16_estimate): Pass link_info arguments. Changed all uses and definitions. * libcoff.h: Rebuilt. * ecoff.c (ecoff_get_extr): If symbol is defined by linker, but not by ECOFF, make it scAbs. (ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and rewritten. * elf32-mips.c (mips_elf_final_link): Renamed from mips_elf_seclet_link and rewritten. * elf32-hppa.c (elf32_hppa_stub_description): Added link_info field. (new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub, hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section): Added link_info arguments. Changed all callers. * elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is not NULL. * oasys.c (oasys_write_sections): Return boolean value rather than using bfd_error_vector. (oasys_write_object_contents): Check return value of oasys_write_sections. * hosts/std-host.h: Don't declare qsort or strtol. * Makefile.in: Rebuild dependencies. (BFD_LIBS): Removed seclet.o. Added hash.o and linker.o. (CFILES): Removed seclet.c. Added hash.c and linker.c. (HFILES): Removed seclet.h. Added genlink.h.
1993-12-01declare sparccoff_vecKen Raeburn1-0/+1
1993-11-30 * irix-core.c: New file for Irix 4 and Irix 5 core support.Ian Lance Taylor1-0/+9
Functions taken out of coff-mips.c. Handle vmap type VMAPFILE. * coff-mips.c: Irix 4 core file support moved to irix-core.c. * targets.c: If IRIX_CORE defined, include irix_core_vec in target_vector. * config/irix4.mh (HDEFINES): Add -DIRIX_CORE. (HDEPFILES): Define to be irix-core.o. * config/irix5.mh (HDEFINES): Define to be -DIRIX_CORE. (HDEPFILES): Define to be irix-core.o. * Makefile.in (OPTIONAL_BACKENDS): Added irix-core.o. Removed sco-core.o, which no longer exists. (CFILES): Added all *-core.c files. Rebuilt dependencies.
1993-11-17Need to declare nlm32_sparc_vec; oopsie.Sean Eric Fagan1-4/+9
1993-11-05doc cleanupDavid MacKenzie1-55/+61
1993-10-28 * configure.in, config/i386-mach3.mt: Update for new configurationJim Kingdon1-0/+1
(--with-targets and so on). * hosts/i386mach3.h: Declare errno. * targets.c: Declare i386mach3_vec.
1993-10-26 * targets.c (target_vector): Remove SCO_CORE. On Sep 11 1993,Jim Kingdon1-11/+9
we started using trad-core.c for SCO instead. * targets.c (target_vector): Re-enable generic ELF and NLM targets.
1993-10-26From Jeff Law and Pete Hoogenboom at Utah:Ken Raeburn1-4/+2
* elf32-hppa.h (hppa_elf_stub_finish): Add prototype. (ELF32_HPPA_R_ARG_RELOC): Renamed without the ELF32 prefix and moved into libhppa.h. All references changed. (ELF32_HPPA_R_CONSTANT, ELF32_HPPA_R_ADDEND): Likewise. (get_opcode and opcode defines): Move into libhppa.h * elf32-hppa.c (hppa_elf_insn2fmt): Rename and move info libhppa.h. * libhppa.h (HPPA_R_*): Moved here. Reformatted slightly to make for easier reading. (get_opcode): Moved here. FIXME! this really should be a C function inside the opcode library! (bfd_hppa_insn2fmt): Likewise. * targets.c (target_vector): Enable elf32-hppa vector. * elf32-hppa.c (hppa_elf_get_section_contents): Add new comments and clarify existing comments. Do not use DEFUN to declare this function. Fix numerous indention problems. Correctly handle cases where symbol extension section may need to be read from disk, read from memory, or built then read from memory. * elf32-hppa.h: Reformat with gnu-indent and hand fix numerous formatting and indention problems gnu-indent can not handle. Clarify some comments about relocation types. Comment basic relocation "classes". Group PARAM declarations together. (HPPA_SXT_{NULL, SYMNDX, RG_RELOC}): Make members of a new enumerated type rather than #defines.
1993-10-21elfcode.h (FILE_ALIGN_: Renamed from EALIGN, to avoid conflict with UltrixKen Raeburn1-5/+18
header files. Also, lots of changes for PA elf and som support from Utah; see ChangeLog for details.
1993-08-19targets.c (target_vector): Remove hp300bsd_vec due to clash with sunos_big_vec.David MacKenzie1-0/+2
1993-08-19Thu Aug 19 09:45:51 1993 David J. Mackenzie (djm@thepub.cygnus.com)David MacKenzie1-90/+143
* configure.in, targets.c: Add missing vectors to the tables. * targets.c (target_vector) [!SELECT_VECS]: Add DEFAULT_VECTOR.
1993-08-12Thu Aug 12 10:32:47 1993 David J. Mackenzie (djm@thepub.cygnus.com)David MacKenzie1-2/+7
* config/u68k-coff.mt: Fix typo, DEFAULT_TARGET for DEFAULT_VECTOR. * config/h8300-coff.mt, h8500-coff.mt, sh-coff.mt, st2000.mt, z8k-coff.mt (DEFAULT_VECTOR): Define. Don't explicitly add S-records via SELECT_VECS. * targets.c (target_vector), Makefile.in (BFD_LIBS): Always support S-records, for convenience. * config.bfd: New file, broken out of configure.in. * configure.in: Use it, and use standard target names for --with-targets, replacing --with-bfd-targets.
1993-08-07make target selection fully configurableDavid MacKenzie1-41/+10
1993-08-06add hp300bsd to default target vectorDavid MacKenzie1-8/+12
1993-07-22 * hpux-core.c: New file; backend for HP/UX style core files.Ian Lance Taylor1-4/+10
* bfd.c (struct _bfd): Renamed hppa_core_data field to hpux_core_data. * bfd-in2.h: Updated. * hppa.c (make_bfd_asection, hppa_core_file_p, hppa_core_file_failing_command, hppa_core_file_failing_signal, hppa_core_file_matches_executable_p): Moved into hpux-core.c. Removed from target vector. * libhppa.h (struct hppa_core_struct and accessor macros): Moved into hpux-core.c. * targets.c: If HPUX_CORE is defined, add hpux_core_vec to target list. * config/hp300.mh (HDEFINES): Set to -DHPUX_CORE. (HDEPFILES): Set to hpux-core.o. * config/hppabsd.mh, config/hppahpux.mh: Likewise. * hosts/hp300.h (HOST_HP300HPUX): Define. * Makefile.in (OPTIONAL_BACKENDS): Added sco-core.o, aix386-core.o, hpux-core.o. (sco-core.o, aix386-core.o, hpux-core.o): New dependencies.
1993-07-20 * bfd.c (union tdata): Add nlm_obj_data;Fred Fish1-0/+1
* targets.c (enum target_flavour): Add bfd_target_nlm_flavour.
1993-07-20 * configure.in (*-*-netware, i[34]86-*-netware): New configs.Fred Fish1-0/+8
* Makefile.in (BFD32_BACKENDS): Add nlm.o, nlm32.o, nlm32-gen.o. * Makefile.in (BFD64_BACKENDS): Add nlm64.o, nlm64-gen.o. * Makefile.in (CFILES): Add nlm{32,64}.c, nlm{32,64}-gen.c. * Makefile.in (nlm.o, nlm{32,64}.o, nlm{32,64}-gen.o: New targets. * bfd-in2.h (INLINE): Defines moved here. * {aoutx.h, elf.c, elfcode.h}: Move INLINE defines to bfd-in2.h. * libelf.h (CAT4): Move define to bfd-in2.h. * bfd-in2.h (CAT4): Merge CAT4 macro with other CAT macros. * bfd-in2.h (union tdata): Add nlm_obj_data. * bfd-in2.h (enum target_flavour): Add bfd_target_nlm_flavour. * targets.c (bfd_nlm{32,64}_{big,little}_vec): Add prototypes. * targets.c (target_vector): Add bfd_nlm{32,64}_{big,little}_vec. * (libnlm.h, nlm.c, nlmcode.h, nlm{32,64}-gen.c, nlm{32,64}-target.h, nlm{32,64}.c, config/i386-nlm.mt): New files for NLM support.
1993-07-11 * elfcode.h: Use memset not bzero.Jim Kingdon1-0/+2
* trad-core.c: Don't include <sys/file.h>. * i386linux.h: Include <sys/file.h>. * coff-m68k-un.c: new file to handle names with underscores on svr3 machines. * coff-m68k.c (m68k_rtype2howto): added #ifdef ONLY_DECLARE_RELOCS to not duplicate the function in the executable. (TARGET_SYM, TARGET_NAME, NAMES_HAVE_UNDERSCORE): new macros needed by coff-m68k-un.c. * coffcode.h (MC68KBCSMAGIC): case added. * targets.c: Add m68kcoffun_vec. * configure.host: added support for Bull dpx/2. * config/dpx2.mh, hosts/dpx2.h: new files. * Makefile.in: added target coff-m68k-un.
1993-07-07 * aoutx.h (translate_from_native_sym_flags): Removed statepIan Lance Taylor1-0/+12
argument. Just let an indirect symbol point to the next symbol without forcing the next symbol to be undefined. Changed all callers. * hp300hpux.c (slurp_symbol_table): Changed call to translate_from_native_sym_flags. * targets.c: Added hp300hpux_vec. * Makefile.in (hp300hpux.o): Added dependencies.
1993-06-18 * Makefile.in: Add elf32-{mips,m88k}.Jim Kingdon1-2/+8
elf32-{mips,m88k}.c: New files. targets.c (target_vector): Include bfd_elf32_{mips,m88k}_vec.
1993-05-25Updated for new macro, type, and structure names.Ken Raeburn1-9/+10
Cleaned up some namespace pollution; renamed elf vectors.
1993-05-21Move printing from bfd to nm and add POSIX and SysV formats.David MacKenzie1-2/+8
1993-04-17 * libbfd.c: Add signed versions of bfd_{h_,}{get,put}_signed_<size>.Jim Kingdon1-11/+21
libbfd.c, libbfd-in.h: Add _do*signed*. targets.c, all targets: Add bfd*signed*. bfd-in.h: Add bfd_signed_vma. Add comments.
1993-02-27symbol srec stuffSteve Chamberlain1-11/+18
1993-01-08Basically a checkpoint.Ian Lance Taylor1-2/+3
Fri Jan 8 15:47:53 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) * bfd.c (struct _bfd): Added ecoff_tdata to tdata union. * targets.c (enum target_flavour): Added bfd_target_ecoff_flavour. * coff-msym.c: Use DEFUN for function definitons. * coff-mips.c: Added code to read and print symbols, and to find line numbers.
1992-12-21Mon Dec 21 12:40:10 1992 Ian Lance Taylor (ian@cygnus.com)Ian Lance Taylor1-122/+81
* Patches from Minh Tran-le <mtranle@paris.intellicorp.com>. * configure.in (i386-*-isc*, i386-*-aix*): New targets. * configure.host (i386-*-isc*, i386-*-aix*): New hosts. * hosts/i386isc.h, config/i386isc.mh: New files for Interactive Unix. * hosts/i386aix.h, config/i386aix.mh: New files for AIX on PS/2. * aix386-core.c: New file for handling core files on AIX on PS/2. * targets.c: if AIX386_CORE, use aix386_core_vec. * coffcode.h (coff_real_object_p): check for I386SVMAGIC as well as I386MAGIC.
1992-11-05* bfd-in.h, bfd.c, libbfd.h, reloc.c, seclet.h, section.c,John Gilmore1-2/+12
targets.c: Rename struct bfd_seclet_struct to struct bfd_seclet.
1992-09-26Add Adobe a.out support.John Gilmore1-3/+9
* aout-adobe.c: New file. So far, only reads a.out.adobe. FIXME. * config/adobe.mt: Add. * configure.in (*-adobe-* target): Add. * targets.c (a_out_adobe_vec): Add. * Makefile.in: add aout-adobe.c. * configure.in: Put two dashes in all entries to be matched. Add comments to remind people to do this. Reorder all entries that match manufacturer names, to occur last, so they will only be matched if no more specific match occurs. Remove manufacturers `aout', `bout', `coff', and `elf'.
1992-09-01 * targets.c (target_vector): Take out oasys (unless that isPer Bothner1-2/+4
the default): Because there is no magic number in archives, there can be annoying target mis-matches.
1992-08-28Back out yesterday's change for using host endian order in 960 bout files.Ian Lance Taylor1-35/+2
1992-08-28Thu Aug 27 17:01:04 1992 Ian Lance Taylor (ian@cygnus.com)Ian Lance Taylor1-2/+35
* targets.c, config/i960-bout.mt, hosts/*: added HOST_BIG_ENDIAN_DEFAULT_VECTOR and HOST_LITTLE_ENDIAN_DEFAULT_VECTOR because bout archive format depends on the endianness of the host. Added #define HOST_BIG_ENDIAN_P and #undef HOST_BIG_ENDIAN_P to a number of configuration files in hosts/ (it was already in some).
1992-08-27Add preliminary support for the we32k (AT&T 3b2).Brendan Kehoe1-3/+6
1992-06-22Lint stuff which didn't make it last timeSteve Chamberlain1-1/+1
1992-06-19* Makefile.in, archures.c, configure.in, cpu-hppa.c, hppa.c, libhppa.h,Stu Grossman1-1/+8
targets.c: HPPA merge.
1992-06-16[time to file a PR on cvs...]Ken Raeburn1-4/+24
Various changes to get linker working again for a.out: * don't set/adjust section file positions or vmas more than once * use correct page size and segment size when calculating them * deal with some variations in a.out implementations Tested on sun4 and sun4->sun3 so far, will be testing further but needed to get wider exposure&testing. See ChangeLog for details. Also: * coffcode.h (coff_write_relocs): Write out swapped reloc, not pre-swapped version. * hosts/sparc.h (abort, exit): Hide these names if compiling with gcc version 2, to avoid warnings.
1992-05-02 * targets.c, Makefile.in: comment out tekhex for the moment.Steve Chamberlain1-2/+5
* ieee.c: if some places where null pointers were used instead of &bfd_abs_section. * configure.in: tandem target is st2000 * coff-m68k.c: rename static howto_table to global m68kcoff_howto_table. * bout.c: remove unnecessary abort
1992-02-07Fluff removal.Steve Chamberlain1-1/+1
1992-01-24Uses the new small reloc type now.Steve Chamberlain1-2/+6
Currently self hosts on sun4 and sun3
1991-12-08Remove crass vaxism. Now SELECT_VECS will do something again.Steve Chamberlain1-2/+36
1991-12-08 * aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c,Steve Chamberlain1-141/+16
coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c, libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c, srec.c, syms.c, targets.c : all new documentation and lint removal.
1991-12-01New documentation styleSteve Chamberlain1-228/+246
1991-11-27 * Makefile.in: added coff-h8300Steve Chamberlain1-0/+5
* configure.in: now h8 is a coff target * cpu-h8300.c: fix various disassembly problems * libcoff.h: took out some code which has been #0ed for a long time. * targets.c: added h8 coff * coff-a29k.c, coff-i386.c, coff-i960.c, coff-m68k.c, coff-m88k.c added new macro RTYPE2HOWTO to take a load of #ifdefs out of coffcode.h * coffcode.h: Started to change the way machine dependencies are handled, from the nest of #ifdefs to macros defined in the including coff-<foo>.c
1991-11-22const lintJohn Gilmore1-8/+26
1991-10-25RS/6000 support, by Metin G. Ozisik, Mimi Phûông-Thåo Võ, and John Gilmore.John Gilmore1-0/+6
1991-10-21 * targets.c (proto write_armap). Changed orl_count to unsigned.Steve Chamberlain1-3/+3
* opncls.c (bfd_close_all_done). Added so that generative programs like gas can close a bfd without causing bfd confusion. * libbfd.h (changed becuase of protos) * amdcoff.c: messed with the way that jmp displacements are calcualated. This may not yet be totally correct. * archive.c (coff_write_armap): rewrote the way that ranlibs are written out. * coffcode.h (fixup_symbol_value): now doesn't core dump if a non abs symbol has no section (like a register symbol). (coff_write_symbol) now zeros auxent before filling it up to help with sensitive applications. * libbfd.c (bfd_write_bigendian_4byte_int): added.
1991-10-11 * bfd-in.h: Added more macros to COFF_SWAP_TABLE.Steve Chamberlain1-0/+40
* bfd.c: Added macros to enable gas to swap coff records. * coffcode.h: Make the coff_swap_*_out routines return the number of bytes swapped, and cleaned up their prototypes. * configure.in: Added ebmon/coff support * ecoff.c: Changed null definitions of coff_swap_*_out to conform to new prototypes * targets.c: Added new entry points for coff swapping
1991-10-11Include bfd.h before sysdep.h, so ansidecl and PROTO() get defined first.John Gilmore1-1/+7
1991-10-08 * reloc.c, section.c, syms.c, targets.c: correct info-nodeRoland Pesch1-25/+42
structure in *doc* comments.
1991-10-01* Makefile.in, configure.in, targets.c, elf.c: Add preliminaryJohn Gilmore1-1/+14
ELF support good enough for GDB. * configure.in, config/h-amix, config/t-m68k-elf: Handle m68k-cbm-svr4 host and target.
1991-10-01Mon Sep 30 15:13:46 1991 Steve Chamberlain (steve at cygnus.com)Steve Chamberlain1-28/+38
* cpu-a29k.c, cpu-i386.c, cpu-m68k.c, cpu-mips.c, cpu-vax.c, cpu-h8300.c, cpu-i960.c, cpu-m88k.c, cpu-sparc.c: added. These files will eventually contain processor specific bits for bfd, like strange relocation information and dis/assembly. So far only the H8 has been even partially done. This work also ties in with the change in handling architectures. * aout-f1.h: (choose_reloc_size) now calls bfd_get_arch to discover the architecture of the bfd. (sunos4_callback) calls the function bfd_set_arch_mach rather than stuffing stuff directly into the bfd. (sunos4_write_object_contents), changed names of accessor functions. * aoutx.h: (set_arch_mach) now calls bfd_default_set_arch_mach to setup the environment. * archive.c: (bfd_slurp_coff_armap) coff archives always have the headers in big endian format, regardless of the endianess of the host or target. * archures.c: totally changed. Now an architecture is represented with a pointer to an info structure rather than an enumerated type and a long. The old info is available as two elements in the structure. Future enhancements to architecure support will involve pointers to methods being placed into the info structure. * bfd.c: changed the definition of the bfd structure for the new architecture stuff. * bout.c: (b_out_set_arch_mach) changed to use the new architecture mechanism. * coffcode.h: (coff_set_arch_mach, coff_set_flags) changed to use the new architecture mechanism. * configure.in: added h8 stuff. * ieee.c: too many changes to note. Now ieee files written with bfd gas and ld can be read by gld and ieee only linkers and simulators. * libbfd.c, libbfd.h: changed prototype of bfd_write. * newsos3.c: (newos3_callback) now calls bfd_set_arch_mach rather than fixing the structure directly. * oasys.c: (oasys_object_p) now calls bfd_default_set_arch_mach rather than fixing the structure directly. * opncls.c: (new_bfd) makes sure that bfd_init has been called before opening a bfd. * srec.c: (srec_set_arch_mach) now calls bfd_default_set_arch_mach rather than fixing the structure directly. * targets.c: (target_vector) now by defining SELECT_VECS (perhaps in the t/hmake file) a user can select which backends they want linked with bfd without changing the source. * init.c: new, looks after initializing modules. * howto.c: for future use, will allow an application to work out what cookie to use as a handle on a relcoatio howto.