systems that have a system <libelf.h>.
* Makefile.in: Globally replace libelf.h with elf-bfd.h.
* bfd.c, elf.c, elf32-arc.c, elf32-gen.c, elf32-hppa.c,
elf32-hppa.h, elf32-i386.c, elf32-i860.c, elf32-m68k.c,
elf32-m88k.c, elf32-mips.c, elf32-ppc.c, elf32-sparc.c,
elf64-gen.c, elf64-sparc.c, elfcode.h, elflink.c,
elfxx-target.h: Include elf-bfd.h rather than libelf.h.
* elfxx-target.h: Change libelf.h reference to elf-bfd.h.
* configure.in: Call AC_CONFIG_HEADER with config.h:config.in.
* configure: Rebuild.
* Makefile.in (stamp-h): Set CONFIG_HEADERS to config.h:config.in
when calling config.status.
HOST_64BIT_LONG. Check that various header files exist. Check
that fcntl exists. Call BFD_BINARY_FOPEN. Check whether malloc
and/or free need to be declared. Don't make a link to sysdep.h.
Define TRAD_HEADER for various hosts.
* configure: Rebuild.
* configure.host: Don't set my_host. Add definitions taken from
host header files for various entries. Remove entries which now
do nothing.
* acconfig.h: New file.
* config.h.in: New file, built by autoheader.
* sysdep.h: New file.
* Makefile.in (do_distclean): Don't remove sysdep.h.
(RECONFIG): Remove.
(LOCAL_H_DEPS): New variable.
($(BFD_LIBS)): Use $(LOCAL_H_DEPS) rather than libbfd.h and
$(RECONFIG).
($(BFD_MACHINES), $(BFD_BACKENDS)): Likewise.
($(OPTIONAL_BACKENDS)): Likewise.
(stmp-bfd.h): Just substitute for BFD_HOST_64BIT_LONG, rather than
looking through sysdep.h.
* bfd-in.h (BFD_HOST_64BIT_LONG): Define; set by Makefile.
(BFD_HOST_64_BIT): Define based on BFD_HOST_64BIT_LONG.
(fprintf_vma, sprintf_vma): Likewise.
(int64_type, uint64_type): Don't define.
* bfd-in2.h: Rebuild.
* archures.c, bfd.c, srec.c: Include <ctype.h>.
* elfcore.h: Check HAVE_SYS_PROCFS_H rather than HAVE_PROCFS.
* lynx-core.c: Include stuff from old hosts/lynx.h.
* opncls.c (bfd_fdopenr): Check HAVE_FNCTL and defined (F_GETFL),
rather than NO_FCNTL.
* targets.c (bfd_target_list): Check HOST_HPPAHPUX and ! __STDC__
rather than NATIVE_HPPAHPUX_COMPILER.
* trad-core.c: Don't include <errno.h>. Include TRAD_HEADER if it
is defined.
* hosts/*.h: Remove all header files which merely include,
declare, and define things. Leave header files which define
information needed by trad-core.c.
shell variables.
* configure.in: Call AC_PROG_CC. Substitute CFLAGS, HDEFINES and
AR. Call AC_PROG_INSTALL. Substitute CC_FOR_BUILD, choosing a
value based on whether the code is being compiled by a cross
compiler. Don't substitute host_makefile_frag or frags.
* aclocal.m4: New file to define local AC_PROG_CC.
* configure: Rebuild.
* Makefile.in (INSTALL): Set to @INSTALL@.
(INSTALL_PROGRAM): Set to @INSTALL_PROGRAM@.
(INSTALL_DATA): Set to @INSTALL_DATA@.
(AR): Set to @AR@.
(CC): Define as @CC@.
(CFLAGS): Set to @CFLAGS@.
(CC_FOR_BUILD): Set to @CC_FOR_BUILD@.
(@host_makefile_frag@): Remove.
(ALL_CFLAGS): Change $(HDEFINES) to @HDEFINES@. Move $(CFLAGS)
after other options.
(config.status): Remove dependency upon @frags@.
* config/*.mh, config/README: Remove.
Moved some mostly size-independent stuff from elfcode.h to elf.c, adding a data
structure to elfcode.h with some misc data and callback functions. Added a
pointer to that structure to the target back end data. More work can be done
here.
Renamed generic elf routines (not cpu-specific stuff) to start with bfd_elf or
_bfd_elf. Updated most call sites, sometimes defined some macros.
Moved some dynamic linking support code from m68k, sparc, i386 to common files,
using target back end flags to control behavior. More work can probably be
done here too.
Moved core- and linker-support code out of elfcode.h to elf.c, elfcore.h,
elflink.h, or elflink.c. Now elfcode.h contains only .o and executable
support, plus #includes of elfcore.h and elflink.h. Much of the contents of
these other header files can probably still be moved from the .h files to the
.c files, to get compiled only once.
Cleaned up some "gcc -Wall" warnings regarding unused or uninitialized
variables, in generic and cpu-specific code.
pr ld/6997
* elf32-i386.c (elf_i386_relocate_section): Give error
message when linking to a shared reloc which isn't there.
Wed May 24 10:40:00 1995 Steve Chamberlain <sac@slash.cygnus.com>
Support for ARM-PE.
* Makefile.in, coffcode.h, config.bfd, configure.in, pe-arm.c,
pei-arm.c, reloc.c, targets.c, config/arm-pe.mt:
Support for ARM COFF/PE.
tekhex.c (first_phase): Understand type 0 symbols.
(tekhex_write_object_contents): Fix typo in final record.
Thu May 11 16:43:14 1995 Steve Chamberlain <sac@slash.cygnus.com>
pr ld/6840
* coff-i960.c (optcall_callback): don't try and optimize
undefined refs.
(coff_write_relocs): Search for broken relocs on the way
out and fix them up.
(coff_renumber_symbols): Calculate and return index of
first undefined symbol.
(coff_write_object_contents): Call coff_renumber_symbols
and coff_write_relocs with the new args.
* libcoff.h: (coff_renumber_symbols, coff_renumber_symbols):
Modified prototypes.
Thu May 11 16:43:14 1995 Steve Chamberlain <sac@slash.cygnus.com>
Tom Griest <griest@cs.yale.edu>
Initial support for PE format.
* Makefile.in, targets.c, configure.in, config.bfd:
Add support for i386-*-winnt and i386-*-pe.
* archive.c (do_slurp_coff_armap): Understand NTPE format
archives.
(_bfd_slurp_extended_name_table): Turn \ in a filename
into /.
* bfd-in.h (bfd_link_subsystem, _bfd_link_stack_heap): New.
* coff-i386.c (howto_table): Conditionalize PCRELOFFSET.
* coffcode.h (IMAGE_BASE): New.
(coff_compute_section_file_positions): Throw away .junk
sections for PE, align symbols.
(coff_write_object_contents): Throw away .junk sections
for PE. Remember info on .idata and .rsrc sections.
Fill in the PE header.
(coff_slurp_symbol_table): PE uses C_SECTION class.
* cofflink.c (_bfd_coff_final_link): Keep PE info up to date.
(_bfd_coff_generic_relocate_section): Cope with PE relocs.
* coffswap.h (coff_swap_{aout/file/scn/sym}hdr_{in/out}):
New code for PE headers.
(ns32k-*-netbsd): use ns32knbsd.
* hosts/{nbsd,i386nbsd,ns32knbsd,sparcnbsd}.h: New files, NetBSD
host support.
* sparcnetbsd.c: New file, adds support for NetBSD/sparc.
* config/sparc-nbsd.mt: Likewise.
* netbsd.h: New file, definitions common to all netbsd ports.
* i386netbsd.c: Use it.
* ns32knetbsd.c: Use it.
* Makefile.in, configure.in, targets.c, config/i386-nbsd.mt,
config/ns32k-nbsd.mt: canonicalize netbsd targets to conform to
file/variable naming conventions.
* i386netbsd.c: New file, renamed from netbsd386.c.
* ns32knetbsd.c: New file, renamed from netbsd532.c.
* cofflink.c: New file.
* libcoff-in.h: Include bfdlink.h.
(obj_coff_external_syms, obj_coff_strings): Define accessor macro.
(obj_coff_sym_hashes): Define accessor macro.
(struct coff_tdata): Add fields external_syms, strings, and
sym_hashes.
(struct coff_link_hash_entry): Define.
(struct coff_link_hash_table): Define.
(coff_link_hash_lookup, coff_link_hash_traverse): Define.
(coff_hash_table): Define.
(_bfd_coff_link_hash_table_create): Declare.
(_bfd_coff_link_add_symbols, _bfd_coff_final_link): Declare.
* coffcode.h (bfd_coff_backend_data): Add fields _bfd_relsz,
_bfd_coff_swap_reloc_in, _bfd_coff_sym_is_global,
_bfd_coff_compute_section_file_positions,
_bfd_coff_relocate_section.
(bfd_coff_relsz, bfd_coff_swap_reloc_in): Define.
(bfd_coff_sym_is_global): Define.
(bfd_coff_compute_section_file_positions): Define.
(bfd_coff_relocate_section): Define.
(coff_mkobject_hook): Initialize obj_raw_syment_count and
obj_conv_table_size.
(coff_compute_section_file_positions): Set target_index of all
sections. Set output_has_begun field.
(coff_write_object_contents): Don't set target_index; now done by
coff_compute_section_file_positions. Remove obsolete handling of
scn_base and data_base. Don't bother to check that target_index
is positive, since it always is. Remove use of pad, which is
always zero. Check obj_raw_syment_count, not bfd_get_symcount,
for the number of symbols, but only write them out if
bfd_get_symcount is non-zero.
(coff_slurp_symbol_table): Use obj_raw_syment_count, not
bfd_get_symcount for the number of symbols. Don't set
obj_conv_table_size.
(coff_sym_is_global): New static function or macro.
(coff_slurp_reloc_table): Call coff_swap_reloc_in, not
bfd_swap_reloc_in.
(coff_bfd_link_hash_table_create): If coff_relocate_section is
defined, define as _bfd_coff_link_hash_table_create.
(coff_bfd_link_add_symbols): Similar change.
(coff_bfd_final_link): Similar change.
(coff_relocate_section): Define as NULL if not defined.
(bfd_coff_std_swap_table): Initialize new fields.
* coffgen.c (coff_real_object_p): Don't set obj_raw_syment_count
and obj_conv_table_size here.
(coff_count_linenumbers): Reindent. If bfd_get_symcount is zero,
add up the line numbers from the sections.
(coff_write_symbols): Don't set bfd_get_symcount.
(coff_pointerize_aux): Don't pointerize a nonpositive x_endndx
field.
(coff_get_normalized_symtab): Use obj_raw_syment_count, not
bfd_get_symcount.
(coff_print_symbol): If auxp->fix_end, print x_endndx value.
* coffswap.h (coff_swap_reloc_in): Rename from bfd_swap_reloc_in.
Reindent. Change argument type to PTR.
* coff-a29k.c (coff_a29k_relocate_section): New static function.
(coff_relocate_section): Define.
* configure.in (a29kcoff_big_vec): Compile cofflink.o.
* coff-alpha.c (alpha_ecoff_backend_data): Initialize new fields.
* coff-mips.c (mips_ecoff_backend_data): Likewise.
* libcoff.h: Rebuilt.
* Makefile.in: Rebuilt dependencies.
(BFD32_BACKENDS): Add cofflink.o.
(CFILES): Add cofflink.c.
variant of a.out.
* configure.in, config.bfd: Use them for Dynix.
* Makefile.in: Add dependencies for i386dynix.o.
* targets.c: Add definition for i386dynix_vec.