Commit Graph

2281 Commits

Author SHA1 Message Date
Ian Lance Taylor
e83f77457b Thu Mar 30 14:32:26 1995 H.J. Lu (hjl@nynexst.com)
* config.bfd: Change linux to default to elf.  Using
	i[345]86-*-linuxaout will build a library which defaults to a.out.
	* config/i386-laout.mt: Rename from old config/i386-linux.mt.
	* config/i386-linux.mt: Rename from old config/i386-lelf.mt.
	Comment out EXTRALIBS.
	* config/i386-lelf.mt: Remove.
1995-03-30 19:37:22 +00:00
Ian Lance Taylor
21e061e3f8 * coff-i960.c (coff_i960_relocate): Cache the section symbol in
the used_by_bfd field of the section, to avoid looping for each
	reloc.
PR 6638.
1995-03-29 18:20:33 +00:00
Ian Lance Taylor
75afa8846b * cpu-h8500.c (arch_info_struct): Change name from "H8/300" to
"h8300" for consistency with other cpu-* files.
1995-03-29 17:02:34 +00:00
Jeff Law
0cd908d2b9 Add entry I forgot to commit:
* som.c (som_set_reloc_info): Sign extend constants from
        R_DATA_OVERRIDE fixups.
        * libhppa.h (sign_extend): Renamed from sign_ext.  Fix.
        (low_sign_extend): Likewise.
1995-03-28 23:28:50 +00:00
Ian Lance Taylor
661cf37446 * bout.c (b_out_canonicalize_reloc): Handle SEC_CONSTRUCTOR
sections.
	(b_out_get_reloc_upper_bound): Likewise.
1995-03-28 20:27:35 +00:00
Ian Lance Taylor
da7bfa91fb * linker.c (generic_link_add_symbol_list): Skip constructor
symbols which the main linker code did not do anything with.
	(_bfd_generic_link_output_symbols): Use udata.p if it is set,
	rather than looking the symbol up in the hash table.  Just pass
	through constructor symbols for which udata.p is not set.  If the
	linker defined the symbol, clear the constructor flag.
Fix -r for b.out file format when constructor symbols are defined.
1995-03-28 20:17:37 +00:00
Jeff Law
6adcecef34 * som.c (som_slurp_symbol_table): Tighten test to determine
what symbols are section symbols.
1995-03-21 05:40:30 +00:00
Ian Lance Taylor
03788f0539 * elfcode.h (elf_bfd_link_add_symbols): An empty archive is OK. 1995-03-18 06:56:00 +00:00
Ian Lance Taylor
7fe4ed45e9 * elfcode.h (elf_link_add_object_symbols): Check whether a dynamic
object has already been included, and ignore it the second time.
1995-03-17 16:51:36 +00:00
Ian Lance Taylor
de906b511e * libelf.h (bfd_elf32__write_relocs): Don't declare.
(bfd_elf64__write_relocs): Don't declare.
1995-03-15 16:57:15 +00:00
Ken Raeburn
75236adbd2 stab-syms.c: Rewrite to improve performance. Shaves about 5% off gprof run
time, according to gprof itself, on i486-netbsd.
1995-03-14 11:02:19 +00:00
Ian Lance Taylor
d042121899 * elfcode.h (write_relocs): Make static. Use PTR argument as a
pointer to a boolean variable set to true if something fails.
	Cast to PTR rather than void *.
	(sym_is_global): Rewrite for clarity.
	(map_program_segments): If the program header size is too small,
	call _bfd_error_handler and return failure rather than aborting.
	(NAME(bfd_elf,write_object_contents)): Pass boolean variable when
	calling write_relocs.
	(elf_symbol_from_bfd_symbol): Use BFD_ASSERT rather than abort.
	(struct elf_info_failed): Define.
	(NAME(bfd_elf,size_dynamic_sections)): Declare variables in inner
	blocks.  Pass elf_info_failed structure when calling
	elf_export_symbol and elf_adjust_dynamic_symbol.
	(elf_export_symbol): Treat data argument as elf_info_failed rather
	than bfd_link_info.  Set failed field on error.
	(elf_adjust_dynamic_symbol): Likewise.
	(struct elf_finfo_failed): Define.
	(elf_bfd_final_link): Pass elf_finfo_failed structure when calling
	elf_link_output_extsym.  Use BFD_ASSERT rather than abort.
	(elf_link_output_extsym): Treat data argument as elf_finfo_failed
	rather than elf_final_link_info.  Set failed field on error.
	(elf_link_input_bfd): Use BFD_ASSERT rather than abort.
	(elf_reloc_link_order): Likewise.
