Commit Graph

1480 Commits

Author SHA1 Message Date
Ian Lance Taylor 6c481b58a6 * aoutx.h (NAME(aout,link_add_symbols)): Don't bother to check
that archives hold a.out objects.
	* cf-i386lynx.c (coff_bfd_link_add_symbols): Don't define.
	(lynx_link_add_symbols): Remove.
	* cf-m68klynx.c (coff_bfd_link_add_symbols): Don't define.
	(lynx_link_add_symbols): Remove.
	* elflink.h (elf_bfd_link_add_symbols): Don't bother to check that
	archives hold ELF objects.
1995-07-11 21:22:17 +00:00
Ian Lance Taylor 0e75a8d6da * archive.c (bfd_generic_archive_p): If the archive has a map, and
the target was defaulted, but the first object in the archive can
	not be matched with that target, then return a bad format error.
1995-07-11 21:12:41 +00:00
Ian Lance Taylor 18bf5d5f2f * elf64-sparc.c (elf_sparc_howto_table): Set howto for WDISP16 to
elf64_wdisp16_reloc.
	(elf64_wdisp16_reloc): New static function.
	(elf64_sparc_relocate_section): New static function.
	(elf_backend_relocate_section): Define.
PR 7333.
1995-07-11 20:16:48 +00:00
Ian Lance Taylor cf9fb9f243 * libelf.h (struct elf_size_info): Change type of last argument to
swap_symbol_out from char * to PTR.
	(bfd_elf32_swap_symbol_out): Update declaration.
	(bfd_elf64_swap_symbol_out): Likewise.
	* elfcode.h (elf_swap_symbol_out): Change type of cdst from char *
	to PTR.
	* elf.c (swap_out_syms): Cast to PTR, not char *, when calling
	swap_symbol_out routine.
	* elflink.h (NAME(bfd_elf,size_dynamic_sections)): Likewise.
	(elf_link_output_sym): Likewise.
	(elf_link_output_extsym): Likewise.
	* elf32-sparc.c (elf32_sparc_finish_dynamic_sections): Likewise.
1995-07-11 19:24:46 +00:00
Ian Lance Taylor 6f904fce87 Tue Jul 11 12:29:49 1995 Rick Sladkey <jrs@world.std.com>
* elf.c (_bfd_elf_find_nearest_line): Handle the simple case where
	there is no debugging information.
1995-07-11 16:31:39 +00:00
Ian Lance Taylor 9ab8a0e87b * coff-arm.c (PCRELOFFSET): Define if not already defined.
* Makefile.in: Rebuild dependencies.
	(BFD32_BACKENDS): Add coff-arm.o
	(CFILES): Add coff-arm.c, pe-arm.c, pei-arm.c.
1995-07-10 18:24:39 +00:00
Ian Lance Taylor 56fd39e800 * cofflink.c (_bfd_coff_generic_relocate_section): Remove unused
local i.
	* coff-arm.c (coff_arm_rtype_to_howto): Don't declare.
1995-07-10 18:16:25 +00:00
Ian Lance Taylor 921fc2819c * coff-i960.c (coff_i960_relocate): Correct typo: use ! on strcmp,
not on string.
1995-07-10 18:11:13 +00:00
Ian Lance Taylor e336470145 * aoutx.h (NAME(aout,link_hash_table_create)): Allocate hash table
using bfd_alloc, not malloc.
	* cofflink.c (_bfd_coff_link_hash_table_create): Likewise.
	* ecoff.c (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
	* i386linux.c (linux_link_hash_table_create): Likewise.
	* linker.c (_bfd_generic_link_hash_table_create): Likewise.
	* sunos.c (sunos_link_hash_table_create): Likewise.
1995-07-10 18:07:17 +00:00
Ian Lance Taylor 951fe66d62 Based on patches from Eric Youngdale <eric@aib.com>:
* elflink.h (NAME(bfd_elf,size_dynamic_sections)): If -Bsymbolic,
	output a DT_SYMBOLIC dynamic entry.
	(elf_adjust_dynamic_symbol): If -Bsymbolic, don't require a PLT
	entry for a locally defined symbol.
	* elf32-i386.c (elf_i386_relocate_section): If -Bsymbolic, do warn
	about undefined symbols, and fill in the GOT entry for a symbol
	defined in a regular object file.
	(elf_i386_finish_dynamic_symbol): If -Bsymbolic, output a RELATIVE
	reloc rather than a GLOB_DAT reloc for a symbol defined in a
	regular object file.
	* elf32-m68k.c (elf_m68k_relocate_section): If -Bsymbolic, do warn
	about undefined symbols, and fill in the GOT entry for a symbol
	defined in a regular object file.
	(elf_m68k_finish_dynamic_symbol): If -Bsymbolic, output a RELATIVE
	reloc rather than a GLOB_DAT reloc for a symbol defined in a
	regular object file.
	* elf32-sparc.c (elf32_sparc_relocate_section): If -Bsymbolic, do
	warn about undefined symbols, and fill in the GOT entry for a
	symbol defined in a regular object file.
	(elf32_sparc_finish_dynamic_symbol): If -Bsymbolic, output a
	RELATIVE reloc rather than a GLOB_DAT reloc for a symbol defined
	in a regular object file.
1995-07-10 17:31:31 +00:00
Ken Raeburn 5b2c2b363d add binary.o, tekhex.o 1995-07-10 15:48:58 +00:00
Ian Lance Taylor d11d1fb673 * config/m68k-coff.mt (SELECT_VECS): Rename from SELECT_VECTORS.
Correct elements to be actual BFD vector names.
1995-07-10 15:12:33 +00:00
Ian Lance Taylor c7e76b5eea * coffgen.c (coff_renumber_symbols): Sort defined symbols that are
neither BSF_FUNCTION not BSF_NOT_AT_END just before undefined
	symbols.
	* coffcode.h (coff_slurp_symbol_table): Set BSF_FUNCTION as well
	as BSF_NOT_AT_END.
PR 5491.
1995-07-07 21:40:56 +00:00
Ken Raeburn 5375150754 clean up new config stuff for mostlyclean, distclean 1995-07-07 21:34:08 +00:00
Ian Lance Taylor 1d5d75e90a * elf32-i386.c (elf_i386_relocate_section): Revert May 24 patch.
Don't copy PC32 reloc against section into shared object.
PR 6997, 7381.
1995-07-06 19:40:51 +00:00
Ian Lance Taylor b10e9afbfd * Makefile.in: Rebuild dependencies.
(CFILES): Added elflink.c.
	(Makefile): Depend upon config.status, not configure.in.
	(config.status): New target; depend upon configure configure.host
	and config.bfd.
1995-07-06 18:39:19 +00:00
Ken Raeburn 0a8310aca8 * Makefile.in (BFD_LIBS): No, don't put elflink.o here.
* configure.in: Include it here whenever elf.o is specified.
1995-07-06 02:28:46 +00:00
Ken Raeburn ede4eed483 Added new files elflink.c, elflink.h, elfcore.h.
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.
1995-07-06 02:22:00 +00:00
Ian Lance Taylor 6c495350ae * elf32-mips.c (mips_elf_object_p): Unconditionally set
elf_bad_symtab, since sometimes the symbol table is messed up and
	the last symbol is global.
PR 6921.
1995-07-05 20:54:57 +00:00
Ian Lance Taylor a2546fcef7 * ecoff.c (_bfd_ecoff_bfd_is_local_label): New function.
* libecoff.h (_bfd_ecoff_bfd_is_local_label): Declare.
	* elf32-mips.c (mips_elf_is_local_label): New static function.
	(bfd_elf32_bfd_is_local_label): Define.
PR 6978.
1995-07-05 16:31:07 +00:00
Ian Lance Taylor 9525b61b1b * configure.in: Use $ac_config_sub, not $configsub.
* configure: Likewise.
1995-07-05 14:34:12 +00:00
Ken Raeburn b6113657eb don't define FASCIST_FDOPEN for i386aix host 1995-07-05 09:47:20 +00:00
Ken Raeburn 8c69366021 autoconfiscation 1995-07-05 09:32:47 +00:00
Ian Lance Taylor 27b1ec9478 * archive.c (_bfd_construct_extended_name_table): If
BFD_TRADITIONAL_FORMAT is set, limit the length of all file names
	to ar_max_namelen.
	(bfd_dont_truncate_arname): If BFD_TRADITIONAL_FORMAT is set, call
	bfd_bsd_truncate_arname.
PR 6888.
1995-07-04 20:22:43 +00:00
Ian Lance Taylor e510074320 * archive.c (_bfd_write_archive_contents): Revert June 1 change. 1995-07-04 18:07:47 +00:00
Ian Lance Taylor b5279eb6a9 * elfcode.h (NAME(bfd_elf,record_link_assignment)): Add provide
argument.
	* bfd-in.h (bfd_elf32_record_link_assignment): Update prototype.
	(bfd_elf64_record_link_assignment): Likewise.
	* bfd-in2.h: Rebuild.
PR 7164.
1995-07-04 17:43:05 +00:00
Ian Lance Taylor b176e1e92a * libelf.h (struct elf_link_hash_table): Add needed field. Remove
saw_needed field.
	* elfcode.h (elf_link_add_object_symbols): If elf_dt_needed_name
	is an empty string, don't make a DT_NEEDED entry in the output
	file.  Record all DT_NEEDED entries found in input dynamic
	objects.
	(elf_link_output_extsym): Don't check saw_needed when issuing
	warnings.
	* elf.c (_bfd_elf_link_hash_table_init): Initialize needed, not
	saw_needed.
	(bfd_elf_get_needed_list): New function.
	* bfd-in.h (struct bfd_elf_link_needed_list): Define.
	(bfd_elf_get_needed_list): Define.
	* bfd-in2.h: Rebuild.
PR 7083.
1995-07-04 16:54:49 +00:00
Ian Lance Taylor 194fc93542 * ecoff.c (_bfd_ecoff_find_nearest_line): Also initialize
find_buffer and fdrtab_len fields of newly allocated
	find_line_info structure.
1995-07-04 16:23:58 +00:00
Jeff Law c40439a219 * som.c (hppa_som_gen_reloc_type): New argument "sym_diff",
nonzero when we're generating relocations for an expression
	using the difference of two symbols.  All callers changed.
	Handle difference of symbols for both R_HPPA and R_COMPLEX
	cases.
	(som_write_fixups): Handle R_COMP1, R_COMP2 and R_CODE_EXPR
	fixups.
1995-07-03 23:27:25 +00:00
Ian Lance Taylor 3a6eecd42f * ecoff.c (_bfd_ecoff_find_nearest_line): If we allocate
find_line_info, clear the fdrtab field.
1995-07-03 22:41:51 +00:00
Ian Lance Taylor 9fd10c34d0 x 1995-07-03 22:19:02 +00:00
Steve Chamberlain bd676d26ea Mon Jul 3 13:55:18 1995 Steve Chamberlain <sac@slash.cygnus.com>
* config.bfd (win32): New configuration.
	* configure.host (pe): Changed to i386win32.
	* config/i386pe.mh: Deleted.
	* config/i386win32.mh: New file.
1995-07-03 21:11:15 +00:00
Ian Lance Taylor 3004a68c46 * elfcode.h (elf_link_add_object_symbols): Permit common and
indirect symbols in weakdefs BFD_ASSERT.
	* elf32-i386.c (elf_i386_adjust_dynamic_symbol): Simplify
	BFD_ASSERT to permit some legal, but odd, cases.
	* elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
	* elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
1995-07-03 17:57:25 +00:00
Ian Lance Taylor 30dc85f1b8 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Correct
BFD_ASSERT to handle __start_SECNAME symbols automatically defined
	by the linker.
	* elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
	* elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
1995-07-03 17:05:56 +00:00
Ian Lance Taylor 8809320bb9 * Makefile.in: Rebuild dependencies.
(BFD32_BACKENDS): Add versados.o.
	(CFILES): Add pe-i386.c, pei-i386.c, and versados.c.
start-sanitize-arc
	(elf32-arc.o): New target.  This should be removed when
	elf32-arc.c can be added to CFILES.
end-sanitize-arc
1995-07-03 15:41:52 +00:00
Ian Lance Taylor be89267cfc * cofflink.c (_bfd_coff_generic_relocate_section): Cast base_file
to FILE * before using it.
	* stab-syms.c: Revert yesterday's patch.
1995-07-02 21:51:36 +00:00
Fred Fish 033d545b29 * stab-syms.c (stdio.h): Include prior to libaout.h, which
includes bfdlink.h, which now uses FILE.
1995-07-01 19:14:29 +00:00
Ken Raeburn 5cab016b72 removed unused elf_64_p field 1995-07-01 04:20:05 +00:00
Ken Raeburn b968e4f491 generate elf*-target.h from common elfxx-target.h source 1995-07-01 04:16:03 +00:00
Steve Chamberlain ece22cd04c Fri Jun 30 16:07:18 1995 Steve Chamberlain <sac@slash.cygnus.com>
* cofflink.c (_bfd_coff_generic_relocate_section): Compare
	the full text of .reloc or .edata section names.
1995-06-30 23:19:57 +00:00
Fred Fish d84d840f18 * cofflink.c (_bfd_coff_generic_relocate_section):
Remove extra '+'.
1995-06-30 22:53:13 +00:00
Steve Chamberlain 69b799dfd7 * coff-h8300.c (COFF_LONG_FILENAMES): Define. 1995-06-30 00:26:53 +00:00
Steve Chamberlain 89665c8562 Wed Jun 28 18:04:42 1995 Steve Chamberlain <sac@slash.cygnus.com>
* Makefile.in: versados.o is now conditionally built.
	* coffcode.h (add_data_entry): New function.
	(coff_write_object_contents): Clean up. Calculate
	data entries.
	* cofflink.c (_bfd_coff_generic_relocate_section):
	.reloc and .edata sections are IMAGE_BASED too.
	If there's a base_file then write out base information.
	* configure.host (i386-*-pe): New.
	* syms.c (coff_section_type): Only scan prefixes.
	* targets.c (bfd_target_vector): Versados is now conditionally
	built.
	* config/m68k-coff.mt: Build versados.o
	* hosts/i386pe.h: New file.
1995-06-29 01:17:58 +00:00
Jeff Law 6cb964d4ef * elf32-hpa.c (elf32_hppa_relocate_section): Close comment before
R_PARISC_DPREL21L handling.
1995-06-26 19:55:27 +00:00
Steve Chamberlain f4761bb244 * reloc.c (bfd_perform_relocation): Add case for -ve words. 1995-06-22 15:59:14 +00:00
Jeff Law 775d12552e * elf32-hppa.c (elf32_hppa_relocate_section): Don't try to apply a
relocation against an undefined symbols.
1995-06-21 19:14:39 +00:00
Steve Chamberlain 9eacc5c494 * versados.c: Second pass/rewrite. 1995-06-21 17:19:25 +00:00
Jeff Law 9fe4fade31 * elf32-hppa.c (elf32_hppa_size_stubs): Set the size of the stub
section if we get an error.
1995-06-18 03:39:23 +00:00
Jeff Law 9a6880571c * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Don't mess
with the operands of an R_PARISC_DPREL21L relocation if the insn
        is not "addil <symbol>,%r27".
1995-06-17 15:43:06 +00:00
Stan Shebs 018dafca8a * bfd-in.h (NT_subsystem, NT_stack_heap): Declare but don't
define.
	* bfd-in2.h: Rebuilt.
	* bfd.c (NT_subsystem, NT_stack_heap): Define.
1995-06-16 22:08:26 +00:00