1995-03-13 21:55:44 +00:00
Ian Lance Taylor
f786a73f08 * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Only write
out PLTRELSZ, PLTREL and JMPREL relocs if there is a .rela.plt
	section.  Solaris 2.4 apparently does not handle empty reloc
	information correctly.
1995-03-13 20:39:36 +00:00
Ian Lance Taylor
c4299ed83a * archive.c (bsd_write_armap): Cast getuid and getgid results to
long, and print with %ld.
1995-03-13 18:49:44 +00:00
David Edelsohn
890b53ef65 * elf32-arc.c (elf_arc_howto_table): Relocs with implicit addends
don't work too well with zero src_masks.  Correct values.
1995-03-12 13:26:57 +00:00
Ian Lance Taylor
6a107a2838 * aoutx.h (translate_to_native_sym_flags): Always use the output
section if it is not NULL.
PR 6477.
1995-03-10 21:43:02 +00:00
Ian Lance Taylor
99514eec14 * coffswap.h (coff_swap_scnhdr_out): If the line number count or
the reloc count does not fit, print an error and return 0.
	* coffcode.h (coff_write_object_contents): Check return value of
	coff_swap_scnhdr_out.
	* ecoff.c (_bfd_ecoff_write_object_contents): Check return value
	of bfd_coff_swap_scnhdr_out.
1995-03-09 22:58:14 +00:00
Ian Lance Taylor
0318ed3109 * bfd.c: Include <stdarg.h> or <varargs.h>, depending upon
ANSI_PROTOTYPES.
	(bfd_error_handler_type): New global type.
	(_bfd_error_program_name): New static variable.
	(_bfd_default_error_handler): New static function.
	(_bfd_error_handler): New BFD private global variable.
	(bfd_set_error_handler): New globally visible function.
	(bfd_set_error_program_name): New globally visible function.
	* libbfd-in.h (_bfd_error_handler): Declare.
	* bfd-in2.h, libbfd.h: Rebuild.
1995-03-09 22:16:40 +00:00
Ian Lance Taylor
2f6754271f * aoutx.h (NAME(aout,swap_ext_reloc_in)): Add symcount parameter,
and use it instead of bfd_get_symcount.  Check r_index after
	setting r_extern based on whether this is a base relative reloc.
	(NAME(aout,swap_std_reloc_IN)): Add symcount parameter, and use it
	instead of bfd_get_symcount.
	(NAME(aout,slurp_reloc_table)): Pass bfd_get_symcount to reloc
	swap routines.
	* libaout.h (NAME(aout,swap_ext_reloc_in)): Add symcount parameter
	to declaration.
	(NAME(aout,swap_std_reloc_in)): Likewise.
	* sunos.c (sunos_canonicalize_dynamic_reloc): Pass
	info->dynsym_count to reloc swap routines.
	* aout-ns32k.c (MY_swap_std_reloc_in): Add symcount parameter.
	* hp300hpux.c (MY(swap_std_reloc_in)): Likewise.
	(MY(slurp_reloc_table)): Pass bfd_get_symcount to reloc swap
	routine.
	* i386lynx.c (NAME(lynx,swap_ext_reloc_in)): Add symcount
	parameter.
	(NAME(lynx,swap_std_reloc_in)): Likewise.
	(NAME(lynx,slurp_reloc_table)): Pass bfd_get_symcount to reloc
	swap routines.
1995-03-09 20:14:04 +00:00
Michael Meissner
d5fb1e2a71 Add support for checking whether all PowerPC ELF modules either use -mrelocatable or do not. 1995-03-09 17:20:20 +00:00
Ian Lance Taylor
0f6020cb02 * cpu-mips.c (arch_info_struct): Add mips:8000 entry. 1995-03-08 20:47:26 +00:00
Ian Lance Taylor
a48769bfbf * elfcode.h (swap_out_syms): Mark an undefined BSF_WEAK symbol as
STB_WEAK rather than STB_GLOBAL.
1995-03-08 05:56:53 +00:00
David Edelsohn
917666603b * configure.in (SELECT_VECS): Split bfd_elf32_arc_vec into big/little.
* targets.c (bfd_target_vector): Likewise.
	* elf32-arc.c (TARGET_BIG_SYM): Define.
	(TARGET_BIG_NAME): Define.
	* config/arc-elf.mt (DEFAULT_VECTOR): Set to bfd_elf32_littlearc_vec.
	(SELECT_VECS): Add bfd_elf32_bigarc_vec.
1995-03-08 04:41:13 +00:00
Ian Lance Taylor
f135c69272 * coffcode.h (bfd_coff_backend_data): Add new field
_bfd_coff_adjust_symndx.
	(bfd_coff_adjust_symndx): Define.
	(coff_adjust_symndx): Define as NULL if not already defined.
	(bfd_coff_std_swap_table): Initialize new field to
	coff_adjust_symndx.
	* cofflink.c (coff_link_input_bfd): Call coff_adjust_symndx if it
	is defined.
	* coff-a29k.c (coff_a29k_adjust_symndx): New static function.
	(coff_adjust_symndx): Define before including coffcode.h.
	* libcoff.h: Rebuild.
1995-03-07 19:56:31 +00:00
Ian Lance Taylor
597e3d58ba * format.c (bfd_check_format_matches): Skip binary_vec when
searching through bfd_target_vector.
1995-03-07 19:32:39 +00:00
Ian Lance Taylor
d211786089 * elfcode.h (elf_sort_hdrs): Check SHT_NOBITS before checking
sh_size.
1995-03-07 17:25:07 +00:00
David Edelsohn
df168c35f9 * elfcode.h (elf_sort_hdrs): Keep SHT_NOBITS sections after
!SHT_NOBITS ones.
1995-03-07 07:34:21 +00:00
Jeff Law
0f4161ddd0 * cpu-hppa.c (arch_info_struct): Support both PA1.0 and PA1.1
machine types.
	(bfd_hppa_arch): Link in both PA1.0 and PA1.1 architecture info
	structures.
	* libhppa.h (enum pa_arch): New enumeration to describe the
	different variants of the PA architecture.
	* som.c (som_object_setup): Use new enumeration to set machine
	type.
	(som_finish_writing): If the machine type is PA1.1, then use the
	PA1.1 machine identifier in the output file.
1995-03-06 17:00:18 +00:00
Stan Shebs
ab62d0499e * hosts/mpw.h (SEEK_SET, SEEK_CUR, BYTES_IN_PRINTF_INT):
Remove definitions.
	(mpw_fread, mpw_fwrite): Declare, define as substitutes
	for fread and fwrite.
1995-03-04 00:47:01 +00:00
Ian Lance Taylor
773033d2d2 * aoutx.h (NAME(aout,set_section_contents)): Double check that the
caller is writing to a valid section.
PR 5996 cleanup.
1995-03-02 21:00:39 +00:00
Ian Lance Taylor
c9f92c114b Thu Mar 2 14:37:57 1995 Bryan Ford <baford@cs.utah.edu>
* binary.c: Add support for reading binary files.  Loads the raw
	contents of the file into a data section and wraps some symbols
	around it.  The symbols `_binary_<filename>_start' and
	`_binary_<filename>_end' indicate the start and end of the data,
	while `_binary_<filename>_size' is an absolute symbol whose value
	is the size of the data.  <filename> is the name of the binary
	input file, with all non-alphanumeric characters converted to
	underscores.

	* archures.c (bfd_arch_get_compatible): Assume users knows what
	they're doing if one of the architectures is bfd_arch_unknown.
1995-03-02 20:04:07 +00:00
Michael Meissner
3598343227 Warn if GOT16 overflows. 1995-03-01 22:34:34 +00:00
Jason Molenda
8760f77caf Wed Mar 1 11:52:55 1995 Jason Molenda <crash@phydeaux.cygnus.com>
* configure.host: Recognize powerpc-*-aix*.

for sludge.cygnus.com.
1995-03-01 19:55:05 +00:00
Ian Lance Taylor
46cde09506 * coff-i960.c (COFF_PAGE_SIZE): Define. 1995-03-01 18:06:13 +00:00
Ian Lance Taylor
d842ea0b17 * configure.in: Rewrite output of TDEFAULTS to avoid relying on
semantics of single quotes in parameter substitution.
1995-03-01 16:58:57 +00:00
Ian Lance Taylor
afbc1a16b3 * elfcode.h (elf_sort_hdrs): Sort empty sections before non-empty
sections, if they have the same VMA.
1995-02-28 19:33:51 +00:00
Ian Lance Taylor
c47c90f441 * config.bfd (i[345]86-*-linuxelf*): New target. Use i386-lelf.
(i[345]86-*-gnuelf*): New target.  Use i386-gelf.
	* config/i386-lelf.mt: New file.
	* config/i386-gelf.mt: New file.
1995-02-28 17:54:37 +00:00
Kung Hsu
490d89a787 * config.bfd: add a29k-*-vxworks configuration. 1995-02-27 20:59:54 +00:00
Ian Lance Taylor
19a681380e * bout.c (b_out_slurp_reloc_table): Don't return an error if asked
for relocations for the .bss section.
PR 6377.
1995-02-22 02:20:51 +00:00
Jeff Law
ee4d24c613 * som.c (som_bfd_ar_write_symbol_stuff): Handle objects with odd
lengths.
1995-02-21 22:15:19 +00:00
Jeff Law
312eb91b73 Add missed log entry for som.c. 1995-02-21 05:12:58 +00:00
Ian Lance Taylor
ebb6075d2a * hosts/sysv4.h: Include <unistd.h>, <stdlib.h>, and <time.h>.
Only define SEEK_SET and SEEK_CUR if they are not already defined.
	Remove all external function declarations.
1995-02-17 18:35:40 +00:00
Michael Meissner
eaba51690a Make GOT relocs offset by 32768, which allows the table to double in size. 1995-02-17 17:41:08 +00:00
Ian Lance Taylor
cd0456a208 * syms.c (bfd_decode_symclass): Return 'W' for a weak symbol. 1995-02-17 17:26:48 +00:00
Ian Lance Taylor
6936966a62 * coffgen.c (coff_real_object_p): Set start address and flags
before calling coff_mkobject_hook.  Restore them on failure.
	* ecoff.c (_bfd_ecoff_mkobject_hook): If not ECOFF_AOUT_ZMAGIC,
	clear D_PAGED.
PR 6341.
1995-02-17 16:57:18 +00:00
Ian Lance Taylor
6dc6a81a7c * coffgen.c: Reindented. 1995-02-17 16:46:52 +00:00
David Edelsohn
b596295f13 * reloc.c (bfd_perform_relocation): Don't use bitpos in overflow calculations.
(bfd_install_relocation): Likewise.
1995-02-16 22:40:19 +00:00
Ian Lance Taylor
fe46552d89 * hosts/std-host.h: Remove all function declarations which return
int or void, except the one for free.
1995-02-16 18:23:57 +00:00
Michael Meissner
bcbe2c719c Fix powerpc PC relative reloc & add some 16 bit relocs. 1995-02-15 19:57:56 +00:00
Ian Lance Taylor
580102b026 * elf32-mips.c (struct mips_elf_find_line): Define.
(mips_elf_find_nearest_line): New static function.
	(bfd_elf32_find_nearest_line): Define.
	* libelf.h (struct elf_obj_tdata): Add find_line_info field.

	* ecoff.c (_bfd_ecoff_swap_tir_in): Move to ecofflink.c.
	(_bfd_ecoff_swap_tir_out): Likewise.
	(_bfd_ecoff_swap_rndx_in): Likewise.
	(_bfd_ecoff_swap_rndx_out): Likewise.
	(cmp_fdrtab_entry): Likewise.
	(mk_fdrtab): Likewise.
	(lookup): Likewise.
	(_bfd_ecoff_find_nearest_line): Just call _bfd_ecoff_locate_line
	to do most of the work.  Allocate find_line_info if necessary.
	* ecofflink.c: Include "aout/stab_gnu.h".
	(_bfd_ecoff_swap_tir_in): Move in from ecoff.c.
	(_bfd_ecoff_swap_tir_out): Likewise.
	(_bfd_ecoff_swap_rndx_in): Likewise.
	(_bfd_ecoff_swap_rndx_out): Likewise.
	(cmp_fdrtab_entry): Likewise.  Use PTR instead of void *.
	(mk_fdrtab): Move in from ecoff.c.  Add debug_info, debug_swap,
	and line_info arguments, and use them instead of ecoff_data.
	(fdrtab_lookup): Move in from lookup in ecoff.c.  Remove abfd
	argument, add line_info argument.  Use it instead of ecoff_data.
	(_bfd_ecoff_locate_line): New function, mostly from the old
	_bfd_ecoff_find_nearest_line in ecoff.c.
	* libecoff.h (ecoff_data_type): Remove find_buffer, fdrtab_len and
	fdrtab fields, replacing them find_line_info field.
	(_bfd_ecoff_swap_tir_in): Declare.
	(_bfd_ecoff_swap_tir_out): Declare.
	(_bfd_ecoff_swap_rndx_in): Declare.
	(_bfd_ecoff_swap_rndx_out): Declare.
	* libbfd-in.h (_bfd_ecoff_locate_line): Declare.
	* libbfd.h: Rebuild.
	* configure.in: Don't use ecoff.o for bfd_elf32_bigmips_vec or
	bfd_elf32_littlemips_vec.
	* Makefile.in: Rebuild dependencies.
1995-02-14 23:03:45 +00:00
Michael Meissner
8c9bfee312 Reconize old versions of the PowerPC machine code (EM_PPC_OLD and EM_CYGNUS_POWERPC). 1995-02-14 19:20:16 +00:00
Ian Lance Taylor
aed592693f * aoutf1.h (MACHTYPE_OK): Don't define if already defined. Don't
accept M_SPARC if bfd_arch_sparc is not in the list of supported
	architectures, and don't accept a 680x0 machine type if
	bfd_arch_m68k is not in the list of supported architectures.
	* aout0.c (MACHTYPE_OK): Define.
1995-02-14 17:49:30 +00:00
Ian Lance Taylor
1f9327360d * aoutx.h (NAME(aout,swap_ext_reloc_in)): Don't return a pointer
to garbage if the symbol index is out of range.
	(NAME(aout,swap_std_reloc_in)): Likewise.
1995-02-14 04:27:39 +00:00
Ian Lance Taylor
405affccae Revert this patch, since it breaks linking PIC code with no dynamic
objects:
	* elfcode.h (elf_bfd_final_link): Add assertion to make sure that
	dynamic and dynobj are in synch.
1995-02-13 19:04:05 +00:00
David Edelsohn
ac5357fa5d E_ARC_CPU_XXX renamed to E_ARC_MACH_XXX for consistency with rest of BFD. 1995-02-10 04:34:36 +00:00
David Edelsohn
c932fd968a Regenerated. 1995-02-10 01:41:57 +00:00
David Edelsohn
866da18e1f * archures (bfd_mach_arc_base): #define.
(bfd_mach_arc_host, bfd_mach_arc_graphics, bfd_mach_arc_audio): Ditto.
	* cpu-arc.c (arch_info_struct): Define entries for each cpu variant.
	(bfd_arc_arch): Link each one in.
	(arc_get_mach): New function.
	* elf32-arc.c (arc_info_to_howto_rel): Renamed from arc_info_to_howto.
	(elf_info_to_howto_rel): Update.
	(arc_elf_object_p, arc_elf_final_write_processing): New functions.
	(elf_backend_object_p): Define.
	(elf_backend_final_write_processing): Define.
	(USE_REL): Define.
1995-02-10 01:40:36 +00:00
Ken Raeburn
10bf6ddf08 * Makefile.in (BFD32_BACKENDS): Add i386msdos.o. 1995-02-10 00:17:32 +00:00
Ian Lance Taylor
ac400c0e03 update dependencies 1995-02-09 17:34:44 +00:00
Ian Lance Taylor
c93e959c81 * i386linux.c (NEEDS_SHRLIB): Define.
(linux_tally_symbols): Crash if a NEEDS_SHRLIB symbol is
	undefined.  From hjl@nynexst.com (H.J. Lu).
1995-02-09 17:19:53 +00:00
Ian Lance Taylor
62e5acdce9 * elfcode.h (elf_bfd_final_link): Add assertion to make sure that
dynamic and dynobj are in synch.
1995-02-09 17:03:47 +00:00
Ian Lance Taylor
6581a70a9a * linker.c (generic_link_check_archive_element): Allocate common
symbol information structure.  Don't bother to check for common
	symbol size overflow.
	(_bfd_generic_link_add_one_symbol): Likewise.
	* aoutx.h (aout_link_check_ar_symbols): Likewise.
	* linker.c (generic_link_check_archive_element): Adjust references
	to common symbol information for new structure.
	(_bfd_generic_link_add_one_symbol): Likewise.
	* aoutx.h (aout_link_check_ar_symbols): Likewise.
	(aout_link_add_symbols): Likewise.
	* ecoff.c (ecoff_link_add_externals): Likewise.
	* elfcode.h (elf_link_add_object_symbols): Likewise.
	(elf_link_output_extsym): Likewise.
	* sunos.c (sunos_add_one_symbol): Likewise.
1995-02-08 22:57:48 +00:00
David Edelsohn
121a846514 elfcode.h (elf_sort_hdrs): Put SHT_NOBITS sections after !SHT_NOBITS. 1995-02-08 20:58:01 +00:00
Jeff Law
28860f46fa * som.c (som_bfd_find_nearest_line): Just return false, don't
abort.
1995-02-07 23:29:08 +00:00
Ken Raeburn
2559e01429 clean up mechanics of mosberger-tang's changes 1995-02-07 20:06:28 +00:00
Ian Lance Taylor
95b0f14bce * ecoffswap.h (ecoff_swap_pdr_in): Zero out intern before setting
any of the fields.
1995-02-07 19:22:43 +00:00
Ken Raeburn
7c2c70f3f1 keep new msdos files 1995-02-07 19:14:32 +00:00
Ken Raeburn
97d5a14949 ecoff gprof related fixes & improvements from David Mosberger-Tang 1995-02-07 01:06:25 +00:00
Ian Lance Taylor
5947417403 * libelf.h (struct elf_link_hash_table): Add saw_needed field.
* elfcode.h (elf_link_add_object_symbols): Set saw_needed if
	DT_NEEDED seen in .dynamic section.
	(elf_link_output_extsym): Warn if an undefined symbol is
	only referenced from a dynamic object, and not making a shared
	object, and saw_needed is false.
	* elf.c (_bfd_elf_link_hash_table_init): Initialize saw_needed.
1995-02-06 23:23:37 +00:00
Ian Lance Taylor
0bef7f7266 * libelf.h (ELF_LINK_HASH_DEFINED_WEAK): Don't define.
* elfcode.h (elf_link_add_object_symbols): Don't clear or set
	ELF_LINK_HASH_DEFINED_WEAK.
	(elf_link_output_extsym): Don't check ELF_LINK_HASH_DEFINED_WEAK.
1995-02-06 21:34:44 +00:00
Ian Lance Taylor
6c97aedf26 Distinguish a weak defined symbol from a regular defined symbol.
* linker.c (enum link_action): Add DEFW.
	(link_action): Add bfd_link_hash_defweak column.
	(_bfd_generic_link_add_one_symbol): Add DEFW case.  Handle
	bfd_link_hash_defweak in a few other cases.
	* Many files (bfd_link_hash_undefweak): Renamed from
	bfd_link_hash_weak.
	* aoutx.h (aout_link_write_symbols): Handle bfd_link_hash_defweak.
	(aout_link_write_other_symbol): Likewise.
	(aout_link_input_section_std): Likewise.
	(aout_link_input_section_ext): Likewise.
	* bout.c (get_value): Likewise.
	* coff-a29k.c (coff_a29k_relocate_section): Likewise.
	* coff-alpha.c (alpha_convert_external_reloc): Likewise.
	(alpha_relocate_section): Likewise.
	* coff-mips.c (mips_relocate_section): Likewise.
	(mips_relax_section): Likewise.
	(bfd_mips_ecoff_create_embedded_relocs): Likewise.
	* cofflink.c (coff_write_global_sym): Likewise.
	(_bfd_coff_generic_relocate_section): Likewise.
	* ecoff.c (ecoff_link_add_externals): Likewise.
	(ecoff_link_write_external): LIkewise.
	* elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
	(elf32_hppa_size_stubs): Likewise.
	* elf32-i386.c (elf_i386_adjust_dynamic_symbol): Likewise.
	(elf_i386_relocate_section): Likewise.
	(elf_i386_finish_dynamic_symbol): Likewise.
	* elf32-mips.c (mips_elf_output_extsym): Likewise.
	(mips_elf_relocate_section): Likewise.
	* elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
	(elf32_sparc_relocate_section): Likewise.
	* elfcode.h (elf_link_add_object_symbols): Likewise.
	(elf_adjust_dynamic_symbol): Likewise.
	(elf_bfd_final_link): Likewise.
	(elf_link_output_extsym): Likewise.
	* i386linux.c (linux_add_one_symbol): Likewise.
	(linux_tally_symbols): Likewise.
	(linux_finish_dynamic_link): Likewise.
	* linker.c (_bfd_generic_link_output_symbols): Likewise.
	(set_symbol_from_hash): Likewise.
	* reloc16.c (bfd_coff_reloc16_get_value): Likewise.
	(bfd_perform_slip): Likewise.
	* sunos.c (sunos_add_one_symbol): Likewise.
	(sunos_scan_std_relocs): Likewise.
	(sunos_scan_ext_relocs): Likewise.
	(sunos_scan_dynamic_symbol): Likewise.
	(sunos_write_dynamic_symbol): Likewise.
1995-02-06 20:01:08 +00:00
Ken Raeburn
5dc8db4897 msdos .exe file support from bryan ford 1995-02-06 08:31:27 +00:00
Jeff Law
9ea5de84ab * som.c (som_object_setup): More heruistics to detect the
braindamaged HP OSF1 linker.
	(setup_sections): Don't forget to free subspace_sections if we get
	an error.
	(som_slurp_string_table): Allocate strings on this bfd's obstack
	rather than directly out of the heap.
	(som_slurp_symbol_table): Likewise for the saved copy of the
	canonical symbols.
	(som_slurp_reloc_table): Likewise for the saved copy of the
	canonical relocations.  Free the native relocations when we're
	done with them.
1995-02-01 08:35:40 +00:00
David Edelsohn
ef6fb95dea * libelf.h (struct elf_obj_tdata): New member program_header_size.
* elfcode.h (get_program_header_size): New parameters sorted_hdrs,
	count, and maxpagesize.  All callers updated.
	If sorted_hdrs is non-NULL, use it to compute the number of segments.
	Save result in case called again.
	(assign_file_positions_except_relocs): Sort headers before calling
	get_program_header_size.
1995-02-01 05:56:53 +00:00
Ian Lance Taylor
5945db2997 * elfcode.h (map_program_segments): Add sorted_hdrs parameter.
Search through it rather than through unsorted section headers.
	(assign_file_positions_except_relocs): Pass sorted_hdrs to
	map_program_segments.
1995-01-31 20:55:25 +00:00
Ken Raeburn
3e46110757 * ecoff.c (_bfd_ecoff_find_nearest_line): Fix problems in range checking.
Expect argument OFFSET to be section-relative.  From David Mosberger-Tang,
davidm@piston.cs.arizona.edu.
1995-01-31 03:57:31 +00:00
Jeff Law
8bc3e02c9d * som.c (compare_subspaces): New function to sort subspaces by
their location in the object file.
	(setup_sections): When computing the index for each subspace,
	handle case where setup_sections reads the subspaces in a
	different order that they appear in the object file.
	(som_is_space): Also examine the output section for the containing
	section.
	(som_is_subspace, som_is_container): Likewise.
	(som_begin_writing): Don't prepare or write fixups here.  When
	writing the symbol strings, use the unsorted symbol table.
	(som_write_object_contents): Don't write the symbol table here.
	(som_finish_writing): Prepare and write the fixups here.  Likewise
	for the symbol table.
	(som_bfd_derive_misc_symbol_info): Undefined symbols always have
	type SS_UNSAT regardless of BSF_EXPORT.
	(som_set_reloc_info): Unpack and attach argument location
	information for R_PCREL_CALL and R_ABS_CALL relocations.
1995-01-29 06:37:35 +00:00
Jeff Law
fede999213 * som.c (som_object_setup): New heuristic to determine if the
entry and flags fields are switched in the exec header.
1995-01-28 19:50:52 +00:00
Ian Lance Taylor
cd9dba7b37 * elfcode.h (elf_link_add_object_symbols): Use *sym_hash instead
of h if we might not be doing an ELF link.
1995-01-28 05:17:04 +00:00
Ian Lance Taylor
cea133af7f * elf32-mips.c (mips_elf_final_link): If the size of an input
.reginfo section is zero, force it to the correct size, since the
	linker emulation code may have clobbered it.
1995-01-27 21:27:33 +00:00
Ian Lance Taylor
6977046f0f * elfcode.h (elf_sort_hdrs): Correct SHF_ALLOC test.
(assign_file_positions_except_relocs): Free sorted_hdrs.
1995-01-27 21:24:28 +00:00
Steve Chamberlain
7896128dfa * srec.c (srec_set_section_contents): Fix off by
one end address calculation.
1995-01-27 16:41:11 +00:00
Ian Lance Taylor
4b412ed189 * elfcode.h (elf_link_add_object_symbols): Only examine weakdef if
we are using an ELF hash table.
1995-01-26 21:48:14 +00:00
Steve Chamberlain
61a914c923 * config.bfd: (m68*-est-coff): New configuration. 1995-01-26 17:37:31 +00:00
Ian Lance Taylor
e83e94effd * aoutx.h (NAME(aout,some_aout_object_p)): Always set EXEC_P if
the start address is in the .text section, even if STAT_FOR_EXEC
	is set.  Just use STAT_FOR_EXEC as an additional test.
1995-01-26 16:43:54 +00:00
Michael Meissner
c6d729b375 Add new relocs for PowerPC Elf support.
Add eabi support.
1995-01-26 16:31:24 +00:00
Ian Lance Taylor
e079cfe890 * coff-sh.c (CALC_ADDEND): Don't define.
(coff_sh_relocate_section): Remove.
	(coff_relocate_section): Use _bfd_coff_generic_relocate_section.
1995-01-26 04:27:50 +00:00
Ian Lance Taylor
51fbf4548f update copyright dates 1995-01-24 19:48:50 +00:00
Ian Lance Taylor
16fe8950ad * elf32-mips.c (mips_elf_output_extsym): Set the value of the
ECOFF symbol from the hash table entry.
1995-01-24 19:27:35 +00:00
Steve Chamberlain
c525c3afcb Mon Jan 23 14:53:35 1995 Steve Chamberlain <sac@splat>
* coff-sh.c (coff_sh_relocate_section):  Don't subtract
	vma twice.
1995-01-23 22:57:30 +00:00
Ian Lance Taylor
6e3acf74d0 * coff-sh.c (sh_reloc): Don't ignore the previous contents of an
R_SH_IMM32 reloc.
PR 6215.
1995-01-23 22:32:18 +00:00
Ian Lance Taylor
6e7f3f077b x 1995-01-23 19:01:41 +00:00
Ian Lance Taylor
e18ecf7a78 * config.bfd (i[345]86-*-gnu*): Set bfd_name to i386-gnu.
* config/i386-gnu.mt: New file.  Include ELF support.
1995-01-23 18:55:58 +00:00
Ian Lance Taylor
123bfaa5ec * opncls.c (bfd_openstreamr): Call bfd_cache_init. 1995-01-23 18:35:07 +00:00
Ian Lance Taylor
04dc16b76b * sunos.c (sunos_add_one_symbol): Only set the sunos specific
fields if we are doing a sunos link.
1995-01-20 16:57:34 +00:00
Ian Lance Taylor
d01a0278a0 * bfd-in.h (bfd_byte, reloc_howto_type): Define here, not...
* reloc.c (bfd_byte, reloc_howto_type): here.
	* Changed all occurrences of ``const struct reloc_howto_struct''
	to be ``reloc_howto_type'' instead.
	* bfd-in2.h, libbfd.h, libcoff.h: Rebuilt.
Avoids problems with the native Irix 5 compiler.
1995-01-17 21:16:53 +00:00
Ian Lance Taylor
8a51b06cf6 * opncls.c (bfd_openstreamr): New function.
* bfd-in2.h: Rebuilt.
1995-01-17 19:26:56 +00:00
Ian Lance Taylor
6a5848cd10 * elf32-mips.c (enum reloc_type): Define new relocs used on Irix.
(elf_mips_howto_table): Add entries for new relocs.
	(mips_elf_section_from_shdr): Handle SHT_MIPS_MSYM,
	SHT_MIPS_DWARF, and SHT_MIPS_EVENTS.
	(mips_elf_fake_sections): Handle sections named .msym, .debug_*
	and .MIPS.events.*.
1995-01-17 15:55:55 +00:00
Steve Chamberlain
d468a1499b * archures.c, Makefile.in, targets.c, bfd-in2.h, coffcode.h,
config.bfd, configure.in, config/w65.mt: Initial support for the W65.
1995-01-16 05:44:00 +00:00
Steve Chamberlain
c21b376fc6 * archures.c, Makefile.in, targets.c, bfd-in2.h, coffcode.h,
config.bfd, configure.in, config/w65.mt: Initial support for the W65.
1995-01-16 05:39:06 +00:00