aboutsummaryrefslogtreecommitdiff
path: root/contrib/binutils/bfd
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2000-05-12 23:15:20 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2000-05-12 23:15:20 +0000
commit78ce21c1dfcbe7807f37679871930161a4431ea9 (patch)
tree9d4ce42d357c391a11d77254b770908c02ecf672 /contrib/binutils/bfd
parent4a6dfd6c0adbe41f5abde95c957a415f8b6eb3dd (diff)
downloadsrc-78ce21c1dfcbe7807f37679871930161a4431ea9.tar.gz
src-78ce21c1dfcbe7807f37679871930161a4431ea9.zip
Import of Binutils 2.10 snapshot.
Notes
Notes: svn path=/vendor/binutils/dist/; revision=60484
Diffstat (limited to 'contrib/binutils/bfd')
-rw-r--r--contrib/binutils/bfd/ChangeLog12862
-rw-r--r--contrib/binutils/bfd/ChangeLog-91937851
-rw-r--r--contrib/binutils/bfd/ChangeLog-949510043
-rw-r--r--contrib/binutils/bfd/ChangeLog-96976711
-rw-r--r--contrib/binutils/bfd/Makefile.am334
-rw-r--r--contrib/binutils/bfd/Makefile.in639
-rw-r--r--contrib/binutils/bfd/README3
-rw-r--r--contrib/binutils/bfd/acinclude.m466
-rw-r--r--contrib/binutils/bfd/aclocal.m4818
-rw-r--r--contrib/binutils/bfd/aout-arm.c552
-rw-r--r--contrib/binutils/bfd/aout-sparcle.c32
-rw-r--r--contrib/binutils/bfd/aout-target.h18
-rw-r--r--contrib/binutils/bfd/aout-tic30.c50
-rw-r--r--contrib/binutils/bfd/aoutf1.h8
-rw-r--r--contrib/binutils/bfd/aoutx.h153
-rw-r--r--contrib/binutils/bfd/archive.c79
-rw-r--r--contrib/binutils/bfd/archures.c134
-rw-r--r--contrib/binutils/bfd/armnetbsd.c49
-rw-r--r--contrib/binutils/bfd/bfd-in.h78
-rw-r--r--contrib/binutils/bfd/bfd-in2.h501
-rw-r--r--contrib/binutils/bfd/bfd.c74
-rw-r--r--contrib/binutils/bfd/binary.c59
-rw-r--r--contrib/binutils/bfd/cache.c23
-rw-r--r--contrib/binutils/bfd/coff-alpha.c24
-rw-r--r--contrib/binutils/bfd/coff-arm.c2552
-rw-r--r--contrib/binutils/bfd/coff-i386.c362
-rw-r--r--contrib/binutils/bfd/coff-mips.c101
-rw-r--r--contrib/binutils/bfd/coff-ppc.c2969
-rw-r--r--contrib/binutils/bfd/coff-sparc.c214
-rw-r--r--contrib/binutils/bfd/coff-tic30.c8
-rw-r--r--contrib/binutils/bfd/coff-z8k.c42
-rw-r--r--contrib/binutils/bfd/coffcode.h1506
-rw-r--r--contrib/binutils/bfd/coffgen.c197
-rw-r--r--contrib/binutils/bfd/cofflink.c539
-rw-r--r--contrib/binutils/bfd/coffswap.h44
-rwxr-xr-xcontrib/binutils/bfd/config.bfd253
-rw-r--r--contrib/binutils/bfd/config.in200
-rwxr-xr-xcontrib/binutils/bfd/configure3308
-rw-r--r--contrib/binutils/bfd/configure.host3
-rw-r--r--contrib/binutils/bfd/configure.in195
-rw-r--r--contrib/binutils/bfd/cpu-alpha.c41
-rw-r--r--contrib/binutils/bfd/cpu-arm.c143
-rw-r--r--contrib/binutils/bfd/cpu-i386.c18
-rw-r--r--contrib/binutils/bfd/cpu-mips.c2
-rw-r--r--contrib/binutils/bfd/cpu-powerpc.c124
-rw-r--r--contrib/binutils/bfd/cpu-sparc.c16
-rw-r--r--contrib/binutils/bfd/cpu-v850.c11
-rw-r--r--contrib/binutils/bfd/dep-in.sed2
-rw-r--r--contrib/binutils/bfd/doc/ChangeLog33
-rw-r--r--contrib/binutils/bfd/doc/Makefile.am4
-rw-r--r--contrib/binutils/bfd/doc/Makefile.in193
-rw-r--r--contrib/binutils/bfd/doc/bfd.texinfo4
-rw-r--r--contrib/binutils/bfd/doc/bfdint.texi1885
-rw-r--r--contrib/binutils/bfd/dwarf1.c578
-rw-r--r--contrib/binutils/bfd/dwarf2.c578
-rw-r--r--contrib/binutils/bfd/ecoff.c66
-rw-r--r--contrib/binutils/bfd/ecofflink.c14
-rw-r--r--contrib/binutils/bfd/elf-bfd.h393
-rw-r--r--contrib/binutils/bfd/elf.c1721
-rw-r--r--contrib/binutils/bfd/elf32-arc.c12
-rw-r--r--contrib/binutils/bfd/elf32-arm.h3239
-rw-r--r--contrib/binutils/bfd/elf32-gen.c43
-rw-r--r--contrib/binutils/bfd/elf32-i386.c334
-rw-r--r--contrib/binutils/bfd/elf32-mips.c5378
-rw-r--r--contrib/binutils/bfd/elf32-ppc.c3761
-rw-r--r--contrib/binutils/bfd/elf32-sparc.c450
-rw-r--r--contrib/binutils/bfd/elf32-v850.c861
-rw-r--r--contrib/binutils/bfd/elf64-alpha.c1477
-rw-r--r--contrib/binutils/bfd/elf64-gen.c43
-rw-r--r--contrib/binutils/bfd/elf64-mips.c380
-rw-r--r--contrib/binutils/bfd/elf64-sparc.c1064
-rw-r--r--contrib/binutils/bfd/elfarm-nabi.c672
-rw-r--r--contrib/binutils/bfd/elfarm-oabi.c420
-rw-r--r--contrib/binutils/bfd/elfcode.h212
-rw-r--r--contrib/binutils/bfd/elfcore.h437
-rw-r--r--contrib/binutils/bfd/elflink.c159
-rw-r--r--contrib/binutils/bfd/elflink.h2322
-rw-r--r--contrib/binutils/bfd/elfxx-target.h135
-rw-r--r--contrib/binutils/bfd/format.c27
-rw-r--r--contrib/binutils/bfd/freebsd.h6
-rw-r--r--contrib/binutils/bfd/gen-aout.c6
-rw-r--r--contrib/binutils/bfd/hash.c6
-rw-r--r--contrib/binutils/bfd/hosts/alphalinux.h4
-rw-r--r--contrib/binutils/bfd/i386linux.c15
-rw-r--r--contrib/binutils/bfd/ieee.c210
-rw-r--r--contrib/binutils/bfd/ihex.c31
-rw-r--r--contrib/binutils/bfd/libaout.h4
-rw-r--r--contrib/binutils/bfd/libbfd-in.h28
-rw-r--r--contrib/binutils/bfd/libbfd.c230
-rw-r--r--contrib/binutils/bfd/libbfd.h112
-rw-r--r--contrib/binutils/bfd/libcoff-in.h51
-rw-r--r--contrib/binutils/bfd/libcoff.h90
-rw-r--r--contrib/binutils/bfd/libecoff.h4
-rw-r--r--contrib/binutils/bfd/linker.c67
-rw-r--r--contrib/binutils/bfd/mipsbsd.c28
-rw-r--r--contrib/binutils/bfd/netbsd-core.c5
-rw-r--r--contrib/binutils/bfd/netbsd.h6
-rw-r--r--contrib/binutils/bfd/opncls.c103
-rw-r--r--contrib/binutils/bfd/osf-core.c8
-rw-r--r--contrib/binutils/bfd/pe-arm.c47
-rw-r--r--contrib/binutils/bfd/pe-i386.c9
-rw-r--r--contrib/binutils/bfd/pe-mips.c998
-rw-r--r--contrib/binutils/bfd/pe-ppc.c44
-rw-r--r--contrib/binutils/bfd/po/Make-in251
-rw-r--r--contrib/binutils/bfd/po/POTFILES.in234
-rw-r--r--contrib/binutils/bfd/po/bfd.pot2051
-rw-r--r--contrib/binutils/bfd/ppcboot.c537
-rw-r--r--contrib/binutils/bfd/ptrace-core.c8
-rw-r--r--contrib/binutils/bfd/reloc.c781
-rw-r--r--contrib/binutils/bfd/reloc16.c13
-rw-r--r--contrib/binutils/bfd/sco5-core.c431
-rw-r--r--contrib/binutils/bfd/section.c196
-rw-r--r--contrib/binutils/bfd/sparclinux.c771
-rw-r--r--contrib/binutils/bfd/sparcnetbsd.c34
-rw-r--r--contrib/binutils/bfd/srec.c78
-rw-r--r--contrib/binutils/bfd/stabs.c14
-rw-r--r--contrib/binutils/bfd/syms.c171
-rw-r--r--contrib/binutils/bfd/sysdep.h21
-rw-r--r--contrib/binutils/bfd/targets.c125
-rw-r--r--contrib/binutils/bfd/tekhex.c16
-rw-r--r--contrib/binutils/bfd/trad-core.c30
121 files changed, 73659 insertions, 15121 deletions
diff --git a/contrib/binutils/bfd/ChangeLog b/contrib/binutils/bfd/ChangeLog
index 557679d4542b..b877c08f33cd 100644
--- a/contrib/binutils/bfd/ChangeLog
+++ b/contrib/binutils/bfd/ChangeLog
@@ -1,9241 +1,6381 @@
-Mon Apr 27 11:49:55 1998 Ian Lance Taylor <ian@cygnus.com>
+2000-05-09 Alan Modra <alan@linuxcare.com.au>
- * configure.in: Set version number to 2.9.1.
- * configure: Rebuild.
+ * elf.c (bfd_section_from_shdr): Don't set use_rela_p if rela
+ section is empty.
+ (copy_private_bfd_data): Allow for space possibly taken up by elf
+ headers when calculating segment physical address from lma.
- Based on patch from H.J. Lu <hjl@gnu.org>:
- * elf.c (bfd_elf_get_bfd_needed_list): New function.
- * bfd-in.h (bfd_elf_get_bfd_needed_list): Declare.
- * bfd-in2.h: Rebuild.
+2000-05-08 Alan Modra <alan@linuxcare.com.au>
-Fri Apr 24 12:09:18 1998 Ian Lance Taylor <ian@cygnus.com>
+ * versados.c (versados_scan): Init stringlen and pass_2_done.
- * syms.c (struct indexentry): Change directory_name, file_name,
- and function_name fields to char *.
- (struct stab_find_info): Change cached_file_name field to char *.
+ * trad-core.c (trad_unix_core_file_p): Return
+ bfd_error_wrong_format rather than bfd_error_file_truncated.
-Thu Apr 16 11:43:33 1998 Ian Lance Taylor <ian@cygnus.com>
+ * peigen.c (_bfd_pei_swap_aouthdr_out): Pass ImageBase to
+ add_data_entry. DataDirectory virtual address is relative.
+ (pe_print_idata): Account for relative DataDirectory virtual
+ addresses. Don't trash datasize inside POWERPC_LE_PE code.
+ (pe_print_edata): Similarly.
- * archive.c (bfd_generic_archive_p): If a slurp subroutine returns
- an error other than bfd_error_system_call, set the error to
- bfd_error_wrong_format.
+ From Szabolcs Szakacsits <szaka@F-Secure.com>
+ * peigen.c (dir_names): Add Delay Import Directory.
+ (pe_print_idata): Always search for bfd section containing
+ idata address rather than looking up section name. Print this
+ section name rather than .idata.
+ (pe_print_edata): Similarly. Also print some fields as %08lx.
+ (_bfd_pe_print_private_bfd_data_common): Print Reserved1 field as
+ Win32Version.
- * targets.c (bfd_target_vector) [SELECT_VECS not defined]: Add
- bfd_elf32_powerpcle_vec.
+2000-05-03 Mark Elbrecht <snowball3@bigfoot.com>
- * elf.c (copy_private_bfd_data): If all the p_paddr fields in the
- program segments are zero, don't set p_paddr_valid.
+ * bfd/coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Add entry for
+ the .bss section.
+ * bfd/coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
-Fri Apr 10 13:44:27 1998 Ian Lance Taylor <ian@cygnus.com>
+2000-04-29 Andreas Jaeger <aj@suse.de>
- * coffcode.h (coff_write_object_contents): Move a PE COMDAT symbol
- before any other symbols in the same section.
+ * libbfd-in.h: Correctly check GCC version.
+ * bfd-in.h: Likewise.
+ * libhppa.h: Likewise.
+ * libbfd.h: Regenerate.
+ * bfd-in2.h: Regenerate.
-Tue Apr 7 12:35:18 1998 Ian Lance Taylor <ian@cygnus.com>
+2000-04-19 Michael Sokolov <msokolov@ivan.Harhan.ORG>
- * archures.c (bfd_default_scan): Add m68k cases back to default
- switch, reverting patch of March 25, since IEEE support depends
- upon them.
+ K&R compiler fixes.
+ * dwarf2.c (concat_filename): Avoid string literal concatenation.
+ * ieee.c (ieee_get_symtab): Don't initialise union in struct.
-Mon Apr 6 14:06:40 1998 Ian Lance Taylor <ian@cygnus.com>
+2000-04-12 Alan Modra <alan@linuxcare.com.au>
- * Makefile.am (diststuff): New target.
- * Makefile.in: Rebuild.
+ * dep-in.sed: Match space before file name, not after.
+ * Makefile.am: Regenerate dependencies.
+ * Makefile.in: Regenerate.
-Sun Apr 5 16:21:44 1998 Jeffrey A Law (law@cygnus.com)
+ * reloc.c (_bfd_relocate_contents): In complain_overflow_bitfield
+ case, allow address wrap-around stupidly removed 2000-03-17. Sign
+ extend without an if statement.
- * som.c (som_bfd_ar_write_symbol_stuff): Fix computation of
- som_offset when we have an extended name table.
+2000-04-04 Alan Modra <alan@linuxcare.com.au>
-Sun Apr 5 16:04:39 1998 H.J. Lu <hjl@gnu.org>
+ * po/bfd.pot: Regenerate.
- * Makefile.am (stamp-lib): Check that .libs/libbfd.a exists before
- trying to copy it.
- * Makefile.in: Rebuild.
+ * Makefile.am: Remove extraneous mkdep comment.
+ (MKDEP): Use gcc -MM rather than mkdep.
+ (DEP): Quote when passing vars to sub-make. Add warning
+ message to end.
+ (DEP1): Rewrite for "gcc -MM".
+ (CLEANFILES): Add DEP2.
+ Update dependencies.
+ * Makefile.in: Regenerate.
-Fri Apr 3 11:09:42 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+2000-04-03 H.J. Lu <hjl@gnu.org>
- * elf32-m68k.c (elf_m68k_size_dynamic_sections): Generate section
- symbols when creating a shared library.
- (elf_m68k_adjust_dynindx): New function, used by above code.
- (elf_m68k_finish_dynamic_sections): Initialize the section
- symbols.
- (elf_m68k_relocate_section): Change abort to BFD_ASSERT.
+ * cache.c (bfd_open_file): Unlink the output file only if
+ it has non-zero size.
-Wed Apr 1 13:36:58 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+2000-04-01 Ken Block USG <block@zk3.dec.com>
- * elf32-m68k.c (elf_m68k_relocate_section, case R_68K_PLT*O): Fix
- assertion.
+ * elf64-alpha.c (elf64_alpha_relocate_section): Don't emit
+ relative relocations for non-loaded sections in shared objects.
+ (elf64_alpha_check_relocs): Similarly.
-Tue Mar 31 16:25:45 1998 Ian Lance Taylor <ian@cygnus.com>
+2000-03-31 Thomas de Lellis <tdel@wrs.com>
- * Makefile.am: Rebuild dependencies.
- * Makefile.in: Rebuild.
+ * srec.c : Set CHUNK size to 16 bytes to prevent download failures
+ on some targets.
+ * ihex.c : Ditto.
-Mon Mar 30 16:12:17 1998 Ian Lance Taylor <ian@cygnus.com>
+Wed Mar 30 15:28:00 2000 Donald Lindsay <dlindsay@cygnus.com>
- * configure.in: Set version number to 2.9.
- * configure: Rebuild.
+ * elf32-m32r.c (m32r_elf_generic_reloc): new function. All
+ HOWTO references to bfd_elf_generic_reloc, that have
+ partial_inplace == true, now use the new function. The function
+ is based on the recent rewrite of m32r_elf_lo16_reloc(), and
+ extends its fixes to the R_M32R_{16,24,32} relocs.
+ The new logic in m32r_elf_lo16_reloc() has been removed, and
+ it instead calls the new routine to obtain that functionality.
-Mon Mar 30 12:20:50 1998 Brent Baccala <baccala@freesoft.org>
+2000-03-27 Alan Modra <alan@linuxcare.com.au>
- * syms.c (ENABLE_CACHING): Define.
- (struct indexentry): Define.
- (struct stab_cache): Remove.
- (cmpindexentry): New static function.
- (struct stab_find_info): Add new fields: indextable,
- indextablesize, cached_indexentry, cached_offset, cached_stab, and
- cached_file_name. Remove fields: file_cache, function_cache, and
- line_cache.
- (_bfd_stab_section_find_nearest_line): Rewrite to build a sorted
- index table and search it.
+ * elf32-avr.c (elf32_avr_gc_mark_hook, elf32_avr_gc_sweep_hook,
+ elf32_avr_check_relocs, avr_final_link_relocate,
+ elf32_avr_relocate_section, bfd_elf_avr_final_write_processing,
+ elf32_avr_object_p): Add prototypes.
+ (elf32_avr_gc_mark_hook): Add default for h->root.type.
+ (bfd_elf_avr_final_write_processing): Make static.
-Mon Mar 30 10:39:34 1998 Ian Lance Taylor <ian@cygnus.com>
+2000-03-27 Denis Chertykov <denisc@overta.ru>
- * elf.c (_bfd_elf_copy_private_section_data): Call
- copy_private_bfd_data once we've seen the last SEC_ALLOC section.
+ * cpu-avr.c: New file. BFD support routines for AVR architecture.
+ * archures.c (bfd_architecture): Add AVR architecture.
+ (bfd_archures_list): Add reference to AVR architecture info.
+ * elf.c (prep_headers): Handle bfd_arch_avr.
+ * reloc.c: Add various AVR relocation enums.
+ * targets.c (bfd_elf32_avr_vec): Declare and add to target vector
+ list.
+ * Makefile.am: Add support for AVR elf.
+ * configure.in: Likewise.
+ * config.bfd: Likewise.
+ * Makefile.in: Regenerate.
+ * configure: This too.
+ * bfd-in2.h: And this.
+ * libbfd.h: And this.
- * cpu-mips.c: Remove trailing comma at end of enumeration list.
+2000-03-24 H.J. Lu <hjl@gnu.org>
-Sat Mar 28 16:33:02 1998 Ian Lance Taylor <ian@cygnus.com>
+ * elf64-alpha.c (elf64_alpha_merge_ind_symbols): Add prototype.
+ (elf64_alpha_find_reloc_at_ofs): Likewise.
- * coff-arm.c: Define all globally visible variables and functions
- only when COFF_WITH_PE is not defined.
- * configure.in (armpe_little_vec, armpe_big_vec): Add
- coff-arm.lo.
- * configure: Rebuild.
+2000-03-17 Alan Modra <alan@linuxcare.com.au>
-Fri Mar 27 16:06:02 1998 Ian Lance Taylor <ian@cygnus.com>
+ * reloc.c (bfd_check_overflow): In case complain_overflow_bitfield,
+ flag an overflow if the bitfield is outside -2**n to 2**n-1. The
+ allowable range used to be -2**(n-1) to 2**n-1.
+ * reloc.c (_bfd_relocate_contents): Same here. Also replace
+ "boolean overflow" with "bfd_reloc_status_type flag".
- Fix some gcc -Wall warnings:
- * aout-arm.c (MY(fix_pcrel_26)): Add casts to avoid warnings.
- * archive.c (_bfd_generic_read_ar_hdr_mag): Likewise.
- * archures.c (bfd_default_scan): Likewise.
- * bfd.c (bfd_scan_vma): Likewise.
- * binary.c (mangle_name): Likewise
- * coff-arm.c (aoutarm_fix_pcrel_26): Likewise.
- * coff-sh.c (sh_relocate_section): Likewise.
- * coff-stgo32.c (create_go32_stub): Likewise.
- * coffcode.h (coff_slurp_line_table): Likewise.
- * ecoff.c (_bfd_ecoff_write_armap): Likewise.
- * elf.c (_bfd_elf_make_section_from_shdr): Likewise.
- (assign_file_positions_for_segments): Likewise.
- * elf32-mips.c (mips_elf_relocate_section): Likewise.
- * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
- * oasys.c (oasys_write_sections): Likewise.
- * ppcboot.c (ppcboot_object_p): Likewise.
- (mangle_name): Likewise.
- * riscix.c (riscix_fix_pcrel_26): Likewise.
- * srec.c (srec_scan): Likewise.
- * stabs.c (_bfd_write_section_stabs): Likewise.
- * sunos.c (sunos_add_dynamic_symbols): Likewise.
- * aout-ns32k.c (_bfd_ns32k_relocate_contents): Add default case to
- switch. Declare parameters for function pointers.
- * archures.c (bfd_default_scan): Add braces to avoid ambiguous if
- warning.
- * elf.c (elf_sort_sections): Likewise.
- * coff-arm.c (coff_thumb_pcrel_common): Initialize relocation.
- Add default cases to switches.
- (coff_arm_relocate_section): Remove unused local variables.
- Always set rstat.
- (coff_arm_bfd_set_private_flags): Change flag variable to type
- flagword.
- * coff-mips.c (mips_relocate_section): Initialize use_lo.
- * coff-ppc.c (ppc_record_toc_entry): Change i to unsigned int.
- (dump_toc): Change cat to const, and initialize it.
- * coff-sh.c (sh_relax_delete_bytes): Initialize start and voff.
- * elf32-sh.c (sh_elf_relax_delete_bytes): Likewise.
- (sh_elf_relocate_section): Initialize r_symndx.
- * coffcode.h (coff_compute_section_file_positions): Only declare
- old_sofar if ALIGN_SECTIONS_IN_FILE.
- (coff_write_object_contents): Initialize csym.
- * coffgen.c (coff_pointerize_aux): Make type and class unsigned.
- * cpu-ns32k.c (_bfd_ns32k_get_displacement): Add default case to
- switch.
- * dwarf2.c: Include libiberty.h.
- (read_2_signed_bytes, read_4_signed_bytes): Comment out.
- (decode_line_info): Remove unused local variables.
- * elf32-m32r.c (m32r_elf_sda16_reloc): Likewise.
- (m32r_elf_relocate_section): Likewise.
- * elf32-v850.c (v850_elf_store_addend_in_insn): Likewise.
- (v850_elf_reloc): Likewise.
- * elf-bfd.h (elf_linker_section_t): Make alignment unsigned.
- (struct elf_obj_tdata): Make cverdefs and cverrefs unsigned.
- * elf.c (assign_file_positions_for_segments): Always set adjust.
- * elf32-d30v.c (bfd_elf_d30v_reloc): Initialize tmp_addr. Fully
- parenthesize expression.
- * elf32-m32r.c (m32r_elf_relocate_section): Always initialize h.
- (m32r_elf_object_p): Return a value.
- (m32r_elf_print_private_bfd_data): Change fprintf format string.
- * elf32-mips.c (mips_elf_final_link): Initialize last.
- (mips_elf_finish_dynamic_sections): Initialize last and dindx.
- * elf32-v850.c (v850_elf_object_p): Return a value.
- (v850_elf_print_private_bfd_data): Change fprintf format string.
- * elfcode.h (elf_slurp_symbol_table): Change symcount and i to
- unsigned long.
- * elflink.h (elf_link_add_object_symbols): Change vernum to
- unsigned int, and initialize it. Change fprintf format string.
- (NAME(bfd_elf,size_dynamic_sections)): Cast -1 to bfd_size_type
- when setting or comparing to soname_indx.
- (elf_create_pointer_linker_section): Change num_symbols to
- unsigned int.
- * libcoff-in.h (coff_data_type): Change flags to flagword.
- * peicode.h (pe_print_idata): Initialize idx. Change j to
- bfd_size_type. Initialize hint_member. Remove useless test to
- time_stamp.
- (pe_print_edata): Change num_functions and num_names in struct
- EDT_type to unsigned long. Remove cast. Change fprintf format
- string.
- * ppcboot.c (ppcboot_object_p): Change i to size_t.
- * reloc.c (bfd_get_reloc_size): Change return type to unsigned
- int.
- * reloc16.c (bfd_coff_reloc16_relax_section): Change shrinks to
- int *. Update uses. Change j to long.
- * bfd-in2.h, libcoff.h: Rebuild.
+2000-03-14 Doug Evans <dje@casey.transmeta.com>
+
+ * elf32-m32r.c (m32r_elf_lo16_reloc): Rewrite.
+
+2000-03-14 Kazu Hirata <kazu@hxi.com>
-Thu Mar 26 13:32:17 1998 Ian Lance Taylor <ian@cygnus.com>
+ * reloc16.c (bfd_coff_reloc16_relax_section): Count the total number
+ of shrinks properly, including the last reloc.
+
+2000-03-13 Kazu Hirata <kazu@hxi.com>
- * coffcode.h (coff_new_section_hook): Set the type and storage
- class in the native symbol information allocated for a new section
- symbol.
-
-Thu Mar 26 10:13:41 1998 Nick Clifton <nickc@cygnus.com>
-
- * peicode.h: Chain together calls to
- coff_bfd_copy_private_bfd_data and
- coff_bfd_print_private_bfd_data.
-
- * coff-arm.c: Add prototypes for
- coff_arm_bfd_print_private_bfd_data and
- coff_arm_bfd_copy_private_bfd_data.
-
-Wed Mar 25 15:45:55 1998 Nick Clifton <nickc@cygnus.com>
-
- * coffcode.h (coff_mkobject_hook): Set private falgs even for a PE
- build.
-
- * peicode.h: Call arm-coff private data functions after handling
- pe private data.
-
- * coff-arm.c: Turn statics into globals so that they can be shared
- both pe and pei backends.
-
-Wed Mar 25 15:19:38 1998 Ian Lance Taylor <ian@cygnus.com>
-
- * aoutf1.h (sunos_set_arch_mach): Use bfd_mach_m68* rather than
- plain numbers.
- (sunos_write_object_contents): Likewise.
- * aoutx.h (NAME(aout,machine_type)): Likewise.
- * coffcode.h (coff_set_arch_mach_hook): Likewise.
-
-Wed Mar 25 13:59:24 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * archures.c (bfd_mach_m68*): Add definitions for various m68k
- variants.
- (bfd_default_scan): Remove m68k special cases.
+ * coff-h8300.c (h8300_reloc16_extra_cases): Fix the sanity
+ check for R_MOVL2.
+
+2000-03-11 Alan Modra <alan@linuxcare.com.au>
+
+ * ieee.c (ieee_archive_p): Return bfd_error_wrong_format on
+ a format mismatch rather than an "error" from bfd_read such as
+ bfd_error_file_truncated.
+
+2000-03-10 Geoff Keating <geoffk@cygnus.com>
+
+ * elf32-mips.c (_bfd_mips_elf_relocate_section): Do proper
+ sign-extension and big-endian compensation for
+ R_MIPS_64 even in ld -r.
+
+2000-03-10 Geoffrey Keating <geoffk@cygnus.com>
+
+ * elf32-mips.c (mips_elf_next_relocation): Rename from
+ mips_elf_next_lo16_relocation, and generalize to look
+ for any relocation type.
+ (elf_mips_howto_table): Make R_MIPS_PC16 pcrel_offset.
+ (elf_mips_gnu_rel_hi16): Howto for R_MIPS_GNU_REL_HI16.
+ (elf_mips_gnu_rel_lo16): Howto for R_MIPS_GNU_REL_LO16.
+ (elf_mips_gnu_rel16_s2): Howto for R_MIPS_GNU_REL16_S2.
+ (elf_mips_gnu_pcrel64): Howto for R_MIPS_PC64.
+ (elf_mips_gnu_pcrel32): Howto for R_MIPS_PC32.
+ (bfd_elf32_bfd_reloc_type_lookup): Add new relocs.
+ (mips_rtype_to_howto): Likewise.
+ (mips_elf_calculate_relocation): Handle new relocs.
+ (_bfd_mips_elf_relocate_section): REL_HI16/REL_LO16 relocs
+ are paired. The addend for R_MIPS_GNU_REL16_S2
+ is shifted right two bits.
+
+2000-03-10 Alan Modra <alan@linuxcare.com.au>
+
+ * reloc.c (bfd_perform_relocation): Undo emacs formatting of
+ comment, and ensure it doesn't happen again.
+ (bfd_install_relocation): Same here.
+ (_bfd_relocate_contents): Don't bother assigning unused signmask
+ shift result. Fix typos in comments.
+ Remove trailing whitespace throughout file.
+
+2000-03-07 Doug Evans <dje@casey.transmeta.com>
+
+ * reloc.c (reloc_howto_struct): Fix partial_inplace comment.
* bfd-in2.h: Rebuild.
- * mipsbsd.c (MY(write_object_contents)): Use bfd_mach_m68* rather
- than plain numbers.
- * sparclynx.c (NAME(lynx,set_arch_mach)): Likewise.
- * cpu-m68k.c (arch_info_struct): Likewise. Add entry for
- m68k:68000.
- (bfd_m68k_arch): Set mach field to zero to signal no explicit
- selection, change printable_name to just "m68k" and make that the
- default instead of m68k:68020.
-
- * aout-tic30.c (NAME): Define this to avoid multiple definitions
- from aoutx.h.
- (MY_get_section_contents): Define as aout_32_get_section_contents
- rather than NAME(aout,get_section_contents).
-
- * elf-m10300.c (elf32_mn10300_link_hash_table_create): Fix cast.
-
- * evax-alpha.c (evax_set_arch_mach): Only accept bfd_arch_alpha
- and call bfd_default_set_arch_mach to do the real work.
-
-Wed Mar 25 10:41:35 1998 Richard Henderson <rth@cygnus.com>
-
- * bout.c (BALX): Include return register g14 as part of the insn.
- (BALX_MASK): New.
- (calljx_callback): Use it.
-
-Wed Mar 25 11:19:28 1998 Ian Lance Taylor <ian@cygnus.com>
- * libbfd-in.h (BFD_ALIGN): Cast this parameter to bfd_vma.
- * libbfd.h: Rebuild.
+2000-03-06 Nick Clifton <nickc@cygnus.com>
- * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Change
- byte_count to unsigned int.
- (mn10300_elf_relax_section): Initialize internal_relocs. Remove
- unused local variables.
+ * peicode.h (struct pe_ILF_vars): Add sym_ptr_table and
+ sym_ptr_ptr fields.
+ (SIZEOF_ILF_SYM_PTR_TABLE): Define.
+ (SIZEOF_ILF_STRINGS): Redefine.
+ (pe_ILF_make_a_symbol-reloc): New function. Creates a symbol
+ relative reloc, as opposed to a section relative reloc.
+ (pe_ILF_make_a_symbol): Set the class of local symbols to C_STAT
+ not C_LABEL.
+ Add length of symbol's prefix to string pointer.
+ Store a pointer to the symbol in the symbol pointer table.
+ (pe_ILF_build_a_bfd): Do not build .idata$2 or .idata$7.
+ Initialise the symbol pointer table.
+ Store the hint in the Hint/Name table.
+ Make the jump reloc be symbol realtive, not section relative.
+ Create an import symbol for imported code.
- * evax-alpha.c (evax_close_and_cleanup): Remove unused local
- variables er and er1.
+2000-03-06 Catherine Moore <clm@cygnus.com>
- * cpu-v850.c: Include <ctype.h>.
- (scan): Case isdigit argument to unsigned char.
+ * elf.c (swap_out_syms): Check for null type_ptr.
- From Yan Meroth <YAN.MEROTH@st.com>:
- * ihex.c (ihex_scan): Add extbase variable so that getting an
- extended linear address record does not ignore any previous
- extended address.
- (ihex_write_object_contents): When writing out an extended linear
- address record, zero out any previous extended address.
+2000-03-01 Hans-Peter Nilsson <hp@axis.com>
-Tue Mar 24 16:09:43 1998 Manfred Hollstein <manfred@s-direktnet.de>
+ * aout-target.h (MY(write_object_contents)): Remove unused
+ and unusable "#if CHOOSE_RELOC_SIZE".
+ * pc532-mach.c (MY(write_object_contents)): Ditto.
+ * netbsd.h (MY(write_object_contents)): Ditto.
+ * hp300hpux.c (MY(write_object_contents)): Ditto.
+ * freebsd.h (MY(write_object_contents)): Ditto.
+ * aout-tic30.c (tic30_aout_write_object_contents): Ditto.
- * ieee.c (do_one): Check section before dereferencing it.
- (ieee_canonicalize_reloc): Likewise with src->relent.sym_ptr_ptr.
- (ieee_generic_stat_arch_elt): Likewise with abfd->my_archive.
+2000-02-29 H.J. Lu <hjl@gnu.org>
-Mon Mar 23 18:51:47 1998 Joel Sherrill <joel@OARcorp.com>
+ * peicode.h (jtab): Make it static.
- * config.bfd: (sh*-*-rtems*): Switched from ELF to COFF.
+ * coff-sh.c (sh_align_load_span): Declared if COFF_WITH_PE is
+ defined and COFF_IMAGE_WITH_PE is not defined.
+ (_bfd_sh_align_load_span): Defined as sh_align_load_span if
+ COFF_WITH_PE is defined and COFF_IMAGE_WITH_PE is not defined.
-Mon Mar 23 14:23:36 1998 Nick Clifton <nickc@cygnus.com>
+2000-03-01 Nick Clifton <nickc@cygnus.com>
- * coff-arm.c: Add interworking functions to pe backends.
+ * coff-arm.c (bfd_arm_process_before_allocation): Make
+ 'symndx' signed to prevent compile time warning.
-Fri Mar 20 18:47:20 1998 Ian Lance Taylor <ian@cygnus.com>
+ * coff-mcore.c: Remove unused prototype for pe_object_p.
- * configure.in: Use AM_DISABLE_SHARED.
- * aclocal.m4, configure: Rebuild with libtool 1.2.
-
-Fri Mar 20 11:25:41 1998 Nick Clifton <nickc@cygnus.com>
-
- * coff-arm.c (coff_arm_relocate_section): Better error messages
- when interowrking conflucts occur. Courtesy of Jonathan Walton
- and Tony Thompson. PR 15357.
- (aoutarm_std_reloc_howto): Fixed bitsize fields of rightshifted
- relocations. Patch courtesy of Jonathan Walton and Tony
- Thompson. PR 15373.
-
-Fri Mar 20 02:26:43 1998 Richard Henderson <rth@cygnus.com>
-
- * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Revert
- part of Feb 22 change controling when to override the existing
- symbol with the .plt entry.
-
-Wed Mar 18 09:26:25 1998 Nick Clifton <nickc@cygnus.com>
-
- * config.bfd (targ_cpu): Add thumb-pe target.
-
- * coffcode.h (OTHER_GLOBAL_CLASS): Support thumb external
- functions in PE build.
-
-Sun Mar 8 23:37:26 1998 Stan Cox <scox@equinox.cygnus.com>
+ * coff-sh.c: Add "#ifndef COFF_IMAGE_WITH_PE" around static
+ functions that are not used when COFF_IMAGE_WITH_PE is
+ defined.
+ (struct sh_opcode): Change type of 'flags' field to unsigned
+ long so that it can hold the USESAS flag.
- * config.bfd (sparclite-*-elf*): Added.
+ * coffcode.h (styp_to_sec_flags): Initialise 'target_name'.
-Mon Feb 23 19:31:19 1998 Ian Lance Taylor <ian@cygnus.com>
+ * elf-m10300.c (mn10300_elf_relax_section): Initialise
+ 'sym_sec'.
- * configure.in: Add elf.lo to elf shell variable.
- * Makefile.am (BFD_LIBS): Remove elf.lo.
- (BFD_LIBS_CFILES): Remove elf.c.
- (BFD32_BACKENDS): Add elf.lo.
- (BFD32_BACKENDS_CFILES): Add elf.c.
- * configure, Makefile.in: Rebuild.
+ * elf32-i370.c: Add ATTRIBUTE_UNUSED to unused function
+ parameters.
+ Remove unusued variables and code.
+ (elf_backend_add_symbol_hook): Fix prototype.
-1998-02-23 15:53 Richard Henderson <rth@cygnus.com>
+ * elf32-m68k.c (elf_m68k_gc_sweep_hook): Initialise 'sgot' and
+ 'srelgot'.
- * elf32-i386.c (elf_i386_relocate_section): A pc-relative
- relocation against a now-local symbol should not have a dynamic
- relocation.
+ * elf32-mcore.c (mcore_elf_relocate_section): Initialise
+ 'oldinst'.
-Mon Feb 23 16:17:08 1998 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-mips.c: Add ATTRIBUTE_UNUSED to unused function
+ parameters.
+ Remove unusued variables and code.
+ (elf_backend_add_symbol_hook): Fix prototype.
- * peicode.h (coff_swap_filehdr_in): Don't set BFD flag HAS_SYMS in
- COFF filehdr flags.
- (pe_print_private_bfd_data): Print PE flags. From Mikey
- <jeffdb@netzone.com>.
+ * elf32-sh.c (sh_elf_set_mach_from_flags): Use 'flags'.
-Sun Feb 22 20:39:00 1998 Richard Henderson <rth@cygnus.com>
+ * elflink.h (elf_bfd_link_add_symbols): Add ATTRIBUTE_UNUSED
+ to unused function parameter.
+
+ * pe-mips.c: Add ATTRIBUTE_UNUSED to unused function
+ parameters.
+ Use EMPTY_HOWTO to initialise empty howto slots.
+ Remove unused variables.
- * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Don't create
- a plt entry when we can determine that we authoritatively define
- the symbol.
+ * peicode.h (pe_ILF_build_a_bfd): Initialise id6.
-Sun Feb 22 20:33:05 1998 Richard Henderson <rth@cygnus.com>
+2000-03-01 H.J. Lu <hjl@gnu.org>
- * configure.in (COREFILE selection): Remove sparc-*-linux*. They
- don't actually use trad-core, but a SunOS-style core file handled
- by gdb directly.
- * hosts/sparclinux.h: Remove.
+ * aoutx.h (aout_link_input_section_std): Pass "true" to
+ the undefined_symbol callback.
+ (aout_link_input_section_ext): Likewise.
+ * bout.c (get_value): Likewise.
+ * coff-a29k.c (coff_a29k_relocate_section): Likewise.
+ * coff-alpha.c (alpha_ecoff_get_relocated_section_conten):
+ Likewise.
+ (alpha_relocate_section): Likewise.
+ * coff-arm.c (coff_arm_relocate_section): Likewise.
+ * coff-i960.c (coff_i960_relocate_section): Likewise.
+ * coff-mcore.c (coff_mcore_relocate_section): Likewise.
+ * coff-mips.c (mips_relocate_section): Likewise.
+ * coff-ppc.c (coff_ppc_relocate_section): Likewise.
+ * coff-sh.c (sh_relocate_section): Likewise.
+ * coff-tic80.c (coff_tic80_relocate_section): Likewise.
+ * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
+ * elf-m10200.c (mn10200_elf_relocate_section): Likewise.
+ * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
+ * elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
+ * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
+ * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
+ * elf32-i370.c (i370_elf_relocate_section): Likewise.
+ * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
+ * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
+ * elf32-sh.c (sh_elf_relocate_section): Likewise.
+ * elf32-v850.c (v850_elf_relocate_section): Likewise.
+ * elflink.c (_bfd_elf_link_record_dynamic_symbol): Likewise.
+ * elflink.h (elf_link_output_extsym): Likewise.
+ * pe-mips.c (coff_pe_mips_relocate_section): Likewise.
+ * reloc.c (bfd_generic_get_relocated_section_conten): Likewise.
+ * reloc16.c (_bfd_ppc_xcoff_relocate_section): Likewise.
+
+ * elf-hppa.h (elf_hppa_relocate_section): Pass "false" to the
+ undefined_symbol callback when building shared library with
+ -Bsymbolic and undefined symbols are allowed. Otherwise, pass
+ "true".
+ * elf32-arm.h (elf32_arm_relocate_section): Likewise.
+ * elf32-i386.c (elf_i386_relocate_section): Likewise.
+ * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
+ * elf32-mips.c (mips_elf_calculate_relocation): Likewise.
+ (elf32_mips_get_relocated_section_content): Likewise.
+ * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+ * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
+ * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
-Wed Feb 18 15:31:06 1998 Ian Lance Taylor <ian@cygnus.com>
+2000-02-28 Nick Clifton <nickc@cygnus.com>
- * peicode.h (pe_print_idata): If there is no .idata section, look
- for the import tables in some other section. Make the initial
- label line up better with the data. Print the import address
- table even if there is no import name table. If the import
- address table holds actual addresses, print them.
+ * Makefile.am: Add rules to build pe[i]-{sh|mips}.lo objects.
+ * Makefile.in: Regenerate.
-Tue Feb 17 12:58:34 1998 Ian Lance Taylor <ian@cygnus.com>
+ * configure.in: Add support for mips and sh pe vectors.
+ * configure: regenerate.
- * libbfd.c (bfd_seek): If fseek fails, save errno around call to
- bfd_tell. If errno is EINVAL, set bfd_error_file_truncated, not
- bfd_error_system_call.
+ * config.bfd: Add support for arm-wince, mips-pe and sh-pe
+ targets.
-Fri Feb 13 13:11:33 1998 Ian Lance Taylor <ian@cygnus.com>
+ * targets.c: Add mips and sh pe vectors.
- * Makefile.am (AUTOMAKE_OPTIONS): Define.
- * configure, Makefile.in, aclocal.m4: Rebuild with automake 1.2e.
+ * libpei.h (coff_final_link_postscript): Only define if not
+ already defined.
- From H.J. Lu <hjl@gnu.org>:
- * Makefile.am (libbfd_la_LDFLAGS): Define.
+ * coffcode.h: Add support for WinCE magic numbers.
+
+ * peigen.c (pe_print_reloc): Update comment and rearrange
+ appending of newline character.
+
+ * peicode.h: Add support for Image Library Format.
+ (pe_ILF_vars): Structure containing data used by ILF code.
+ (pe_ILF_make_a_section): New function. Create a section based
+ on ILF data.
+ (pe_ILF_make_a_reloc): New function. Create a reloc based on
+ ILF data.
+ (pe_ILF_make_a_symbol): New function. Create a symbol based
+ on ILF data.
+ (pe_ILF_save_relocs): New function. Store the relocs created
+ by pe_ILF_make_a_reloc in a section.
+ (pe_ILF_build_a_bfd): New function. Create a BFD describing
+ an ILF object.
+ (pe_ILF_object_p): New function. Return a bfd_target pointer
+ for an ILF object.
+ (pe_bfd_object_p): If an ILF object is detected call
+ pe_ILF_object_p on it.
+
+ * coff-arm.c: Add support for WinCE relocs which are different
+ from normal ARM COFF relocs.
+ * pe-arm.c: Unset TARGET_UNDERSCORE for a WinCE target.
+
+ * coff-sh.c: Add support for sh-pe target.
+ * pe-sh.c: New file. Support code for sh-pe target.
+ * pei-sh.c: New file. Support code for sh-pe target.
+
+ * pe-mips.c: New file. Support code for mips-pe target.
+ * pei-mips.c: New file. Support code for mips-pe target.
+
+2000-02-27 Jakub Jelinek <jakub@redhat.com>
+
+ * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Don't bump
+ architecture if the object causing the bump is dynamic.
+ * elf64-sparc.c (sparc64_elf_merge_private_bfd_data): Likewise,
+ and also don't it for memory ordering.
+ (sparc64_elf_write_relocs): Take src_rela out of the loop.
+
+2000-02-27 Ian Lance Taylor <ian@zembu.com>
+
+ * dwarf2.c (read_abbrevs): Use _raw_size directly rather than
+ calling bfd_get_section_size_before_reloc.
+ (decode_line_info): Likewise.
+ (_bfd_dwarf2_find_nearest_line): Likewise.
+
+2000-02-27 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * Makefile.am (stamp-lib): Use $(LIBTOOL) --config to get the
+ name of the libtool directory.
* Makefile.in: Rebuild.
-Thu Feb 12 17:31:11 1998 Ian Lance Taylor <ian@cygnus.com>
+Fri Feb 25 18:39:26 2000 Rodney Brown (RodneyBrown@pmsc.com)
- NetBSD patches from Gordon W. Ross <gwr@mc.com>:
- * netbsd.h (MACHTYPE_OK): Define.
- (MY(write_object_contents)): Use DEFAULT_ARCH and DEFAULT_MID when
- calling N_SET_MACHTYPE, rather than having a switch.
- * libaout.h (enum machine_type): Add M_PMAX_NETBSD, M_VAX_NETBSD,
- and M_ALPHA_NETBSD.
- * i386netbsd.c (MACHTYPE_OK): Don't define.
- (DEFAULT_MID): Define.
- * m68k4knetbsd.c (SEGMENT_SIZE): Don't define.
- (MACHTYPE_OK): Don't define.
- (DEFAULT_MID): Define.
- * m68knetbsd.c: (MACHTYPE_OK): Don't define.
- (DEFAULT_MID): Define.
- * ns32knetbsd.c (MACHTYPE_OK): Don't define.
- (DEFAULT_MID): Define.
- * sparcnetbsd.c (MACHTYPE_OK): Don't define.
- (DEFAULT_MID): Define.
+ * som.c (SOM_HOWTO): Define.
+ (som_hppa_howto_table): Use it.
- NetBSD patches from Gordon W. Ross <gwr@mc.com>:
- * vaxnetbsd.c: New file.
- * netbsd-core.c: Clean up. Remove unused macros. Use netbsd
- rather than netbsd_core.
- * targets.c (vaxnetbsd_vec): Declare.
- (bfd_target_vector): Add vaxnetbsd_vec. If NETBSD_CORE is
- defined, add netbsd_core_vec.
- * configure.in: Set COREFILE for alpha*-*-netbsd* and
- powerpc-*-netbsd* to netbsd-core.lo. If COREFILE is
- netbsd-core.lo, set COREFLAG to -DNETBSD_CORE.
- * config.bfd (alpha*-*-netbsd*): New target.
- * Makefile.am: Rebuild dependencies.
- (BFD32_BACKENDS): Add vaxnetbsd.lo.
- (BFD32_BACKENDS_CFILES): Add vaxnetbsd.c.
- * configure, Makefile.in: Rebuild.
+2000-02-25 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
- * configure.host: Remove the old shared library build stuff. We
- now use libtool instead.
+ * config.bfd: Enable 64 bit support for GNU/Linux/sparc.
-Wed Feb 11 17:13:09 1998 Richard Henderson <rth@cygnus.com>
+ * config.bfd: Enable 64 bit support for Solaris7+/sparc.
- * tekhex.c (tekhex_write_object_contents): Call tekhex_init.
+2000-02-24 Catherine Moore <clm@cygnus.com>
-Tue Feb 10 19:23:28 1998 H.J. Lu <hjl@gnu.org>
+ * som.c (som_misc_symbol_info): Add field
+ secondary_def.
+ (som_bfd_derive_misc_symbol_info): Initialize
+ secondary_def.
+ (som_build_and_write_symbol_table): Keep track
+ of secondary_def field.
+ (som_slurp_symbol_table): Set BSF_WEAK symbol flag
+ if secondary_def field is set.
+ (som_bfd_ar_write_symbol_stuff): Initialize
+ secondary_def.
- * configure.in: Take stab-syms.lo out of sparclinux_vec list.
- * configure: Rebuild.
+2000-02-23 Stephane Carrez <stcarrez@worldnet.fr>
-Tue Feb 10 15:16:38 1998 Nick Clifton <nickc@cygnus.com>
- * elf32-v850.c (remember_hi16s_reloc): New function.
- (find_remembered_hi16s_reloc): New function.
- (v850_elf_store_addend_in_insn): Use the above new functions to
- match up HI6S relocs with LO16 relocs.
+ * dwarf2.c (read_address): Read 16-bits addresses.
+ (parse_comp_unit): Accept addr_size == 2.
+
+2000-02-23 Alan Modra <alan@spri.levels.unisa.edu.au>
-Tue Feb 10 15:01:39 1998 Ian Lance Taylor <ian@cygnus.com>
+ * bfd-in.h: Update copyright date.
- * configure.in: Change -linux* to -linux-gnu*.
- * config.bfd, configure.host: Likewise.
- * configure: Rebuild.
-
-Mon Feb 9 19:40:59 1998 Nick Clifton <nickc@cygnus.com>
+2000-02-23 Linas Vepstas <linas@linas.org>
- * elf32-v850.c (v850_elf_store_addend_in_insn): Fix another
- LO16/HI16S bug and improve comments about what is going on.
-
-Sat Feb 7 15:27:03 1998 Ian Lance Taylor <ian@cygnus.com>
+ * cpu-i370.c: New file.
+ * elf32-i370.c: New file.
+ * archures.c (enum bfd_architecture): Add bfd_arch_i370.
+ (bfd_i370_arch): New.
+ (bfd_archures_list): Add bfd_i370_arch.
+ * elf.c (prep_headers): Add bfd_arch_i370.
+ * Makefile.am: Add support for IBM 370 elf.
+ * config.bfd: Likewise.
+ * configure.in: Likewise.
+ * libbfd.h (bfd_reloc_code_real_names): Likewise.
+ * reloc.c (bfd_reloc_code_type): Likewise.
+ * targets.c: Likewise.
- * configure, aclocal.m4: Rebuild with new libtool.
-
-Fri Feb 6 11:50:22 1998 Jeffrey A Law (law@cygnus.com)
-
- * elf32-mips.c (bfd_elf32_bfd_reloc_type_lookup): For BFD_RELOC_CTOR
- get the size from bfd_arch_bits_per_address instead of directly
- from the isa.
-
-Thu Feb 5 14:21:34 1998 Michael Meissner <meissner@cygnus.com>
-
- * libbfd-in.h (BFD_ALIGN): If rounding up would cause the address
- to wrap, just return all 1's bits instead.
- * libbfd.h: Regenerate.
-
-Thu Feb 5 11:51:05 1998 Ian Lance Taylor <ian@cygnus.com>
-
- * coff-i386.c (coff_pe_i386_relocate_section): New static function
- if COFF_WITH_PE.
- (coff_relocate_section): If COFF_WITH_PE, define as
- coff_pe_i386_relocate_section.
- * coffcode.h (coff_write_object_contents): If COFF_IMAGE_WITH_PE,
- skip empty sections, to match coff_write_object_contents.
-
- * elf64-mips.c (mips_elf64_swap_reloca_out): Swap out r_addend,
- rather than swapping out r_offset twice. From Luke Deller
- <luked@cse.unsw.edu.au>.
-
-Wed Feb 4 19:11:28 1998 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Set libtool_enable_shared rather than
- libtool_shared. Remove diversion hack.
- * configure, Makefile.in, doc/Makefile.in, aclocal.m4: Rebuild
- with new libtool.
+ * Makefile.in: Regenerate.
+ * configure: Regenerate.
+ * bfd-in2.h: Regenerate.
-Wed Feb 4 16:10:21 1998 Brent Baccala <baccala@freesoft.org>
+2000-02-22 Ian Lance Taylor <ian@zembu.com>
- * syms.c (struct stab_cache): Define.
- (struct stab_find_info): Remove cached_offset, cached_stab,
- cached_str, and cached_stroff fields. Add file_cache,
- function_cache, and line_cache fields.
- (_bfd_stab_section_find_nearest_line): Use extensive caching to
- speed up searches.
+ * elf32-i386.c (elf_i386_info_to_howto_rel): Give a warning for
+ invalid relocation types, and change them to R_386_NONE.
-Wed Feb 4 13:34:22 1998 Ian Lance Taylor <ian@cygnus.com>
+2000-02-22 H.J. Lu <hjl@gnu.org>
- * peicode.h (pe_print_idata): Check for import of ordinal rather
- than name.
- (pe_print_edata): If there is no .edata section, look for the
- export data in some other section.
+ * elflink.h (elf_link_add_object_symbols): If a version symbol is
+ not defined, don't add a second ELF_VER_CHR.
-Mon Feb 2 20:05:42 1998 Jason Molenda (crash@bugshack.cygnus.com)
+ * elflink.h (elf_bfd_final_link): Call output_extsym for global
+ symbols converted to local symbols even when stripping all
+ symbols.
+ (elf_link_output_extsym): Process global symbols converted to
+ local symbols even if they are being stripped.
+
+2000-02-21 Alan Modra <alan@spri.levels.unisa.edu.au>
+
+ * archures.c (bfd_octets_per_byte): Return unsigned int.
+ (bfd_arch_mach_octets_per_byte): Ditto.
+ * libbfd.c (bfd_read, bfd_seek): Quell signed vs. unsigned
+ comparison warning.
+ * section.c (bfd_get_section_size_before_reloc): Quell signed
+ vs. unsigned comparison warning.
+ (bfd_get_section_size_after_reloc): Same here. Fix parentheses too.
+ * trad-core.c (trad_unix_core_file_p): Correct 2000-01-27
+ change. What was I thinking?
+ * bfd-in2.h: Regenerate.
- * configure.in: Change version to 2.8.4.
- * configure: Regenerated.
+ * elflink.h (elf_gc_sweep): Skip non-elf input bfds.
+ (elf_gc_sections): Same here.
+ (elf_gc_common_finalize_got_offsets): And here.
-Mon Feb 2 17:39:39 1998 Steve Haworth <steve@pm.cse.rmit.EDU.AU>
+2000-02-21 Ian Lance Taylor <ian@zembu.com>
- Add tms320c30 support:
- * cpu-tic30.c: New file.
- * aout-tic30.c: New file.
- * coff-tic30.c: New file.
- * archures.c (bfd_arch_tic30): Define.
- (bfd_tic30_arch): Declare.
- (bfd_archures_list): Add bfd_tic30_arch.
- * targets.c (bfd_target_vector): Add tic30_aout_vec and
- tic30_coff_vec.
- * reloc.c (BFD_RELOC_TIC30_LDP): Define.
- * coffcode.h (coff_set_arch_mach_hook): Add tic30 case.
- (coff_set_flags): Likewise.
- * config.bfd (tic30-*-*aout*, tic30-*-*coff*): New targets.
- * configure.in (tic30_aout_vec, tic30_coff_vec): New vectors.
+ ELF HPPA doesn't work at present; remove it until it does.
+ * config.bfd: Comment out setting targ_defvec to
+ bfd_elf32_hppa_vec.
* Makefile.am: Rebuild dependencies.
- (ALL_MACHINES): Add cpu-tic30.lo.
- (ALL_MACHINES_CFILES): Add cpu-tic30.c.
- (BFD32_BACKENDS): Add aout-tic30.lo and coff-tic30.lo.
- (BFD32_BACKENDS_CFILES): Add aout-tic30.c and coff-tic30.c.
- * configure, Makefile.in, bfd-in2.h, libbfd.h: Rebuild.
+ (BFD32_BACKENDS): Remove elf32-hppa.lo.
+ (BFD32_BACKENDS_CFILES): Remove elf32-hppa.c.
+ (SOURCE_HFILES): Remove elf32-hppa.h and hppa_stubs.h.
+ * Makefile.in: Rebuild.
+ * targets.c (bfd_target_vector): Comment out bfd_elf32_hppa_vec.
-Mon Feb 2 12:25:12 1998 Nick Clifton <nickc@cygnus.com>
+2000-02-18 Geoff Keating <geoffk@cygnus.com>
- * elf32-v850.c (v850_elf_store_addend_in_insn): Allow HI16_S reloc
- to lag behind LO16 reloc by a couple of instructions.
+ * coffcode.h (coff_set_arch_mach_hook): Use free(), because there
+ is no bfd_free(). Revert bfd_free part of previous change.
-Mon Feb 2 14:09:46 1998 Ian Lance Taylor <ian@cygnus.com>
+2000-02-18 Geoff Keating <geoffk@cygnus.com>
- * Makefile.am ($(srcdir)/bfd-in2.h): Add dummy command to force
- make to reexamine the file timestamp.
- ($(srcdir)/libbfd.h, $(srcddir)/libcoff.h): Likewise.
+ * coffcode.h (coff_set_arch_mach_hook): Don't use variable-size
+ arrays.
+ (coff_compute_section_file_positions): Use bfd_free to pair
+ bfd_malloc.
+ (coff_write_object_contents): Likewise.
- * elf64-alpha.c (ELF_MAXPAGESIZE): Change to 0x10000 from
- 0x100000.
+ * coff-rs6000.c (xcoff_howto_table_16): New variable.
+ (xcoff_rtype2howto): Handle 16-bit variants of 32-bit relocs.
+
+2000-02-18 Ulrich Drepper <drepper@cygnus.com>
+
+ * coff-rs6000.c (XCOFFARMAGBIG): New macro.
+ (xcoff_ar_file_hdr_big): New structure.
+ (SIZEOF_AR_FILE_HDR_BIG): New macro.
+ (xcoff_ar_hdr_big): New structure.
+ (SIZEOF_AR_HDR_BIG): New macro.
+ (xcoff_big_format_p): New macro.
+ (xcoff_ardata_big): New macro.
+ (arch_xhdr_big): New macro.
+ (xcoff_slurp_armap): Handle large archives.
+ (xcoff_archive_p): Detect large archives.
+ (xcoff_read_ar_hdr): Handle large archives.
+ (xcoff_openr_next_archived_file): Handle large archives.
+ (xcoff_generic_stat_arch_elt): Handle large archives.
+ (xcoff_write_armap_old): Rename from xcoff_write_armap.
+ (xcoff_write_armap_big): New function.
+ (xcoff_write_armap): New function, dispatch to _old or _big.
+ (xcoff_write_archive_contents_old): Rename from
+ xcoff_write_archive_contents.
+ (xcoff_write_archive_contents_big): New function.
+ (xcoff_write_archive_contents): New function, dispatch to _old or
+ _big.
+
+2000-02-18 Richard Henderson <rth@cygnus.com>
+
+ * elf-bfd.h (struct elf_link_hash_table): Remove copy_indirect
+ and hide_symbol members.
+ (elf_link_hash_copy_indirect): Remove.
+ (elf_link_hash_hide_symbol): Remove.
+ (struct elf_backend_data): Add elf_backend_copy_indirect_symbol
+ and elf_backend_hide_symbol.
+ (_bfd_elf_link_hash_copy_indirect): Declare.
+ (_bfd_elf_link_hash_hide_symbol): Declare.
+ * elf.c (_bfd_elf_link_hash_copy_indirect): Remove table argument.
+ (_bfd_elf_link_hash_hide_symbol): Likewise.
+ (_bfd_elf_link_hash_table_init): Don't init killed members.
+ * elflink.h (elf_link_add_object_symbols): Use the bed function
+ pointers not elf_link_hash_{copy_indirect,hide_symbol}.
+ (elf_link_assign_sym_version): Likewise.
+ * elfxx-target.h (elf_backend_copy_indirect_symbol): Default.
+ (elf_backend_hide_symbol): Likewise.
+ (elfNN_bed): Update for new members.
+
+2000-02-17 Kevin Buettner <kevinb@redhat.com>
+
+ * rs6000-core.c (CORE_DATA_SIZE_FIELD, CORE_COMM_FIELD, SAVE_FIELD,
+ STACK_END_ADDR): Define for new core file format.
+ (LOADER_OFFSET_FIELD, LOADER_REGION_SIZE, CORE_DUMP): New defines
+ for handling the vagaries of the various core file structures used
+ by AIX over the years.
+ (rs6000coff_core_p, rs6000coff_core_file_matches_executable,
+ Rs6kCorData): Use above defines to adapt code to use AIX 4.3's
+ core_dumpx structure.
+
+Thu Feb 17 00:04:48 2000 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * archures.c (bfd_mach_sh2, bfd_mach_sh_dsp): New macros.
+ (bfd_mach_sh3_dsp): Likewise.
+ (bfd_mach_sh4): Reinstate.
+ (bfd_default_scan): Recognize 7410, 7708, 7729 and 7750.
+ * bfd-in2.h: Regenerate.
+ * coff-sh.c (struct sh_opcode): flags is no longer short.
+ (USESAS, USESAS_REG, USESR8, SETSAS, SETSAS_REG): New macros.
+ (sh_opcode41, sh_opcode42): Integrate as sh_opcode41.
+ (sh_opcode01, sh_opcode02, sh_opcode40): Add sh-dsp opcodes.
+ (sh_opcode41, sh_opcode4, sh_opcode80): Likewise.
+ (sh_opcodes): No longer const.
+ (sh_dsp_opcodef0, sh_dsp_opcodef): New arrays.
+ (sh_insn_uses_reg): Check for USESAS and USESR8.
+ (sh_insn_sets_reg, sh_insns_conflict): Check for SETSAS.
+ (_bfd_sh_align_load_span): Return early for SH4.
+ Modify sh_opcodes lookup table for sh-dsp / sh3-dsp.
+ Take into account that field b of a parallel processing insn
+ could be mistaken for a separate insn.
+ * cpu-sh.c (arch_info_struct): New array elements for
+ sh2, sh-dsp and sh3-dsp.
+ Reinstate element for sh4.
+ (SH2_NEXT, SH_DSP_NEXT, SH3_DSP_NEXT): New macros.
+ (SH4_NEXT): Reinstate.
+ (SH3_NEXT, SH3E_NEXT): Adjust.
+ * elf-bfd.h (_sh_elf_set_mach_from_flags): Declare.
+ * elf32-sh.c (sh_elf_set_private_flags): New function.
+ (sh_elf_copy_private_data, sh_elf_set_mach_from_flags): Likewise.
+ (sh_elf_merge_private_data): New function.
+ (elf_backend_object_p, bfd_elf32_bfd_set_private_bfd_flags): Define.
+ (bfd_elf32_bfd_copy_private_bfd_data): Define.
+ (bfd_elf32_bfd_merge_private_bfd_data): Change to
+ sh_elf_merge_private_data.
+
+2000-02-13 Richard Henderson <rth@cygnus.com>
+
+ * elf-bfd.h (struct elf_link_hash_table): Add copy_indirect and
+ hide_symbol members.
+ (elf_link_hash_copy_indirect): New.
+ (elf_link_hash_hide_symbol): New.
+ * elflink.h (elf_link_add_object_symbols): Break out copy from
+ indirect new new symbol to elf.c.
+ (elf_link_assign_sym_version): Break out privatization of
+ non-exported symbol to elf.c.
+ * elf.c (_bfd_elf_link_hash_copy_indirect): New.
+ (_bfd_elf_link_hash_hide_symbol): New.
+ (_bfd_elf_link_hash_table_init): Init copy_indirect and hide_symbol.
+
+2000-02-13 Ian Lance Taylor <ian@zembu.com>
+
+ * section.c (_bfd_strip_section_from_output): Add info parameter.
+ If it passed as non-NULL, use it to check whether any input BFD
+ has an input section which uses this output section. Change all
+ callers.
+ * bfd-in2.h: Rebuild.
-Fri Jan 30 19:07:07 1998 Geoff Keating <geoffk@ozemail.com.au>
+ * bfd-in.h: Move declarations of bfd_get_elf_phdr_upper_bound and
+ bfd_get_elf_phdrs in from bfd-in2.h, correcting patch of
+ 1999-11-29.
+ * bfd-in2.h: Rebuild.
- * elf32-ppc.c (ppc_elf_create_dynamic_sections): New procedure
- to create .dynsbss and .rela.sbss sections.
- (ppc_elf_adjust_dynamic_symbol): Put space for small data to be
- copied from dynamic objects into .sbss.
- (ppc_elf_size_dynamic_sections): Strip .rela.sbss if we don't
- use it. Correct typo of .rela.sdata2.
- (ppc_elf_finish_dynamic_symbol): Generate reloc to where we
- put the data, which may now be in .sbss.
- (ppc_elf_relocate_section): A SDAREL16 reloc can be in dynsbss.
- (elf_backend_create_dynamic_sections): Define as
- ppc_elf_create_dynamic_sections.
+2000-02-10 Timothy Wall <twall@cygnus.com>
- * elf32-ppc.c (ppc_elf_check_relocs): Don't emit R_PPC_REL* relocs
- against _GLOBAL_OFFSET_TABLE_.
- (ppc_elf_relocate_section): Don't emit R_PPC_REL32 relocs in
- shared libraries which refer to local symbols. Make sure that the
- test for allocating space for a reloc in a shared object is the
- same as the test for emitting a reloc.
+ * coffswap.h (coff_swap_sym_in): Add hook SWAP_SYM_IN_POST to
+ allow final modifications of swapped-in symbol.
+ (coff_swap_sym_out): Ditto with SWAP_SYM_OUT_POST.
+ * coffcode.h (coff_write_relocs): Use macro
+ SECTION_RELATIVE_ABSOLUTE_SYMBOL_P if defined to determine whether
+ symbol index should be set to -1.
-Thu Jan 29 15:55:35 1998 J.J. van der Heijden <J.J.vanderHeijden@student.utwente.nl>
+Thu Feb 10 20:07:50 GMT 2000 Toshiyasu Morita (toshi.morita@sega.com)
- * config.bfd (i[3456]-*-mingw32*): New target.
- * acinclude.m4 (BFD_BINARY_OPEN): Check for mingw32.
- * aclocal.m4, configure: Rebuild.
+ * coff-sh.c (USES1_REG, USES2_REG, SETS1_REG, SETS2_REG,
+ USESF1_REG, USESF2_REG, SETSF1_REG, SETSF2_REG): New macros.
+ * (sh_insn_sets_reg, sh_insn_sets_freg): New prototypes.
+ * (sh_insn_sets_reg, sh_insn_uses_or_sets_reg, sh_insns_sets_freg,
+ sh_insns_uses_or_sets_freg): New functions.
+ * (sh_insn_uses_reg, sh_insn_uses_freg): Use new macros.
+ * (sh_insns_conflict): Use new functions and new macros to
+ detect conflicts when two instructions both set same integer registers,
+ both set same fp register, and both set special register.
-Wed Jan 28 13:41:26 1998 Ian Lance Taylor <ian@cygnus.com>
+2000-02-09 Timothy Wall <twall@cygnus.com>
- * elf.c (_bfd_elf_close_and_cleanup): Only check the strtab if we
- have a bfd_object.
+ * coffgen.c (coff_real_object_p): Set arch/mach info prior to
+ swapping in sections, so that the swapping routines have access to
+ the arch/mach info.
-Tue Jan 27 21:43:55 1998 Richard Henderson <rth@cygnus.com>
+2000-02-08 Mark Elbrecht <snowball3@bigfoot.com>
+
+ * coff-go32.c: Update comment. Update copyright.
+
+2000-01-27 Thomas de Lellis <tdel@windriver.com>
- Sparc v9 ABI compliant PLT:
- * elf64-sparc.c (PLT_HEADER_SIZE): V9 ABI uses 4 entries.
- (plt_templates, sparc64_elf_build_plt_entry): Delete.
- (LARGE_PLT_THRESHOLD): New define.
- (GOT_RESERVED_ENTRIES): V9 ABI only uses 1.
- (sparc64_elf_build_plt): New function.
- (sparc64_elf_plt_entry_offset): Likewise.
- (sparc64_elf_plt_ptr_offset): Likewise.
- (sparc64_elf_adjust_dynamic_symbol): Change h->plt_offset to
- contain the index for convenience. Skip the initial entries
- in .rela.plt.
- (sparc64_elf_size_dynamic_sections): Zero the allocated contents
- memory for the benefit of .rela.plt.
- (sparc64_elf_relocate_section): Call sparc64_elf_plt_entry_offset.
- (sparc64_elf_finish_dynamic_symbol): Kill template stuff. Use
- sparc64_elf_plt_entry_offset & sparc64_elf_plt_ptr_offset for reloc.
- (sparc64_elf_finish_dynamic_sections): DT_PLTGOT points to .plt.
- Call sparc64_elf_build_plt.
- (elf_backend_want_got_plt): No.
- (elf_backend_plt_readonly): No.
- (elf_backend_plt_alignment): 8.
+ * syms.c (bfd_decode_symclass)
+ Two new class characters were added - 'V' and 'v'. The
+ meaning of 'W' is now restricted to just weak non-object
+ symbols. This allows differentiation between, for example,
+ weak functions vs weak objects. nm for example now dumps:
+ 'W' = weak global
+ 'w' = weak unresolved
+ 'V' = weak global object
+ 'v' = weak unresolved object
- * elf.c (_bfd_elf_close_and_cleanup): New function; free the shstrtab.
- * elf-bfd.h (_bfd_elf_close_and_cleanup): Declare it.
- * elfxx-target.h (bfd_elfNN_close_and_cleanup): Arrange for it
- to be called.
+ (bfd_is_undefined_symclass): New function. Return true if the
+ given symbol class represents and undefined/unresolved symbol.
+
+ (bfd_symbol_info): Use bfd_is_undefined_symclass to check for
+ unresolved symbols.
-Tue Jan 27 21:45:15 1998 Jeffrey A Law (law@cygnus.com)
+ * bfd-in2.h: Add prototype for bfd_is_undefined_symbol().
+
+ * elf32-arm.h (elf32_arm_get_symbol_type): If a symbol has the
+ STT_ARM_16BIT flag set, but it is not attached to a data object
+ return STT_ARM_16BIT so that it will be treated as code by the
+ disassembler.
- * archures.c (bfd_mach_mips*): Add definitions for various MIPS
- processors.
- * cpu-mips.c (arch_info_struct): Add mips variants.
- * bfd-in2.h: Rebuilt.
+2000-01-27 Alan Modra <alan@spri.levels.unisa.edu.au>
-Tue Jan 27 15:06:04 1998 Nick Clifton <nickc@cygnus.com>
+ * coff-i386.c (i3coff_object_p): Remove prototype.
+ Update copyright.
- * coff-arm.c (coff_arm_relocate_section): Fix for PR14752 by
- preserving the contents of t2a3_b_insn.
+ * elflink.c (_bfd_elf_link_record_dynamic_symbol): Add const
+ to name. Update copyright.
-Tue Jan 27 12:47:27 1998 Robert Lipe <robertl@dgii.com>
+ * trad-core.c (trad_unix_core_file_p): Cast core_regsec
+ assignment to avoid warning. Update copyright.
- * config.bfd (i[3456]86-sco3.2v5*): ELF now the default.
- (i[3456]86sco3.2v5*coff): New target.
+2000-01-24 Robert Lipe (robertl@sco.com)
-Mon Jan 26 15:41:30 1998 Ian Lance Taylor <ian@cygnus.com>
+ * coffcode.h (coff_write_object_contents): Get buff via bfd_malloc
+ instead of using GNU C extension.
- * bfd-in2.h: Rebuild with changes to chew--tab expansion.
+2000-01-21 Nick Clifton <nickc@cygnus.com>
-Thu Jan 22 21:26:48 1998 Richard Henderson <rth@cygnus.com>
+ * libbfd.c (bfd_read): Do not attempt to get a negativly sized
+ amount from a bfd_in_memory structure.
+ (bfd_seek): Do not allow seeks past the end of a bfd_in_memory
+ structure.
- * bfd.c (bfd_get_error_handler): Add orthogonal function.
- * bfd-in2.h: Regenerate.
+2000-01-14 Nick Clifton <nickc@cygnus.com>
-Thu Jan 22 21:13:39 1998 Richard Henderson <rth@cygnus.com>
+ * linker.c (default_indirect_link_order): oops - fix incorrectly
+ applied patch from Tim Wall.
- * tekhex.c (tekhex_write_object_contents): Check for no symbols.
+2000-01-13 Timothy Wall (twall@tiac.net>
-Wed Jan 21 21:19:03 1998 Ian Lance Taylor <ian@cygnus.com>
+ * coffcode.h: Use bfd_coff_xxx instead of the macro XXX (where xxx
+ = scnhsz, filhsz, relsz, aoutsz, etc)
- * coff-i386.c (coff_i386_rtype_to_howto): If COFF_WITH_PE, don't
- adjust addend for an output common symbol (from Jimmy Blair
- <jimmyb@wrs.com>). If COFF_WITH_PE, adjust addend for PC relative
- defined symbol to counteract adjustment made in generic relocation
- code.
+ * coffswap.h: Ditto.
+
+2000-01-13 Nick Clifton <nickc@cygnus.com>
- * dwarf2.c: Include sysdep.h, not stdio.h and stdlib.h.
+ * elf32-arm.h (elf32_thumb_to_arm_stub): Fix offset in branch to
+ interwork thumb to arm stub.
-Wed Jan 21 21:16:06 1998 Manfred Hollstein <manfred@s-direktnet.de>
+2000-01-13 Timothy Wall (twall@tiac.net>
- * coff-m88k.c (GET_SCNDHR_NRELOC): Fix typo in macro name.
- (GET_SCNDHR_NLNNO): Likewise.
+ * archures.c (bfd_octets_per_byte): New function: Return
+ target byte size.
+ (bfd_arch_mach_octets_per_byte): New function: Return target
+ byte size.
-Mon Jan 19 12:49:52 1998 Ian Lance Taylor <ian@cygnus.com>
+ * section.c: Distinguish between octets and bytes for usage of
+ _cooked_size, _raw_size, and output_offset. Clarify
+ description of bfd_set_section_contents.
- * cpu-sh.c (arch_info_struct): Correct next field of sh3e.
+ * bfd-in2.h: Regenerate.
-Wed Jan 14 17:23:27 1998 Nick Clifton <nickc@cygnus.com>
+ * coffgen.c: Indicate that the offset parameter is in bytes, not
+ octets.
+
+ * cofflink.c (bfd_coff_link_input_bfd): Use bfd_octets_per_byte
+ where appropriate to get the octet offset when calling
+ bfd_set_section_contents.
+ (bfd_coff_reloc_link_order): Ditto.
+
+ * linker.c (bfd_generic_reloc_link_order): Ditto.
+ (_bfd_default_link_order): Ditto.
+
+ * reloc.c (bfd_perform_relocation): Distinguish between octets
+ and bytes. Use octets when indexing into octet data; use bytes
+ when calculating target addresses.
+ (bfd_install_relocation): Ditto.
+
+ * srec.c (srec_write_section): Ditto.
+
+2000-01-13 Nick Clifton <nickc@cygnus.com>
+
+ * coff-mcore.c (COFF_DEFAULT_SECTION_ALIGNMENT_POWER): Change from
+ 3 to 2. This allows 4 byte sized sections, which is necessary for
+ dlltool to build funcitoning DLLs.
+
+2000-01-10 Philip Blundell <pb@futuretv.com>
+
+ * config.bfd (arm*-*-linux-gnu*): Match instead of arm*-*-linux-gnu.
+ (arm*-*-conix*): New target.
+
+2000-01-10 Egor Duda <deo@logos-m.ru>
+
+ * config.bfd: Include elf32_i386 vector to target list for cygwin
+ and mingw.
+
+ * config.in: Undefine HAVE_WIN32_PSTATUS_T.
+ * configure.in: Test for structure win32_pstatus_t in
+ <sys/procfs.h>
+ * configure: Regenerate.
+
+ * elf.c (elfcore_grok_win32pstatus): New function: process
+ win32_pstatus_t notes in elf core file.
+ (elfcore_grok_note): Detect win32_pstatus notes.
- * elf32-m32r.c: Add macros to handle NOP insertion.
+2000-01-03 Martin v. Loewis <loewis@informatik.hu-berlin.de>
-Wed Jan 14 16:15:22 1998 Richard Henderson <rth@cygnus.com>
+ * elflink.c (_bfd_elf_link_record_dynamic_symbol): Process symbol
+ visibility.
+ * elflink.h (elf_link_add_object_symbols): Combine visibilities.
+ * elf.c (bfd_elf_print_symbol): Interpret st_other as visibility.
- * xcofflink.c (xcoff_mark_symbol): Don't mark the absolute section.
- (xcoff_mark): Likewise.
- (xcoff_build_ldsyms): Mark absolute symbols.
+1999-12-29 Richard Henderson <rth@cygnus.com>
-Wed Jan 14 16:03:11 1998 Richard Henderson <rth@cygnus.com>
+ * elflink.h (bfd_elf,size_dynamic_sections): Don't export all
+ if no dynamic sections created.
- * bout.c (b_out_write_object_contents): Sort symbols before output
- to keep {CALL,BAL}NAME symbols adjacent.
- (b_out_symbol_cmp): New function.
+1999-12-27 Nick Clifton <nickc@cygnus.com>
-Tue Dec 30 12:45:18 1997 Ian Lance Taylor <ian@cygnus.com>
+ * peicode.h (pe_bfd_object_p): Only define for PE format
+ targets.
- * elf32-sparc.c (elf32_sparc_check_relocs): If -Bsymbolic, don't
- allocate space for a PC relative reloc against a symbol which is
- defined in a regular file.
- (elf32_sparc_relocate_section): If -Bsymbolic, don't copy a PC
- relative reloc against a symbol which is defined in a regular
- file.
+1999-12-17 Nick Clifton <nickc@cygnus.com>
-Mon Dec 29 18:02:28 1997 Ian Lance Taylor <ian@cygnus.com>
+ * coff-i386.c (i3coff_object_p): Delete.
+ (i386coff_vec): Replace reference to i3coff_object_p with a
+ reference to coff_object_p.
- From Jonathan Stone <jonathan@DSG.Stanford.EDU>:
- * config.bfd (mips-dec-netbsd*): Add ECOFF vectors to
- targ_selvecs.
- (mips*el-*-netbsd*): Like mips-dec-netbsd*.
- (mips*-*-netbsd*): New target.
+ * coff-mcore.c (pe_object_p): Delete.
-Mon Dec 29 17:13:28 1997 H.J. Lu (hjl@gnu.org)
+ * peicode.h (pe_bfd_object_p): New function: Detect the
+ presence of a PE format COFF object file. Also detect and
+ warn about the presence of LINK6 format Image Library Format
+ object files.
+
+1999-12-16 Nick Clifton <nickc@cygnus.com>
- * elflink.h (elf_link_assign_sym_version): Change error message
- from "undefined version name" to "undefined versioned symbol
- name".
+ * coff-arm.c (NUM_ELEM): New macro.
+ (NUM_RELOCS): New macro: The number of known ARM relocs.
+ (RTYPE2HOWTO): Return NULL if the reloc type is out of range.
+ (coff_arm_rtype_to_howto): Return NULL if the reloc type is out
+ of range.
+ (bfd_arm_process_before_allocation): Produce a warning message if
+ an out of range symbol index is encountered.
-Mon Dec 29 11:41:16 1997 Nick Clifton <nickc@cygnus.com>
+1999-12-14 Nick Clifton <nickc@cygnus.com>
- * coff-arm.c (coff_arm_relocate_section): Fix typo from previous
- delta.
+ * elflink.h (is_global_symbol_definition): New Function: Return
+ true iff the symbol is being given a global definition in this
+ bfd.
+ (elf_link_is_defined_archive_symbol): Do not bother processing
+ symbols for an archive element that has already been included
+ in the link.
+ Use is_global_symbol_definition().
+
+1999-12-09 Andrew Cagney <cagney@cygnus.com>
+
+ * config.bfd: Add support for sparc-*-netbsdelf* and
+ sparc-*-netbsdaout*.
+
+1999-12-13 Nick Clifton <nickc@cygnus.com>
+
+ * elflink.h (elf_link_is_defined_archive_symbol): Check to see
+ if the symbol is in the common section.
+
+1999-12-10 Nick Clifton <nickc@cygnus.com>
+
+ * elflink.h (elf_link_is_defined_archive_symbol): New
+ function: Decide if a symbol, in an archive map is there
+ because it is defined in the archive element, or because it is
+ just another common declaration of it.
+ (elf_link_add_archive_symbols): Use
+ elf_link_is_defined_archive_symbol to decide if an archive
+ element contain a reference to a common symbol should be
+ linked in or not.
+
+1999-12-10 Nick Clifton <nickc@cygnus.com>
+
+ * elflink.h: Revert previous patch.
+ * targets.c: Revert previous patch.
+ * libbfd-in2.h: Revert previous patch.
+ * libbfd.h: Revert previous patch.
+ * elfxx-target.h: Revert previous patch.
+ * archive.c: Revert previous patch.
+ * aout-target.h: Revert previous patch.
+ * aout-tic30.h: Revert previous patch.
+ * bfd.c: Revert previous patch.
+ * coff-alpha.c: Revert previous patch.
+ * coff-rs6000.c: Revert previous patch.
+ * elf64-mips.c: Revert previous patch.
+ * ieee.c: Revert previous patch.
+ * libecoff.h: Revert previous patch.
+ * oasys.c: Revert previous patch.
+ * som.c: Revert previous patch.
+ * vms.c: Revert previous patch.
+
+1999-12-09 Nick Clifton <nickc@cygnus.com>
+
+ * elflink.h (elf_link_add_archive_symbols): Add an archive
+ element even if contains a symbol which is currently only
+ considered to be a common.
+
+ * targets.c (struct bfd_target): Add new field
+ _bfd_allow_commons_in_armap.
+ * bfd-in2.h:Regenerate.
+
+ * libbfd-in2.h (_bfd_noarchive_allow_commons_in_armap):
+ Define.
+ (_bfd_archive_bsd_allow_commons_in_armap): Define.
+ * libbfd.h: Regenerate.
-Tue Dec 23 17:01:10 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elfxx-target.h: If using COFF archive map, override
+ definition of allow_commons_in_armap and replace with
+ bfd_false.
- * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Declare.
- * libbfd.h: Rebuild.
+ * archive.c (bfd_compute_and_write_armap): Do not place common
+ symbols into the archive map unless _bfd_allow_commons_in_armap
+ returns true.
- * peicode.h (coff_swap_scnhdr_out): Set .reloc section to be
- shared. Set stab* sections to be shared and read. Set .rsrc
- section to be read and shared.
+ * aout-target.h (MY_allow_commons_in_armap): Define.
+ * aout-tic30.h (MY_allow_commons_in_armap): Define.
+ * bfd.c (bfd_allow_commons_in_armap): Define.
+ * coff-alpha.h (alpha_ecoff_allow_commons_in_armap): Define.
+ * coff-rs6000.h (xcoff_allow_commons_in_armap): Define.
+ * elf64-mips.c (bfd_elf64_allow_commons_in_armap): Define.
+ * ieee.c (ieee_ecoff_allow_commons_in_armap): Define.
+ * libecoff.h (_bfd_ecoff_allow_commons_in_armap): Define.
+ * oasys.c (oasys_allow_commons_in_armap): Define.
+ * som.c (som_allow_commons_in_armap): Define.
+ * vms.c (vms_allow_commons_in_armap): Define.
-Mon Dec 22 13:20:57 1997 Ian Lance Taylor <ian@cygnus.com>
+1999-12-07 Jim Blandy <jimb@cygnus.com>
- * Makefile.am: Rebuild dependencies.
- (ALL_MACHINES_CFILES): Add dwarf2.lo.
- (ALL_MACHINES_CFILES): Add dwarf2.c.
- * Makefile.in: Rebuild.
+ Add support for SSE registers in ELF core files.
+ * elf.c (elfcore_make_note_pseudosection): New function.
+ (elfcore_grok_prfpreg): Use it.
+ (elfcore_grok_prxfpreg): New function.
+ (elfcore_grok_note): Recognize Linux NT_PRXFPREG notes.
- * coff-arm.c: Don't include obstack.h.
+1999-12-03 Ian Lance Taylor <ian@zembu.com>
-Mon Dec 22 13:04:33 1997 Joel Sherrill <joel@oarcorp.com>
+ * elf32-mips.c (mips_elf_calculate_relocation): Divide R_MIPS_PC16
+ value by 4 before storing it back in the field. From
+ Koundinya. K <kk@ddeorg.soft.net>.
- * config.bfd (i[3456]86*-go32-rtems*): Fix to be the same as
- i[3456]86-go32.
+Tue Nov 30 22:41:14 1999 Jeffrey A Law (law@cygnus.com)
-Thu Dec 18 16:01:25 1997 Doug Evans <devans@canuck.cygnus.com>
+ * archures.c (bfd_mach_am33): Define.
+ * bfd-in2.h: Rebuilt.
+ * cpu-m10300.c (bfd_am33_arch): Add to the mn103 architecture list
+ * elf-m10300.c (mn10300_elf_relax_section): Handle am33 instructions.
+ (compute_function_info): Handle additional registers saved by
+ movm on the am33.
+ (elf_mn10300_mach): Handle E_MN10300_MACH_AM33.
+ (_bfd_mn10300_elf_final_write_processing): Handle bfd_mach_am33.
- * configure: Regenerate to get @SHELL@ substituted.
+1999-11-29 Jim Blandy <jimb@cygnus.com>
-Wed Dec 17 09:45:09 1997 Nick Clifton <nickc@cygnus.com>
+ * elf.c (bfd_get_elf_phdrs, bfd_get_elf_phdr_upper_bound): New
+ functions.
+ * bfd-in2.h (bfd_get_elf_phdrs, bfd_get_elf_phdr_upper_bound): New
+ declarations.
- * coff-arm.c (coff_arm_relocate_section): Only look at section
- owner if there is one.
+1999-11-27 Michael Meissner <meissner@cygnus.com>
- * elf.c (assign_file_positions_for_segments): Fail if there is not
- enough room for the program headers. (PR14186)
+ * reloc.c (BFD_RELOC_ALPHA_USER_LITERAL): New relocation for
+ internal use within gas for alpha explicit relocations.
+ (BFD_RELOC_ALPHA_USER_LITUSE_BASE): Ditto.
+ (BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF): Ditto.
+ (BFD_RELOC_ALPHA_USER_LITUSE_JSR): Ditto.
+ (BFD_RELOC_ALPHA_USER_GPDISP): Ditto.
+ (BFD_RELOC_ALPHA_USER_GPRELHIGH): Ditto.
+ (BFD_RELOC_ALPHA_USER_GPRELLOW): Ditto.
-Tue Dec 16 08:09:56 1997 Gavin Koch <gavin@cygnus.com>
+ * elf64-alpha.c (elf64_alpha_reloc_map): Add mappings for
+ BFD_RELOC_ALPHA_USER_*.
- * elf.c (_bfd_elf_find_nearest_line): Call
- _bfd_dwarf2_find_nearest_line first.
- * elf32-mips.c (_bfd_mips_elf_find_nearest_line): Same.
- * dwarf2.c: New file; implement _bfd_dwarf2_find_nearest_line.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
-Mon Dec 15 16:08:52 1997 Nick Clifton <nickc@cygnus.com>
+1999-11-26 Fred Fish <fnf@cygnus.com>
- * archures.c: Add bfd_mach_m32r.
+ * elf.c (elfcore_read_notes): Add prototype for static function.
+ (_bfd_elf_make_section_from_phdr): Renamed from bfd_section_from_phdr.
+ (bfd_section_from_phdr): Replacement function that calls
+ _bfd_elf_make_section_from_phdr for generic segment types and
+ backend fucntion pointed to by elf_backend_section_from_phdr for
+ backend specific segment types.
+ (_bfd_elfcore_section_from_phdr): Remove call to elfcore_read_notes,
+ now called by _bfd_elf_make_section_from_phdr. Note that this func
+ is now just a stub between the caller and bfd_section_from_phdr.
+
+ * elf-bfd.h (struct elf_backend_data): Add new function pointer
+ elf_backend_section_from_phdr.
+ (elf_backend_section_from_phdr): Add prototype.
+
+ * elfxx-target.h (elf_backend_section_from_phdr): Define default.
+ (elfNN_bed): Add elf_backend_section_from_phdr.
-Mon Dec 15 16:11:22 1997 Fred Fish <fnf@cygnus.com>
+1999-11-25 Nick Clifton <nickc@cygnus.com>
- * coffcode.h (ALIGN_SECTIONS_IN_FILE): Define if I960 not defined.
- (coff_compute_section_file_positions): Use ALIGN_SECTIONS_IN_FILE
- to decide when to align the file sections for paging.
+ * coff-arm.c (bfd_arm_get_bfd_for_interworking): Add
+ SEC_CODE and SEC_READONLY flags to glue sections.
-Mon Dec 15 15:01:15 1997 Nick Clifton <nickc@cygnus.com>
+ * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Add
+ SEC_CODE and SEC_READONLY flags to glue sections.
- * elf32-m32r.c (m32r_elf_object_p): New Function.
- (m32r_elf_final_write_processing): New Function.
- (m32r_elf_set_private_flags): New Function.
- (m32r_elf_copy_private_bfd_data): New Function.
- (m32r_elf_merge_private_bfd_data): New Function.
- (m32r_elf_print_private_bfd_data): New Function.
- (elf_backend_object_p): Point to m32r_object_p.
- (elf_backend_final_write_processing): Point to
- m32r_elf_final_write_processing.
- (bfd_elf32_bfd_copy_private_bfd_data): Point to
- m32r_elf_copy_private_bfd_data.
- (bfd_elf32_bfd_merge_private_bfd_data): Point to
- m32r_elf_merge_private_bfd_data.
- (bfd_elf32_bfd_set_private_flags): Point to
- m32r_elf_set_private_bfd_data.
- (bfd_elf32_bfd_print_private_bfd_data): Point to
- m32r_elf_print_private_bfd_data.
+1999-11-20 Nick Clifton <nickc@cygnus.com>
+ * coff-mcore.c (coff_mcore_relocate_section): Fix typo in previous
+ delta.
- * bfd-in2.h (bfd_mach_m32r): Add identifier for M32R architecture
- machines.
+1999-11-19 Catherine Moore <clm@cygnus.com>
-Fri Dec 12 11:30:28 1997 Brendan Kehoe <brendan@canuck.cygnus.com>
+ * elf32-m68k.c (elf_cpu32_plt0_entry): Fix encoding.
+ (elf_cpu32_plt_entry): Likewise.
- * configure: Only build libbfd shared if --enable-shared's value
- was `yes', or was set to `*bfd*'.
- * aclocal.m4: Likewise.
- * NOTE: this really needs to be fixed in libtool/libtool.m4, the
- original source of this bit of code. It's not clear what the best fix
- would be, though.
+1999-11-18 Nick Clifton <nickc@cygnus.com>
-Thu Dec 11 17:48:11 1997 Richard Henderson <rth@cygnus.com>
+ * coff-mcore.c (coff_mcore_rtype_to_howto): Special case handling
+ for RVA relocs.
+ (coff_mcore_relocate_section): Initialise addend to 0.
+ Special case processing of RVA reloc.
- * linker.c (generic_link_add_symbol_list): Always init udata.p so
- that the generic relaxation code can function when input and output
- file formats are mismatched.
+1999-11-17 Richard Henderson <rth@cygnus.com>
-Thu Dec 11 01:02:18 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elf-bfd.h (struct elf_backend_data): Reorder collect and
+ type_change_ok; add sign_extend_vma.
+ * elf32-mips.c (elf_backend_sign_extend_vma): Define.
+ * elfcode.h (elf_swap_symbol_in): Mind be->sign_extend_vma.
+ (elf_swap_shdr_in, elf_swap_phdr_in): Likewise.
+ * elfxx-target.h (elf_backend_sign_extend_vma): Default.
+ (elfNN_bed): Follow struture changes.
- * coff-sh.c (bfd_coff_small_swap_table): Initialize new fields.
+1999-11-09 Ian Lance Taylor <ian@zembu.com>
- * elf.c (assign_file_positions_for_segments): For a loadable
- section, make sure that the load address is correct relative to
- the load address of the segment plus the size of the segment so
- far.
+ * libbfd.c (bfd_read): Check result of read against desired result
+ using !=, not <.
+ (_bfd_generic_get_section_contents): Set bfd_error if the seek is
+ invalid compared to the section size.
- * coffcode.h (_coff_link_output_has_begun): Make static.
- (_coff_final_link_postscript): Likewise.
+ * ieee.c (ieee_slurp_debug): Get the length of the debug
+ information right if there is no data part.
-Wed Dec 10 23:37:11 1997 Ian Lance Taylor <ian@cygnus.com>
+Tue Nov 2 01:44:41 1999 Jeffrey A Law (law@cygnus.com)
- * elflink.h (elf_link_input_bfd): Handle a relocateable link in
- which a relocation refers to an indirect or warning symbol.
+ * som.c (som_fixup_formats): Improve handling of R_AUX_UNWIND,
+ R_LINETAB, R_LINETAB_ESC, and R_COMMENT.
-Wed Dec 10 11:15:55 1997 Nick Clifton <nickc@cygnus.com>
+1999-10-28 Ian Lance Taylor <ian@zembu.com>
- * coff-arm.c (bfd_arm_coff_final_link): Function deleted.
- (coff_arm_final_link_postscript): New function.
- (coff_arm_link_output_has_begun): New function.
+ * elflink.h (elf_bfd_final_link): Make last_local signed.
- * libcoff.h (struct bfd_coff_backend_data): Add new fields:
- _bfd_coff_link_output_has_begun and
- _bfd_coff_final_link_postscript. Add new macros:
- bfd_coff_link_output_has_begun() and
- bfd_coff_final_link_postscript().
+1999-10-27 Ian Lance Taylor <ian@zembu.com>
- * cofflink.c (_bfd_coff_final_link): Insert calls to
- bfd_coff_link_output_has_begun() and
- bfd_coff_final_link_postscript().
+ * stabs.c (_bfd_link_section_stabs): Make sure .stabstr section
+ starts with a zero.
- * coffcode.h: Add two new fields to bfd_coff_backend_data
- structure: _bfd_coff_link_output_has_begun and
- _bfd_coff_final_link_postscript. Add default initialisers for
- these fields. Add overridable aliases for the coff swap functions
- in the backend data structure.
+Sat Oct 23 17:36:12 1999 Andrew Cagney <cagney@b1.cygnus.com>
- * elf32-v850.c: Update with patches from the branch to fix
- HI16_S/LO16 reloc pairs.
+ * archures.c: Add definitions bfd_mach_d10v, bfd_mach_d10v_ts2 and
+ bfd_mach_d10v_ts3.
+ * cpu-d10v.c (d10v_ts3_info, d10v_ts2_info): Add.
+ * bfd-in2.h: Regenerate.
+
+1999-10-15 Andrew Haley <aph@cygnus.com>
-Tue Dec 9 11:37:53 1997 Andrew Cagney <cagney@b1.cygnus.com>
+ * dwarf1.c (parse_die): Fail to parse a die if its length is zero.
- * archures.c (bfd_mach_mips*): Define.
- (bfd_default_scan): For 3000 and 4000 replace magic constant with
- macro.
+Sun Oct 17 17:19:00 1999 Jeffrey A Law (law@cygnus.com)
- * cpu-mips.c (N): Define.
- (bfd_mips_arch, arch_info_struct): Re-write using macro N, replace
- numbers with bfd_mach_mips* macros.
+ * libhppa.h (bfd_hppa_insn2fmt): Change to return an int.
-Fri Dec 5 11:13:46 1997 Nick Clifton <nickc@cygnus.com>
+1999-10-08 Ian Lance Taylor <ian@zembu.com>
- * elf32-v850.c (v850_elf_reloc, v850_elf_store_addend_in_insn,
- v850_elf_relocate_section): Fix PR2 14180 and 14181
- (v850_elf_section_from_bfd_section, v850_elf_symbol_processing,
- v850_elf_add_symbol_hook, v850_elf_link_output_symbol_hook,
- v850_elf_section_from_shdr, v850_elf_fake_sections): New functions
- (for PR14180) to create and handle special common sections.
- (v850_elf_final_link_relocate): Fix HI16 and HI16_S relocations
- which have data stored in the instructions. PR14258.
+ * elflink.h (elf_merge_symbol): When overriding a weak symbol with
+ a defined symbol in a shared library, clear the DEF_DYNAMIC flag
+ too.
-Tue Dec 2 10:26:16 1997 Nick Clifton <nickc@cygnus.com>
+Fri Oct 8 13:03:45 1999 Geoffrey Keating <geoffk@cygnus.com>
- * coff-arm.c (TARGET_UNDERSCORE): Revert back to '_'
- (USER_LABEL_PREFIX): Revert back to '_'
+ * elf32-mips.c (mips_elf_calculate_relocation): R_MIPS_LITERAL
+ relocs also need the GP value.
+ (_bfd_mips_elf_relocate_section): Handle unpaired LO16 relocs
+ properly. Handle sign-extension for R_MIPS_64 correctly. Correct
+ the GP value for R_MIPS_LITERAL relocs too. Handle
+ R_MIPS_64 relocs properly on big-endian MIPS.
+ (mips_elf_sign_extend): Behave properly with 'long long'.
+ (mips_elf_highest): Correct typo.
- * config.bfd (targ_cpu): Add support for Thumb target.
+Mon Oct 4 17:49:45 1999 Nick Clifton <nickc@cygnus.com>
-Mon Dec 1 20:24:18 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+ * cpu-m32r.c (arch_info_struct): New static global.
+ (bfd_m32r_arch): Refer to it.
+ * elf32-m32r.c (m32r_elf_object_p): Recognize E_M32RX_ARCH.
+ (m32r_elf_print_private_bfd_data): Ditto.
+ (m32r_elf_final_write_processing): Handle bfd_mach_m32rx.
+ * archures.c (bfd_mach_m32rx): Define it.
+ * bfd-in2.h: Rebuild.
- * coff-sh.c (sh_coff_howtos): Add R_SH_SWITCH8 entry.
- (get_symbol_value): Handle R_SH_SWITCH8.
- (sh_relax_delete_bytes): Likewise.
+1999-09-28 Fred Fish <fnf@cygnus.com>
+
+ * targets.c (cisco_core_vec): Replaced with two new vecs ...
+ (cisco_core_big_vec): Add new bigendian vec.
+ (cisco_core_little_vec): Add new little endian vec.
+
+ * cisco-core.c (CRASH_INFO): Fixed offset replaced with ...
+ (crash_info_locs): Add array of possible offsets.
+ (MASK_ADDR): Mask to apply to crash info offset.
+ (crashinfo_external): Add textbase, database, bssbase and
+ turn into a typedef.
+ (cisco_core_file_validate): Renamed from cisco_core_file_p.
+ Many small changes to account for additional hardware versions.
+ Pick a reasonable size for ".reg" section. Add a ".crash"
+ section to allow access to crashinfo_external struct.
+ (cisco_core_file_p): New version of this function that
+ iterates over crash_info_locs, calling cisco_core_file_validate.
+ (cisco_core_vec): Old big endian only vec replaced with ...
+ (cisco_core_big_vec): Add big endian version.
+ (cisco_core_little_vec): Add little endian version.
+
+ * configure.in (cisco_core_vec): Split to two new vectors ...
+ (cisco_core_big_vec): New target vector.
+ (cisco_core_little_vec): New target vector.
+ * configure: Regenerate.
+ * config.bfd (targ): For m68*-*-aout* targ, change cisco_core_vec
+ to cisco_core_big_vec in targ_selvecs.
-Wed Nov 26 14:13:34 1997 Nick Clifton <nickc@cygnus.com>
+1999-09-28 Geoffrey Keating <geoffk@cygnus.com>
- * coff-arm.c (TARGET_UNDERSCORE): Changed to match definition in
- gcc/config/arm/semi.h
+ * elf32-mips.c (mips_elf_relocate_hi16): Unused, delete.
+ (mips_elf_relocate_got_local): Unused, delete.
+ (mips_elf_relocate_global_got): Unused, delete.
- * coffcode.h (coff_slurp_symbol_table): Add ARM and Thumb symbol
- classes.
+1999-09-24 Fred Fish <fnf@cygnus.com>
-Sun Nov 23 16:02:58 1997 Andrew Cagney <cagney@b1.cygnus.com>
+ * elf.c (bfd_section_from_phdr): Add typename variable. Use p_type
+ to initialize it to something meaningful. Then use it to generate
+ more useful segment names.
- * freebsd.h (SWAP_MAGIC): Read magic number little and not big
- endian.
+Sun Sep 19 12:16:47 1999 Jeffrey A Law (law@cygnus.com)
-Wed Nov 26 09:30:37 1997 Nick Clifton <nickc@cygnus.com>
+ * som.c (NO_PCREL_MODES): Define if the system does not define
+ R_SHORT_PCREL_MODE.
+ (hppa_som_gen_reloc_type): Handle both short and long pcrel branches.
+ (som_write_fixups): Eliminate redundant pcrel mode relocs. Handle
+ R_LONG_PCREL_MODE and R_SHORT_PCREL_MODE
+ * libhppa.h (dis_assemble_22): New function.
+ (bfd_hppa_insn2fmt): Handle long branch.
- * coffcode.h (coff_mkobject_hook): Only set private flags for non
- PE ARM ports.
+ * libhppa.h (bfd_hppa_insn2fmt): Decode and handle formats found
+ in PA2.0.
-Tue Nov 25 15:33:23 1997 Richard Henderson <rth@cygnus.com>
+1999-09-17 Alan Modra <alan@spri.levels.unisa.edu.au>
- * binary.c (binary_set_section_contents): Also ignore NEVER_LOAD
- sections.
+ * coff-i386.c (coff_i386_reloc_type_lookup): Support BFD_RELOC_16,
+ BFD_RELOC_16_PCREL, BFD_RELOC_8, BFD_RELOC_8_PCREL relocs.
+ (reloc_howto_type howto_table): Tidy comments and whitespace.
-Tue Nov 25 10:55:36 1997 Nick Clifton <nickc@cygnus.com>
+1999-09-17 Nick Clifton <nickc@cygnus.com>
- * coff-arm.c (coff_arm_bfd_merge_private_bfd_data): Do not
- complain if inout and output formats differ.
+ * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Undo
+ previous delta. Set sec->gc_mark instead.
-Tue Nov 25 11:26:27 1997 Ian Lance Taylor <ian@cygnus.com>
+Thu Sep 16 11:21:13 1999 Catherine Moore <clm@cygnus.com>
- * Makefile.am (BFD32_BACKENDS): Remove tekhex.lo.
- (BFD32_BACKENDS_CFILES): Remove tekhex.c.
- * Makefile.in: Rebuild.
- * aclocal.m4, configure, src/Makefile.in: Rebuild with current
- automake and autoconf.
+ * elf32-m68k.c (elf_cpu32_plt0_entry): Use a1 instead of a0.
+ (elf_cpu32_plt_entry): Likewise.
- * coff-arm.c (arm_allocate_interworking_sections): Fix typo
- (COFF_WITH_PR to COFF_WITH_PE).
+Thu Sep 16 10:48:17 1999 Jeffrey A Law (law@cygnus.com)
-Mon Nov 24 15:47:49 1997 Nick Clifton <nickc@cygnus.com>
+ * elf-hppa.h (elf_hppa_final_write_processing): Turn on TRAPNIL.
- * coff-arm.c: Make variables and some functions static, so that
- this file can be included in multiple object files.
- (coff_arm_bfd_final_link): Fix minor bug.
+ * elf-hppa.h (elf_hppa_final_link): If unable to find __gp in the
+ symbol table, then just compute a suitable value (but do not
+ create a __gp symbol).
-Sat Nov 22 15:16:00 1997 Nick Clifton <nickc@cygnus.com>
+ * elf-hppa.h (elf_hppa_relocate_section): Allow undefined
+ symbols when building shared libraries.
+ (elf_hppa_final_link_relocate): Correct handling of PCREL
+ relocations against undefined symbols.
- * coff-arm.c: Add support for PIC and APCS-FLOAT type binaries.
+1999-09-16 Nick Clifton <nickc@cygnus.com>
- * coffcode.h: Add support for PIC and APCS-FLOAT type binaries.
+ * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Mark
+ interworking sections as linker created so that they will not
+ be removed by garbage collection.
-Sat Nov 22 16:06:56 1997 Klaus Kaempf <kkaempf@progis.de>
+Wed Sep 15 02:31:57 1999 Jeffrey A Law (law@cygnus.com)
- * evax-emh.c (_bfd_evax_write_emh): Use alloca instead of strdup.
+ * elf-hppa.h (elf_hppa_final_link): Revamp __gp handling.
+ (elf_hppa_final_link_relocate): Consistently create an absolute
+ address, then subtract out the value of __gp.
-Sat Nov 22 12:29:30 1997 Ian Lance Taylor <ian@cygnus.com>
+1999-09-14 Michael Meissner <meissner@cygnus.com>
- * sunos.c (sunos_add_one_symbol): When overriding a defined
- symbol, set it to undefined, not new.
+ * configure.in (Canonicalization of target names): Remove adding
+ ${CONFIG_SHELL} in front of $ac_config_sub, since autoconfig 2.14
+ generates $ac_config_sub with a ${CONFIG_SHELL} already.
+ * configure: Regenerate.
- * elf32-sh.c (sh_elf_relax_delete_bytes): Don't kill LABEL
- relocs.
+1999-09-14 Nick Clifton <nickc@cygnus.com>
-Fri Nov 21 14:14:22 1997 Richard Henderson <rth@cygnus.com>
+ * elf32-m32r.c (ELF_MAXPAGESIZE): Change to 0x1 (at request of
+ Mitsubishi).
- * coff-sh.c (sh_relax_section): Force sign extention of USES r_offset.
- (sh_relax_delete_bytes): Don't kill LABEL relocs.
+Mon Sep 13 20:01:47 1999 Jeffrey A Law (law@cygnus.com)
-Mon Nov 17 15:08:38 1997 Jeffrey A Law (law@cygnus.com)
+ * elf-hppa.h (elf_hppa_record_segment_addrs): New function.
+ (elf_hppa_final_link): Initialize text_segment_base and
+ data_segment_base.
+ (elf_hppa_final_link_relocate): Handle SEGREL relocations.
- * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Fix typo.
- (mn10300_elf_relax_section): Likewise.
+ * elf-hppa.h (elf_hppa_final_link): Remove unused variables.
+ (elf_hppa_final_link_relocate): Likewise.
+ (elf_hppa_relocate_insn): Likewise.
+ (elf_hppa_relocate_section): Initialize HOWTO.
-Sat Nov 15 15:36:07 1997 Fred Fish <fnf@cygnus.com>
+1999-09-13 Donn Terry <donn@interix.com>
- * peicode.h (coff_swap_aouthdr_in): Cast second arg of
- bfd_h_get_* calls to "bfd_byte *".
+ * coffcode.h (styp_to_sec_flags): Further refinement of COMDAT
+ handling to support both GNU and MS objects.
-Tue Nov 11 10:37:23 1997 Jeffrey A Law (law@cygnus.com)
+ * coffcode.h (coff_write_object_contents): Don't check reloc_count
+ when determining whether to set F_RELFLG.
- * elf-m10300.c (elf32_mn10300_link_hash_entry): Add new field
- "movm_stack_size".
- (mn10300_elf_relax_section): Include stack space for register saves
- in the imm8 field of a "call" instruction.
- (compute_function_info): Determine how much stack is allocated by
- the movm instruction. Fix typo.
- (elf32_mn10300_link_hash_newfunc): Initialize movm_stack_size.
+1999-09-13 Philip Blundell <pb@nexus.co.uk>
-Mon Nov 10 14:32:40 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Don't crash if
- a version dependency could not be found.
-
-Tue Nov 4 12:05:56 1997 Klaus K"ampf <kkaempf@progis.de>
-
- * configure.com: Get version info from configure.in
-
-Fri Oct 24 11:15:58 1997 Jakub Jelinek <jj@sunsite.mff.cuni.cz>
-
- * elf64-sparc.c (sparc64_elf_merge_private_bfd_data):
- New function. Avoid mixing US1 and HAL R1 code.
- Set resulting memory ordering to the strongest one used.
- (sparc64_elf_object_p): Set bfd_mach correctly.
-
-Thu Oct 23 14:09:33 1997 Richard Henderson <rth@cygnus.com>
-
- * elf64-sparc.c (sparc64_elf_howto_table): Add UA64 & UA16.
- (sparc64_elf_check_relocs): Handle them.
- (sparc64_elf_relocate_section): Likewise. Before emitting a dyn reloc,
- check alignment and transmute R_SPARC_x<->R_SPARC_UAx.
-
-Thu Oct 23 00:53:14 1997 Richard Henderson <rth@dot.cygnus.com>
-
- * configure.in (sparc*-*-linux*): Use trad-core and ...
- * hosts/sparclinux.h: New file.
-
-Thu Oct 23 00:25:29 1997 Richard Henderson <rth@dot.cygnus.com>
-
- * config.bfd (sparc64-*-linux*): New target.
-
- * elf-bfd.h (struct elf_backend_data): Add plt_alignment member.
- * elflink.c (_bfd_elf_create_got_section): Set .got alignment based
- on arch_size.
- (_bfd_elf_create_dynamic_sections): Likewise for .rel* sections.
- Set .plt alignment from new plt_alignment.
- * elflink.h (elf_link_create_dynamic_sections): Set version section
- alignment to LOG_FILE_ALIGN.
- * elfxx-target.h (elf_backend_plt_alignment): Provide default.
- (elfXX_bed): Init plt_alignment.
-
- * elf64-sparc.c (sparc64_elf_check_relocs,
- sparc64_elf_adjust_dynamic_symbol, sparc64_elf_size_dynamic_sections,
- sparc64_elf_adjust_dynindx, sparc64_elf_finish_dynamic_symbol,
- sparc64_elf_finish_dynamic_sections): New functions.
- (sparc64_elf_howto_table): Fix a few name strings.
- (ELF_DYNAMIC_INTERPRETER): New definition.
- (sparc64_elf_relocate_section): Handle shared libraries.
-
- * elf64-sparc.c (struct plt_template, plt_*_header, plt_*_entry,
- sparc64_elf_build_plt_entry, sparc64_elf_finish_dynamic_symbol):
- PLT definitions sparc64-linux originally choose. These will go
- away soon in favour of the official abi definitions.
-
-Wed Oct 22 16:08:45 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * coff-sh.c (coff_small_object_p): New static function.
- (coff_small_new_section_hook): New static function.
- (bfd_coff_small_swap_table): New static const structure.
- (coff_small_close_and_cleanup): Define.
- (coff_small_bfd_free_cached_info): Define.
- (coff_small_get_section_contents): Define.
- (coff_small_get_section_contents_in_window): Define.
- (shcoff_small_vec): New static structure.
- (shlcoff_small_vec): New static structure.
- * targets.c (bfd_target_vector): Add shcoff_small_vec and
- shlcoff_small_vec.
- * config.bfd (sh-*-elf*): Add shcoff_small_vec and
- shlcoff_small_vec to targ_selvecs.
- (sh-*-*): Likewise.
- * configure.in: Add shcoff_small_vec and shlcoff_small_vec cases.
- * configure: Rebuild.
+ * elf32-arm.h (elf32_arm_final_link_relocate): Don't range-check
+ PC24 relocs if the target is an undefined weak symbol.
+ (arm_add_to_rel): Fix compiler warning.
+ (elf32_arm_plt0_entry): Correct comments.
+
+1999-09-13 Alan Modra <alan@spri.levels.unisa.edu.au>
-Mon Oct 20 15:01:27 1997 Klaus K"ampf <kkaempf@progis.de>
+ * elfcode.h (write_relocs): Check for the_bfd NULL when handling
+ an absolute symbol in REL relocs.
- * evax-egsd.c: Weak symbols are global.
+Sun Sep 12 23:47:58 1999 Jeffrey A Law (law@cygnus.com)
- * evax-emh.c: Use proper casts.
+ * elf-hppa.h (elf_hppa_final_link_relocate): Handle SECREL32.
+ Stub SEGREL32. Return an error for any relocation not handled.
- * evax-egsd.c (_bfd_evax_write_egsd): Remove unneeded uname.
+1999-09-12 Ian Lance Taylor <ian@zembu.com>
- * evax-egsd.c: Section names and symbols have different
- length restrictions. Add length parameter to
- _bfd_evax_length_hash_symbol.
- * evax-etir.c: Likewise.
- * evax-misc.c (_bfd_evax_length_hash_symbol): Add length
- parameter.
- * evax.h (EOBJ_S_C_SECSIZ): Define.
+ * cofflink.c (coff_link_add_symbols): Look for special MSVC string
+ constant symbols, and avoid multiple definition errors on them.
- * evax-alpha.c: Remove duplicate test.
+1999-09-12 Donn Terry <donn@interix.com>
- * evax-emh.c: SYS$ functions are upper-case.
+ * libbfd.c (bfd_log2): Rewrite to avoid infinite loop if most
+ significant bit is set.
- * evax-egsd.c: Create separate sections for common symbols.
- * evax-etir.c: Don't output common section.
- * evax.h: Bump up section count.
+1999-09-11 Ian Lance Taylor <ian@zembu.com>
- * configure.com: Use 64bit integers with DEC C.
+ * coff-ppc.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define.
- * evax-egsd.c: Make section flags dec c compatible.
+ * elfcode.h (write_relocs): Handle an absolute symbol in REL
+ relocs as we do for RELA relocs.
-Mon Oct 20 09:38:31 1997 Jeffrey A Law (law@cygnus.com)
+1999-09-11 Donn Terry <donn@interix.com>
- * som.c (normalize): Delete function.
- (som_bfd_ar_write_symbol_stuff): New parameter elength. All callers
- changed. Use passed in elength to determine size of the extended
- name table instead of computing it again.
+ * libpei.h (_bfd_pei_final_link_postscript): Declare.
+ (coff_final_link_postscript): Define.
+ * peigen.c (_bfd_pei_swap_aouthdr_out): Don't set value for data
+ directory entries here.
+ (_bfd_pei_final_link_postscript): New function.
-Sun Oct 19 23:36:21 1997 Jim Wilson <wilson@cygnus.com>
+ * peigen.c (_bfd_pei_swap_scnhdr_out): Remove code which sets
+ section flags based on the section name.
- * peicode.h (coff_swap_scnhdr_out): Use |= not = to set
- IMAGE_SCN_MEM_READ for an unrecognized section.
+ * peicode.h (coff_swap_scnhdr_in): If COFF_IMAGE_WITH_PE, the
+ get the overflow of the s_nlnno field from the s_nreloc field.
+ * peigen.c (_bfd_pei_swap_scnhdr_out): If doing a final link, swap
+ the s_nlnno overflow of the .text section into the s_nreloc
+ field.
-Sun Oct 19 21:04:56 1997 Jeffrey A Law (law@cygnus.com)
+ * peigen.c (add_data_entry): Declare.
+ (pei_swap_aouthdr_out): Get image size right. Set linker version
+ more intuitively.
+ (pei_swap_scnhdr_out): Test for UNINIT section, not .bss.
+ (pe_print_idata): Code cleanup, print more info, get rid of (now)
+ extraneous ImageBase.
+ (pe_print_edata): Likewise.
+ (pe_print_pdata): Likewise. Print exception entries.
+ (pe_print_reloc): Likewise. Print MIPS_JMPADDR.
+ (tbl): Make const, add "UNKNOWN".
+ (_bfd_pe_print_private_bfd_data_common): Print timestamp.
+ (_bfd_pe_bfd_copy_private_bfd_data_common): Don't copy deleted
+ section data directory.
+ (_bfd_pe_bfd_copy_private_section_data): Copy pe_flags.
+
+ * libpei.h (_bfd_pe_bfd_get_symbol_info): Declare.
+ * peigen.c (_bfd_pe_bfd_get_symbol_info): New function.
+ * peicode.h (coff_get_symbol_info): Define.
+
+ * config.bfd (i[3456]86-*-interix*): Set targ_cflags to
+ -DSTRICT_PE_FORMAT.
+ * coffcode.h (styp_to_sec_flags): Check STRICT_PE_FORMAT rather
+ than __INTERIX.
+ (coff_classify_symbol): Re-revert 1999-08-08 patch if
+ STRICT_PE_FORMAT.
+
+ * libpei.h: New file, broken out of peicode.h.
+ * peigen.c: New file, broken out of peicode.h.
+ * peicode.h: A bunch of code moved out to libpei.h and peigen.c.
+ * configure.in: Add peigen.lo to list of files required for each
+ PE target.
+ * Makefile.am: Rebuild dependencies.
+ (BFD32_BACKENDS): Add peigen.lo.
+ (BFD32_BACKENDS_CFILES): Add peigen.c.
+ (SOURCE_HFILES): Add libpei.h.
+ * configure, Makefile.in: Rebuild.
- * som.c (som_bfd_ar_write_symbol_stuff): Account for trailing
- '/' in the extended name table.
+ * peicode.h (coff_swap_scnhdr_in): Don't check for a special
+ section name of _BSS; check IMAGE_SCN_CNT_UNINITIALIZED_DATA
+ instead. Don't clear the s_paddr field for an uninitialized data
+ section.
-Fri Oct 17 00:04:13 1997 Richard Henderson <rth@cygnus.com>
+ * coffcode.h (coff_mkobject_hook): Set timestamp field in
+ coff_data_type to f_timdat.
+ * peicode.h (pe_mkobject_hook): Likewise.
+
+ * peicode.h (coff_swap_filehdr_in): Check the NT executable magic
+ number if COFF_IMAGE_WITH_PE.
+
+ * coffcode.h (coff_mkobject_hook): If COFF_WITH_PE, set HAS_DEBUG
+ to the reverse of IMAGE_FILE_DEBUG_STRIPPED.
+ (coff_write_object_contents): Set IMAGE_FILE_DEBUG_STRIPPED if
+ there is no SEC_DEBUGGING section.
+ * peicode.h (pe_mkobject_hook): Set HAS_DEBUG to the reverse of
+ IMAGE_FILE_DEBUG_STRIPPED.
+
+ * pe-i386.c (COFF_LONG_FILENAMES): Define.
+ (COFF_SECTION_ALIGNMENT_ENTRIES): Define.
+ * pei-i386.c (COFF_LONG_FILENAMES): Define.
+ (COFF_SECTION_ALIGNMENT_ENTRIES): Define.
+
+ * coffswap.h (IMAGE_BASE): Don't define.
+ * pei-arm.c (IMAGE_BASE): Don't define.
+ * pei-i386.c (IMAGE_BASE): Don't define.
+ * pei-mcore.c (IMAGE_BASE): Don't define.
+ * pei-ppc.c (IMAGE_BASE): Don't define.
+
+ * cofflink.c (_bfd_coff_link_input_bfd): When writing out a
+ symbol, switch on the class when determining whether to modify the
+ value. For PE, don't modify the value of a C_FCN symbol not named
+ .bf.
+
+ * libbfd-in.h (_bfd_abort): Declare.
+ (abort): Define.
+ * bfd.c (_bfd_abort): New function.
+ * libbfd.h: Rebuild.
- * elflink.h (elf_link_assign_sym_version): For explicitly versioned
- symbols, check globals list before matching on locals.
+ * coffcode.h (coff_set_alignment_hook): Delete POWERPC_LE_PE
+ special handling.
-Thu Oct 16 08:17:06 1997 Michael Meissner <meissner@cygnus.com>
+ * cofflink.c (_bfd_coff_link_input_bfd): If a symbol is stripped,
+ don't write out the associated line numbers.
- * peicode.h (coff_swap_scnhdr_out,pe_print_idata): Fix mangled
- patch.
+ * cofflink.c (_bfd_coff_write_global_sym): Handle section symbol
+ aux entries.
-Wed Oct 15 13:45:10 1997 Ian Lance Taylor <ian@cygnus.com>
+ * cofflink.c (coff_link_add_symbols): Don't warn about symbol type
+ changes when the base type is unknown.
- * peicode.h (pe_mkobject_hook): Set DLL flag.
- (pe_bfd_copy_private_bfd_data): Copy DLL flag.
+ * coffgen.c (coff_print_symbol): Fix printing of aux record for
+ function symbols.
- * peicode.h (coff_swap_scnhdr_out): Set IMAGE_SCN_MEM_DISCARDABLE
- for .stab* sections. Replace strlen of constant strings with
- number.
+ * syms.c (BSF_DEBUGGING_RELOC): Define.
+ * coffcode.h (coff_slurp_symbol_table): If PE, set BSF_DEBUGGING
+ for C_FCN/C_EFCN symbols, and set BSF_DEBUGGING_RELOC for such
+ symbols named .bf.
+ * coffgen.c (fixup_symbol_value): Relocate a symbol which has
+ BSF_DEBUGGING_RELOC set.
+ * bfd-in2.h: Rebuild.
-Tue Oct 14 15:42:45 1997 Richard Henderson <rth@cygnus.com>
+1999-09-10 Ian Lance Taylor <ian@zembu.com>
- * elf64-alpha.c (elf64_alpha_merge_ind_symbols): New function to
- merge got and reloc entries from ind syms to their target.
- (elf64_alpha_always_size_sections): Call it.
- (elf64_alpha_check_relocs): Operate on the target of indirect symbols.
- (elf64_alpha_can_merge_gots): Likewise.
- (elf64_alpha_merge_gots): Likewise.
+ * ecoff.c (bfd_debug_section): Update initialization for new
+ comdat_info field.
+ (_bfd_ecoff_styp_to_sec_flags): Add section parameter.
+ * libecoff.h (_bfd_ecoff_styp_to_sec_flags): Update declaration.
- * elf64-alpha.c (elf64_alpha_relocate_section): Back out HJ's change,
- as it is insufficient to handle the relocation changes as well.
+1999-09-10 H.J. Lu <hjl@gnu.org>
-Mon Oct 13 23:10:08 1997 Richard Henderson <rth@cygnus.com>
+ * coff-alpha.c (alpha_ecoff_backend_data): Initialize the new
+ _bfd_filnmlen field.
+ * coff-mips.c (mips_ecoff_backend_data): Likewise.
- * elf64-alpha.c (elf64_alpha_calc_dynrel_sizes): Allow for RELATIVE
- relocs for symbols in shlibs that have been forced local.
- (elf64_alpha_relocate_section): Output RELATIVEs in .got for same.
+Fri Sep 10 00:35:14 1999 Jeffrey A Law (law@cygnus.com)
-Mon Oct 13 21:24:04 1997 Richard Henderson <rth@cygnus.com>
+ * elf-hppa.h (elf_hppa_final_link_relocate): Create .opd entries
+ for FPTR relocs involving local symbols.
- * elf64-alpha.c (elf64_alpha_relocate_section): Use the
- got_enties of the default symbol for the default versioned
- symbol. Patch from hjl@gnu.ai.mit.edu, modified not to use
- alloca in the loop.
+ * elf-hppa.h (elf_hppa_final_link_relocate): Get the right
+ value for the stub address in a call through a stub.
+ Install the value for a local symbol directly into the DLT
+ instead of generating a reloc. Correctly handle FPTR64 relocs.
-Mon Oct 13 17:37:37 1997 Nick Clifton <nickc@cygnus.com>
+ * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): New function.
+ (elf_hppa_remark_useless_dynamic_symbols): Similarly.
+ (elf_hppa_final_link): Call them.
- * elf32-v850.c (v850_elf_final_link_relocate): Only use the bottom
- 24 bits of the PC when computing a PC relative relocation.
+1999-09-10 Ian Lance Taylor <ian@zembu.com>
-Fri Oct 10 16:01:30 1997 Nick Clifton <nickc@cygnus.com>
+ * elflink.h (elf_fix_symbol_flags): Move weakdef handling here...
+ (elf_adjust_dynamic_symbol): ...from here.
- * elf32-v850.c (v850_elf_reloc, v850_elf_final_link_relocate):
- Correct value for maximum positive 22 bit PC relative relocation.
- (v850_elf_final_link_relocate): Prevent overflow from HI16_S and
- HI_16 relocations. Correct bit adjustment in TDA offsets.
+Wed Sep 8 17:56:11 1999 Jeffrey A Law (law@cygnus.com)
-Thu Oct 9 16:43:39 1997 Doug Evans <dje@canuck.cygnus.com>
+ * elf-hppa.h (elf_hppa_howto_table); There is no DIR64WR, DIR64DR
+ relocation, remove them. SECREL64->LTOFF16WF.
+ (elf_hppa_final_link_relocate): Handle LTOFF* relocations. Handle
+ DIR* relocations.
+ (elf_hppa_relocate_insn): Similarly.
- * elf64-sparc.c (sparc_elf_{hix22,lox10}_reloc): New functions.
- (sparc64_elf_howto_table): Use them for HIX22,LOX10 relocs.
+ * elf-hppa.h (elf_hppa_final_link_relocate): Handle PLTOFF* relocs.
+ (elf_hppa_relocate_insn): Similarly.
-Wed Oct 8 11:38:45 1997 Richard Henderson <rth@cygnus.com>
+ * elf-hppa.h (elf_hppa_final_link_relocate): Handle DPREL* and
+ GPREL* relocations.
+ (elf_hppa_relocate_insn): Similarly.
- * elfcore.h (bfd_prstatus): Pedanticly, alignment_power should
- be LOG_FILE_ALIGN.
+ * elf-hppa.h (elf_hppa_link_final_relocate): Fix typos.
+ Handle LTOFF_TP* relocs.
+ (elf_hppa_relocate_insn): Similarly.
-Wed Oct 8 11:36:00 1997 Richard Henderson <rth@cygnus.com>
+ * elf-hppa.h (elf_hppa_final_link_relocate): Handle PCREL* relocs.
+ Consistently deal with addends. Handle DLTIND14F and DLTREL14F.
+ (elf_hppa_relocate_insn): Handle PCREL* relocs.
- * config.bfd: Missed one alpha* change.
+ * elf-hppa.h (elf_hppa_final_link_relocate): Handle LT_OFF_FPTR*,
+ DIR32, DIR64 and FPTR64 relocations.
+ (elf_hppa_relocate_insn): Similarly.
-Tue Oct 7 13:00:17 1997 Doug Evans <dje@canuck.cygnus.com>
+ * elf-hppa.h (elf_hppa_final_link): Set the value of __gp to the
+ address of the .PARISC.global section.
+ (elf_hppa_relocate_section): Lookup and pass the PA64 hash
+ table entry elf_hppa_final_link_relocate. Do not give a warning
+ for a reloc against an external symbol if it has a PA64 hash
+ table entry.
+ (elf_hppa_final_link_relocate): Significantly rework. Handle
+ DLTIND relocations. Compute the final value of the relocation
+ before passing the value of elf_hppa_relocate_insn.
+ (elf_hppa_relocate_insn): Revamp to handle just bit tiwiddling
+ relocation support. Handle DLTIND relocation requests just like
+ DLTREL relocation requests. Simplify branch handling.
- * elf32-sparc.c (_bfd_sparc_elf_howto_table): Remove BFD64 support.
- * elf64-sparc.c (SPARC64_OLD_RELOCS): Undef.
- (MINUS_ONE): New macro.
- (sparc_elf_notsup_reloc): New function.
- (sparc64_elf_howto_table): Add entries for DISP64,PLT64,HIX22,LOX10,
- H44,M44,L44,REGISTER.
- (sparc_reloc_map): Likewise. Map BFD_RELOC_CTOR to R_SPARC_64.
- (init_insn_reloc): New function.
- (sparc_elf_wdisp16_reloc): Use it.
- (sparc64_elf_relocate_section): Add entries for OLO10,HIX22,LOX10.
-
-Tue Oct 7 11:40:37 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * som.c (som_construct_extended_name_table): Remove static
- function, and define as macro instead.
-
-Fri Oct 3 14:02:17 1997 Richard Henderson <rth@cygnus.com>
-
- * config.bfd: Change alpha-*-* to alpha*-*-*; config.guess now
- recognizes alphaev5 etc.
- * configure.host: Likewise.
-
-Fri Oct 3 11:23:47 1997 Ian Lance Taylor <ian@cygnus.com>
-
- Make ld -s work on AIX:
- * xcofflink.c (xcoff_link_add_symbols): Don't create the .debug
- section if we are stripping.
- (bfd_xcoff_size_dynamic_sections): Don't set the .debug section
- size if we are stripping.
- (_bfd_xcoff_bfd_final_link): Don't set SEC_RELOC or rel_filepos,
- and don't write out relocs, if we are stripping.
- (xcoff_link_input_bfd): Don't set up reloc if we are stripping.
- (xcoff_write_global_symbol): Don't write out symbol or reloc if we
- are stripping.
-
- * configure.in: Don't include elf.lo again for ELF targets; it's
- always in the library anyhow.
- * configure: Rebuild.
+1999-09-08 Ulrich Drepper <drepper@cygnus.com>
- * bfd-in2.h: Rebuild.
+ * elf-hppa.h (elf_hppa_relocate_section): Catch problems with
+ non-allocated section as done in i386 version.
+ (elf_hppa_final_link_relocate): Uncomment R_PARISC_14F in switch
+ statement since this is no know relocation.
- * elf32-sparc.c (sparc_elf_wdisp16_reloc): Cast to bfd_byte *, not
- char *, when calling bfd_get_32 and bfd_put_32.
- * sunos.c (sunos_scan_dynamic_symbol): Cast contents to char *
- when calling strcpy.
+Tue Sep 7 17:25:12 1999 Jeffrey A Law (law@cygnus.com)
-Thu Oct 2 16:15:50 1997 Doug Evans <dje@canuck.cygnus.com>
+ * elf-hppa.h (elf_hppa_final_link_relocate): Handle DLTREL14F
+ relocs.
+ (elf_hppa_relocate_insn): Similarly.
- * reloc.c (bfd_check_overflow): New function.
- (bfd_perform_relocation, bfd_install_relocation): Use it.
- (BFD_RELOC_SPARC_{DISP64,PLT64}): New relocs.
- (BFD_RELOC_SPARC_{HIX22,LOX10,H44,M44,L44,REGISTER}): New relocs.
- * bfd-in2.h: Regenerate.
- * libbfd.h: Regenerate.
+ * elf-hppa.h (elf_hppa_final_link_relocate): Handle DLTREL14WR and
+ DLTREL14WD relocs.
+ (elf_hppa_relocate_insn): Similarly.
-Thu Oct 2 13:17:18 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elf-hppa.h (elf_hppa_final_link_relocate): Handle DLTREL14R and
+ DLTREL21L relocs. Pass the output bfd to elf_hppa_relocate_insn.
+ Pass the relocate type rather than the insn format to
+ elf_hppa_relocate_insn.
+ (elf_hppa_relocate_insn): Make switch dependent on relocation type
+ rather than the opcode. Handle DLTREL21L and DLTREL14R relocs.
- * peicode.h (coff_swap_scnhdr_out): Set IMAGE_SCN_MEM_READ for an
- unrecognized section. From Jon Thackray <jont@harlequin.co.uk>.
+1999-09-07 Ian Lance Taylor <ian@zembu.com>
-Wed Oct 1 14:03:44 1997 Ian Lance Taylor <ian@cygnus.com>
+ * coffcode.h (bfd_coff_backend_data): Add _bfd_filnmlen field.
+ (bfd_coff_filnmlen): Define.
+ (bfd_coff_std_swap_table): Initialize new field.
+ * coffgen.c (coff_fix_symbol_name): Use bfd_coff_filnmlen rather
+ than FILNMLEN.
+ (coff_write_symbols): Likewise.
+ (coff_get_normalized_symtab): Likewise.
+ * coff-sh.c (bfd_coff_small_swap_table): Initialize new field.
+ * libcoff.h: Rebuild.
- * Makefile.am ($(BFD_H)): Change stmp-bfd.h to stmp-bfd-h.
- (stmp-bfd-h): Rename from stmp-bfd.h.
- (BFD_H_FILES, LIBBFD_H_FILES, LIBCOFF_H_FILES): New variables.
- ($(srcdir)/bfd-in2.h): Just depend upon stmp-bin2-h.
- (stmp-bin2-h): New target.
- ($(srcdir)/libbfd.h): Just depend upon stmp-lbfd-h.
- (stmp-lbfd-h): New target.
- ($(srcdir)/libcoff.h): Just depend upon stmp-lcoff-h.
- (stmp-lcoff-h): New target.
- (CLEANFILES): Change stmp-bfd.h to stmp-bfd-h. Add stmp-bin2.h,
- stmp-lbfd-h, and stmp-lcoff-h.
- * Makefile.in: Rebuild.
+1999-09-06 Donn Terry <donn@interix.com>
- * configure.in: Use a diversion to set enable_shared before the
- arguments are parsed.
- * configure: Rebuild.
+ * coffcode.h (sort_by_secaddr): New static function if
+ COFF_IMAGE_WITH_PE.
+ (coff_compute_section_file_positions): If COFF_IMAGE_WITH_PE, sort
+ sections by VMA when assigning target_index values. Always set
+ virt_size.
-Tue Sep 30 14:18:32 1997 Doug Evans <dje@canuck.cygnus.com>
+ * libcoff-in.h (struct pei_section_tdata): Add pe_flags field.
+ * coffcode.h (coff_set_alignment_hook) [COFF_WITH_PE version]: Set
+ pe_flags field.
+ * libcoff.h: Rebuild.
- * elf32-sparc.c (_bfd_sparc_elf_howto_table): R_SPARC_GLOB_JMP
- renamed to R_SPARC_UNUSED_42.
- (sparc_reloc_map): Delete R_SPARC_GLOB_JMP entry.
- * elf64-sparc.c (_bfd_sparc_elf_howto_table): R_SPARC_GLOB_JMP
- renamed to R_SPARC_UNUSED_42.
- (sparc_reloc_map): Delete R_SPARC_GLOB_JMP entry.
- * reloc.c (BFD_RELOC_SPARC_GLOB_JMP): Delete.
- * bfd-in2.h: Regenerated.
- * libbfd.h: Regenerated.
+ * coffcode.h (coff_set_custom_section_alignment): Add const to
+ declaration to match definition.
+ (coff_write_object_contents): Don't set F_AR32W(R)? if
+ COFF_WITH_PE.
-Thu Sep 25 12:15:02 1997 Ian Lance Taylor <ian@cygnus.com>
+ * coff-i386.c (in_reloc_p): Add declaration.
+ (i386coff_vec): Simplify initialization of
+ application_section_flags.
- * elflink.h (elf_merge_symbol): Don't check the hash creator until
- after we have set *sym_hash.
+ * coffcode.h (sec_to_styp_flags): Write separate COFF_WITH_PE
+ version. Move COFF_WITH_PE specific code to new version.
+ (stype_to_sec_flags): Likewise. Add section parameter.
+ * coffgen.c (make_a_section_from_file): Set target_index before
+ calling styp_to_sec_flags. Pass section to styp_to_sec_flags.
+ * libcoff.h: Rebuild.
-Wed Sep 24 16:52:28 1997 Joel Sherrill <joel@oarcorp.com>
+ * syms.c (stt): Add some PE/PEI section names.
+ (bfd_decode_symclass): Return 'w', not 'U', for a weak undefined
+ symbol.
+ (bfd_symbol_info): Check for 'w'.
- * config.bfd (sh*-*-rtems*): New target, like sh-*-*elf*.
+ * section.c (struct bfd_comdat_info): Define.
+ (asection): Add comdat field.
+ (STD_SECTION): Initialize comdat field.
+ (bfd_make_section_anyway): Likewise.
+ * bfd-in2.h: Rebuild.
-Wed Sep 24 11:27:23 1997 Ian Lance Taylor <ian@cygnus.com>
+1999-09-06 Andreas Schwab <schwab@suse.de>
- * Makefile.am (libbfd_a_SOURCES): Define.
- * Makefile.in: Rebuild.
+ * elflink.h (elf_link_add_object_symbols): Copy NON_GOT_REF flag
+ to version symbols.
- * configure.in: Call AC_CHECK_TOOL before AM_PROG_LIBTOOL.
- * aclocal.m4: Rebuild with new libtool.
- * configure: Rebuild.
+1999-09-06 Nick Clifton <nickc@cygnus.com>
-Tue Sep 23 19:03:13 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elflink.h (elf_gc_record_vtentry): Use bfd_zmalloc and
+ bfd_realloc instead of calloc and realloc.
- * elf.c (map_sections_to_segments): Even if we are not demand
- paged, don't put a loadable section after a nonloadable section.
- (assign_file_positions_for_segments): Increment the file offset
- for a section with contents, even if it is not loadable.
+1999-09-04 Steve Chamberlain <sac@pobox.com>
-Thu Sep 18 15:04:57 1997 Nick Clifton <nickc@cygnus.com>
+ * cpu-pj.c: New file.
+ * elf32-pj.c: New file.
+ * config.bfd (pj*): New cpu.
+ (pj-*-*, pjl-*-*): New targets.
+ * configure.in (bfd_elf32_pj_vec): New target vector.
+ (bfd_elf32_pjl_vec): New target vector.
+ * archures.c (bfd_arch_pj): Define.
+ * elf.c (prep_headers): Handle bfd_arch_pj.
+ * reloc.c: Define BFD_RELOC_PJ_* relocations.
+ * targets.c (bfd_elf32_pj_vec, bfd_elf32_pjl_vec): Declare and add
+ to target vector list.
+ * Makefile.am: Rebuild dependencies.
+ (ALL_MACHINES): Add cpu-pj.lo.
+ (ALL_MACHINES_CFILES): Add cpu-pj.c.
+ (BFD32_BACKENDS): Add elf32-pj.lo.
+ (BFD32_BACKENDS_CFILES): Add elf32-pj.c.
+ * configure, Makefile.in, bfd-in2.h, libbfd.h: Rebuild.
- * elf32-v850.c (v850_elf_check_relocs): Improve error message.
+1999-09-04 Ian Lance Taylor <ian@zembu.com>
-Wed Sep 17 09:54:51 1997 Nick Clifton <nickc@cygnus.com>
+ * elf-bfd.h (ELF_LINK_NON_GOT_REF): Define.
+ * elflink.h (elf_adjust_dynamic_symbol): Copy REF_REGULAR_NONWEAK
+ and NON_GOT_REF from weak defined symbol to real symbol.
+ * elf32-i386.c (elf_i386_check_relocs): Set NON_GOT_REF.
+ (elf_i386_adjust_dynamic_symbol): If NON_GOT_REF is not set, don't
+ create a COPY reloc.
+ * elf32-sparc.c (elf32_sparc_check_relocs): Set NON_GOT_REF.
+ (elf32_sparc_adjust_dynamic_symbol): If NON_GOT_REF is not set,
+ don't create a COPY reloc.
- * elf32-v850.c (v850_elf_final_link_relocate): Add checks to catch
- relocations against non-existant symbols.
+1999-09-03 Ian Lance Taylor <ian@zembu.com>
-Tue Sep 16 14:20:27 1997 Nick Clifton <nickc@cygnus.com>
+ * elflink.h (elf_bfd_final_link): When counting relocations, don't
+ count those in sections we are not including in the link.
- * reloc.c: Add BFR_RELOC_V850_TDA_16_16_OFFSET.
+Thu Sep 2 17:41:20 1999 Jeffrey A Law (law@cygnus.com)
- * elf32-v850.c (v850_elf_reloc, v850_elf_final_link_relocate,
- v850_elf_howto_table, v850_elf_reloc_map): Add support for a 16
- bit reloc in the tiny data area.
+ * elflink.h (elf_link_add_object_symbols): Work around bogus SH_LINK
+ field in hpux11 shared libraries.
-Wed Sep 10 15:17:25 1997 Nick Clifton <nickc@cygnus.com>
+1999-09-02 Nick Clifton <nickc@cygnus.com>
- * elf32-v850.c (v850_elf_reloc): Remove spurious error message.
+ * elflink.h (elf_gc_record_vtentry): Fix memory leak.
-Wed Sep 10 11:17:50 1997 Andrew Cagney <cagney@b1.cygnus.com>
+Wed Sep 1 13:34:29 1999 Jeffrey A Law (law@cygnus.com)
- * archures.c (bfd_default_scan): Use strcasecmp.
- (bfd_default_scan): Test for match with arch_name + ":" +
- printable_name.
- (bfd_default_scan): Test for match with printable_name - ":".
- (bfd_default_scan): Delete w65, h8300, h8500, z8k, i960 special
- cases. Each implements their own scan function.
- (bfd_default_scan): Delete 386, 2900, 860, mips 2000, mips 4400
- special cases. Since info->mach == 0. The test mach == number
- fails.
- (bfd_arch_list): New function, return name of all the supported
- architectures.
+ * elf-hppa.h (elf_hppa_add_symbol_hook): New function.
+ (elf_hppa_final_link, elf_hppa_relocate_section): Likewise.
+ (elf_hppa_final_link_relocate, elf_hppa_relocate_insn): Likewise.
-Tue Sep 9 10:21:56 1997 Nick Clifton <nickc@cygnus.com>
+1999-08-31 Alexandre Petit-Bianco <apbianco@cygnus.com>
- * elf32-v850.c (v850_elf_print_private_bfd_data): Break after
- decoding architecture.
- (v850_elf_reloc): Do not complain if a R_V850_LO16 reloc has bit
- 15 set.
+ * elflink.h (record_link_assignment): When possible, keep the
+ original type of the symbol.
-Sun Sep 7 12:25:22 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
+Mon Aug 30 15:26:48 1999 Jeffrey A Law (law@cygnus.com)
- * bfd/elf64-alpha.c (reloc_howto_type): Fix the howto table.
+ * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Allow both
+ R_PARISC_DIR32 and R_PARISC_DIR64 regardless of how the
+ tools were configured.
+ * elf32-hppa.h (_bfd_elf32_hppa_gen_reloc_type): Declare.
-Thu Sep 4 09:44:10 1997 Ian Lance Taylor <ian@cygnus.com>
+1999-08-26 Mark Mitchell <mark@codesourcery.com>
- * Makefile.am: Rebuild dependencies.
- (ALL_MACHINES_CFILES): Add cpu-v850.c.
- (ALL_MACHINES_CFILES): Add elf32-v850.c.
- * Makefile.in: Rebuild.
+ * elf32-mips.c (_bfd_mips_elf_check_relocs): Don't allocate local
+ GOT entries for GOT16 relocations; they're not required.
- * reloc.c: Remove extraneous commas from relocation entries.
- Remove BFD_RELOC_V850_16_PCREL.
- * bfd-in2.h: Rebuild.
+1999-08-24 Nick Clifton <nickc@cygnus.com>
- * xcofflink.c (xcoff_link_add_symbols): Put XTY_CM/XMC_TD symbols
- in sections named .tocbss rather than .bss.
+ From a patch submitted by Roland McGrath <roland@baalperazim.frob.com>
-Wed Sep 3 11:23:23 1997 Nick Clifton <nickc@cygnus.com>
+ * config.bfd (arm-*-netbsd*): New target.
+ * configure.in (armnetbsd_vec): New target vector.
+ * configure: Regenerate
+ * targets.c (bfd_target_vector): Add &armnetbsd_vec.
- * libbfd.h, bfd-in2.h, elf32-v850.c: Removed
- BFD_RELOC_V850_16_PCREL.
+ * Makefile.am (BFD32_BACKENDS): Add armnetbsd.lo.
+ (ALL_MACHINES_CFILES): Add armnetbsd.c.
+ (armnetbsd.lo): New rule with deps.
+ * Makefile.in: Regenerate.
+
+ * armnetbsd.c: New file: Definitions specific to arm-netbsd
+ target.
-Tue Sep 2 20:44:10 1997 Fred Fish <fnf@cygnus.com>
+Tue Aug 24 00:25:58 1999 Jeffrey A Law (law@cygnus.com)
- * cofflink.c (coff_link_check_ar_symbols): Handle C_SYSTEM syms
- the same as C_EXT syms.
- (coff_link_add_symbols): Ditto.
- (_bfd_coff_link_input_bfd): Ditto.
- (_bfd_coff_write_task_globals): Add save_global_to_static. Use
- it to preserve and restore state of global_to_static flag.
+ * som.c (som_slurp_symbol_table): Fix typo in comment.
-Tue Sep 2 17:45:22 1997 Nick Clifton <nickc@cygnus.com>
+Fri Aug 20 17:01:23 1999 Jeffrey A Law (law@cygnus.com)
- * elf32-v850.c (v850_elf_object_p): Set machine number based on
- bits in e_flags field rather than magic numbers.
- (v850_elf_final_write_processing, v850_elf_set_private_flags,
- v850_elf_copy_private_bfd_data, v850_elf_merge_private_bfd_data,
- v850_elf_print_private_bfd_data): New functions.
+ * elf-hppa.h (elf_hppa_fake_sections): Compute section indices
+ here instead of using elf_section_data...
+1999-08-19 Nick Clifton <nickc@cygnus.com>
-Tue Sep 2 17:35:05 1997 Doug Evans <dje@canuck.cygnus.com>
+ * coff-mcore.c (mcore_emit_base_file_entry): New function: Emit
+ relocations into the base file.
+ (coff_mcore_relocate_section): Call mcore_emit_base_file_entry if
+ we are building a base file.
- * cpu-arc.c (arc_get_mach): Properly scan defined mach entries.
+1999-08-19 Nick Clifton <nickc@cygnus.com>
-Tue Sep 2 18:29:37 1997 Jeffrey A Law (law@cygnus.com)
+ * elf32-arm.h (arm_add_to_rel): New function. Add a value to
+ a REL style reloc.
+ (elf32_arm_relocate_section): Use arm_add_to_rel to increment
+ REL relocs when performing a partial relocation.
- * elf-m10200.c (mn10200_elf_final_link_relocate): PC relative
- instructions are relative to the next instruction, not the
- current instruction.
- (mn10200_elf_relax_section): Similarly.
+1999-08-18 Donn Terry <donn@interix.com>
-Tue Sep 2 15:45:45 1997 Nick Clifton <nickc@cygnus.com>
+ * cofflink.c: Move definitions of N_TMASK, et. al., out of
+ _bfd_coff_link_input_bfd into top level.
- * cpu-v850.c: Use a macro to construct bfd_arch_info_type
- entries.
+ * coff-i386.c (coff_i386_reloc): Handle R_IMAGEBASE.
+ (RTYPE2HOWTO): Return NULL if reloc type is out of range.
+ (coff_i386_rtype_to_howto): Likewise.
+ * coffcode.h (coff_slurp_symbol_table): Change a -2 to N_DEBUG.
+ Completely ignore symbols which are all zero.
+ (dummy_reloc16_estimate): Add return 0.
+ * cofflink.c (_bfd_coff_link_input_bfd): Rename inner scope
+ variable copy to name_copy to avoid shadowing outer scope
+ variable.
+ * libcoff-in.h (coff_data_type): Change raw_syment_count field
+ from unsigned int to unsigned long. Add timestamp field.
+ * libcoff.h: Rebuild.
- * reloc.c, libbfd.h, bfd-in2.h, elf32-v850.c: Replace
- BFD_RELOC_V850_{SDA/TDA/ZDA}_OFFSET relocs with new bit pattern
- specific versions: BFD_RELOC_V850_{area}_{bits}_OFFSET.
+1999-08-17 H.J. Lu <hjl@gnu.org>
-Thu Aug 28 17:01:09 1997 Andrew Cagney <cagney@b1.cygnus.com>
+ * elf32-hppa.c (bfd_elf32_bfd_is_local_label_name): Fix typo in
+ macro definition.
- * cpu-v850.c: Remove "plain" from v850 printable name.
- (scan): Use strcasecmp.
+1999-08-17 Ian Lance Taylor <ian@zembu.com>
- * archures.c (bfd_mach_v850): Define.
+ * elf32-mips.c (_bfd_mips_elf_add_symbol_hook): Set BSF_DYNAMIC
+ for special section symbols.
+ * elflink.h (elf_merge_symbol): If we have no old BFD, check
+ BSF_DYNAMIC on the section symbol to see whether the old BFD is
+ dynamic.
- * cpu-sh.c (scan_mach): Compare with table instead of hardwired to
- just sh/SH, use strcasecmp.
- (arch_info_struct): Add entries for sh3 et.al.
+1999-08-15 Mark Mitchell <mark@codesourcery.com>
- * archures.c (bfd_mach_sh, ...): Define.
+ * elf32-mips.c (mips_elf_calculate_relocation): Fix unfortunate
+ coincidence of variable names between old and new code.
-Wed Aug 27 17:33:07 1997 Andrew Cagney <cagney@b1.cygnus.com>
+1999-08-12 Nick Clifton <nickc@cygnus.com>
- * archures.c (bfd_archures_list): Always NULL terminate the list.
+ * elf32-arm.h (elf32_arm_to_thumb_stub): Make 'offset' parameter
+ into a bfd_vma and 'addend' parameter a 'bfd_signed_vma'.
+ (elf32_thumb_to_arm_stub): Make 'offset' parameter into a bfd_vma
+ and 'addend' parameter a 'bfd_signed_vma'.
+ (elf32_arm_final_link_relocate): Do not involve stubs in
+ R_ARM_THM_PC22 relocs relative to section symbols, they are long
+ jumps, not function calls.
-Tue Aug 26 17:26:51 1997 Ian Lance Taylor <ian@cygnus.com>
+1999-08-11 Robin Farine <advanc@dial.eunet.ch>
- * Makefile.am: Rebuild dependencies.
- (ALL_MACHINES_CFILES): Add cpu-arc.c.
- (ALL_MACHINES_CFILES): Add elf32-arc.c.
- (elf32-arc.lo): Remove explicit dependency.
- * Makefile.in: Rebuild.
+ * elf32-arm.h (elf32_arm_final_link_relocate): Check for overflow
+ in R_ARM_PC24 relocs.
- * acinclude.m4 (BFD_CC_FOR_BUILD): Set EXEEXT_FOR_BUILD.
- * doc/Makefile.am (MKDOC): Use EXEEXT_FOR_BUILD, not EXEEXT.
- * aclocal.m4, configure, Makefile.in, doc/Makefile.in: Rebuild.
+Tue Aug 10 12:48:09 1999 Jeffrey A Law (law@cygnus.com)
-Mon Aug 25 16:14:34 1997 Christopher Provenzano <proven@cygnus.com>
+ * elf-hppa.h (elf_hppa_fake_sections): New function.
+ * elf32-hppa.c (elf_backend_fake_sections): Define.
- * configure: Rebuild with latest devo autoconf for NT support
+ * elf-hppa.h (elf_hppa_final_write_processing): Update for
+ recent changes to the arch_info structure.
-Mon Aug 25 16:11:04 1997 Nick Clifton <nickc@cygnus.com>
+ * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle
+ R_HPPA_SEGBASE and R_HPPA_SEGREL32.
+ * cpu-hppa.c (bfd_hppa20w_arch): New entry in architecture info
+ list.
- * cpu-arm.c (compatible): If B is a default type, return A.
+Tue Aug 10 00:34:29 1999 Mark P. Mitchell <mark@codesourcery.com>
+ Ralf Baechle <ralf@uni-koblenz.de>
-Mon Aug 25 15:35:46 1997 Nick Clifton <nickc@cygnus.com>
+ * elf32-mips.c (_bfd_mips_elf_size_dynamic_sections): Always
+ output DT_MIPS_GOTSYM.
+ (_bfd_mips_elf_finish_dynamic_sections): Use the same value as
+ DT_MIPS_SYMTABNO if there are no global GOT symbols.
- * cpu-v850.c (scan): New function.
- (arch_info_struct): New structure.
- (bfd_v850_arch): Add link into arch_info_structure.
+Tue Aug 10 00:21:08 1999 Mark P. Mitchell <mark@codesourcery.com>
- * config.bfd (targ_cpu): All v850 variants use the bfd_arch_v850
- architecture.
+ * elf32-mips.c (mips_elf_create_dynamic_relocation): Change
+ prototype. Handle local symbols. Add commentary.
+ (mips_elf_calculate_relocation): Adjust accordingly.
+ (_bfd_mips_elf_check_relocs): Handle local symbols in R_MIPS_32
+ relocations.
+
+ * elflink.h (elf_bfd_final_link): Tweak last change.
- * elf32-v850.c (v850_elf_object_p): New function.
+1999-08-09 Mark Mitchell <mark@codesourcery.com>
+ * elflink.h (elf_link_size_reloc_section): Use the counts in the
+ elf-section data to allocate just the right amount of relocation
+ space. Don't allocate the hash space twice.
+ (elf_bfd_final_link): Calculate the amount of space to allocate in
+ each relocation section.
-Mon Aug 25 14:07:33 1997 Ian Lance Taylor <ian@cygnus.com>
+Mon Aug 9 17:37:30 1999 Jeffrey A Law (law@cygnus.com)
- * syms.c (_bfd_stab_section_find_nearest_line): Clear the
- cached_stab field if the offset prevents us from using the cache.
+ * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type, case 32): When in
+ 64bit mode, generate a section relative relocation for a 32bit
+ wide relocation.
+ (elf_hppa_is_local_label_name): New function.
+ * elf32-hppa.c (elf_hppa_is_local_label_name): Deleted. To be
+ shared between 32bit and 64bit port.
-Mon Aug 25 12:08:13 1997 Ian Lance Taylor <ian@cygnus.com>
+1999-08-09 Mark Mitchell <mark@codesourcery.com>
- * aout-target.h (MY(vec)): Add SEC_CODE and SEC_DATA to section
- flags.
- * aout-arm.c (aout_arm_little_vec): Likewise.
- (aout_arm_big_vec): Likewise.
- * bout.c (b_out_vec_big_host): Likewise.
- (b_out_vec_little_host): Likewise.
- * mipsbsd.c (aout_mips_little_vec): Likewise.
- (aout_mips_big_vec): Likewise.
+ * elf32-mips.c (elf_mips_howto_table): Fix src_mask for
+ R_MIPS_GOT16 and R_MIPS_CALL16.
+ (mips_elf_got16_entry): Use mips_elf_high to calculate the value
+ to use when looking for a preexisting GOT entry.
-Tue Aug 19 08:47:17 1997 Fred Fish <fnf@cygnus.com>
+1999-08-09 Jakub Jelinek <jj@ultra.linux.cz>
- * coff-i960.c (COFF_ALIGN_IN_SECTION_HEADER): Define to 1.
- (GET_SCNHDR_ALIGN, PUT_SCNHDR_ALIGN): Define.
- * coff-m88k.c (GET_SCNHDR_NRELOC, GET_SCNHDR_NLNNO): Define.
- * coffcode.h (coff_set_alignment_hook): Conditionally compile in if
- COFF_ALIGN_IN_SECTION_HEADER is defined. Convert alignment to power
- of two for I960 only.
- * coffswap.h (GET_SCNHDR_NRELOC, PUT_SCNHDR_NRELOC, GET_SCNDHR_NLNNO,
- PUT_SCNHDR_NLNNO, GET_SCNHDR_FLAGS, PUT_SCNHDR_FLAGS): Provide
- default definitions.
- (coff_swap_scnhdr_in): Use GET_SCNHDR_FLAGS, GET_SCNHDR_NRELOC,
- GET_SCNHDR_NLNNO, and GET_SCNHDR_ALIGN.
- (coff_swap_scnhdr_out): Use PUT_SCNHDR_FLAGS, PUT_SCNHDR_ALIGN.
+ * elf64-sparc.c (sparc64_elf_relocate_section): Back out part of
+ the Sep. 4th, 1998 change. glibc 2.0.x dynamic linker had bug,
+ not binutils.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
-Mon Aug 18 11:36:19 1997 Nick Clifton <nickc@cygnus.com>
+1999-08-09 Geoff Keating <geoffk@cygnus.com>
- * elf32-v850.c (v850_elf_howto_table, v850_elf_reloc_map,
- v850_elf_check_relocs, v850_elf_reloc,
- v850_elf_final_link_relocate): Add support for
- BFD_RELOC_V850_16_PCREL relocation.
+ * elflink.h (elf_link_output_extsym): Don't output a weak
+ reference to an undefined symbol just because it was defined weak
+ in a shared object.
- * reloc.c (COMMENT): Add suuport for BFD_RELOC_V850_16_PCREL
- relocation.
+1999-08-09 Eli Zaretskii <eliz@is.elta.co.il>
- * libbfd.h: Add support for BFD_RELOC_V850_16_PCREL relocation.
+ * coffgen.c (coff_find_nearest_line): When looking for file, use
+ last best match rather than first. If address is beyond last line
+ number record, don't return the last line as the correct value.
- * bfd-in2.h: Add support for BFD_RELOC_V850_16_PCREL relocation.
+1999-08-08 Ian Lance Taylor <ian@zembu.com>
+ * section.c (SEC_SMALL_DATA): Rename from SEC_SHORT.
+ * bfd-in2.h: Rebuild.
-Fri Aug 15 12:01:28 1997 Ian Lance Taylor <ian@cygnus.com>
+1999-08-08 Mark Elbrecht <snowball3@bigfoot.com>
- * coffgen.c (coff_find_nearest_line): Correctly handle the offset
- argument as section relative, rather than an absolute address.
- From Jan Hoogenraad <hoogenrd@natlab.research.philips.com>.
+ * libcoff-in.h (struct coff_section_alignment_entry): Define.
+ * coffcode.h (coff_set_custom_section_alignment): New static
+ function.
+ (coff_section_alignment_table): New static array.
+ (coff_new_section_hook): Use coff_set_customer_section_alignment.
+ * coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define.
+ * coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define.
+ * libcoff.h: Rebuild.
-Fri Aug 15 04:58:02 1997 Doug Evans <dje@canuck.cygnus.com>
+1999-08-08 Ian Lance Taylor <ian@zembu.com>
- * config.bfd (arc-*-elf*): Add.
- * configure.in (bfd_elf32_{little,big}arc_vec): Add.
- * configure: Rebuild.
- * Makefile.am (ALL_MACHINES): Add cpu-arc.lo.
- (BFD32_BACKENDS): Add elf32-arc.lo.
- (cpu-arc.lo,elf32-arc.lo): Add rules for.
+ * Makefile.am: Rename .dep* files to DEP*. Change DEP variable to
+ MKDEP.
* Makefile.in: Rebuild.
- * archures.c (architecture list): Add bfd_arch_arc.
- (bfd_archures_list): Add bfd_arc_arch.
- (bfd_mach_arc_base): Define.
- * reloc.c (BFD_RELOC_ARC_B22_PCREL,BFD_RELOC_ARC_B26): Add.
- * targets.c (bfd_elf32_{little,big}arc_vec): Declare.
- (bfd_target_vect): Add them.
- * bfd-in2.h, libbfd.h: Rebuild.
- * cpu-arc.c, elf32-arc.c: New files.
- * elf.c (pre_headers): Recognize bfd_arch_arc.
-Tue Aug 12 11:45:18 1997 Ian Lance Taylor <ian@cygnus.com>
+1999-08-08 Mumit Khan <khan@xraylith.wisc.edu>
- * aoutx.h (NAME(aout,final_link)): If no symbols, make sure the
- data section is correctly rounded to a page in the file.
-
-Mon Aug 11 12:45:43 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * aoutx.h (NAME(aout,final_link)): Don't emit the string table if
- there are no symbols.
+ * section.c (SEC_SHARED): Define.
+ * coffcode.h (sec_to_styp_flags): Handle SEC_SHARED.
+ (styp_to_sec_flags): Likewise.
+ * peicode.h (coff_swap_scnhdr_out): Likewise.
+ * bfd-in2.h: Rebuild.
-Sun Aug 10 14:45:56 1997 Ian Lance Taylor <ian@cygnus.com>
+1999-08-08 Ian Lance Taylor <ian@zembu.com>
- * coff-stgo32.c: Rename from coff-stubgo32.c to avoid old System V
- file system 14 character limit.
- * Makefile.am, configure.in: Corresponding changes.
- * Makefile.in, configure: Rebuild.
+ * coffcode.h (coff_classify_symbol): Comment out part of
+ 1999-08-05 change which breaks cygwin DLLs.
-Fri Aug 8 18:34:36 1997 Ian Lance Taylor <ian@cygnus.com>
+ * acinclude.m4 (BFD_BINARY_FOPEN): Change -windows to -windows*.
+ * aclocal.m4, configure: Rebuild.
- * Makefile.am: (ALL_MACHINES_CFILES): Add elf32-d10v.c.
- Rebuild dependencies.
- * Makefile.in: Rebuild.
+1999-08-06 Ian Lance Taylor <ian@zembu.com>
+
+ * section.c (global_syms): Only initialize union field if
+ __STDC__.
+
+1999-08-04 Mark Mitchell <mark@codesourcery.com>
+
+ * elf32-mips.c (mips_elf_got16_entry): Don't multiply GOT index by
+ the size of a GOT entry here.
+ (mips_elf_calculate_relocation): Don't create a local GOT entry
+ for the symbol in a GOT16 relocation; just for it's high-order bit
+ (_bfd_mips_elf_relocate_section): Fix thinko.
+
+1999-08-05 Ian Lance Taylor <ian@zembu.com>
+
+ Based on patches from Donn Terry <donn@interix.com>:
+ * coffcode.h (enum coff_symbol_classification): Define.
+ (bfd_coff_backend_data): Rename _bfd_coff_sym_is_global to
+ _bfd_coff_classify_symbol. Change return type.
+ (bfd_coff_classify_symbol): Rename from bfd_coff_sym_is_global.
+ (coff_slurp_symbol_table): Use coff_classify_symbol.
+ (coff_classify_symbol): New static function.
+ (coff_sym_is_global): Never define.
+ (bfd_coff_std_swap_table): Initialize with coff_classify_symbol.
+ * cofflink.c (coff_link_check_ar_symbols): Use
+ bfd_coff_classify_symbol rather than bfd_coff_sym_is_global.
+ (coff_link_add_symbols): Likewise.
+ (_bfd_coff_link_input_bfd): Likewise.
+ * coff-sh.c (bfd_coff_small_swap_table): Initialize with
+ coff_classify_symbol.
+ * libcoff.h: Rebuild.
-Wed Aug 6 18:56:51 1997 Ian Lance Taylor <ian@cygnus.com>
+Wed Aug 4 18:08:07 1999 Jeffrey A Law (law@cygnus.com)
- * Makefile.am (docdir): Define.
- * Makefile.in: Rebuild.
+ * libhppa.h (R_HPPA_LTPSEL, R_HPPA_RTPSEL): New field selectors
+ (e_ltpsel, e_rtpsel): Similarly.
-Tue Aug 5 23:05:03 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle 21bit e_ltpsel
+ and 14bit ertpsel. Handle 64bit psel.
- * configure: Rebuild with autoconf 2.12.1.
+1999-08-04 Mark Mitchell <mark@codesourcery.com>
-Mon Aug 4 12:00:35 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-mips.c (_bfd_mips_elf_relocate_section): Tweak HI16/LO16
+ handling for REL relocations. And only left-shift R_MIPS26
+ relocation addends where necessary.
- * aclocal.m4, configure: Rebuild with new automake patches.
+1999-08-03 Mark Mitchell <mark@codesourcery.com>
-Sun Aug 3 08:15:12 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+ * elf32-mips.c (mips_elf_next_lo16_addend): Rename to ...
+ (mips_elf_next_lo16_relocation): Don't compute the addend here.
+ Just return the relocation found.
+ (mips_elf_relocate_section): Pull the LO16 addend out of the
+ section itself when using REL relocations.
+
+ * elf32-mips.c (mips_elf_calculate_relocation): Restore
+ _DYNAMIC_LINK handling and handling of undefined symbols in shared
+ libraries.
- * rs6000-core.c (make_bfd_asection): New function to add a section
- to the core file bfd.
- (rs6000coff_core_p): Use make_bfd_asection to add the core file
- sections.
- Use BFD routines to seek, read and stat the core file.
- Handle .data sections from loaded objects and anonymously mmapped
- regions, these are available in AIX 4 core files.
+1999-08-03 Ian Lance Taylor <ian@zembu.com>
-Fri Aug 1 12:58:32 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-ppc.c (ppc_elf_relocate_section): Don't use the relocation
+ value of a symbol in a SEC_DEBUGGING section. Warn when doing a
+ relocation against a symbol in an input section with no output
+ section. From Daniel Jacobowitz <drow@false.org>.
- * configure.in: Set enable_shared before AM_PROG_LIBTOOL.
- * acinclude.m4: Move acmacros.m4 in here. Remove AM_PROG_LIBTOOL
- copy; use a patches libtool instead.
- * acmacros.m4: Remove.
- * Makefile.in, aclocal.m4, configure: Rebuild.
+ * coff-stgo32.c (go32_stubbed_coff_object_p): Remove; not used.
-Thu Jul 31 19:55:36 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * Makefile.am: New file, based on old Makefile.in.
- * acmacros.m4: New file, copied from old aclocal.m4.
- * acinclude.m4: New file.
- * configure.in: Call AM_PROG_LIBTOOL. Remove shared library
- handling; now handled by libtool. Replace AC_CONFIG_HEADER with
- AM_CONFIG_HEADER. Replace AC_PROG_INSTALL with AM_PROG_INSTALL.
- Call AM_MAINTAINER_MODE, AM_CYGWIN32, and AM_EXEEXT. Change all
- .o files to .lo. Remove stamp-h handling in AC_OUTPUT.
- * acconfig.h: Mention PACKAGE and VERSION.
- * stamp-h.in: New file.
- * dep-in.sed: Change .o to .lo.
- * Makefile.in: Now built with automake.
- * aclocal.m4: Now built with aclocal.
- * config.in, configure: Rebuild.
- * VERSION: Remove.
-
-Thu Jul 31 12:09:20 1997 Geoff Keating <geoffk@ozemail.com.au>
-
- * elf32-ppc.c (ppc_elf_size_dynamic_sections): Don't set TEXTREL
- if there is only a relocation to a read-only but not allocatable
- section (like .stab).
- * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise.
- * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise.
- * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
- * elf32-mips.c (mips_elf_size_dynamic_sections): Likewise.
- * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
-
- * elf32-ppc.c (ppc_elf_howto_raw): Correct various comments.
- (ppc_elf_create_linker_section): These sections are not
- created by the linker (that is, they are created by the user
- putting data in them). In particular, they can be the source
- and target of relocations.
- (ppc_elf_adjust_dynamic_symbol): Check postcondition of
- bfd_elf32_link_record_dynamic_symbol. Align 16-byte common
- objects (for instance, 'long double') to 16-byte boundaries.
- (ppc_elf_size_dynamic_sections): Make the code that generates
- section symbols exactly the same as for sparc, reducing the
- number of section symbols output.
- (ppc_elf_check_relocs): Check postcondition of
- bfd_elf32_link_record_dynamic_symbol. Make default case the
- same as corresponding code for sparc, fixing bug involving
- .rela.stabs.
- (ppc_elf_finish_dynamic_symbol): Fix case involving GOT symbols
- forced to be local because of versioning (by replicating
- corresponding change in sparc). Treat R_PPC_RELATIVE RELA relocs
- as usual in ELF, not as pseudo-REL relocs (as the sparc linker
- does).
- (ppc_elf_relocate_section): Add handy debugging code for when
- assertion fails. Add some more 'symbol made local because of
- versioning' cases.
-
- * elf32-ppc.c (ppc_elf_relocate_section): Cope with addend when
- processing a GOT relocation as required by ABI.
-
-Wed Jul 30 21:30:35 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * elflink.h (NAME(bfd_elf,record_link_assignment)): Remove any
- version info if this symbol came from a dynamic object.
- (elf_link_add_object_symbols): Set the version info of a symbol
- only if the object actually contains version definitions and
- defines this symbol.
-
-Mon Jul 28 18:07:43 1997 Rob Savoye <rob@chinadoll.cygnus.com>
-
- * aclocal.m4: Add CYGWIN and EXEEXT autoconf macros.
- * configure.in: Use CYGWIN and EXEEXT autoconf macro to look for
- win32 dependencies.
- * configure: Regenerated with autoconf 2.12.
- * doc/Makefile.in: Add $(EXEEXT) to chew executable.
-
-Mon Jul 28 02:50:29 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
-
- * rs6000-core.c (rs6000coff_core_p): If CORE_TRUNC is set, print
- a warning rather than returning an error.
-
-Sun Jul 27 19:54:14 1997 Felix Lee <flee@cygnus.com>
-
- * coffswap.h (coff_swap_aux_in): add semicolon to make MSVC happy.
-
-Fri Jul 25 14:50:08 1997 Felix Lee <flee@cygnus.com>
-
- * cisco-core.c: define signals for wingdb.
-
-Fri Jul 25 16:27:07 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * ecofflink.c (bfd_ecoff_debug_accumulate): Only merge files with
- the same number of aux entries.
-
-Fri Jul 25 08:22:15 1997 Jeffrey A Law (law@cygnus.com)
-
- * som.c (hppa_som_gen_reloc_type): Use R_DATA_EXPR for the
- difference of two symbols if the relocation size is 32 bits.
- (som_write_fixups): Handle R_DATA_EXPR.
-
-Wed Jul 23 16:08:02 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * coff-i386.c (coff_i386_reloc): Don't offset a common symbol by
- its value if COFF_WITH_PE is defined.
-
-Tue Jul 22 17:19:45 1997 Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>
-
- * coff-stubgo32.c: New file.
- * go32stub.h: New file.
- * coff-i386.c: If COFF_GO32_EXE, include coff/go32exe.h.
- * coffswap.h (coff_swap_filehdr_in): Invoke
- COFF_ADJUST_FILEHDR_IN_PRE and COFF_ADJUST_FILEHDR_IN_POST if they
- are defined.
- (coff_swap_filehdr_out): Invoke COFF_ADJUST_FILEHDR_OUT_PRE and
- COFF_ADJUST_FILEHDR_OUT_POST if they are defined.
- (coff_swap_aux_in): Invoke COFF_ADJUST_AUX_IN_PRE and
- COFF_ADJUST_AUX_IN_POST if they are defined.
- (coff_swap_aux_out): Invoke COFF_ADJUST_AUX_OUT_PRE and
- COFF_ADJUST_AUX_OUT_POST if they are defined.
- (coff_swap_scnhdr_in): Invoke COFF_ADJUST_SCNHDR_IN_PRE and
- COFF_ADJUST_SCNHDR_IN_POST if they are defined.
- (coff_swap_scnhdr_out): Invoke COFF_ADJUST_SCNHDR_OUT_PRE and
- COFF_ADJUST_SCNHDR_OUT_POST if they are defined.
- * targets.c (go32stubbedcoff_vec): Declare.
- (bfd_target_vector): Add go32stubbedcoff_vec.
- * configure.in (go32coff_vec): New target vector.
- (go32stubbedcoff_vec): Likewise.
- * config.bfd (i[3456]86-*-msdosdjgpp*): New target.
- (i[3456]86-*-go32*): Change to be like new msdosdjgpp*.
- * Makefile.in: Rebuild dependencies.
- (BFD32_BACKENDS): Add coff-stubgo32.o.
- (BFD32_BACKENDS_CFILES): Add coff-stubgo32.c.
- (HFILES): Add go32stub.h.
-
-Tue Jul 22 15:09:12 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Check for fdopen.
- * configure, config.in: Rebuild.
- * opncls.c (bfd_fdopenr): Check HAVE_FDOPEN rather than VMS or
- __GO32__. Reindent a bit.
+ * acinclude.m4 (BFD_CC_FOR_BUILD): Change to use conftest, and to
+ look for generated file correctly.
+ * aclocal.m4, configure: Rebuild.
-Sun Jul 20 20:05:20 1997 Ian Lance Taylor <ian@cygnus.com>
+1999-08-02 Mark Mitchell <mark@codesourcery.com>
+
+ * elf32-mips.c (_bfd_mips_elf_relocate_section): Handle R_MIPS_26
+ and R_MIPS16_26 relocations correctly when relocating.
+ (_bfd_mips_elf_check_relocs): Don't assume that R_MIPS_CALL_HI16
+ and R_MIPS_CALL_LO16 are for global symbols.
+
+1999-08-02 Jakub Jelinek <jj@ultra.linux.cz>
+
+ * elflink.h (elf_bfd_final_link): Copy the whole isym, not just
+ some fields.
+ * elf64-sparc.c (sparc64_elf_output_arch_syms): Declare used
+ variables and initialize them.
+
+1999-08-01 Mark Mitchell <mark@codesourcery.com>
+
+ * elf32-mips.c (_bfd_mips_elf_final_link): Handle the case where
+ there are no global symbols requiring GOT entries.
+ (_bfd_mips_elf_size_dynamic_sections): Likewise.
+ (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
+ (_bfd_mips_elf_finish_dynamic_sections): Likewise.
+
+ * elf32-mips.c (mips_elf_calculate_relocation): Undefined weak
+ symbols are considered to have the value zero.
+ (_bfd_mips_elf_relocate_section): Don't try to perform a
+ relocation for an undefined symbol.
+ (_bfd_mips_elf_check_relocs): Allocate locate GOT space for local
+ GOT16 relocations.
+
+1999-07-30 Jakub Jelinek <jj@ultra.linux.cz>
+
+ * elf64-sparc.c (sparc64_elf_build_plt): Cosmetic change - ABI
+ wants ba,a,pt %xcc instead of %icc.
+ Emit correct .PLT0-(.PLTN+4) initial value into the pointer slots
+ of large PLT entries.
+ (sparc64_elf_plt_ptr_offset): Fix calculation.
+ (sparc64_elf_finish_dynamic_symbol): Negative value of R_SPARC_JMP_SLOT
+ addend should be relative to load address, not .plt section start.
+ (sparc64_elf_size_info): Sparc64 uses 32bit .hash entries.
+
+1999-07-30 Jakub Jelinek <jj@ultra.linux.cz>
+
+ * elf-bfd.h (struct elf_backend_data): Add
+ print_symbol_all and output_arch_syms backend methods.
+ * elfxx-target.h: Likewise.
+ * elf64-sparc.c (sparc64_elf_bfd_link_hash_table_create,
+ sparc64_elf_add_symbol_hook, sparc64_elf_output_arch_syms,
+ sparc64_elf_get_symbol_type, sparc64_elf_symbol_processing): New
+ functions.
+ (sparc64_elf_size_dynamic_sections): Leave space for STT_REGISTER
+ symbols in .dynsym, add their names into .dynstr. Put those symbols
+ into dynlocal.
+ (sparc64_elf_finish_dynamic_sections): Fix up DT_SPARC_REGISTER
+ pointers to STT_REGISTER symbols in dynsym section.
+ (sparc64_elf_print_symbol_all): New function.
+ * elf.c (bfd_elf_print_symbol): Allow special backend symbol
+ printing using the print_symbol_all hook.
- * sunos.c (sunos_create_dynamic_sections): Set SEC_LINKER_CREATED
- flag for newly created sections.
- (sunos_add_dynamic_symbols): Don't discard newly created sections
- if shared library is dynobj.
+1999-07-30 Catherine Moore <clm@cygnus.com>
-Mon Jul 14 15:33:55 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-arm.h (elf32_arm_check_relocs): Use r_offset for
+ R_ARM_GNU_VTENTRY.
- * elf.c (map_sections_to_segments): When checking whether
- including a section in a segment would force us to skip a page,
- align the address of the next segment to avoid wraparound
- problems.
+1999-07-29 Richard Henderson <rth@cygnus.com>
-Mon Jul 7 16:41:20 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-mips.c (_bfd_mips_elf_final_link): Only re-sort dynsyms if
+ dynamic_sections_created.
- * coff-i386.c (coff_i386_is_local_label_name): New static function
- if TARGET_UNDERSCORE.
- (coff_bfd_is_local_label_name): Define if TARGET_UNDERSCORE.
- (i386coff_vec): Add SEC_CODE and SEC_DATA to section_flags.
+1999-07-29 Richard Henderson <rth@cygnus.com>
-Mon Jun 30 14:29:26 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-mips.c (mips_info_to_howto_rel): Split out switch to ...
+ (mips_rtype_to_howto): ... new function.
+ (_bfd_mips_elf_relocate_section): Use it.
- * elf32-m68k.c (howto_table): Use complain_overflow_bitfield, not
- complain_overflow_signed, for 32 bit PC relative relocations.
+1999-07-28 Mark Mitchell <mark@codesourcery.com>
-Thu Jun 26 01:26:31 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-mips.c (_bfd_mips_elf_relocate_section): Fix typo.
- * elflink.h (elf_link_add_object_symbols): When a version
- indirection symbol is overridden, make the original symbol point
- at the real overriding symbol.
+1999-07-27 Nick Clifton <nickc@cygnus.com>
- * elf.c (bfd_elf_string_from_elf_section): Check for an invalid
- string index.
+ Patch generated by Bernd Schmidt. <bernds@cygnus.co.uk>
+
+ * coff-arm.c (coff_arm_is_local_label_name): Change to strip
+ out only symbols that start with LOCAL_LABEL_PREFIX followed by 'L'.
- * elflink.h (elf_link_output_extsym): Use the right section for a
- common symbol.
- * elf32-mips.c (mips_elf_link_output_symbol_hook): If a common
- symbol was in .scommon, mark it as SHN_MIPS_SCOMMON.
+1999-07-23 Donn Terry <donn@interix.com>
-Wed Jun 25 12:43:10 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+ * libcoff-in.h (coff_link_hash_entry): Add coff_link_hash_flags
+ field, and define COFF_LINK_HASH_PE_SECTION_SYMBOL.
+ * cofflink.c (coff_link_add_symbols): If PE, handle section
+ symbols specially.
+ * libcoff.h: Rebuild.
- * elflink.h (elf_merge_symbols): Resolve indirect and warning
- symbols before checking for new symbols.
+ * config.bfd (i[3456]86-*-interix*): New target.
- * elfcore.h (elf_corefile_note): Move out of HAVE_SYS_PROCFS_H.
+1999-07-21 Mark Elbrecht <snowball3@bigfoot.com>
-Tue Jun 24 11:20:43 1997 Ian Lance Taylor <ian@cygnus.com>
+ * coffcode.h (styp_to_sec_flags): If COFF_LONG_SECTION_NAMES and
+ COFF_SUPPORT_GNU_LINKONCE, mark sections whose names begin with
+ .gnu.linkonce with SEC_LINKONCE and SEC_LINK_DUPLICATES_DISCARD.
+ * coff-go32.c: (COFF_LONG_SECTION_NAMES): Define.
+ (COFF_SUPPORT_GNU_LINKONCE): Define.
+ * coff-stgo32.c: (COFF_LONG_SECTION_NAMES): Define.
+ (COFF_SUPPORT_GNU_LINKONCE): Define.
- * coffgen.c (coff_object_p): Read the f_opthdr bytes from the
- file, not aoutsz bytes (they are different in XCOFF .o files).
+1999-07-21 Ian Lance Taylor <ian@zembu.com>
- * xcofflink.c (xcoff_link_add_symbols): Permit symbols to be
- redefined by objects included from archives.
+ From Mark Elbrecht:
+ * makefile.dos: Remove; obsolete.
+ * configure.bat: Remove; obsolete.
-Mon Jun 23 18:03:27 1997 Ian Lance Taylor <ian@cygnus.com>
+1999-07-21 H.J. Lu <hjl@gnu.org>
- * elflink.h (elf_merge_symbol): In the case of a new defined
- symbol overriding an old defined symbol, return the hash table
- entry which we modify, even if it is the target of an
- indirection.
- (elf_link_add_object_symbols): If the real name of the symbol gets
- overridden, convert the versioned symbol into an indirect symbol
- to the real symbol.
+ * config.bfd (i[3456]86-*-vxworks*): Add targ_underscore=yes.
- * elflink.h (elf_merge_symbol): New static function, broken out of
- elf_link_add_object_symbols.
- (elf_link_add_object_symbols): Call it.
+1999-07-21 Philippe De Muyter <phdm@macqel.be>
-Sun Jun 22 19:40:57 1997 Ian Lance Taylor <ian@cygnus.com>
+ * cofflink.c (_bfd_coff_generic_relocate_section): Issue an error
+ message and fail if a symbol index is out of range.
- * coff-i386.c (i3coff_object_p): If COFF_IMAGE_WITH_PE, hack to
- handle case where COFF filehdr does not immediately follow PE
- header.
- * coffgen.c (coff_object_p): Remove useless seek to current
- location.
-
-Wed Jun 18 19:03:38 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * linker.c (link_action): Change COMMON_ROW/indr to from CREF to
- REFC.
-
-Tue Jun 17 11:55:02 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * cofflink.c (_bfd_coff_link_input_bfd): If stripping debugging
- symbols, skip N_ABS symbols with debugging storage classes.
-
-Mon Jun 16 18:56:27 1997 Geoff Keating <geoffk@ozemail.com.au>
-
- * elf32-ppc.c (ppc_elf_relocate_section): Don't emit R_PPC_REL*
- relocs in shared libraries which refer to local symbols. Cope
- with addend when processing a GOT relocation.
-
- * elf32-ppc.c (ppc_elf_size_dynamic_sections): Only create symbols
- for sections that the linker didn't create.
- (ppc_elf_finish_dynamic_sections): Only try to write out a section
- symbol if it was created in ppc_elf_size_dynamic_sections.
- (ppc_elf_relocate_section): Complain if we have to generate a reloc
- relative to a section for which we didn't output a symbol.
-
- * elf32-ppc.c (ppc_elf_size_dynamic_sections): Clean up. PLT
- relocs are 'rela' relocs, like everything else. .rela.plt is not
- a read-only section, so we don't have to special-case it.
-
- * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Entries in the
- .rela.bss section are (of course) 'rela' relocs not 'rel' relocs.
-
- * elf32-ppc.c (ppc_elf_check_relocs): Initialise srelgot.
- (ppc_elf_relocate_section): @got offsets are 4 from start of the
- actual .got section.
- * elflink.c (_bfd_elf_create_got_section): The three reserved
- words start from the symbol '_GLOBAL_OFFSET_TABLE_'.
-
- * elf32-ppc.c (ppc_elf_size_dynamic_sections): '.rela' is 5
- characters, not 4.
-
- * elf32-ppc.c (ppc_elf_check_relocs): Use
- _bfd_elf_create_got_section to create the GOT rather than
- ppc_elf_create_linker_section. Create the '.rela.got' section
- ourselves.
- (ppc_elf_finish_dynamic_symbol): Set up GOT relocations when a
- symbol has a GOT entry.
- (ppc_elf_relocate_section): Record when a symbol is used through
- the GOT, and allocate space in the GOT for each such symbol.
- (ppc_elf_adjust_dynamic_symbol): Delete unused .got.plt stuff.
- (ppc_elf_create_linker_section): Delete unused LINKER_SECTION_GOT
- stuff.
-
- * elf32-ppc.c (ppc_elf_howto_raw): GOT16_HA relocs should be
- treated in a similar way to ADDR16_HA relocs.
- (ppc_elf_relocate_section): PLTREL24 relocs do not get copied into
- shared objects; the linker must deal with them.
- (ppc_elf_create_linker_section): Stop setting
- _GLOBAL_OFFSET_TABLE_ to the wrong value; delete unused
- LINKER_SECTION_PLT stuff.
- (ppc_elf_check_relocs): Delete unused LINKER_SECTION_PLT stuff.
- (ppc_elf_finish_dynamic_sections): Use BFD calls to get GOT
- section, not ELF-specific calls.
- (elf_backend_plt_not_loaded): Set to 1.
- (elf_backend_got_symbol_offset): Set to 4.
- * elf-bfd.h (elf_backend_data): Add 'plt_not_loaded' member
- for when ld.so fills in the PLT; and 'got_symbol_offset' member.
- * elflink.c (_bfd_elf_create_dynamic_sections): Apply
- plt_not_loaded member.
- (_bfd_elf_create_got_section): Apply got_symbol_offset.
- * elfxx-target.h (elf_backend_plt_not_loaded): Set default to
- 'loaded'.
- (elf_backend_G_O_T_offset): Set default to 0.
- (elfNN_bed): Set added fields.
-
- * elf32-ppc.c (ppc_elf_size_dynamic_sections): Was setting
- DT_RELENT in shared objects; should be DT_RELAENT.
-
- * elf32-ppc.c (ppc_elf_relocate_section): Propagate
- R_PPC_ADDR16_HA relocs to shared objects. Cope with case where
- such a reloc (in a non-shared object) refers to a symbol that's
- not defined.
-
-Mon Jun 16 14:42:14 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
-
- * elfcode.h (put_signed_word): Define.
- (get_signed_word): Define.
- (elf_swap_reloca_in): Use get_signed_word for the r_addend field.
- (elf_swap_reloca_out): Use put_signed_word for the r_addend
- field.
- * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): Use
- bfd_get_signed_32 to set the r_addend field.
- * elf64-mips.c (mips_elf64_swap_reloca_in): Use
- bfd_h_get_signed_64 to set the r_addend field.
-
-Mon Jun 16 12:31:29 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * elf32-i386.c (elf_i386_relocate_section): When generating a
- shared library, do the relocation if the input section is not
- allocated in memory.
-
- * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Call
- elf_link_assign_sym_version before elf_adjust_dynamic_symbol.
- (elf_fix_symbol_flags): New static function, broken out of
- elf_adjust_dynamic_symbol.
- (elf_adjust_dynamic_symbol): Call elf_fix_symbol_flags.
- (elf_link_assign_sym_version): Likewise. Permit a symbol to be
- forced local even if NEEDS_PLT is set. When forcing a symbol to
- be local, clear NEEDS_PLT.
- (elf_link_output_extsym): Remove unused local bed.
-
-Wed Jun 11 22:44:20 1997 Jeffrey A Law (law@cygnus.com)
-
- * elf32-mn10300.c (elf32_mn10300_link_hash_entry): New structure
- for derived elf linker hash table entries. References to
- elf_link_hash_entry changed appropriately.
- (elf32_mn10300_link_hash_table): New structure for derived elf
- linker hash table.
- (elf32_mn10300_hash_table): Define.
- (elf32_mn10300_link_hash_traverse): Likewise.
- (elf32_mn10300_link_hash_newfunc): New function.
- (elf32_mn10300_link_hash_table_create): Likewise.
- (elf32_mn10300_finish_hash_table_entry): Likewise.
- (mn10300_elf_relax_section): Handle "call" -> "calls", removal
- of prologue code, and call:32->call:16 relaxing.
- (compute_function_info: New function.
- (bfd_elf32_bfd_ilink_hash_table_create): Define.
-
-Wed Jun 11 00:00:07 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * elflink.h (elf_link_output_extsym): Call finish_dynamic_symbol
- for a symbol which is being forced to be local.
- * elf32-i386.c (elf_i386_relocate_section): Write out the
- relocation value for a GOT reloc for a symbol which is turning
- into a local symbol.
- (elf_i386_finish_dynamic_symbol): If a symbol is turning into a
- local symbol, write out a RELATIVE reloc rather than a GLOB_DAT
- reloc.
- * elf32-m68k.c, elf32-sparc.c: Corresponding changes.
+1999-07-21 Ian Lance Taylor <ian@zembu.com>
- * elf32-i386.c (elf_i386_relocate_section): Get the relocation
- value if the symbol is turning into a local symbol.
- * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
- * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
-
-1997-06-10 22:58 Ulrich Drepper <drepper@cygnus.com>
-
- * elflink.h (elf_link_add_object_symbols): Also read verneed
- information by calling `_bfd_elf_slurp_version_tables'.
- (elf_link_add_object_symbols): For undefined symbols look for
- version information in the verneed records.
- (elf_link_add_object_symbols): Use soname of shared object
- for verneed record if it is available.
+ * elf32-mips.c (mips_elf_calculate_relocation): Get the GP value
+ when looking at a R_MIPS_GOT16 relocation.
-Tue Jun 10 11:13:03 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+1999-07-20 Nick Clifton <nickc@cygnus.com>
- * cpu-arm.c: Add prototypes for compatible and scan.
- * cofflink.c: Add prototype for mark_relocs.
+ * coff-m88k.c: Use CREATE_BIG_COFF_TARGET_VEC.
- * archive.c (bfd_special_undocumented_glue): Change filename to
- const pointer. Add prototype.
+Mon Jul 19 14:03:44 1999 Mark P. Mitchell <mark@codesourcery.com>
-Mon Jun 9 12:34:21 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+ * elf32-mips.c (_bfd_mips_elf_final_link): Restore setting of GP
+ removed in previous change.
+ (_bfd_mips_elf_relocate_section): Adjust GP relative relocations
+ in relocateable output.
- * elflink.h (elf_link_add_object_symbols): Ignore relocations of
- sections that will be discarded.
+1999-07-19 Ian Lance Taylor <ian@zembu.com>
-1997-06-06 22:58 Ulrich Drepper <drepper@cygnus.com>
+ * coff-m88k.c (m88kbcs_vec): Initialize new field of bfd_target
+ structure.
- * elflink.h (elf_link_find_version_dependencies): When searching
- for known version symbol skip non-matching verdef records, not
- matching records.
+ * elflink.h (elf_merge_symbol): Do merge symbols from the same BFD
+ if they appear to be specially created by the linker.
-Thu Jun 5 15:52:45 1997 Ian Lance Taylor <ian@cygnus.com>
+1999-07-19 Nick Clifton <nickc@cygnus.com>
- * cofflink.c (_bfd_coff_generic_relocate_section): Write a long,
- not a bfd_vma, to the base file, to match how dlltool reads it.
-
-Tue Jun 3 16:57:45 1997 Nick Clifton <nickc@cygnus.com>
-
- * reloc.c: Add thumb relocations.
+ * targets.c (alternative_target): New field in bfd_target
+ structure.
+ (bfd_search_for_target): New function: Find a target that
+ satisifies a search function.
+ * bfd-in2.h: Regenerate.
- * bfd-in2.h: Add Thumb relocations.
+ * elfxx-target.h: Initialise the alternative_target field of
+ the bfd_target structures to point to the other target (if
+ defined).
+ * nlm-target.h: Initialise the alternative_target field of
+ the bfd_target structures to point to the other target (if
+ defined).
+
+ * coffcode.h (CREATE_BIG_COFF_TARGET_VEC): New macro.
+ (CREATE_LITTLE_COFF_TARGET_VEC): New macro.
+
+ * aix386-core.c: Initialise new field of bfd_target structure.
+ * aout-adobe.c: Initialise new field of bfd_target structure.
+ * aout-arm.c: Initialise new field of bfd_target structure.
+ * aout-target.h: Initialise new field of bfd_target structure.
+ * aout-tic30.c: Initialise new field of bfd_target structure.
+ * binary.c: Initialise new field of bfd_target structure.
+ * bout.c: Initialise new field of bfd_target structure.
+ * cisco-core.c: Initialise new field of bfd_target structure.
+ * coff-a29k.c: Use CREATE_BIG_COFF_TARGET_VEC.
+ * coff-alpha.c: Initialise new field of bfd_target structure.
+ * coff-apollo.c: Use CREATE_BIG_COFF_TARGET_VEC.
+ * coff-arm.c: Use CREATE_{BIG|LITTLE}_COFF_TARGET_VEC.
+ * coff-h8300.c: Use CREATE_BIG_COFF_TARGET_VEC.
+ * coff-h8500.c: Use CREATE_BIG_COFF_TARGET_VEC.
+ * coff-i386.c: Initialise new field of bfd_target structure.
+ * coff-i860.c: Initialise new field of bfd_target structure.
+ * coff-i960.c: Use CREATE_LITTLE_COFF_TARGET_VEC.
+ * coff-m68k.c: Use CREATE_BIG_COFF_TARGET_VEC.
+ * coff-mcore.c: Use CREATE_{BIG|LITTLE}_COFF_TARGET_VEC.
+ * coff-mips.c: Initialise new field of bfd_target structure.
+ * coff-ppc.c: Initialise new field of bfd_target structure.
+ * coff-rs6000.c: Initialise new field of bfd_target structure.
+ * coff-sh.c: Use CREATE_{BIG|LITTLE}_COFF_TARGET_VEC.
+ * coff-sparc.c: Use CREATE_BIG_COFF_TARGET_VEC.
+ * coff-tic30.c: Initialise new field of bfd_target structure.
+ * coff-tic80.c: Use CREATE_LITTLE_COFF_TARGET_VEC.
+ * coff-w65.c: Use CREATE_LITTLE_COFF_TARGET_VEC.
+ * coff-we32k.c: Use CREATE_BIG_COFF_TARGET_VEC.
+ * coff-z8k.c: Use CREATE_BIG_COFF_TARGET_VEC.
+ * hppabsd-core.c: Initialise new field of bfd_target structure.
+ * hpux-core.c: Initialise new field of bfd_target structure.
+ * i386msdos.c: Initialise new field of bfd_target structure.
+ * i386os9k.c: Initialise new field of bfd_target structure.
+ * ieee.c: Initialise new field of bfd_target structure.
+ * ihex.c: Initialise new field of bfd_target structure.
+ * irix-core.c: Initialise new field of bfd_target structure.
+ * mipsbsd.c: Initialise new field of bfd_target structure.
+ * netbsd-core.c: Initialise new field of bfd_target structure.
+ * oasys.c: Initialise new field of bfd_target structure.
+ * osf-core.c: Initialise new field of bfd_target structure.
+ * ppcboot.c: Initialise new field of bfd_target structure.
+ * ptrace-core.c: Initialise new field of bfd_target structure.
+ * sco5-core.c: Initialise new field of bfd_target structure.
+ * som.c: Initialise new field of bfd_target structure.
+ * srec.c: Initialise new field of bfd_target structure.
+ * tekhex.c: Initialise new field of bfd_target structure.
+ * trad-core.c: Initialise new field of bfd_target structure.
+ * versados.c: Initialise new field of bfd_target structure.
+ * vms.c: Initialise new field of bfd_target structure.
+
+1999-07-19 Andreas Schwab <schwab@suse.de>
+
+ * elflink.h (elf_bfd_final_link): Remove unused variables rel_hash
+ and rel_hdr.
+
+Sat Jul 17 02:28:28 1999 Mark P. Mitchell <mark@codesourcery.com>
+
+ * elflink.h (elf_link_adjust_relocs): New function.
+ (elf_bfd_final_link): Use it.
+ (elf_link_input_bfd): Deal with the fact that there can be
+ two relocation sections for a single section.
+ (elf_reloc_link_order): Likewise.
- * libbfd.h: Add Thumb relocations.
+ * elf32-mips.c (_bfd_mips_elf_final_link): Don't set GP for
+ a relocateable object.
+ (_bfd_mips_elf_relocate_section): Handle relocateable links.
-Mon Jun 2 10:41:52 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+1999-07-16 Jakub Jelinek <jj@ultra.linux.cz>
- * cpu-m68k.c (arch_info_struct): Fix 68060 cpu name.
+ * elf64-sparc.c (sparc64_elf_info_to_howto): Use ELF64_R_TYPE_ID.
+ (sparc64_elf_get_reloc_upper_bound,
+ sparc64_elf_get_dynamic_reloc_upper_bound,
+ sparc64_elf_slurp_one_reloc_table, sparc64_elf_slurp_reloc_table,
+ sparc64_elf_canonicalize_dynamic_reloc, sparc64_elf_write_relocs):
+ New functions.
+ (sparc64_elf_check_relocs, sparc64_elf_relocate_section): Use
+ ELF64_R_TYPE_ID/DATA where appropriate.
-Fri May 30 12:46:27 1997 Ian Lance Taylor <ian@cygnus.com>
+1999-07-16 Jakub Jelinek <jj@ultra.linux.cz>
- * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Set dynindx
- for a section even if it is not loaded.
+ * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Remove
+ DT_SPARC_PLTFMT.
- * cofflink.c (coff_link_add_symbols): If PE file, don't subtract
- section VMA.
- (_bfd_coff_link_input_bfd): Separate section VMA handling for
- input and output files.
- (_bfd_coff_generic_relocate_section): Check whether input file,
- not output file, is a PE file.
+1999-07-16 Ian Lance Taylor <ian@zembu.com>
-Wed May 28 15:48:43 1997 Nick Clifton <nickc@cygnus.com>
+ * elf32-mips.c (mips_elf_local_relocation_p): New static
+ function.
+ (mips_elf_next_lo16_addend): Call bfd_set_error on failure.
+ (mips_elf_calculate_relocation): Use mips_elf_local_relocation_p.
+ Always set *require_jalxp.
+ (mips_elf_stub_section_p): Mark abfd parameter as unused.
+ (_bfd_mips_elf_relocate_section): Only look for LO16 following
+ GOT16 if the GOT16 is against a local symbol. Don't return false
+ for an undefined symbol. If there is an overflow, assert that we
+ have a name.
- * coff-arm.c: (coff_arm_bfd_set_private_flags): Make static.
+1999-07-16 Andreas Schwab <schwab@suse.de>
-Wed May 28 16:16:04 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elflink.h (elf_link_record_local_dynamic_symbol): Remove unused
+ variables `link' and `elfsec'.
+ (elf_bfd_final_link): Remove unused variable `os'.
- * coff-i386.c (coff_i386_reloc): Don't just exit if we see an
- R_IMAGEBASE reloc.
+Thu Jul 15 17:55:31 1999 Mark P. Mitchell <mark@codesourcery.com>
-Wed May 28 09:48:43 1997 Nick Clifton <nickc@cygnus.com>
+ * elf32-mips.c (_bfd_mips_elf_modify_segment_map): Don't require
+ a PT_PHDR program headers.
+ (_bfd_mips_elf_final_link): Don't assume there are going to be
+ section symbols when we're not building a shared object.
+ (_bfd_mips_elf_check_relocs): Make sure we have a GOT when
+ we need one.
- * cpu-arm.c (compatible): Add test for supersets of ARM
- architectures.
+1999-07-15 J.T. Conklin <jtc@redback.com>
-Tue May 27 19:42:03 1997 Bob Manson <manson@charmed.cygnus.com>
+ * config.bfd (i[3456]86-*-vxworks*): New target.
- * cofflink.c (_bfd_coff_final_link): Initialize global_to_static
- member.
+1999-07-15 Mark Mitchell <mark@codesourcery.com>
-Tue May 27 14:34:08 1997 Nick Clifton <nickc@cygnus.com>
+ * elf32-mips.c (mips_elf_stub_section_p): New function.
+ (mips_elf_calculate_relocation): Handle MIPS16 stub functions.
+ (mips_elf_relocate_section): Adjust calling sequence for
+ mips_elf_calculate_relocation and mips_elf_perform_relocation.
+ (mips_elf_perform_relocation): Turn `jal' into `jalx' where
+ required.
- * coff-arm.c (coff_arm_bfd_set_private_flags): Make global. It is
- called directly by gas/config/tc-arm.c.
+1999-07-15 Ian Lance Taylor <ian@zembu.com>
-Tue May 27 15:58:53 1997 Richard Henderson <rth@tamu.edu>
+ * configure.in: Bump version number to 2.9.5.
+ * configure: Rebuild.
- * elf64-alpha.c (PLT_ENTRY_*): Use a new thread-safe format.
- (elf64_alpha_finish_dynamic_symbol): Fill it in properly.
+Thu Jul 15 02:56:15 1999 Jeffrey A Law (law@cygnus.com)
-Mon May 26 14:05:13 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type, case R_HPPA): Handle
+ 64bit format.
+ (_bfd_elf_hppa_gen_reloc_type, case R_GOTOFF): Use base reloc type
+ to derive final type instead of hardwiring a selection.
- * coff-ppc.c (coff_ppc_relocate_section): If PE file, don't add
- section VMA.
+1999-07-14 Mark Mitchell <mark@codesourcery.com>
-Mon May 26 10:57:48 1997 Fred Fish <fnf@cygnus.com>
+ * elf32-mips.c (mips_elf_obtain_contents): Swap 16-bit halves of
+ things relocated by R_MIPS16_GPREL.
+ (mips_elf_perform_relocation): Likewise.
- * peicode.h (coff_bfd_print_private_bfd_data): #undef before #define.
- (coff_bfd_copy_private_bfd_data): Ditto.
- * coff-arm.c (coff_arm_bfd_merge_private_bfd_data): Make static.
- (coff_arm_bfd_print_private_bfd_data): Ditto.
- (coff_arm_bfd_set_private_flags): Ditto.
- (coff_arm_bfd_copy_private_bfd_data): Ditto.
+Wed Jul 14 15:23:19 1999 Jim Wilson <wilson@cygnus.com>
-Fri May 23 15:14:58 1997 Fred Fish <fnf@cygnus.com>
+ * elfxx-target.h (elfNN_bed): Add elf_backend_want_dynbss.
- * libcoff-in.h (struct coff_final_link_info): Add boolean
- global_to_static member for support of task linking.
- (_bfd_coff_write_task_globals): Add prototype.
- * libcoff.h: Regenerate.
- * coffcode.h (coff_write_object_contents): Use #ifdef to
- check RS6000COFF_C, to be consistent with all other uses
- in this file.
- * cofflink.c (_bfd_coff_final_link): If doing task linking,
- call _bfd_coff_write_task_globals.
- (_bfd_coff_link_input_bfd): If doing task linking, convert
- global functions to static.
- (_bfd_coff_write_global_sym): If doing task linking, convert
- global variables to static.
- (_bfd_coff_write_task_globals): New function.
+1999-07-14 Richard Henderson <rth@cygnus.com>
-Wed May 21 17:15:50 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-mips.c (struct mips_got_info): Add global_gotno.
+ (_bfd_mips_elf_size_dynamic_sections): Set it.
+ (_bfd_mips_elf_final_link): Re-sort; verify the got did not grow.
+ (mips_elf_sort_hash_table): Set max_non_got_dynindex based off
+ new argument max_local.
- * coffcode.h (coff_slurp_symbol_table): If COFF_WITH_PE or
- COFF_IMAGE_WITH_PE, don't subtract the section VMA from the symbol
- value.
- * coffgen.c (fixup_symbol_value): Add abfd parameter. Change all
- callers. If PE file, don't add section VMA.
- (coff_write_alien_symbol): If PE file, don't add section VMA.
- * cofflink.c (_bfd_coff_link_input_bfd): Likewise.
- (_bfd_coff_write_global_sym): Likewise.
- (_bfd_coff_generic_relocate_section): Likewise.
+1999-07-14 Mark Mitchell <mark@codesourcery.com>
- * peicode.h: Add & 0xffffffff when using ImageBase in case bfd_vma
- is 64 bits.
+ * elf32-mips.c (mips_elf_obtain_contents): Swap the 16-bit
+ subwords when handling an R_MIPS16_26 relocation.
+ (mips_elf_perform_relocation): Don't be paranoid abour right-shift
+ semantics.
+
+ * elf32-mips.c (elf_mips16_gprel_howto): Adjust src_mask and
+ dst_mask to match reality.
+ (_bfd_mips_elf_calculate_relocation): Handle R_MIPS16_GPREL.
+ (mips_elf_obtain_contents): Use bfd_get.
+ (mips_elf_perform_relocation): Handle R_MIPS16_GPREL.
+ (mips_elf_relocate_section): Likewise.
-Wed May 21 09:58:10 1997 Nick Clifton <nickc@cygnus.com>
+1999-07-13 Mark Mitchell <mark@codesourcery.com>
+
+ * elf32-mips.c (mips_elf_calculate_relocation): Handle R_MIPS16_26.
+ (mips_elf_relocate_section): Adjust calling sequence for
+ mips_elf_perform_relocation.
+ (mips_elf_perform_relocation): Take additional argument. Handle
+ R_MIPS16_26. Use bfd_put for convenience.
+
+1999-07-13 Richard Henderson <rth@cygnus.com>
+
+ * elf.c (assign_file_positions_for_segments): Thinko last change.
+ Always overwrite p_flags.
+
+1999-07-13 Richard Henderson <rth@cygnus.com>
+
+ * elf-bfd.h (struct elf_backend_data): Add want_dynbss.
+ * elflink.c (_bfd_elf_create_dynamic_sections): Only create
+ .dynbss and .rel[a].bss if want_dynbss.
+ * elfxx-target.h (elf_backend_want_dynbss): Provide default.
+
+1999-07-13 Richard Henderson <rth@cygnus.com>
+
+ * elf.c (assign_file_positions_for_segments): Don't overwrite p_flags.
+
+1999-07-13 Richard Henderson <rth@cygnus.com>
+
+ * elf-bfd.h (struct elf_link_local_dynamic_entry): New.
+ (struct elf_link_hash_table): Add dynlocal.
+ (_bfd_elf_link_lookup_local_dynindx): Prototype.
+ (_bfd_elf_link_adjust_dynindx): Delete.
+ (_bfd_elf_link_renumber_dynsyms): Prototype.
+ (_bfd_elf,link_record_local_dynamic_symbol): Prototype.
+ * elfcode.h (elf_link_record_local_dynamic_symbol): New alias.
+ * elflink.c (_bfd_elf_link_adjust_dynindx): Delete.
+ (_bfd_elf_link_lookup_local_dynindx): New function.
+ (elf_link_renumber_hash_table_dynsyms): New function.
+ (_bfd_elf_link_renumber_dynsyms): New function.
+ * elflink.h (elf_link_record_local_dynamic_symbol): New function.
+ (struct elf_assign_sym_version_info): Delete removed_dynamic.
+ (bfd_elf,size_dynamic_sections): Use _bfd_strip_section_from_output
+ instead of elf_link_remove_section_and_adjust_dynindices.
+ Remove removed_dynamic code. Use _bfd_elf_link_renumber_dynsyms.
+ (elf_link_assign_sym_version): Remove removed_dynamic code.
+ (elf_link_renumber_dynsyms): Delete.
+ (elf_bfd_final_link): Install section and local symbols into .dynsym.
+
+ * elf32-m68k.c (elf_m68k_adjust_dynindx): Delete.
+ (elf_m68k_size_dynamic_sections): Don't set section dynindicies.
+ (elf_m68k_finish_dynamic_sections): Don't write section dynsyms.
+ * elf32-mips.c: Similarly.
+ * elf32-ppc.c: Similarly.
+ * elf32-sparc.c: Similarly.
+ * elf64-alpha.c: Similarly.
+ * elf64-sparc.c: Similarly.
+
+1999-07-13 Mark Mitchell <mark@codesourcery.com>
+
+ * elf32-mips.c (mips_elf_calculate_relocation): Do not complain
+ when _gp_disp is undefined. Do not check R_MIPS_LO16 for overflow
+ when the relocation is against _gp_disp.
+
+1999-07-12 Mark Mitchell <mark@codesourcery.com>
+
+ * dwarf2.c (read_attribute): Support DW_FORM_ref8.
+ * elf32-mips.c (mips_elf_link_hash_entry): Change mips_32_relocs
+ to possibly_dynamic_relocs. Adjust usage throughout code.
+ (elf_mips_howto_table): Handle R_MIPS_64 correctly.
+ (elf_mips_ctor64_howto): Likewise.
+ (mips_elf_calculate_relocation): Handle R_MIPS_64 like R_MIPS_32.
+ Adjust indentation.
+ (mips_elf_relocate_section): Handle R_MIPS_64 in 32-bit mode.
+ (_bfd_mips_elf_check_relocs): Handle R_MIPS_64 like R_MIPS_32.
+ Use MIPS_ELF_GOT_SIZE to calculate the size of GOT entries.
+ * elf64-mips.c (elf_backend_may_use_rel_p): Define.
+
+1999-07-12 Ian Lance Taylor <ian@zembu.com>
- * cofflink.c (mark_relocs): Add new function to mark symbols which
- are used by relocations.
- (_bfd_coff_link_input_bfd): Add call to mark_relocs() and code to
- suppress the skipping of symbols that have thus been marked.
+ * Makefile.am: Rebuild dependencies.
+ * Makefile.in: Rebuild.
-Tue May 20 18:45:26 1997 Ian Lance Taylor <ian@cygnus.com>
+ * bfd-in.h: Remove tests of COFF_IMAGE_WITH_PE.
+ * bfd-in2.h: Rebuild.
- * coff-sh.c (sh_merge_private_data): New static function.
- (coff_bfd_merge_private_bfd_data): Define.
+ * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED
+ as appropriate. Use EMPTY_HOWTO as appropriate. Fill in
+ structure initializations. Add casts.
+ * reloc.c (EMPTY_HOWTO): Define.
+ * bfd-in2.h: Rebuild.
+ * coff-h8300.c (h8300_reloc16_extra_cases): Remove useless
+ comparisons against 0.
+ * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Change
+ previous_ibfd_e_flags to unsigned long.
+ * vms.h (struct vms_private_data_struct): Change section_count to
+ unsigned.
+ * vms-gsd.c (_bfd_vms_slurp_gsd): Change psect_idx to unsigned.
+ (_bfd_vms_write_gsd): Change symnum to unsigned.
+ * vms-hdr.c (_bfd_vms_write_hdr): Change symnum to unsigned.
+ * vms-tir.c (etir_sta): Change psect to unsigned.
+ (alloc_section): Change idx to unsigned.
+ (tir_sta, tir_ctl): Change psect to unsigned.
+ (_bfd_vms_write_tir): Change len and before to bfd_size_type.
+ * vms.c (priv_section_count): Change to unsigned.
+
+1999-07-12 Andreas Schwab <schwab@suse.de>
+
+ * elf32-m68k.c: Add some ATTRIBUTE_UNUSED.
+ * m68klinux.c: Likewise.
+
+1999-07-12 Ian Lance Taylor <ian@zembu.com>
+
+ * Many files: Changes to avoid gcc warnings: Remove unused local
+ variables. Add default case to enum switches.
+ * coff-arm.c (bfd_arm_allocate_interworking_sections): Only
+ compile if not COFF_IMAGE_WITH_PE.
+ (record_arm_to_thumb_glue, record_thumb_to_arm_glue): Likewise.
+ (bfd_arm_get_bfd_for_interworking): Likewise.
+ (bfd_arm_process_before_allocation): Likewise.
+ * epoc-pei-arm.c: Don't rename bfd_arm functions.
+ * pei-arm.c: Likewise.
+ * elf32-mips.c (mips_elf_link_hash_table_create): Don't declare.
+ (MIPS_ELF_ADD_DYNAMIC_ENTRY): Correct last change.
+ (mips_elf_got16_entry): Put parens around & in body of ==.
+ (mips_elf_calculate_relocation): Correct test for empty string.
+ * vms-gsd.c: Use _bfd_error_handler rather than fprintf to
+ stderr.
+ * vms-misc.c (_bfd_vms_length_hash_symbol): Correct sprintf
+ format.
-Fri May 16 10:23:03 1997 Jeffrey A Law (law@cygnus.com)
+1999-07-11 Ian Lance Taylor <ian@zembu.com>
- * elf-m10300.c (elf32_mn10300_relax_section): Read in all
- the symbols associated with each BFD.
- (mn10300_elf_relax_delete_bytes): Don't adjust the same symbol
- more than once.
- * elf-m10200.c: Likewise.
- * elf32-m32r.c: Likewise.
- * elf32-sh.c: Likewise.
+ * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED
+ as appropriate. Fill in structure initializations. Add variable
+ initializations. Add casts.
+ * dwarf1.c (parse_line_table): Change eachLine to unsigned long.
+ (dwarf1_unit_find_nearest_line): Change i to unsigned long.
-Fri May 16 12:10:52 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elf.c (bfd_elf_hash): Change parameter from unsigned char * to
+ char *.
+ * elf-bfd.h (bfd_elf_hash): Update declaration.
+ * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Remove casts
+ when calling bfd_elf_hash.
- * elflink.h (elf_link_add_object_symbols): Don't decrease the
- alignment of a common symbol. If two symbols that look like
- common symbols are found in two shared libraries, and the size is
- different, use the larger size, and warn if --warn-common. If a
- common symbol overrides a definition in a shared library, set the
- size to the larger size, and warn if --warn-common.
+1999-07-11 Mark Mitchell <mark@codesourcery.com>
-Thu May 15 14:31:28 1997 Nick Clifton <nickc@cygnus.com>
+ * libbfd.c (bfd_put_8): Make it of type `void'.
+ * bfd-in2.h: Regenerated.
+ * elf32-mips.c (MIPS_ELF_ADD_DYNAMIC_ENTRY): Conditionalize
+ for 32-bit hosts.
+ (_bfd_mips_elf_final_link): Likewise.
+
+ * elflink.h (elf_link_read_relocs_from_section): Be type-correct.
+
+Thu Jul 8 12:32:23 1999 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * config.bfd (hppa*-*-linux-gnu*): New target
+
+1999-07-07 Mark Mitchell <mark@codesourcery.com>
+
+ * elf-bfd.h (_bfd_mips_elf_section_from_shdr): Constify.
+ (_bfd_mips_elf_create_dynamic_sections): New function.
+ (_bfd_mips_elf_add_symbol_hook): Likewise.
+ (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
+ (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
+ (_bfd_mips_elf_finish_dynamic_sections): Likewise.
+ (_bfd_mips_elf_gc_mark_hook): Likewise.
+ (_bfd_mips_elf_gc_sweep_hook): Likewise.
+ (_bfd_mips_elf_always_size_sections): Likewise.
+ (_bfd_mips_elf_size_dynamic_sections): Likewise.
+ (_bfd_mips_elf_check_relocs): Likewise.
+ (_bfd_mips_elf_link_hash_table_create): Likewise.
+ (_bfd_mips_elf_print_private_data): Likewise.
+ (_bfd_mips_elf_link_output_symbol_hook): Likewise.
+ (_bfd_mips_elf_final_link): Likewise.
+ (_bfd_mips_elf_additional_program_headers): Likewise.
+ (_bfd_mips_elf_modify_segment_map): Likewise.
+ (_bfd_mips_elf_relocate_section): Likewise.
+ * elf32-mips.c (mips_elf32_object_p): Move contents into
+ _bfd_mips_elf_object_p.
+ (mips_elf_additional_program_headers): Rename to
+ _bfd_mips_elf_additional_program_headers.
+ (mips_elf_modify_segment_map): Rename to
+ _bfd_mips_elf_modify_segment_map.
+ (elf_mips_abi_name): Change prototype.
+ (mips_elf32_section_from_shdr): Merge into
+ _bfd_mips_elf_section_from_shdr.
+ (mips_elf32_section_processing): Merge into
+ _bfd_mips_elf_section_processing.
+ (mips_elf_final_link): Rename to _bfd_mips_elf_final_link. Invoke
+ the right back-end ELF linker.
+ (mips_elf_relocate_section): Rename to
+ _bfd_mips_elf_relocate_section. Clean up. Adjust for 64-bit code.
+ (mips_elf_link_output_symbol_hook): Rename to
+ _bfd_mips_elf_link_output_symbol_hook.
+ (mips_elf_create_dynamic_section): Rename to
+ _bfd_mips_elf_create_dynamic_section.
+ (mips_elf_check_relocs): Rename to _bfd_mips_elf_check_relocs.
+ Adjust for 64-bit code. Use mips_elf_got_section.
+ (mips_elf_adjust_dynamic_symbol): Rename to
+ _bfd_mips_elf_adjust_dynamic_symbol. Use
+ mips_elf_allocate_dynamic_relocations.
+ (mips_elf_finish_dynamic_symbol): Rename to
+ _bfd_mips_elf_finish_dynamic_symbol. Use mips_elf_got_section.
+ Adjust for 64-bit code.
+ (mips_elf_finish_dynamic_sections): Rename to
+ _bfd_mips_elf_finish_dynamic_sections. Adjust for 64-bit code.
+ (mips_elf_always_size_sections): Rename to
+ _bfd_mips_elf_always_size_sections.
+ (mips_elf_add_symbol_hook): Rename to
+ _bfd_mips_elf_add_symbol_hook.
+ (mips_elf_next_lo16_addend): Constify.
+ (mips_elf_calculate_relocation): Likewise.
+ (mips_elf_obtain_contents): Likewise.
+ (mips_elf_perform_relocation): Likewise.
+ (mips_elf_create_dynamic_relocation): Likewise.
+ (mips_elf_allocate_dynamic_relocations): New function.
+ (MIPS_ELF_REL_DYN_SECTION_NAME): New macro.
+ (MIPS_ELF_REL_SIZE): Likewise.
+ (MIPS_ELF_DYN_SIZE): Likewise.
+ (MIPS_ELF_GOT_SIZE): Likewise.
+ (MIPS_ELF_SYM_SIZE): Likewise.
+ (MIPS_ELF_LOG_FILE_ALIGN): Likewise.
+ (MIPS_ELF_GET_WORD): Likewise.
+ (MIPS_ELF_PUT_WORD): Likewise.
+ (MIPS_ELF_ADD_DYNAMIC_ENTRY): Likewise.
+ (STUB_LW): Conditionalize for 64-bit value.
+ (elf_mips_howto_table): Add R_MIPS_HIGHER and R_MIPS_HIGHEST
+ entries.
+ (_bfd_mips_elf_merge_private_bfd_data): Merge e_ident[EI_CLASS].
+ Check it for inconsistency.
+ (_bfd_mips_elf_print_private_bfd_data): Print ABI=64 for 64-bit
+ ABI.
+ (_bfd_mips_elf_fake_sections): Remove duplicate handling of
+ .msym.
+ (mips_elf_global_got_index): Use MIPS_ELF_GOT_SIZE.
+ (mips_elf_got_offset_from_index): Use misp_elf_got_section.
+ (mips_elf_create_local_got_entry): Use MIPS_ELF_GOT_SIZE.
+ (mips_elf_local_got_index): Likewise.
+ (mips_elf_got_page): Likewise.
+ (mips_elf_got_info): Likewise.
+ (mips_elf_create_dynamic_relocation): Handle 32-bit/64-bit split.
+ (ELF_DYNAMIC_INTERPRETER): Handle 64-bit code.
+ (mips_elf_create_dynamic_sections): Use MIPS_ELF_LOG_FILE_ALIGN,
+ instead of constant `2'.
+ (mips_elf_create_got_section): Tidy. Use MIPS_ELF_GOT_SIZE.
+ (mips_elf_create_msym_section): Use MIPS_ELF_LOG_FILE_ALIGN.
+ (mips_elf_size_dynamic_sections): Use
+ MIPS_ELF_REL_DYN_SECTION_NAME, MIPS_ELF_GOT_SIZE,
+ MIPS_ELF_ADD_DYNAMIC_ENTRY. Remove #if 0'd code.
+ Adjust all releveant entries in elf backend table.
+ * elf64-mips.c (mips_elf64_section_from_shdr): Remove.
+ (mips_elf64_section_processing): Likewise.
+ Adjust elf backend entries to use _bfd_mips_elf variants now
+ publicly available.
+
+ * elflink.h (elf_link_create_dynamic_sections): Handle non-standard
+ hash-entry sizes.
+ (size_dynamic_sections): Likewise.
+ (elf_link_output_extsym): Likewise.
+ * elf.c: (elf_fake_sections): Likewise.
+ * libbfd.c (bfd_get): New macro.
+ (bfd_put): Likewise.
+ * bfd-in2.h: Regenerated.
- * cpu-arm.c (compatible): Allow default machine to be polymorphed
- into any other machine type.
+1999-07-07 Mark Mitchell <mark@codesourcery.com>
- * coffcode.h (coff_set_flags): Initialise flags variable to 0.
+ * elf-bfd.h (elf_size_info): Add hash_entry_size,
+ int_rels_per_ext_rel, swap_dyn_out, swap_reloc_in, swap_reloc_out,
+ wap_reloca_in, and swap_reloca_out.
+ * elflink.h (elf_link_read_relocs_from_section): Adjust to handle
+ multiple internal relocations per external relocation.
+ (link_read_relocs): Likewise.
+ (elf_bfd_final_link): Likewise.
+ (elf_link_input_bfd): Likewise.
+ (elf_gc_mark): Likewise.
+ (elf_gc_smash_unused_vtentry_relocs): Likewise.
+ * elfcode.h (elf_swap_dyn_out): Adjust type to match
+ elf_swap_dyn_in.
+ (size_info): Add entries for new fields.
+ * elf64-mips.c (mips_elf64_swap_reloc_out): Enable.
+ (mips_elf64_be_swap_reloc_in): New function.
+ (mips_elf64_be_swap_reloc_out): Likewise.
+ (mips_elf64_be_swap_reloca_in): Likewise.
+ (mips_elf64_be_swap_reloca_out): Likewise.
+ (mips_elf64_size_info): Add entries for new fields.
+
+1999-07-07 Ian Lance Taylor <ian@zembu.com>
+
+ * elflink.h (elf_bfd_final_link): Assert that section reloc_count
+ field equals the new rel_count field.
+ (elf_link_input_bfd): When doing a relocateable link, use the new
+ rel_count field rather than the reloc_count field.
+ (elf_reloc_link_order): Likewise.
+ (elf_finish_pointer_linker_section): Likewise.
- * coff-arm.c (coff_arm_bfd_merge_private_bfd_data): When merging
- data into an unitialised destination set its machine type as well.
+ Based on patch from H.J. Lu <hjl@gnu.org>:
+ * elflink.h (elf_merge_symbol): Permit a non-weak definition in a
+ shared library to override a weak definition in a regular object.
-Thu May 15 16:40:20 1997 Ian Lance Taylor <ian@cygnus.com>
+Tue Jul 6 10:23:39 1999 Jeffrey A Law (law@cygnus.com)
- * elflink.h (elf_link_add_object_symbols): Force ELF symbol size
- to common symbol size. Consistently treat uninitialized symbols
- in shared objects as common symbols.
+ * libhppa.h: Revert July 2, 1999 patch.
-Fri May 9 10:15:27 1997 Nick Clifton <nickc@cygnus.com>
+ * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): T mode selectors
+ need to generate DLTIND relocations, not DLTREL relocations.
- * archures.c (constants): Added new constants to identify the
- type of the ARM architecture: bfd_mach_arm_2, bfd_mach_arm_2a,
- bfd_mach_arm_3, bfd_mach_arm_3M, bfd_mach_arm_4 and bfd_mach_arm_4T.
+1999-07-05 Nick Clifton <nickc@cygnus.com>
- * bfd-in2.h (constants): Added new constants to identify
- the type of the ARM architecture: bfd_mach_arm_2, bfd_mach_arm_2a,
- bfd_mach_arm_3, bfd_mach_arm_3M, bfd_mach_arm_4 and
- bfd_mach_arm_4T. This file is auto-magically generated from the
- archures.c file. This update is just to save work.
+ * coffcode.h (coff_set_arch_mach_hook): Recognise arm 5
+ architectures.
+ (coff_set_flags): Recognise arm 5 architectures.
- * coff-arm.c (coff_arm_bfd_merge_private_bfd_data,
- coff_arm_bfd_print_private_bfd_data,
- coff_arm_bfd_set_private_flags,
- coff_arm_bfd_copy_private_bfd_data): Added these new functions.
- (global): Macro redefinitions set up to use these new functions.
+ * cpu-arm.c: Add support for strongarm and arm9 cpus.
+ Add support for armv5 architecture.
- * coffcode.h (coff_mkobject_hook): Added call to
- coff_arm_bfd_set_private_flags().
- (coff_set_arch_mach_hook): Added code to set machine type based on
- bits stored in internal flags.
- (coff_set_flags): Added code to set the new bits in the flags
- field based on the machine number.
- (function definition macros): Made all function definition macros
- conditional so that they can be overridden by target specific
- files.
+ * archures.c: Add bfd_mach_arm_5 and bfd_mach_arm_5T.
+
+ * reloc.c: Add new, assembler only, ARM reloc:
+ BFD_RELOC_ARM_ADRL_IMMEDIATE.
+
+ * bfd-in2.h: Regenerate.
- * cpu-arm.c (compatible): Added this function. (arch_info_struct):
- Structure extended to include new types, one each for ARMv2,
- ARMv2a, ARMv3, ARMv3M, ARMv4 and ARMv4T.
+1999-07-02 Mark Mitchell <mark@codesourcery.com>
+
+ * dwarf2.c (parse_comp_unit): Add ABBREV_LENGTH parameter.
+ (_bfd_dwarf2_find_nearest_line): Add ADDR_SIZE parameter.
+ * elf.c (_bfd_elf_find_nearest_line): Pass it.
+ * elf32-arm.h (elf32_arm_find_nearest_line): Likewise.
+ * elf32-mips.c (ABI_64_P): New macro.
+ (IRIX_COMPAT): We are IRIX6-compatible if ABI_64_P.
+ (_bfd_mips_elf_find_nearest_line): Adjust call to
+ _bfd_dwarf2_find_nearest_line.
+ * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Update prototype.
+ * libbfd.h: Regenerated.
- * libcoff-in.h (struct coff_tdata): Added flags field.
+1999-07-02 Ian Lance Taylor <ian@zembu.com>
-Fri May 9 17:40:02 1997 Ian Lance Taylor <ian@cygnus.com>
+ * config.bfd: Add * at the end of i[3456]86-*-unixware.
- * config.bfd (i[3456]86-*-gnu*): Don't include Mach support.
+Fri Jul 2 12:21:10 1999 Jeffrey A Law (law@cygnus.com)
- * config.bfd: Change #if 0 around uses of host_aout_vec to #if
- HAVE_host_aout_vec.
+ * libhppa.h (HPPA_R_ARG_RELOC): Delete.
+ (HPPA_R_CONSTANT, HPPA_R_ADDEND): Likewise.
-Mon May 5 13:57:32 1997 Mike Meissner <meissner@cygnus.com>
+1999-07-01 Mark Mitchell <mark@codesourcery.com>
- * coffgen.c (coff_find_nearest_line): If there are no syments,
- just return false.
+ * elf-bfd.h (bfd_elf_section_data): Add rel_count and rel_count2
+ fields.
+ (_bfd_elf_init_reloc_shdr): New function.
+ * elf.c (_bfd_elf_new_section_hook): Use bfd_zalloc, rather than
+ bfd_alloc followed by memset.
+ (_bfd_elf_init_reloc_shdr): New function, split out from ...
+ (elf_fake_sections): Here.
+ (assign_section_numbers): Assign section numbers for the second
+ relocation section, if required.
+ * elflink.h (elf_link_output_relocs): New function.
+ (elf_link_size_reloc_section): Likewise.
+ (elf_bfd_final_link): Use elf_link_size_reloc_section.
+ (elf_link_input_bfd): Use elf_link_output_relocs.
+
+ * elf32-mips.c (_bfd_mips_elf_fake_sections): Use
+ _bfd_elf_init_reloc_shdr to initialize rel_hdr2.
+
+Thu Jul 1 13:58:48 1999 Jeffrey A Law (law@cygnus.com)
+
+ * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle R_PCREL_CALL
+ with 22bit format.
+
+1999-06-28 Mark Mitchell <mark@codesourcery.com>
+
+ * elf32-mips.c (mips_elf_got_info): Move declaration before
+ prototypes. Change global_gotsym to be a pointer to a hash entry,
+ rather than a number index.
+ (mips_elf_link_hash_entry): Move declaration before prototypes.
+ (mips_elf_irix6_finish_dynamic_symbol): New function.
+ (mips_elf_sign_extend): Likewise.
+ (mips_elf_high): Likewise.
+ (mips_elf_higher): Likewise.
+ (mips_elf_highest): Likewise.
+ (mips_elf_global_got_index): Likewise.
+ (mips_elf_local_got_index): Likewise.
+ (mips_elf_got_offset_from_index): Likeiwse.
+ (mips_elf_record_global_got_symbol): Likewise.
+ (mips_elf_got_page): Likewise.
+ (mips_elf_next_lo16_addend): Likewise.
+ (mips_elf_calculate_relocation): Likewise.
+ (mips_elf_obtain_contents): Likewise.
+ (mips_elf_perform_relocation): Likewise.
+ (mips_elf_assign_gp): Likewise.
+ (mips_elf_sort_hash_table_f): Likewise.
+ (mips_elf_sort_hash_table): Likewise.
+ (mips_elf_got_section): Likewise.
+ (mips_elf_got_info): Likewise.
+ (mips_elf_create_local_got_entry): Likewise.
+ (mips_elf_got16_entry): Likewise.
+ (mips_elf_create_dynamic_relocation): Likewise.
+ (elf_mips_howto_table): Add description of R_MIPS_SCN_DISP.
+ (mips_elf_final_gp): Use mips_elf_assign_gp.
+ (_bfd_mips_elf_symbol_processing): Don't move SHN_COMMON symbols
+ into SHN_SCOMMON automatically on IRIX6.
+ (mips_elf_add_symbol_hook): Likewise.
+ (mips_elf_relocate_section): Rewrite, using
+ mips_elf_calculate_relocation and mips_elf_perform_relocation.
+ (mips_elf_create_dynamic_section): Use MIPS_ELF_STUB_SECTION_NAME.
+ Don't deal with .rld_map on IRIX6.
+ (mips_elf_create_got_section): Adjust use of global_gotsym. Set
+ section flags appropriately for .got.
+ (mips_elf_check_relocs): Handle IRIX6 relocations making use of
+ the got. Call mips_elf_record_global_got_symbol and allocate
+ local got space appropriately.
+ (mips_elf_size_dynamic_sections): Use bfd_byte *, not unsigned
+ char *. Rework calculation of GOT size. Sort dynamic symbol
+ table entries so entries that do not require GOT entries appear at
+ the beginning. Don't use DT_MIPS_HIPAGENO on IRIX6. Remove dead
+ code dealing with DT_INIT and DT_FINI. Remove fiddling with
+ global_gotsym.
+ (mips_elf_finish_dynamic_symbol): Adjust creation of global GOT
+ entries.
+ (mips_elf_finish_dynamic_symbol): Use
+ mips_elf_irix6_finish_dynamic_symbol.
+ (mips_elf_finish_dynamic_sections): Correct off-by-one error
+ setting DT_MIPS_UNREFEXTNO. Adjust setting of DT_MIPS_GOTSYM for
+ change to global_gotsym. Set DT_MIPS_OPTIONS on IRIX6.
+
+1999-06-30 Ian Lance Taylor <ian@zembu.com>
+
+ * elf32-mips.c (mips_elf_final_link): Don't set CPIC when doing a
+ relocateable link. From Ralf Baechle <ralf@uni-koblenz.de>.
+
+1999-06-04 Philip Blundell <philb@gnu.org>
+
+ * elf32-arm.h (elf_backend_got_header_size): Define.
+ (elf_backend_plt_header_size): Likewise.
+
+1999-06-28 Jim Pick <jim@jimpick.com>
+
+ * elf32-arm.h (elf32_arm_relocate_section): Mind no_undefined
+
+Tue Jun 29 02:25:03 1999 Jeffrey A Law (law@cygnus.com)
+
+ * elf-hppa.c (elf_hppa_howto_table): Use bfd_elf_generic_reloc as
+ relocation function.
+ * elf32-hppa.c (hppa_elf_reloc): Kill unused/unwanted function.
+
+1999-06-27 Mark Mitchell <mark@codesourcery.com>
+
+ * elf32-mips.c (MIPS_ELF_SRDATA_SECTION_NAME): New macro.
+ (MIPS_ELF_OPTIONS_SECTION_NAME): Likewise.
+ (MIPS_ELF_STUB_SECTION_NAME): Likewise.
+ (_bfd_mips_elf_section_from_shdr): Use them.
+ (_bfd_mips_elf_fake_sections): Likewise. Add .srdata to the list
+ of GP-relative sections.
+ (_bfd_mips_elf_set_section_contents): Use them.
+ (_bfd_mips_elf_section_processing): Share code between .sdata and
+ .lit4/.lit8 sections. Set appropriate flags for .srdata.
+ (mips_elf_additional_program_headers): Add handling for
+ PT_MIPS_OPTIONS segment on IRIX6.
+ (mips_elf_modify_segment_map): Likeiwse.
+ (mips_elf_final_link): Set EF_MIPS_CPIC when required by the ABI.
+ Include the options sections on IRIX6. Don't look for GP-relative
+ sections by name; use SHF_MIPS_GPREL instead.
+ (ELF_DYNAMIC_INTERPRETER): Adjust to use /usr/lib32/libc.so.1 for
+ the N32 ABI.
+ (mips_elf_create_dynamic_sections): Don't muck about with section
+ alignments and such on IRIX6.
+ (mips_elf_adjust_dynamic_symbol): Use MIPS_ELF_STUB_SECTION_NAME.
+ (mips_elf_size_dynamic_sections): Likewise. Adjust to handle the
+ fact that ELF_DYNAMIC_INTERPRETER is no longer a constant. Use
+ bfd_zalloc rather than bfd_alloc and memset.
+ (mips_elf_finish_dynamic_symbol): Use MIPS_ELF_STUB_SECTION_NAME.
+ Don't assert the existence of .rld_map on IRIX6.
+ (mips_elf_finish_dynamic_sections): Use MIPS_ELF_STUB_SECTION_NAME.
+
+ * elf32-mips.c (mips_elf_adjust_dynindx): Remove.
+ (mips_elf_size_dynamic_sections): Use _bfd_elf_link_adjust_dynindx
+ instead.
-Mon May 5 18:18:45 1997 Philip Blundell <pjb27@cam.ac.uk>
+1999-06-26 Mark Mitchell <mark@codesourcery.com>
+
+ * elf32-mips.c (mips_elf_swap_msym_in): New function.
+ (mips_elf_swap_msym_out): New function.
+ (mips_elf_create_msym_section): Likewise.
+ (MIPS_ELF_MSYM_SECTION_NAME): New macro.
+ (_bfd_mips_elf_final_write_processing): Set sh_link for .msym.
+ (_bfd_mips_elf_section_from_shdr): Reject an SHT_MIPS_MSYM
+ section not named .msym.
+ (_bfd_mips_elf_fake_sections): Use MIPS_ELF_MSYM_SECTION_NAME, not
+ .msym directly. Set appropriate attributes for the .msym
+ section.
+ (mips_elf_link_hash_entry): Add min_dyn_reloc_index field.
+ (mips_elf_link_hash_newfunc): Clear it.
+ (mips_elf_create_dynamic_sections): Create the .msym section
+ on IRIX6.
+ (mips_elf_size_dynamic_sections): Allocate space for the
+ .msym section. Add a DT_MIPS_MSYM entry.
+ (mips_elf_finish_dynamic_symbol): Write out a .msym entry for
+ the symbol.
+ (mips_elf_finish_dynamic_sections): Assign a value for
+ DT_MIPS_MSYM. Add .msym entries for the section symbols as well.
- * config.bfd: cope with '*-*-linux-gnuaout' targets.
+ * elf32-mips.c (irix_compat_t): New enumeration.
+ (ABI_N32_P): New macro.
+ (IRIX_COMPAT): Likewise.
+ (SGI_COMPAT): Implement in terms of IRIX_COMPAT.
+ (mips_elf_relocate_section): Fix typo.
+
+1999-06-26 Mumit Khan <khan@xraylith.wisc.edu>
-Thu May 1 11:31:12 1997 Ian Lance Taylor <ian@cygnus.com>
+ * peicode.h (coff_swap_scnhdr_out): Mark non readonly BFD sections
+ as writable PE sections.
- * targmatch.sed: Add explicit \n characters to work around bug in
- HP/UX 10.20 sed program.
+1999-06-26 David Mosberger <davidm@hpl.hp.com>
-Wed Apr 30 12:27:03 1997 Ian Lance Taylor <ian@cygnus.com>
+ * dwarf2.c (struct arange): New type.
+ (struct comp_unit): Replace LOW and HIGH by member ARANGE.
+ (arange_add): New function.
+ (decode_line_info): Keep track of address ranges that a compilation
+ unit covers.
+ (comp_unit_contains_address): Return true if address is contained
+ in _any_ of the address ranges associated with a compilation unit.
+ (_bfd_dwarf2_find_nearest_line): Call comp_unit_find_nearest_line
+ on the first comp_unit that contains the address.
- * elf.c (copy_private_bfd_data): Cast csecs to avoid sign
- extension problems.
+1999-06-26 David Mosberger <davidm@hpl.hp.com>
-Tue Apr 22 12:06:08 1997 Ian Lance Taylor <ian@cygnus.com>
+ * dwarf2.c (struct dwarf2_debug): Add member dwarf_line_buffer.
+ (decode_line_info): Add variable STASH and initialize it to point
+ to the per-bfd dwarf2_debug info. Remove static variable
+ dwarf_line_buffer and use stash->dwarf_line_buffer in its place.
- * Makefile.in (do_maintainer_clean): Don't remove bfd-in2.h.
+1999-06-26 Ian Lance Taylor <ian@zembu.com>
-Mon Apr 21 11:21:31 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+ * elflink.h (elf_link_output_extsym): It's OK for a -Bsymbolic
+ shared library to have an undefined symbol.
- * elf32-m68k.c: Follow the last changes in elf32-i386.c:
- (struct elf_m68k_pcrel_relocs_copied, struct
- elf_m68k_link_hash_entry, struct elf_m68k_link_hash_table,
- elf_m68k_link_hash_traverse, elf_m68k_hash_table,
- elf_m68k_link_hash_newfunc, elf_m68k_link_hash_table_create,
- elf_m68k_discard_copies, bfd_elf32_bfd_link_hash_table_create):
- New definitions.
- (elf_m68k_check_relocs): If linking with -Bsymbolic, don't copy
- PC relative relocs for a global symbol defined in a regular
- object, and count the number of PC relative relocs copied for any
- global symbol.
- (elf_m68k_size_dynamic_sections): If linking with -Bsymbolic,
- traverse with elf_m68k_discard_copies.
+ From Franz Sirl <Franz.Sirl-kernel@lauterbach.com>:
+ * elf32-ppc.c (ppc_elf_relocate_section): Fix last patch.
-Sat Apr 19 22:50:14 1997 Ian Lance Taylor <ian@cygnus.com>
+Thu Jun 24 20:59:11 1999 Jeffrey A Law (law@cygnus.com)
- * elf32-i386.c (elf_i386_check_relocs): Only count PC relative
- relocs. From Jamie Lokier <jamie@rebellion.co.uk>.
+ * elf-hppa.c (elf_hppa_final_write_processing): New function.
+ * elf32-hppa.c: Remove everything related to symbol extension
+ sections & records. Use the common elf_hppa_final_write_processing.
- * coffcode.h (coff_compute_section_file_positions): Force the
- potential last byte in the file to be written out when
- COFF_IMAGE_WITH_PE.
+1999-06-22 Mark Mitchell <mark@codesourcery.com>
-Thu Apr 17 13:46:56 1997 Per Fogelstrom <pefo@openbsd.org>
+ * elflink.h (size_dynamic_sections): Use user-specified init/fini
+ functions instead of _init/_fini if requested.
- * configure.host (mips*-*-openbsd*): New host.
+1999-06-23 Ian Lance Taylor <ian@zembu.com>
-Thu Apr 17 11:10:54 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elf.c (bfd_section_from_shdr): Avoid crashing on a bogus sh_link
+ field.
- * elflink.h (elf_link_add_object_symbols): Only subtract the
- section VMA from the symbol value if this is a fully linked file.
+1999-06-22 Ian Lance Taylor <ian@zembu.com>
- * elf32-i386.c (struct elf_i386_pcrel_relocs_copied): Define.
- (struct elf_i386_link_hash_entry): Define.
- (struct elf_i386_link_hash_table): Define.
- (elf_i386_link_hash_traverse): Define.
- (elf_i386_hash_table): Define.
- (elf_i386_link_hash_newfunc): New static function.
- (elf_i386_link_hash_table_create): New static function.
- (elf_i386_check_relocs): If linking with -Bsymbolic, don't copy
- PC relative relocs for a global symbol defined in a regular
- object, and count the number of PC relative relocs copied for any
- global symbol.
- (elf_i386_size_dynamic_sections): If linking with -Bsymbolic,
- traverse with elf_i386_discard_copies.
- (elf_i386_discard_copies): New static function.
- (bfd_elf32_bfd_link_hash_table_create): Define.
+ From Franz Sirl <Franz.Sirl-kernel@lauterbach.com>:
+ * elf32-ppc.c (ppc_elf_size_dynamic_sections): Set unused dynindx
+ field to 0, not -1.
+ (ppc_elf_finish_dynamic_sections): Check for positive section
+ dynindx field, rather than comparing against -1.
+ (ppc_elf_relocate_section): Only return false if undefined_symbol
+ or reloc_overflow fail, not always upon encountering an error.
- From Gordon W. Ross <gwr@mc.com>:
- * aoutf1.h (MY_entry_is_text_address): Define if not defined.
- (sunos4_aout_backend): Use MY_entry_is_text_address.
+1999-06-22 Mark Mitchell <mark@codesourcery.com>
-Wed Apr 16 14:02:29 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elflink.h (link_read_relocs): Explicitly cast external_relocs to
+ bfd_byte * before performing pointer arithmetic.
- From Gordon W. Ross <gwr@mc.com>:
- * netbsd.h (N_SHARED_LIB): Define.
- (SEGMENT_SIZE): Don't define.
- * m68knetbsd.c (SEGMENT_SIZE): Don't define (revert change of
- April 11).
- * sparcnetbsd.c (TARGET_PAGE_SIZE): Define as 0x2000.
- (SEGMENT_SIZE): Don't define.
+Tue Jun 22 13:06:25 1999 Jeffrey A Law (law@cygnus.com)
- * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Set .rela.bss size
- to sizeof Rela structure, not sizeof Rel structure. From Gary
- Thomas <g.thomas@opengroup.org>.
+ * elf-hppa.h: New file. Common stuff for elf32 and elf64 PA
+ support.
+ * elf32-hppa.c: Include elf-hppa.h.
+ (ARCH_SIZE): Define.
+ (elf_hppa_reloc_type_lookup): Delete. Found in the common code
+ now.
+ (elf32_hppa_info_to_howto): Similarly.
+ (elf_hppa_howto_table): Similarly.
+ (elf_hppa_reloc_type_lookup): Similarly.
+ (hppa_elf_gen_reloc_type): Similarly.
+ * elf32-hppa.h (ELF_HOWTO_TALBE, N_PARISC_RELOCS): Delete.
-Tue Apr 15 11:50:37 1997 Ian Lance Taylor <ian@cygnus.com>
+1999-06-22 Nick Clifton <nickc@cygnus.com>
- * aout-target.h (MY(callback)): If entry_is_text_address, adjust
- whenever entry is larger than text address, but only by whole
- pages. From Gordon W. Ross <gwr@mc.com>.
+ * elf32-v850.c (v850_elf_final_link_relocate): Catch overflow
+ handling R_V850_22_PCREL relocation.
- * Makefile.in (install): Depend upon installdirs. Use
- mkinstalldirs to build $(oldincludedir).
- (installdirs): New target.
+1999-06-21 Ian Lance Taylor <ian@zembu.com>
- * elflink.h (elf_link_add_object_symbols): Don't call check_relocs
- if this is a debugging section which we are stripping.
+ * coff-arm.c (arm_emit_base_file_entry): Explicitly declare return
+ type.
-Mon Apr 14 12:39:30 1997 Richard Henderson <rth@tamu.edu>
+Sun Jun 20 14:13:57 1999 Richard Henderson <rth@cygnus.com>
- * elf64-alpha.c (elf64_alpha_object_p): Allocate the
- alpha-specific target data struct.
+ * section.c (_bfd_strip_section_from_output): Ignore sections
+ DISCARDed by the link script.
-Mon Apr 14 11:45:46 1997 Ian Lance Taylor <ian@cygnus.com>
+1999-06-19 Ian Lance Taylor <ian@zembu.com>
- From Thomas Graichen <graichen@rzpd.de>:
- * Makefile.in: Always use $(SHELL) when running move-if-change.
- * configure.in: Use ${CONFIG_SHELL} when running $ac_config_sub.
- * configure: Rebuild.
+ * elflink.h (elf_link_remove_section_and_adjust_dynindices):
+ Remove unused local variable spp.
-Fri Apr 11 15:43:24 1997 Ian Lance Taylor <ian@cygnus.com>
+ * xcofflink.c (bfd_xcoff_size_dynamic_sections): Don't crash if
+ the entry symbol is not set.
- * elfcode.h (elf_slurp_symbol_table): Only subtract the section
- VMA if this is an executable file or a shared object.
+Fri Jun 18 04:24:57 1999 Richard Henderson <rth@cygnus.com>
- * targets.c (netbsd_core_vec): Declare. From Gordon W. Ross
- <gwr@mc.com>.
+ * elf64-alpha.c (elf64_alpha_relocate_section): Don't adjust
+ GPDISP or LITUSE in a relocatable link.
- * libaout.h (struct aout_backend_data): Add entry_is_text_address
- field.
- * aout-target.h (SEGMENT_SIZE): Define to TARGET_PAGE_SIZE at the
- start of the file. Remove uses later on which switch using
- ifdef.
- (MY(callback)): Handle entry_is_text_address.
- (MY_entry_is_text_address): Define if not defined.
- (MY(backend_data)): Initialize new field.
- * aoutf1.h (sunos4_aout_backend): Likewise.
- * i386aout.c (MY(backend_data)): Likewise.
- * i386mach3.c (MY(backend_data)): Likewise.
- * mipsbsd.c (MY(backend_data)): Likewise.
- * sparclynx.c (sparclynx_aout_backend): Likewise.
- * netbsd.h (SEGMENT_SIZE): Define if not defined.
- (MY_entry_is_text_address): Define.
- * m68knetbsd.c (SEGMENT_SIZE): Define as 0x20000.
-
- * xcofflink.c (bfd_xcoff_import_symbol): Handle importing a symbol
- whose name starts with `.'.
-
-Fri Apr 11 11:57:15 1997 Niklas Hallqvist <niklas@appli.se>
-
- * config.bfd: (i[3456]86-*-openbsd*, m68*-*-openbsd*,
- mips*el*-*-openbsd*, mips*-*-openbsd*, ns32k-*-openbsd*,
- powerpc-*-*bsd*, sparc-*-openbsd*): New targets.
- * configure.in (i[3456]86-*-openbsd*, mips*-*-openbsd*,
- m68*-*-openbsd*, ns32k-*-openbsd*, powerpc-*-*bsd*,
- sparc-*-openbsd*): New targets.
- * configure: Rebuild.
+Thu Jun 17 21:24:43 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
-Tue Apr 8 18:09:29 1997 Jamie Lokier <jamie@rebellion.co.uk>
+ * dwarf1.c (alloc_dwarf1_unit): Allocate using bfd_zalloc.
+ * (alloc_dwarf1_func): Likewise.
- * stabs.c (struct stab_section_info): New field
- `cumulative_skips'.
- (_bfd_link_section_stabs): Fill the above array.
- (_bfd_stab_section_offset): Use `cumulative_skips' to
- speed up offset calculation.
+Wed Jun 16 03:09:57 1999 Jeffrey A Law (law@cygnus.com)
-Tue Apr 8 00:01:31 1997 Jeffrey A Law (law@cygnus.com)
+ * libhppa.h: Fix various formatting errors.
+ (assemble_3); Rewrite using CATENATE.
+ (assemble_17): Fix various bugs.
- * elf-mn10300.c (mn10300_elf_relax_section): Don't forget the
- addend for non pc-relative relocations.
+1999-06-16 Nick Clifton <nickc@cygnus.com>
- * elf-m10300.c (bfd_elf32_mn10300_reloc): Remove prototype
- for non-existent function.
+ * elf32-mcore.c (R_MCORE_RAW): Fix definition.
- * elf-m10300.c (mn10300_elf_relax_section): New function.
- (mn10300_elf_relax_delete_bytes): Likewise.
- (mn10300_elf_symbol_address_p): Likewise.
- (mn10300_elf_get_relocated_section_contents): Likewise.
- (bfd_elf32_bfd_relax_section): Define.
- (bfd_elf32_bfd_get_relocated_section_contents): Likewise.
+1999-06-15 Richard Henderson <rth@cygnus.com>
-Mon Apr 7 16:47:09 1997 Ian Lance Taylor <ian@cygnus.com>
+ * section.c (SEC_SHORT): Define.
+ * bfd-in2.h: Rebuild.
- * configure.host: Set SHLIB_LIBS.
- * configure.in: Substitute SHLIB_LIBS.
- * configure: Rebuild.
- * Makefile.in (SHLIB_LIBS): New variable.
- ($(SHLIB)): Use $(SHLIB_LIBS).
+1999-06-13 Mark Mitchell <mark@codesourcery.com>
-Mon Apr 7 10:53:52 1997 Michael Snyder <msnyder@cleaver.cygnus.com>
+ * elflink.h (elf_link_remove_section_and_adjust_dynindices):
+ Remove abfd parameter. Use _bfd_strip_section_from_output.
+ (bfd_elf_size_dynamic_sections): Adjust callers accordingly.
+
+ * elf-bfd.h (_bfd_elf_link_adjust_dynindx): New function.
+ * elflink.c (_bfd_elf_link_adjust_dynindx): Define it.
+ * elflink.h (elf_link_remove_section_and_adjust_dynindices): New
+ function.
+ (bfd_elf_size_dynamic_sections): Use it.
- * bfd-in.h bfd-in2.h: add bfd_section_lma macro to correspond
- with bfd_section_vma.
+1999-06-13 Alan Modra <alan@spri.levels.unisa.edu.au>
-Fri Apr 4 11:37:15 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-i386.c (elf_howto_table): Change R_386_PC8 from
+ complain_overflow_bitfield to complain_overflow_signed.
- * configure.in: Update file names for bfd_elf32_mn10[23]00_vec.
- Correct CPU file names for mn10[23]00.
- * configure: Rebuild.
+1999-06-13 Mark Mitchell <mark@codesourcery.com>
- * bfd.c (bfd_record_phdr): Cast count to size_t before
- subtraction.
+ * elflink.h (elf_link_read_relocs_from_section): New function,
+ split out from ...
+ (elf_link_read_relocs): Here. Use it for both relocation
+ sections.
- * coff-ppc.c (dump_toc): Add cast to avoid warning from SunOS cc.
- * coff-rs6000.c (xcoff_read_ar_hdr): Likewise.
- (xcoff_write_archive_contents): LIkewise.
- * elf32-mips.c (_bfd_mips_elf_set_section_contents): Likewise.
- (mips_elf_create_procedure_table): Likewise.
- * peicode.h (pe_print_idata): Likewise.
- (pe_print_edata, pe_print_pdata, pe_print_reloc): Likewise.
- * xcofflink.c (xcoff_get_section_contents): Likewise.
- (_bfd_xcoff_canonicalize_dynamic_symtab): Likewise.
- (xcoff_link_add_symbols): Likewise.
- (xcoff_link_add_symbols): Likewise.
+1999-06-12 Mark Mitchell <mark@codesourcery.com>
- * ppcboot.c (ppcboot_set_arch_mach): Make static.
- (ppcboot_bfd_print_private_bfd_data): Likewise.
+ * elfcode.h (elf_slurp_reloc_table_from_section): Don't assume
+ asect->reloc_count is valid.
- * elf32-mips.c (elf_mips_ctor64_howto): Set complain_on_overflow
- to complain_overflow_signed.
+1999-06-12 Ian Lance Taylor <ian@zembu.com>
-Thu Apr 3 11:51:54 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-mips.c (mips_elf32_section_processing): Permit a
+ SHT_MIPS_REGINFO section to have a size of 0.
- * VERSION: Set to 2.8.1.
+1999-06-12 David O'Brien <obrien@freebsd.org>
- * Branched binutils 2.8.
+ * config.bfd (alpha*-*-freebsd*): New target.
+ (i[3456]86-*-freebsd*): Now defaults to ELF.
- * elf32-ppc.c (ppc_elf_check_relocs): Don't check SEC_ALLOC when
- deciding whether to copy a reloc into a shared object.
- (ppc_elf_relocate_section): Likewise. Relocate R_PPC_RELATIVE
- relocs in unallocated sections.
- * elf32-sparc.c (elf32_sparc_relocate_section): Relocate
- R_SPARC_RELATIVE relocs in unallocated sections.
+1999-06-11 Ian Lance Taylor <ian@zembu.com>
-Wed Apr 2 16:19:41 1997 Mike Meissner <meissner@cygnus.com>
+ * reloc.c (_bfd_relocate_contents): Permit bitfield relocations to
+ wrap if the relocation covers the high bit of an address.
- * elf32-ppc.c (ppc_elf_check_relocs): Undo March 26 change and
- always create got section so that the _GLOBAL_OFFSET_TABLE_ label
- is always created.
+ * dwarf2.c (decode_line_info): Remove unused variable first_time.
-Wed Apr 2 10:49:07 1997 Ian Lance Taylor <ian@cygnus.com>
+1999-06-10 Jakub Jelinek <jj@ultra.linux.cz>
- * elflink.h (elf_link_add_object_symbols): Let a common symbol
- override an uninitialized symbol from a shared library with a
- smaller size.
+ * elf64_sparc.c (sparc64_elf_relocate_section): Use R_SPARC_max_std
+ instead of R_SPARC_max.
+ (sparc64_elf_info_to_howto): Likewise.
+ * elf32_sparc.c (elf32_sparc_relocate_section): Likewise.
+ (elf32_sparc_info_to_howto): Likewise; handle vtable relocations.
- * elf-m10200.c: Rename from elf32-mn10200.c.
- * elf-m10300.c: Rename from elf32-mn10300.c.
- * cpu-m10200.c: Rename from cpu-mn10200.c
- * cpu-m10300.c: Rename from cpu-mn10300.c
- * Makefile.in: Update accordingly.
+1999-06-07 Richard Henderson <rth@cygnus.com>
- * elf32-mips.c (elf_mips_ctor64_howto): New static variable.
- (elf_mips_isa): Move to earlier in file.
- (mips_reloc_map): Remove BFD_RELOC_CTOR entry.
- (bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_CTOR
- specially.
+ * section.c (_bfd_strip_section_from_output): Remove output
+ sections with no initial link_order.
- * elf32-mips.c (mips16_jump_reloc): Print a warning rather than
- calling abort.
+1999-06-07 Nick Clifton <nickc@cygnus.com>
-Tue Apr 1 16:18:05 1997 Klaus Kaempf <kkaempf@progis.de>
+ * elf32-m88k.c (ELF_MAXPAGESIZE): Define.
- * configure.com: New file.
- * config.h-vms: Remove file.
- * makefile.vms: Update for new configure scheme.
+Mon Jun 7 11:49:43 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
-Mon Mar 31 23:28:39 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+ * Makefile.am (SOURCE_HFILES): Add missing headers.
+ * Makefile.in: Regenerated.
- * libcoff-in.h (ppc_allocate_toc_section): Declare.
- (ppc_process_before_allocation): Declare.
- * libcoff.h: Rebuild.
+1999-06-06 Mark Mitchell <mark@codesourcery.com>
- * coffcode.h (coff_mkobject_hook): Declare if not a macro.
+ * elf32-mips.c (_bfd_mips_elf_print_private_data): Recognize
+ the N32 ABI.
-Mon Mar 31 16:29:50 1997 Joel Sherrill <joel@oarcorp.com>
+1999-06-04 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
- * config.bfd (hppa*-*-rtems*): New target, like hppa-*-*elf*.
+ * elf32-ppc.c (ppc_elf_relocate_section): Don't barf on out of
+ range undefweak symbols.
+ * hash.c: Add missing comma after @xref{}
+ * linker.c: Likewise.
-Mon Mar 31 16:11:35 1997 Ian Lance Taylor <ian@cygnus.com>
+1999-06-04 Nick Clifton <nickc@cygnus.com>
- * coff-a29k.c (coff_a29k_relocate_section): Don't use symndx as a
- symbol index for a R_IHCONST reloc.
+ * elfxx-target.h (ELF_MAXPAGESIZE): Produce an error message
+ if not defined.
+ * elf32-gen.c (ELF_MAXPAGESIZE): Define.
+ * elf32-i860.c (ELF_MAXPAGESIZE): Define.
+ * elf32-i960.c (ELF_MAXPAGESIZE): Define.
+ * elf64-gen.c (ELF_MAXPAGESIZE): Define.
-Mon Mar 31 15:40:59 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
+1999-06-04 Ian Lance Taylor <ian@zembu.com>
- * targmatch.sed: Do not use \(\) recursively.
+ * Makefile.am: Rebuild dependencies.
+ (BFD32_BACKENDS): Add dwarf1.lo.
+ (BFD32_BACKENDS_CFILES): Add dwarf1.c.
+ * Makefile.in: Rebuild.
-Fri Mar 28 14:44:08 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+1999-06-04 Nick Clifton <nickc@cygnus.com>
- * m68klinux.c (MACHTYPE_OK): Define.
- * i386linux.c (MACHTYPE_OK): Define.
+ * Makefile.am: Add epoc-arm-pe target.
+ * Makefile.in: Regenerate.
+ * pe-arm.c: Only redefine interworking function names if they have
+ not already been redefined.
+ * pei-arm.c: Only redefine interworking function names if they have
+ not already been redefined.
+ * epoc-pe-arm.c: Redefine interworking function names to avoid a
+ name space clash.
+ * epoc-pei-arm.c: Redefine interworking function names to avoid a
+ name space clash.
-Fri Mar 28 11:56:15 1997 Ian Lance Taylor <ian@cygnus.com>
+1999-06-03 Nick Clifton <nickc@cygnus.com>
- From David S. Miller <davem@caip.rutgers.edu> and H.J. Lu
- <hjl@gnu.ai.mit.edu>:
- * sparclinux.c: New file.
- * bfd-in.h (bfd_sparclinux_size_dynamic_sections): Declare.
- * bfd-in2.h: Rebuild.
- * config.bfd (sparc-*-linuxaout*, sparc-*-linux*): New targets.
- * configure.in (sparclinux_vec): Add to list of vectors.
- * configure: Rebuild.
- * targets.c (sparclinux_vec): Declare.
- (bfd_target_vector): Add sparclinux_vec.
- * Makefile.in: Rebuild dependencies.
- (BFD32_BACKENDS): Add sparclinux.o.
- (BFD32_BACKENDS_CFILES): Add sparclinux.c.
-
- * coff-mips.c (mips_ecoff_backend_data): Initialize new
- bfd_coff_backend_data field.
- * coff-alpha.c (alpha_ecoff_backend_data): Likewise.
-
- * config.bfd: Add bfd_elf64_{big,little}mips_vec to targ_selvecs
- for mips*el*-*-linux* and mips*-*-linux*. From H.J. Lu
- <hjl@lucon.org> and Ralf Baechle <ralf@gnu.ai.mit.edu>.
-
- * bfd.c: Include "libiberty.h".
- (strerror): Don't declare.
- (bfd_errmsg): Call xstrerror rather than strerror.
-
-Thu Mar 27 12:55:42 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Generate a COPY
- reloc even if the symbol is in the .bss section.
- * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
- * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise.
- * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
-
- * coffcode.h (bfd_coff_backend_data): Add new field
- _bfd_coff_default_section_alignment_power.
- (bfd_coff_default_section_alignment_power): Define.
- (bfd_coff_std_swap_table): Initialize new field.
- * libcoff.h: Rebuild.
- * cofflink.c (coff_link_add_symbols): Limit alignment of a common
- symbol to the default section alignment.
+ * elfxx-target.h (ELF_MAXPAGESIZE): Default to 0x1000 not 1.
- * COPYING: Update FSF address.
+Fri Jun 4 10:05:11 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
-Wed Mar 26 14:50:20 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elf.c (elf_fake_sections): Undo change of 1999-05-10.
- * elflink.c (_bfd_elf_create_linker_section): Don't set
- bss_section and rel_section from existing sections.
+Fri Jun 4 03:10:49 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
- * elf32-ppc.c (ppc_elf_check_relocs): Only create the got section
- if it is needed.
+ * elf32-sh.c (sh_elf_relax_delete_bytes): Fix setting of
+ start / stop for recalculating of r_addend of R_SH_SWITCH*.
-Tue Mar 25 22:26:56 1997 Stu Grossman (grossman@critters.cygnus.com)
+Fri Jun 4 02:53:13 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
- * aoutx.h (some_aout_object_p): Change executable test to fix
- problems with embedded a.out systems.
+ * elf32-sh.c (sh_elf_relax_delete_bytes): Handle R_SH_SWITCH32
+ in other text sections.
-Tue Mar 25 14:35:37 1997 Ian Lance Taylor <ian@cygnus.com>
+Fri Jun 4 02:29:34 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
- * stabs.c (_bfd_stab_section_offset): New function.
- * libbfd-in.h (_bfd_stab_section_offset): Declare.
- * libbfd.h: Rebuild.
- * elf32-i386.c (elf_i386_relocate_section): Adjust the offset of a
- stab reloc.
- * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
- * elf32-mips.c (mips_elf_relocate_section): Likewise.
- * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
- * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
- * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
+ * libbfd.c (_bfd_generic_verify_endian_match): New function.
+ * libbfd-in.h (_bfd_generic_verify_endian_match): Declare.
+ * libbfd.h: Regenerate.
+ * coff-sh.c (sh_merge_private_data): Delete.
+ (coff_bfd_merge_private_bfd_data): Change to
+ _bfd_generic_verify_endian_match.
+ (elf32-sh.c): bfd_elf32_bfd_merge_private_bfd_data: Define.
- * stabs.c (_bfd_link_section_stabs): Copy over the first header
- symbol. Check for memory allocation failure of *psinfo.
- (_bfd_write_section_stabs): Add psinfo parameter. Change all
- callers. Set the value of the header symbol.
- * libbfd-in.h (_bfd_write_section_stabs): Update declaration.
- * libbfd.h: Rebuild.
+1999-06-03 Ulrich Drepper <drepper@cygnus.com>
-Mon Mar 24 13:41:00 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * targmatch.sed: Use the hold space to put the #ifdef around the
- the string constant.
- * targets.c (UNSUPPORTED_TARGET): Don't define.
- (find_target): Don't check for UNSUPPORTED_TARGET.
- (bfd_set_default_target): Don't try to optimize by checking for
- default.
-
- * Makefile.in: Rebuild dependencies.
- (ALL_MACHINES_CFILES): Add cpu-m32r.c.
- (BFD32_BACKENDS_CFILES): Add elf32-m32r.c.
- (elf32-m32r.o): Remove explicit target.
-
- * config.bfd: Don't set targ_underscore for i[3456]86-*-gnu* or
- i[3456]86-*-linux*.
-
- * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Don't
- count section symbols for sections that were created by the
- linker, or are not allocatable or not loadable.
- (elf32_sparc_finish_dynamic_sections): Output output section
- symbols for section for which we made space for them.
-
-Fri Mar 21 13:08:26 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * elf32-sparc.c (elf32_sparc_size_dynamic_sections): If there is
- no .rela.plt section, don't output a DT_PLTGOT dynamic entry.
-
-Fri Mar 21 12:36:46 1997 Doug Evans <dje@canuck.cygnus.com>
-
- * elf32-m32r.c (m32r_elf_howto_table): Use special function for LO16.
- (m32r_hi16_list): New static local.
- (m32r_elf_hi16_reloc): Don't perform reloc, just queue it up.
- (m32r_elf_do_hi16_reloc): Delete.
- (m32r_elf_relocate_hi16): New function.
- (m32r_elf_lo16_reloc): New function.
- (m32r_elf_relocate_section): For HI16 relocs, scan for corresponding
- LO16 reloc.
-
- Mon Mar 10 16:03:31 1997 Doug Evans <dje@seba.cygnus.com>
-
- * elf32-m32r.c (m32r_elf_create_linker_section): Delete.
- (m32r_elf_add_symbol_hook): Rewrite _SDA_BASE_ support.
- (m32r_elf_final_sda_base): New function.
- (m32r_elf_relocate_section): Rewrite sdata support.
- (m32r_elf_finish_dynamic_sections): Delete.
-
-Thu Mar 20 12:39:02 1997 Ian Lance Taylor <ian@cygnus.com>
-
- Based on patches from Philippe De Muyter <phdm@info.ucl.ac.be>.
- * coff-svm68k.c: New file. Just defines some macros and includes
- coff-m68k.c.
- * coff-m68k.c: Add functions to handle common addends, moved in
- from cf-m68klynx.c. Control them using COFF_COMMON_ADDEND macro.
- Control whether relocs are visible using STATIC_RELOCS.
- * cf-m68klynx.c: Simplify greatly: just define macros to control
- coff-m68k.c.
- * coff-aux.c: Likewise. Just leave add_one_symbol routine.
- * targets. (m68ksysvcoff_vec): Declare.
- (bfd_target_vector): Add m68ksysvcoff_vec.
- * config.bfd (m68*-motorola-sysv*): New target.
- * configure.in (m68ksysvcoff_vec): New vector.
- * configure: Rebuild.
- * Makefile.in: Rebuild dependencies.
- (BFD32_BACKENDS): Add coff-svm68k.o.
- (BFD32_BACKENDS_CFILES): Add coff-svm68k.c.
+ * elf32-arm.h: Fix typo: change ELF_MAXPAGE_SIZE to ELF_MAXPAGESIZE.
- * binary.c (binary_set_section_contents): Don't get misled if the
- first section is not loadable. From Matthew L. Martin
- <mlm@xedia.com>.
+1999-06-03 Ian Lance Taylor <ian@zembu.com>
- * elflink.h (elf_bfd_final_link): Set the value of a section
- symbol to the section address unless doing a relocateable link.
+ * bfd-in.h (bfd_elf32_arm_allocate_interworking_sections): Correct
+ prototype.
+ (bfd_elf32_arm_process_before_allocation): Likewise.
+ * bfd-in2.h: Rebuild.
-Tue Mar 18 23:03:17 1997 Richard Henderson <rth@tamu.edu>
+1999-06-03 David Mosberger <davidm@hpl.hp.com>
+
+ * dwarf2.c (struct line_info): Add member END_SEQUENCE to keep
+ track of end_sequence markers.
+ (add_line_info): Add END_SEQUENCE arg.
+ (decode_line_info): Don't try to infer lo_pc and hi_pc from the
+ debug-line info---it doesn't work right if a compilation unit
+ consists of multiple discontiguous code-sequences. It would be
+ worthwhile to optimize for the common case where a compilation
+ unit results in a contiguous set of code sequences, but this is
+ quite tricky to get right for arbitrary DWARF2 files.
+ (lookup_address_in_line_info_table): Don't use the last line entry
+ for a compilation unit for anything with an address higher than
+ this line entry. Also, check for end_sequence markers to
+ correctly handle discontinuities.
+ (_bfd_dwarf2_find_nearest_line): When checking previously loaded
+ compilation units, check all compilation units with each->high==0
+ just like when reading compilation units.
+
+ * dwarf2.c (decode_line_info): Initialize table->files and
+ table->last_line to NULL to avoid segfaults due to random
+ values in these members.
+ (concat_filename): Check for out-of-range file number before
+ indexing filename table. Segfaults suck.
+
+ * dwarf2.c (decode_line_info): Don't truncate address to least
+ significant 32 bits (breaks 64 bit targets).
+ (lookup_address_in_function_table): Ditto.
+ (comp_unit_contains_address): Ditto.
+
+1999-06-02 Mark Mitchell <Mark Mitchell <mark@codesourcery.com>>
+
+ * elf32-mips.c (elf_mips_howto_table): Add R_MIPS_JALR.
+ * elf64-mips.c (mips_elf64_howto_table_rel): Likewise.
+ (mips_elf64_howto_table_rela): Likewise.
+
+ * elfcode.h (elf_slurp_reloc_table_from_section): New function,
+ split out from ...
+ (elf_slurp_reloc_table): Here. Use it to handle the case where a
+ single section has two associated relocation sections.
+
+1999-06-02 Mark Salter <msalter@cygnus.com>
+
+ * coffcode.h (coff_set_alignment_hook): Set lma from s_vaddr if
+ COFF_WITH_PE defined.
+
+1999-06-02 Nick Clifton <nickc@cygnus.com>
+
+ * pe-arm.c: Rename global arm interworking functions to avoid name
+ collision when all targets BFD is built.
+ * pei-arm.c: Ditto.
+
+1999-05-31 Mark Mitchell <mark@codesourcery.com>
+
+ * elf-bfd.h (elf_backend_data): Remove use_rela_p. Add
+ may_use_rel_p, may_use_rela_p, default_use_rela_p.
+ (bfd_elf_section_data): Add use_rela_p.
+ * elf.c (bfd_section_from_shdr): Set use_rela_p appropriately.
+ (_bfd_elf_new_section_hook): Likewise.
+ (elf_fake_sections): Use may_use_rela_p, etc., instead of
+ use_rela_p.
+ (_bfd_elf_copy_private_section_data): Copy use_rela_p.
+ * elfcode.h (write_relocs): Determine whether or not use rela
+ relocs based on the relocation section header.
+ * elflink.c (_bfd_elf_create_dynamic_sections): Use default_use_rela_p
+ instead of use_rela_p.
+ * elfxx-target.h (elf_backend_may_use_relp): New macro.
+ (elf_backend_may_use_rela_p): Likewise.
+ (elf_backend_default_use_rela_p): Likewise.
+ (elfNN_bed): Use them.
+
+Wed Jun 2 12:38:49 1999 Miodrag Vallat <miodrag@multimania.com>
+
+ * hosts/alphalinux.h (TRAD_CORE_EXTRA_SIZE_ALLOWED): Expand to 4096.
+
+Tue Jun 1 17:57:58 1999 Mark P. Mitchell <mitchell@n02.acl.lanl.gov>
+
+ * reloc.c (BFD_RELOC_MIPS_SUB): New relocation.
+ (BFD_RELOC_MIPS_GOT_PAGE): Likewise.
+ (BFD_RELOC_MIPS_GOT_OFST): Likewise.
+ (BFD_RELOC_MIPS_GOT_DISP): Likewise.
+ * bfd-in2.h: Regenerated.
+ * libbfd.h: Likewise.
+ * elf32-mips.c (mips_info_to_howto_rela): New function.
+ (USE_REL): Adjust for new conventions.
+ (MINUS_ONE): New macro.
+ (elf_mips_howto_table): Add R_MIPS_SUB.
+ (mips_r): Add entries for MIPS_SUB, MIPS_GOT_PAGE, MIPS_GOT_OFST,
+ and MIPS_GOT_DISP.
+ (mips_elf_final_write_processing): Set sh_link, not sh_info, for a
+ .MIPS.content section.
+ (_bfd_mips_elf_fake_sections): Treat all sections that begin
+ with .MIPS.content as .MIPS.content sections. Set
+ SHF_MNIPS_NOSTRIP for such section.
+ (elf_info_to_howto): Define to mips_info_to_howto_rela.
+ * elf64-mips.c (mips_r): Add entries for MIPS_SUB, MIPS_GOT_PAGE,
+ MIPS_GOT_OFST, and MIPS_GOT_DISP.
+
+Wed Jun 2 11:51:12 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
+
+ * vms-misc.c (_bfd_vms_hash_newfunc): Fix use of uninitialized
+ variable.
+
+ * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Avoid ambigous
+ `else'.
+
+1999-05-30 Philip Blundell <philb@gnu.org>
+
+ * elf32-arm.h (elf32_arm_relocate_section): Reinstate change of
+ 1993-03-25 (!!). Take into account the bitmasks for the reloc so
+ the addend does not overflow into the rest of the word.
+
+1999-05-29 Nick Clifton <nickc@cygnus.com>
+
+ * bfd-in.h: Amend prototype for
+ bfd_elf32_arm_process_before_allocation .
+ * bfd-in.h: Regenerate.
+
+ * elfarm-oabi.c (NUM_ELEM): New macro: Compute the number of
+ elements in a fixed sized array.
+ (ARM_ELF_ABI_VERSION): Define.
+ (ARM_ELF_OS_ABI_VERSION): Define.
+ (R_ARM_THM_ABS5): Fix rightshift and size.
+ (R_ARM_THM_PC22): Fix size.
+ (R_ARM_PLT32): Define Howto.
+ (find_howto): New function: Locate a howto based on a reloc
+ number.
+ (elf32_arm_info_to_howto): Use find_howto if necessary.
+ (elf32_arm_reloc_map): Change type of field bfd_reloc_val to
+ bfd_reloc_code_real_type.
+ (elf32_arm_reloc_map[]): Add entries for BFD_RELOC_VTABLE_INHERIT
+ and BFD_RELOC_VTABLE_ENTRY.
+ (elf32_arm_reloc_type_lookup): Use find_howto if necessary.
+
+ * elfarm-nabi.c (NUM_ELEM): New macro: Compute the number of
+ elements in a fixed sized array.
+ (ARM_ELF_ABI_VERSION): Define.
+ (ARM_ELF_OS_ABI_VERSION): Define.
+ (R_ARM_THM_ABS5): Fix rightshift and size.
+ (R_ARM_THM_PC22): Fix size.
+ (elf32_arm_info_to_howto_rel): Rename to elf32_arm_info_to_howto.
+ (elf32_arm_reloc_map): Change type of field bfd_reloc_val to
+ bfd_reloc_code_real_type.
+
+ * elf32-arm.h (struct elf32_arm_link_hash_table): Add new field:
+ no_pipeline_knowledge.
+ (elf32_arm_link_hash_create): Initialise new field to zero.
+ (bfd_elf32_arm_process_before_allocation): Add new paraemter:
+ no_pipeline_knowledge. Use this parameter to initialise the field
+ in the globals data structure.
+ (elf32_arm_final_link_relocate): Only add in pipeline offset if
+ no_pipeline_knowledge is false and the binary is from an old
+ toolchain.
+ (elf32_arm_merge_private_data): Generate an error if an attempt is
+ made to linl together big endian and little endian code.
+ (elf32_arm_post_process_headers): New function: Initialise the
+ EI_OSABI and EI_ABIVERSION fields of the newly created ELF program
+ header.
+ (elf_backend_post_process_headers): Define.
- * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't create
- .plt entry if we've taken the function's address.
- (elf64_alpha_merge_gots): Merge collected flags info as well.
+1999-05-28 Nick Clifton <nickc@cygnus.com>
-Tue Mar 18 22:40:09 1997 H.J. Lu <hjl@lucon.org>
+ * elf-bfd.h (struct elf_backend_data): Add new field:
+ elf_backend_post_process_headers.
- * Many files: Add function prototypes.
- * cpu-m68k.c (bfd_default_scan_num_mach): Don't declare.
- * ecofflink.c: Include "libcoff.h" and "libecoff.h".
- * elf32-ppc.c (ppc_elf_fake_sections): Make static.
- * opncls.c (bfd_openstreamr): Change stream parameter to PTR.
- * peicode.h: Change several void * parameters to PTR.
- * srec.c (srec_get_symbol_info): Make static.
- * syms.c (bfd_symbol_is_absolute): Remove.
- * Makefile.in: Rebuild dependencies.
+ * elfxx-target.h (elf_backend_post_process_headers): Define to
+ NULL if not already defined.
+ (elfNN_bed): Initialise elf_backend_post_process_headers field.
-Tue Mar 18 12:58:08 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elf.c (prep_headers): Set the EI_OSABI and EI_ABIVERSION fields
+ to zero.
+ (_bfd_elf_compute_section_file_positions): Call
+ elf_backend_post_process_headers if defined.
- * elf32-m32r.c (m32r_elf_is_local_label_name): Remove.
- (bfd_elf32_bfd_is_local_label): Don't define.
+1999-05-28 Ian Lance Taylor <ian@zembu.com>
- * xcofflink.c (_bfd_xcoff_bfd_final_link): Call bfd_malloc rather
- than malloc.
+ * configure.in: Check whether getuid and getgid exist.
+ * archive.c: Define getuid and getgid as macros if HAVE_GETUID or
+ HAVE_GETGID are not defined, respectively.
+ (bfd_write_armap): Don't special case on _WIN32 for getuid and
+ getgid.
+ * configure.host: Set ac_cv_func_get{ug}id for *-*-windows*.
+ * configure, config.in: Rebuild.
-Mon Mar 17 11:32:53 1997 Ian Lance Taylor <ian@cygnus.com>
+1999-05-28 Martin Dorey <mdorey@madge.com>
- * bfd-in.h: Don't include obstack.h.
- (struct bfd_hash_table): Change memory field to PTR.
- * bfd.c (struct _bfd): Change memory field to PTR.
- * bfd-in2.h: Rebuild.
- * libbfd-in.h (bfd_release): Declare as function, don't define as
- macro.
- * libbfd.h: Rebuild.
- * opncls.c: Include "objalloc.h" rather than "obstack.h". Use
- objalloc routines rather than obstack routines.
- (obstack_chunk_alloc, obstack_chunk_free): Don't define.
- (getpagesize): Don't define.
- (_bfd_new_bfd): Don't set _bfd_chunksize.
- (bfd_openr): Free new bfd and objalloc on failure.
- (bfd_fdopenr, bfd_openstreamr, bfd_openw): Likewise.
- (bfd_alloc_size): Remove.
- (bfd_release): New function.
- * hash.c: Include "objalloc.h" rather than "obstack.h". Use
- objalloc routines rather than obstack routines.
- (obstack_chunk_alloc, obstack_chunk_free): Don't define.
- * ecofflink.c: Include "objalloc.h" rather than "obstack.h". Use
- objalloc routines rather than obstack routines.
- (obstack_chunk_alloc, obstack_chunk_free): Don't define.
- (struct accumulate): Change memory to struct objalloc *.
- * liboasys.h (oasys_data_type): Remove oasys_obstack field.
- * dep-in.sed: Don't remove obstack.h from dependency list.
- * Makefile.in: Rebuild dependencies.
- (BFD_H_DEPS): Remove obstack.h.
- (install): Don't install obstack.h.
- * Many files: Don't include "obstack.h".
- * VERSION: Bump.
-
- * opncls.c (bfd_alloc_grow, bfd_alloc_finish): Remove.
- * libbfd-in.h (bfd_alloc_grow, bfd_alloc_finish): Don't declare.
- * libbfd.h: Rebuild.
- * ieee.c (ieee_archive_p): Rewrite to not use bfd_alloc_grow.
- * sunos.c (sunos_add_dynamic_symbols): Likewise.
- * srec.c (srec_scan): Rewrite to not use obstack_1grow.
+ * elf32-i960.c: New file.
+ * elf.c (prep_headers): Handle bfd_arch_i960.
+ * targets.c (bfd_target_vector): Add &bfd_elf32_i960_vec.
+ * config.bfd (i960-*-elf*): New target.
+ * configure.in (bfd_elf32_i960_vec): New target vector.
+ * Makefile.am (BFD32_BACKENDS): Add elf32-i960.lo.
+ (BFD32_BACKENDS_CFILES): Add elf32-i960.c.
+ * Makefile.in, aclocal.m4, configure: Rebuild.
- * opncls.c (bfd_alloc): Rename from bfd_alloc_by_size_t. Remove
- old version of bfd_alloc.
- * libbfd-in.h (bfd_alloc_by_size_t): Don't declare.
- * libbfd.h: Rebuild.
- * Several files: Call bfd_alloc rather than bfd_alloc_by_size_t.
-
-Sat Mar 15 15:24:18 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * elf32-mips.c (mips_elf_is_local_label_name): Accept the generic
- ELF local label syntax as well.
-
-Sat Mar 15 10:16:42 1997 Fred Fish <fnf@cygnus.com>
-
- * config.bfd (powerpc-*-beos*): New target.
- * configure.in (powerpc-*-beos*): Add case that explicitly
- does not set COREFILE for now. A future BeOS version is
- expected to support core files.
- * configure: Regenerate with autoconf.
-
-Fri Mar 14 16:43:22 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * elf32-mips.c (mips_elf_check_relocs): Give an error if CALL16 is
- seen with a local symbol, rather than crashing.
-
- * elfcode.h (elf_slurp_symbol_table): Don't try to read the
- version symbols if there aren't any.
-
-Thu Mar 13 14:08:53 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * elflink.h (elf_link_add_object_symbols): Don't warn about type
- or size changes because of a weak symbol.
-
- * cisco-core.c (SIGEMT): Define if not defined.
-
-Wed Mar 12 21:36:05 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * elflink.h (elf_link_add_object_symbols): Use extsymoff when
- setting ever. Sanity check the version number. Sort out copying
- flags and other information when adding an indirect symbol.
- (NAME(bfd_elf,size_dynamic_sections)): Preserve any dynamic
- symbols added by the backend. Clear the entire contents of the
- versym section.
- (elf_export_symbol): Ignore indirect symbols.
- (elf_link_output_extsym): Accept a section without an owner in an
- assert.
- * elfcode.h (elf_slurp_symbol_table): Add a sanity check on the
- version count. Correct the allocation of x_versymp.
-
- * elf32-mips.c (mips_elf_add_symbol_hook): Don't set the owner of
- the magic sections used for SHN_MIPS_TEXT and SHN_MIPS_DATA.
- Don't return bfd_und_section_ptr when info->shared.
- (mips_elf_final_link): Set the alignment of .rtproc to 4, not 12.
- (mips_elf_create_dynamic_sections): Correct type: ^= for &=.
- (mips_elf_check_relocs): Resolve an indirect symbol in
- sym_hashes.
- (mips_elf_finish_dynamic_symbol): Don't change SHN_ABS into
- SHN_MIPS_TEXT or SHN_MIPS_DATA.
-
- * elf.c (bfd_elf_print_symbol): Tweak version output slightly.
-
-Tue Mar 11 01:38:36 1997 Ian Lance Taylor <ian@cygnus.com>
-
- From Eric Youngdale <eric@andante.jic.com>:
- * elf-bfd.h (ELF_LINK_FORCED_LOCAL): Define.
- * elf.c (bfd_elf_print_symbol): Correct errors in last change.
- * elflink.h (elf_link_add_object_symbols): Handle cases in which a
- versioned symbol appears in both a regular and a shared object.
- (elf_link_assign_sym_version): Set ELF_LINK_FORCED_LOCAL when
- appropriate. Improve error message.
- (struct elf_outext_info): Rename from elf_finfo_failed. Change
- all uses. Add localsyms field.
- (elf_bfd_final_link): When generating a shared library, call
- elf_link_output_extsym to output all local symbols.
- (elf_link_output_extsym): Handle symbols which were forced to
- become local.
-
-Sun Mar 9 23:08:49 1997 Ian Lance Taylor <ian@cygnus.com>
-
- From Eric Youngdale <eric@andante.jic.com>:
- * elf-bfd.h (elf_symbol_type): Add version field.
- * elfcode.h (elf_slurp_symbol_table): Set version field.
- * elflink.h (elf_link_add_object_symbols): When creating an
- indirect symbol for a default version symbol, set DEF_DYNAMIC if
- appropriate. Set up an indirection from the nondefault version of
- the symbol as well.
- (NAME(bfd_elf,size_dynamic_sections)): Call
- elf_link_assign_sym_version before checking whether there are any
- versions. Always record the version name as a dynamic symbol.
- Initialize counters.
- (elf_link_assign_sym_version): After finding a version, see if a
- symbol should be forced to local scope. Create a new version
- definition if appropriate.
- (elf_link_output_extsym): Correct indirect symbol handling.
- * elf.c (bfd_elf_print_symbol): Print version information.
- (bfd_section_from_shdr): Turn version sections into BFD sections.
- (elf_fake_sections): Only copy cverdefs and cverrefs into sh_info
- if sh_info is not already set.
- (_bfd_elf_copy_private_section_data): Copy sh_info for version
- sections.
- * elflink.c (_bfd_elf_link_record_dynamic_symbol): Tell
- _bfd_stringtab_add to copy the name into permanent memory if
- appropriate.
+1999-05-27 Nick Clifton <nickc@cygnus.com>
-Fri Mar 7 11:55:31 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+ * elfarm-oabi.c (elf32_arm_howto_table): Add entry for
+ R_ARM_PLT32.
+ (find_howto): New function: Find entries in the
+ elf32_arm_howto_table.
+ (elf32_arm_info_to_howto): Use find_howto if the entry cannot be
+ computed simply.
+ (elf32_arm_reloc_type_lookup): Add lookup for
+ BFD_RELOC_ARM_PLT32.
- * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Fully parenthesize.
+1999-05-25 Philip Blundell <pb@nexus.co.uk>
-Fri Mar 7 10:37:30 1997 Ian Lance Taylor <ian@cygnus.com>
+ * bfd/elf32-arm.h (elf32_arm_link_hash_newfunc): New function.
+ (elf32_arm_link_hash_table_create): Use above function as the
+ constructor for hash table entries.
+ (elf32_arm_relocate_section): Avoid crash when there is no output
+ section.
+ (elf32_arm_final_link_relocate): New parameter h.
+ (elf32_arm_relocate_section): Pass symbol hash entry to above
+ routine.
+ (elf32_arm_gc_sweep_hook, elf32_arm_check relocs): Correct
+ comments.
- * coffcode.h (bfd_coff_backend_data): Change
- _bfd_coff_compute_section_file_positions to return a boolean
- value. Change all callers.
- (coff_compute_section_file_positions): Change return type to
- boolean. If the size of the last section changed, then output a
- zero byte at the end of the file.
- * libcoff.h: Rebuild.
+1999-05-25 Catherine Moore <clm@cygnus.com>
- * xcofflink.c (_bfd_xcoff_bfd_final_link): Always allocate space
- for at least 6 output symbols.
- (xcoff_write_global_symbol): When emitting TOC entry relocs, also
- emit a TC csect to represent the space they take up. For an XO
- symbol, just emit a reference, not a csect.
+ * coff-arm.c (coff_arm_relocate_section): Don't emit
+ base file entries for pc-relative values.
- * Makefile.in ($(SHLINK)): Just use ln -s, not ln -sf, since
- Solaris doesn't like the combined options, and the -f is
- unnecessary.
- (stamp-tshlink, install): Likewise.
+1999-05-25 DJ Delorie <dj@cygnus.com>
- * elf32-mips.c (mips_elf_relocate_section): Correct R_MIPS16_26
- handling when little endian.
+ * peicode.h (coff_swap_sym_in): When we create the actual section
+ to reflect the not-there section C_SECTION symbols refer to,
+ change the symbol class to C_STAT as the section is now really
+ there.
-Thu Mar 6 13:51:51 1997 Jeffrey A Law (law@cygnus.com)
+1999-05-24 Philip Blundell <pb@nexus.co.uk>
- * elf32-mn10300.c (mn10300_elf_final_link_relocate): New function.
- (mn10300_elf_relocate_section): Likewise.
- (elf_backend_relocate_section): Define.
+ * elf32-arm.h (elf32_arm_relocate_section): Undo change of
+ 1999-03-25.
- * elf32-mn10300.c (reloc_type): Remove PCREL{8,16,32}_{1,2}BYTE
- relocs. Replace them with generic PCREL_{8,16,32} relocs.
- (elf32_mn10300_howto_table): Likewise.
- (elf32_mn10300_reloc_map): Likewise.
- (bfd_elf32_mn10300_reloc): Delete unused function.
-
-Thu Mar 6 12:19:59 1997 Fred Fish <fnf@cygnus.com>
-
- * coffcode.h (coff_slurp_reloc_table): Pull duplicate declarations and
- code fragment out of both legs of #ifdef RELOC_PROCESSING ... #endif
- block. Use NULL for initializations of "ptr" rather than bare 0.
- * coff-h8300.c: Fix typo in comment.
- * coff-h8500.c: Ditto.
- * coff-w65.c: Ditto
- * coff-z8k.c: Ditto.
-
-Wed Mar 5 13:59:09 1997 Doug Evans <dje@seba.cygnus.com>
-
- * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc): Fix overflow calc.
- (m32r_elf_relax_section, m32r_elf_relax_delete_bytes,
- m32r_elf_get_relocated_section_contents): First pass at relax support.
-
-Mon Mar 3 13:27:09 1997 Ulrich Drepper <drepper@rtl.cygnus.com>
-
- * elflink.h (elf_link_add_object_symbols): Use correct sh_size
- entry for reading verdef records.
- Use correct braces for computing increments of extverdaux and
- exteverdef record pointers.
-
-Sun Mar 2 16:25:35 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * elflink.h (elf_link_find_version_dependencies): Check that
- DEF_REGULAR is not set as well as checking that DEF_DYNAMIC is
- set.
-
-Fri Feb 28 15:06:45 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * targets.c (bfd_default_vector): Make non-const.
- (find_target): New static function, broken out of
- bfd_find_target.
- (bfd_set_default_target): New function.
- (bfd_find_target): Call find_target. When defaulting, use
- bfd_default_vector[0] if it is not NULL.
- * libbfd-in.h (bfd_default_vector): Adjust declaration.
- * bfd-in2.h, libbfd.h: Rebuild.
-
- * syms.c (bfd_is_local_label): Return false if the symbol has no
- name.
- * coff-i960.c (coff_i960_is_local_label_name): New function.
- (coff_bfd_is_local_label_name): Define.
- * coff-m68k.c (m68k_coff_is_local_label_name): New function.
- (coff_bfd_is_local_label_name): Define.
- * coff-rs6000.c (xcoff_is_local_label_name): New function.
- (coff_bfd_is_local_label_name): Define.
- * elf.c (_bfd_elf_is_local_label_name): Treat symbols beginning
- with .. or _.L_ as local.
- * elf32-i386.c (elf_i386_is_local_label_name): New function.
- (bfd_elf32_bfd_is_local_label_name): Define.
- * evax-alpha.c (evax_bfd_is_local_label_name): Treat symbols
- beginning with $ as local.
-
-Thu Feb 27 18:36:23 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * aoutx.h (aout_link_write_symbols): Use bfd_is_local_label_name
- rather than comparing against info->lprefix.
- * cofflink.c (_bfd_coff_link_input_bfd): Likewise.
- * elflink.h (elf_link_input_bfd): Likewise.
- * linker.c (_bfd_generic_link_output_symbols): Likewise.
- * xcofflink.c (xcoff_link_input_bfd): Likewise.
-
- * elfxx-target.h (bfd_elfNN_bfd_is_local_label_name): Define as
- _bfd_elf_is_local_label_name if not already defined.
- * elf.c (_bfd_elf_is_local_label_name): New function.
- * elf-bfd.h (_bfd_elf_is_local_label_name): Declare.
-
- * coff-m88k.c (coff_bfd_is_local_label_name): Define.
- (m88k_is_local_label_name): New static function.
-
- * coffcode.h (coff_bfd_is_local_label_name): Define as
- _bfd_coff_is_local_label_name if not already defined.
- * coffgen.c (_bfd_coff_is_local_label_name): New function.
- * libcoff-in.h (_bfd_coff_is_local_label_name): Declare.
- * libcoff.h: Rebuild.
+Mon May 17 13:35:35 1999 Stan Cox <scox@cygnus.com>
- * targets.c (BFD_JUMP_TABLE_SYMBOLS): Change _bfd_is_local_label
- to _bfd_is_local_label_name.
- (bfd_target): Likewise.
- * syms.c (bfd_is_local_label): Define as function, not macro.
- (bfd_is_local_name): Define.
- * libbfd.c (bfd_generic_is_local_label_name): Rename from
- bfd_generic_is_local_label, and take a string rather than a
- symbol.
- * libbfd-in.h (_bfd_nosymbols_bfd_is_local_label): Don't define.
- (_bfd_nosymbols_bfd_is_local_label_name): Define.
- (bfd_generic_is_local_label): Don't declare.
- (bfd_generic_is_local_label_name): Declare.
- * bfd-in2.h, libbfd.h: Rebuild.
- * All backends: Change local_label to local_label_name.
-
- * elf32-mips.c (struct mips_got_info): Add assigned_gotno field.
- (mips_elf_relocate_got_local): Change return type to boolean.
- Don't assume that the first zero entry is unassigned; instead, use
- assigned_gotno.
- (mips_elf_relocate_section): Check return value of
- mips_elf_relocate_got_local.
- (mips_elf_create_got_section): Initialize assigned_gotno field.
-
-Wed Feb 26 13:33:03 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * elflink.h (elf_link_input_bfd): Don't skip symbols from sections
- that have no contents merely because linker_mark is not set.
-
-Tue Feb 25 18:51:35 1997 Stan Shebs <shebs@andros.cygnus.com>
-
- * config.bfd (mips*-*-lnews*): New target.
- * coff-mips.c (mips_relocate_section): Make assert compare
- content byteorder instead of header byteorder.
- (ecoff_biglittle_vec): New BFD, big-endian headers, little-endian
- data.
- * targets.c (bfd_target_vector): Add ecoff_biglittle_vec.
- * configure.in (ecoff_biglittle_vec): Add case.
- * configure: Update.
-
-Tue Feb 25 00:32:49 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * elf.c (elf_fake_sections): Use SHT_NOTE for any section whose
- name begins with ".note".
- (map_sections_to_segments): Add a PT_NOTE segment for any loadable
- section whose name begins with ".note".
- (get_program_header_size): Corresponding change.
-
- * elf32-mips.c (mips_elf_relocate_section): Check for misaligned
- jal and for jal overflow.
-
-Mon Feb 24 17:53:14 1997 Ian Lance Taylor <ian@cygnus.com>
-
- From Eric Youngdale <eric@andante.jic.com>:
- * elflink.h (elf_link_add_archive_symbols): If a default symbol is
- not found, try looking it up again without the version name.
- (elf_link_add_object_symbols): Always link against the dynamic
- symbol table of a dynamic object. When linking against a dynamic
- object, include version strings in symbol names, and set up
- version information. Add indirect symbols for default versions.
- (elf_link_create_dynamic_sections): Add special version sections.
- (struct elf_assign_sym_version_info): Define.
- (struct elf_find_verdep_info): Define.
- (NAME(bfd_elf,size_dynamic_sections)): Add verdefs parameter. Set
- up version sections.
- (elf_adjust_dynamic_symbol): Ignore indirect symbols.
- (elf_link_find_version_dependencies): New static function.
- (elf_link_assign_sym_version): New static function.
- (elf_link_renumber_dynsyms): New static function.
- (struct elf_final_link_info): Add symver_sec field.
- (elf_bfd_final_link): Initialize finfo.symver_sec. Don't count
- local symbols of a dynamic object. Handle DT_VER* constants.
- (elf_link_output_extsym): Simplify BFD_ASSERT checking for a
- dynamic object. Skip indirect symbols from ELF objects. Remove
- the version name before choosing a hash bucket. Write out the
- version information if appropriate.
- (elf_link_input_bfd): Check for DYNAMIC, not ET_DYN.
- * bfd-in.h (bfd_elf32_size_dynamic_sections): Update declaration.
- (bfd_elf64_size_dynamic_sections): Likewise.
- * bfd-in2.h: Rebuild.
- * elf-bfd.h (struct elf_link_hash_entry): Add verinfo field.
- Change elf_link_hash_flags to unsigned short.
- (ELF_LINK_HIDDEN): Define.
- (struct elf_obj_tdata): Add fields dynversym_hdr, dynverref_hdr,
- dynverdef_hdr, dynversym_section, dynverdef_section,
- dynverref_section, cverdefs, cverrefs, verdef, verref.
- (elf_dynversym, elf_dynverdef, elf_dynverref): Define.
- (_bfd_elf_swap_verdef_in, _bfd_elf_swap_verdef_out): Declare.
- (_bfd_elf_swap_verdaux_in, _bfd_elf_swap_verdaux_out): Declare.
- (_bfd_elf_swap_verneed_in, _bfd_elf_swap_verneed_out): Declare.
- (_bfd_elf_swap_vernaux_in, _bfd_elf_swap_vernaux_out): Declare.
- (_bfd_elf_swap_versym_in, _bfd_elf_swap_versym_out): Declare.
- (_bfd_elf_slurp_version_tables): Declare.
- * elf.c (_bfd_elf_swap_verdef_in): New function.
- (_bfd_elf_swap_verdef_out): Likewise.
- (_bfd_elf_swap_verdaux_in, _bfd_elf_swap_verdaux_out): Likewise.
- (_bfd_elf_swap_verneed_in, _bfd_elf_swap_verneed_out): Likewise.
- (_bfd_elf_swap_vernaux_in, _bfd_elf_swap_vernaux_out): Likewise.
- (_bfd_elf_swap_versym_in, _bfd_elf_swap_versym_out): Likewise.
- (_bfd_elf_print_private_bfd_data): Add DT_VER* constants. Print
- version information if there is any.
- (_bfd_elf_link_hash_newfunc): Initialize verinfo field.
- (bfd_section_from_shdr): Handle SHT_GNU_ver* section types.
- (elf_fake_sections): Handle .gnu.version* section names.
- (assign_section_numbers): Handle SHT_GNU_ver* section types.
- (_bfd_elf_slurp_version_tables): New function.
- * elflink.c (_bfd_elf_link_record_dynamic_symbol): Don't include
- version name in string entered in dynamic hash table.
- * elfcode.h: Include fnmatch.h.
- * elf32-i386.c (elf_i386_relocate_section): Handle a dynamic
- symbol which was forced to become local.
- * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
- * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
- * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
- * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise.
+ * coff-arm.c (_bfd_coff_arm_set_private_flags): Changed
+ F_PIC_INT to F_PIC.
+ * coffcode.h (coff_set_arch_mach_hook): Added F_ARM_2a, and
+ F_ARM_3M labels. Changed F_PIC_INT to F_PIC.
-Fri Feb 21 16:15:18 1997 Jeffrey A Law (law@cygnus.com)
+1999-05-16 Nick Clifton <nickc@cygnus.com>
- * elf32-mn10200.c (mn10200_elf_final_link_relocate): Simplify
- somewhat.
- (mn10200_elf_relax_section): Correctly compute a symbol's value
- when the symbol is local, but not in the same section as we are
- relaxing. Implement abs24 -> abs16, imm24 -> imm16 and d24 -> d16
- relaxing.
+ * coff-mcore.c (in_reloc_p): Reinstate.
-Fri Feb 21 13:55:14 1997 Doug Evans <dje@seba.cygnus.com>
+1999-05-15 Nick Clifton <nickc@cygnus.com>
- * elf32-m32r.c: Rewrite to use ELF backend linker.
- Store lower 16 bits of addend in R_M32R_HI16_[SU]LO insns.
- Add small data area support (R_M32R_SDA16).
- * reloc.c: Document BFD_RELOC_M32R_SDA16.
- * bfd-in2.h,libbfd.h: Regenerated.
+ * reloc.c (BFD_RELOC_MCORE_RVA): Define.
+ * bfd-in2.h: Regenerate.
+ * coff-mcore.c (in_reloc_p): Remove defintion.
+ (mcore_coff_howto): Add IMAGE_REL_MCORE_RVA.
+ (mcore_coff_reloc_type_lookup): Map BFD_RELOC_RVA to
+ IMAGE_REL_MCORE_RVA.
+ (coff_mcore_rtype_to_howto): Add special processing for
+ IMAGE_REL_MCORE_RVA.
+ (coff_mcore_relocate_section): Add support for
+ IMAGE_REL_MCORE_RVA.
+ * elf32-mcore (mcore_elf_howto_): Add R_MCORE_RELATIVE.
+ (mcore_elf_reloc_type_lookup): Map BFD_RELOC_RVA to
+ R_MCORE_RELATIVE.
+ (mcore_elf_relocate_section): Delete redundant case labels.
+
+Fri May 14 10:59:55 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
+
+ * elf32-arm.h (elf32_arm_relocate_section): Fix operator
+ precedence between bit-and and comparison.
+
+Thu May 13 09:45:23 1999 Joel Sherrill (joel@OARcorp.com)
+
+ * config.bfd (i[3456]86*-*-rtems*, m68k*-*-rtems*): Added to
+ list of target formats (targ_selvecs).
+ (i[3456]86*-*-rtemself*, mips*el-*-rtems*): New targets.
+ (powerpcle*-*rtems*, sh-*-rtemself*): New targets.
+
+1999-05-10 DJ Delorie <dj@cygnus.com>
+
+ * ecoff.c (_bfd_ecoff_write_armap): give the symtab element a
+ reasonable mode until "ar x" is smart enough to skip it (fixes
+ gcc/libgcc.a builds on mips-ecoff targets
+
+ * coffcode.h (styp_to_sec_flags): Explain how COMDATs are supposed
+ to work. Hack to support MS import libraries, which use different
+ COMDAT types than GNU.
+ (coff_slurp_symbol_table): C_SECTION symbols are local; they refer
+ to implied zero-length sections (see peicode below)
+ * coffgen.c (coff_get_normalized_symtab): Properly read long MS
+ filename symbols, which use one *or more* auxents.
+ * coffswap.h (coff_swap_aux_in): ditto
+ * peicode.h (coff_swap_sym_in): Build the implied zero-length
+ sections
+
+Tue May 11 15:51:58 1999 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-v850.c (v850_elf_howto_table): Make partial_inplace false
+ for all relocations.
+
+1999-05-10 Catherine Moore <clm@cygnus.com>
+
+ * bfd-in.h (bfd_arm_allocate_interworking_sections): Static
+ if COFF_IMAGE_WITH_PE.
+ (bfd_arm_process_before_allocation): Likewise.
+ (bfd_arm_get_bfd_for_interworking): Likewise.
+ * coff-arm.c: Likewise.
+ * bfd-in2.h: Regenerate.
+ * configure.in (armpe_little_vec): Remove coff-arm.lo.
+ (armpe_big_vec): Likewise.
+ * configure: Rebuild.
-Thu Feb 20 23:50:31 1997 Jeffrey A Law (law@cygnus.com)
+1999-05-10 Nick Clifton <nickc@cygnus.com>
- * elf32-mn10200.c (mn10200_elf_relax_section): New function.
- (mn10200_elf_relax_delete_bytes): Likewise.
- (mn10200_elf_symbol_address_p): Likewise.
- (mn10200_elf_get_relocated_section_contents): Likewise.
- (bfd_elf32_bfd_relax_section): Define.
- (bfd_elf32_bfd_get_relocated_section_contents): Likewise.
+ * elf.c (elf_fake_sections): Check for .rel. as start of rel
+ section, not just .rel. Same for .rela.
- * elf32-mn10200.c (mn10200_elf_final_link_relocate): New function.
- (mn10200_elf_relocate_section): Likewise.
- (elf_backend_relocate_section): Define.
+1999-05-07 Nick Clifton <nickc@cygnus.com>
-Tue Feb 18 15:31:48 1997 Fred Fish <fnf@cygnus.com>
+ * coff-mcore.c (coff_mcore_relocate_section): Replace assert about
+ endianism with an error message.
- * reloc.c (struct reloc_howto_struct): Fix typo in comment.
- * bfd-in2.h: Regenerated.
+Thu May 6 17:09:09 1999 Fred Fish <fnf@be.com>
-Tue Feb 18 11:41:00 1996 Dawn Perchik <dawn@cygnus.com>
+ * dwarf2.c (read_abbrevs): Change cast of dwarf_abbrev_buffer
+ assignment from "unsigned char *" to "char *".
+ (decode_line_info): Likewise for dwarf_line_buffer assignment.
- * sysdep.h: Don't define errno in MSVC if error.h is included.
+1999-05-05 Catherine Moore <clm@cygnus.com>
-Tue Feb 18 10:04:13 1997 Jeffrey A Law (law@cygnus.com)
+ * coff-arm.c (coff_arm_relocate_section): Add one to
+ address of ARM_RVA32 thumb functions.
- * elf32-v850.c (v850_elf_relocate_section): Make sure r_symndx
- is initialized before it is used.
+1999-05-05 Catherine Moore <clm@cygnus.com>
-Mon Feb 17 11:28:40 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-m68k.c (elf32_m68k_set_private_flags): New.
+ (elf32_m68k_copy_private_bfd_data): New.
+ (elf32_m68k_merge_private_bfd_data): New.
+ (elf32_m68k_print_private_bfd_data): New.
+ (CPU32_FLAG): Define.
+ (PLT_CPU32_ENTRY_SIZE): Define.
+ (elf_cpu32_plt0_entry): Declare.
+ (elf_cpu32_plt_entry): Declare.
+ (elf_m68k_adjust_dynamic_symbol): Generate cpu32 plt entries.
+ (elf_m68k_finish_dynamic_symbol): Likewise.
+ (elf_m68k_finish_dynamic_sections): Likewise.
+ (elf_backend_plt_header_size): Remove definition.
+ (bfd_elf32_bfd_copy_private_bfd_data): Define.
+ (bfd_elf32_bfd_merge_private_bfd_data): Define.
+ (bfd_elf32_bfd_set_private_flags): Define.
+ (bfd_elf32_bfd_print_private_bfd_data): Define.
- * hp300hpux.c (convert_sym_type): Don't convert a secondary common
- symbol into a weak undefined symbol; leave it as a common symbol.
+Mon May 3 09:24:49 1999 Jeffrey A Law (law@cygnus.com)
-Fri Feb 14 19:08:03 1997 Ian Lance Taylor <ian@cygnus.com>
+ * som.c (som_fixup_formats): Fix comments for R_SHORT_PCREL_MODE
+ and R_LONG_PCREL_MODE.
- * elflink.h (elf_link_add_object_symbols): Don't issue a warning
- about a symbol defined in a dynamic object if it has already been
- defined in a regular object.
+1999-04-29 Nick Clifton <nickc@cygnus.com>
-Thu Feb 13 20:53:22 1997 Klaus Kaempf (kkaempf@progis.de)
+ * coff-mcore.c (coff_mcore_relocate_section): Fix typos.
- * makefile.vms: Add gcc flags to allow compiling with current gcc
- snapshot
- (targmatch.h): New dependency.
+Fri Apr 28 16:36:19 1999 Stan Cox <scox@cygnus.com>
- * reloc.c (BFD_RELOC_ALPHA_CODEADDR): New relocation for
- openVMS/Alpha.
- * evax.h (ALPHA_R_CODEADDR): New relocation.
- * evax-alpha.c (ALPHA_R_CODEADDR): 64 bit procedure relocation for
- openVMS/Alpha.
- * evax-etir.c (ALPHA_R_CODEADDR): Output object code for this
- relocation.
- * bfd-in2.h, libbfd.h: Rebuild.
+ * elf32-sh.c (sh_elf_relocate_section): Include relocation addend
+ in relocation calculation.
- Restrict symbol length to 64 bytes, case preserving:
- * evax-emh.c (_bfd_evax_write_emh): Remove case hacking.
- * evax-misc.c (_bfd_evax_case_hack_symbol): Remove.
- (_bfd_evax_length_hash_symbol): Added.
- * evax-etir.c (_bfd_evax_write_etir): Call
- _bfd_evax_length_hash_symbol before output of symbol.
- * evax-egsd.c (_bfd_evax_write_egsd): Likewise.
- * evax.h (flag_hash_long_names, flag_show_after_trunc): Remove.
+1999-04-26 Tom Tromey <tromey@cygnus.com>
- * evax-emh.c: Output filename to object file without path.
+ * aclocal.m4, configure: Updated for new version of libtool.
- * evax-egsd.c: New sections for local and global commons.
+1999-04-21 Nick Clifton <nickc@cygnus.com>
- * evax-alpha.c, evax-emh.c, evax-egsd.c, evax-etir.c,
- evax-misc.c, evax.h: Remove 8 bit characters from copyright
- notices. Replace AXP with Alpha.
+ * coff-mcore.c: Add support for mcore relocs.
-Wed Feb 12 18:10:30 1997 Ian Lance Taylor <ian@cygnus.com>
+1999-04-20 Gavin Romig-Koch <gavin@cygnus.com>
- * sunos.c (sunos_create_dynamic_sections): We need the dynamic
- sections if we are creating a shared library.
+ * elf32-mips.c (_bfd_mips_elf_print_private_bfd_data): Scrap the
+ incorrect use EF_MIPS_xxBITPTRS.
-Tue Feb 11 15:45:43 1997 Doug Evans <dje@canuck.cygnus.com>
+1999-04-18 Ian Lance Taylor <ian@zembu.com>
- * configure.host (i386-windows): Don't set host64=true.
+ * elf64-alpha.c (elf64_alpha_relax_section): Remove unused local
+ variable insn.
-Tue Feb 11 15:27:32 1997 Ian Lance Taylor <ian@cygnus.com>
+ * bfd-in2.h: Rebuild.
+ * libbfd.h: Rebuild.
- * elf32-mips.c (reloc_type): Add R_MIPS16_GPREL.
- (elf_mips16_gprel_howto): New static variable.
- (mips16_gprel_reloc): New static function.
- (bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS16_GPREL.
- (mips_info_to_howto_rel): Handle R_MIPS16_GPREL.
- (mips_elf_relocate_section): Handle R_MIPS16_GPREL.
- * reloc.c (BFD_RELOC_MIPS16_GPREL): Define.
- * bfd-in2.h, libbfd.h: Rebuild.
+Sat Apr 17 20:55:15 1999 Catherine Moore <clm@cygnus.com>
-Mon Feb 10 23:25:00 1997 Doug Evans <dje@seba.cygnus.com>
+ * coff-arm.c (coff_arm_rtype_to_howto): Remove ARM26D transform.
+ (coff_arm_relocate_section): Add ARM26D transform. Only
+ change to ARM26D for relocateable links.
- * elf32-m32r.c (elf_m32r_howto_table): Change partial_inplace to true
- for R_M32R_{16,32,24,HI16_ULO,HI16_SLO,LO16}.
+1999-04-16 Gavin Romig-Koch <gavin@cygnus.com>
-Fri Feb 7 12:39:11 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-mips.c (_bfd_mips_elf_print_private_bfd_data): New.
+ (bfd_elf32_bfd_print_private_bfd_data): New.
- * elflink.h (elf_link_input_bfd): If we've discarded a section,
- the output section will be the absolute section; don't print an
- assertion message for that case when doing a relocateable link.
+1999-04-15 Doug Evans <devans@casey.cygnus.com>
-Thu Feb 6 16:55:43 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-arm.h (elf32_arm_final_link_relocate): For R_ARM_THM_ABS5,
+ refetch addend if USE_REL, add many comments regarding current state.
+ For R_ARM_THM_PC22, refetch addend if USE_REL, simplify.
+ * elfarm-nabi.c (elf32_arm_howto_table): For R_ARM_THM_ABS5, fix
+ size and rightshift. For R_ARM_THM_PC22, fix bitsize.
+ * elfarm-oabi.c (elf32_arm_howto_table): Ditto.
- * elf32-mips.c (FN_STUB, CALL_STUB, CALL_FP_STUB): Define.
- (struct mips_elf_link_hash_entry): Add new fields fn_stub,
- need_fn_sub, call_stub, and call_fp_stub.
- (struct mips_elf_link_hash_table): Add field mips16_stubs_seen.
- (mips_elf_link_hash_newfunc): Initialize new fields.
- (mips_elf_link_hash_table_create): Likewise.
- (mips_elf_relocate_section): Redirect relocations to use mips16
- stubs when appropriate.
- (mips_elf_check_relocs): Attach stub sections to the appropriate
- symbol. Set need_fn_stub when appropriate.
- (mips_elf_always_size_sections): New static function.
- (mips_elf_check_mips16_stubs): New static function.
- (elf_backend_always_size_sections): Define.
- * elf-bfd.h (struct elf_obj_tdata): Add local_stubs field.
+Wed Apr 14 14:33:08 1999 Richard Henderson <rth@cygnus.com>
- * elflink.h (elf_link_input_bfd): Discard local symbols that are
- attached to sections which are not being included in the link.
+ * elf32-mips.c (_bfd_mips_elf_read_ecoff_info): Zero `debug'.
+ * elf64-alpha.c (elf64_alpha_read_ecoff_info): Likewise.
-Wed Feb 5 13:20:17 1997 Ian Lance Taylor <ian@cygnus.com>
+1999-04-13 David Mosberger <davidm@hpl.hp.com>
- * cofflink.c (_bfd_coff_generic_relocate_section): Ignore the
- symbol value when computing the addend for a pc_relative
- pcrel_offset reloc.
+ * dwarf2.c (decode_line_info): Don't truncate address to least
+ significant 32 bits (breaks 64 bit targets).
+ (lookup_address_in_function_table): Ditto.
+ (comp_unit_contains_address): Ditto.
-Mon Feb 3 11:54:06 1997 Ian Lance Taylor <ian@cygnus.com>
+Tue Apr 13 21:27:19 1999 Catherine Moore <clm@cygnus.com>
- * cofflink.c (_bfd_coff_generic_relocate_section): If doing a
- relocateable link, just skip pc_relative pcrel_offset relocs.
- * coff-arm.c (coff_arm_rtype_to_howto): Return a different howto
- structure for an ARM26 reloc which can be resolved.
- (coff_arm_adjust_symndx): Only convert ARM26 to ARM26D if the
- reloc can be resolved.
+ * coff-arm.c (arm_emit_base_file_entry): New routine.
+ (A2T3_OFFSET): Define.
+ (T2A3_OFFSET): Define.
+ (coff_arm_relocate_section): Emit base file entries for interworking
+ stubs.
- * coff-h8300.c (h8300_reloc16_extra_cases): Correct off by one
- error in overflow check for R_RELBYTE.
+1999-04-13 Philip Blundell <philb@gnu.org>
-Fri Jan 31 14:07:27 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elfarm-nabi.c (elf32_arm_howto_table): Add dummy entries for
+ relocs 17 through 19.
- * ieee.c (ieee_slurp_section_data): Pick up the start address.
- From Mark Rasin <mark.rasin@telrad.co.il>.
+Sun Apr 11 01:25:17 1999 Richard Henderson <rth@cygnus.com>
- * aoutx.h (aout_link_write_symbols): Don't apply discard_l to
- debugging symbols.
+ * elfcode.h: Remove fnmatch.h.
+ * elflink.h (elf_link_assign_sym_version): Call back to ld
+ instead of calling fnmatch.
-Wed Jan 29 00:00:49 1997 Jeffrey A Law (law@cygnus.com)
+ * config.bfd (i?86-*-beoself): Include pe vecs.
- * elf32-mn10200.c (reloc_type): Add 16bit pc-relative reloc.
- (elf_mn10200_howto_table): Likewise.
- (mn10200_reloc_map): Likewise.
+Sun Apr 11 01:14:06 1999 Richard Henderson <rth@cygnus.com>
-Mon Jan 27 12:07:35 1997 Doug Evans <dje@seba.cygnus.com>
+ * elf32-i386.c (elf_i386_finish_dynamic_sections): Allow .plt
+ to go missing.
- * reloc.c: Add relocs BFD_RELOC_M32R_{HI16_[US]LO,LO16}.
- * bfd-in2.h, libbfd.h: Regenerated.
- * elf32-m32r.c: Add support for them.
+1999-04-10 Richard Henderson <rth@cygnus.com>
-Mon Jan 27 12:25:02 1997 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-i386.c (elf_i386_relocate_section): Mind no_undefined
+ when trying to resolve dynamic symbol references.
+ * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
+ * elf32-mips.c (mips_elf_relocate_section): Likewise.
+ * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+ * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
+ * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
+ * elflink.h (elf_link_output_extsym): Likewise.
- * aout-arm.c (MY_swap_std_reloc_in): Remove unused r_length.
- * elf32-ppc.c (ppc_elf_check_relocs): Remove unused plt.
- * elf32-v850.c (v850_elf_final_link_relocate): Remove used
- r_format and r_pcrel. Always return a value.
- * riscix.c (MY_final_link_callback): Define to dummy value.
+Sat Apr 10 15:12:09 1999 Richard Henderson <rth@cygnus.com>
- * elf32-i386.c (elf_i386_size_dynamic_sections): When checking for
- relocations against the text segment, look up the output name of
- the reloc section.
+ * section.c (_bfd_strip_section_from_output): New function moved from
+ * elf64-alpha.c (elf64_alpha_strip_section_from_output): ... here.
+ * elf32-i386.c (elf_i386_size_dynamic_sections): Use it.
* elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
* elf32-mips.c (mips_elf_size_dynamic_sections): Likewise.
* elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
* elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise.
- * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
-
-Thu Jan 16 17:45:57 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Change type of
- auxiliary_filters parameter to be const char * const *. Accept a
- NULL terminated array.
- * bfd-in.h (bfd_elf32_size_dynamic_sections): Update declaration.
- (bfd_elf32_size_dynamic_sections): Update declaration.
- * bfd-in2.h: Rebuild.
+ * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Likewise.
+ * bfd-in2.h: Update.
-Wed Jan 15 11:21:32 1997 Ian Lance Taylor <ian@cygnus.com>
+1999-04-09 Ian Lance Taylor <ian@zembu.com>
- * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Treat a
- NOTYPE symbol in a text section as a FUNC symbol.
+ * elf64-sparc.c: Fix incorrect calls to bfd_check_overflow.
- * coffcode.h (coff_compute_section_file_positions): Force
- relocbase to be aligned to COFF_DEFAULT_SECTION_ALIGNMENT_POWER.
+1999-04-08 Nick Clifton <nickc@cygnus.com>
-Tue Jan 14 08:46:33 1997 Doug Evans <dje@canuck.cygnus.com>
-
- * libaout.h (machine_type): Reserve several values for sparclet.
-
-Mon Jan 13 19:36:25 1997 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * elf32-v850.c (v850_elf_howto_table): Set the special_function
- table to v850_elf_reloc for all non-standard relocations.
- (v850_elf_check_relocs): Add check for h being non-null.
- (v850_elf_reloc): Add R_V850_ZDA_OFFSET support. Use switch
- statement instead of multiple ifs.
- (v850_elf_relocate_section): Fix up error message, don't just call
- abort.
-
-Mon Jan 6 13:28:35 1997 Jeffrey A Law (law@cygnus.com)
-
- * elf32-mn10200.c (elf_mn10200_howto): Don't ever set partial-inplace.
- Use bfd_elf_generic_reloc as special function for all relocs.
- (bfd_elf32_mn10200_reloc): Remove unnecessary function.
-
- * elf32-mn10200.c (elf_mn10200_howto): Set pcrel_offset for
- 24bit pc-relative reloc.
+ * coff-mcore.c: New File: Support for mcore-pe targets.
+ * cpu-mcore.c: New File: Support for mcore targets.
+ * elf32-mcore.c: New File: Support for mcore-elf target.
+ * pe-mcore.c: New File: Definitions for mcore-pe target.
+ * pei-mcore.c: New File: Definitions for mcore-pei target.
+ * Makefile.am: Add support for MCore targets.
+ * Makefile.in: Regenerate.
+ * config.bfd: Add support for MCore targets.
+ * configure.in: Add support for MCore targets.
+ * configure: Regenerate.
+ * archures.c: Add support for MCore architecture.
+ * bfd-in2.h: Regenerate.
+ * coffcode.h: Add support for mcore-pe targets.
+ * elf.c: Add support for mcore-elf target.
+ * reloc.c: Add support for MCore relocs.
+ * targets.c: Add support for MCore targets.
-Fri Jan 3 16:54:08 1997 Jeffrey A Law (law@cygnus.com)
+1999-04-07 Nick Clifton <nickc@cygnus.com>
- * reloc.c: Add BFD_RELOC_24.
- * elf32-mn10200.c (enum reloc_type): Add 24bit and pcrel relocs.
- (elf_mn10200_howto, mn10200_reloc_map): Corresponding changes.
- * bfd-in2.h, libbfd.h: Rebuilt.
+ * elfarm-nabi.c (elf32_arm_howto_table): Add entries for
+ R_ARM_XPC25 and R_ARM_THM_XPC22.
+ (elf32_arm_reloc_map): Remove redundant entries.
-Fri Jan 3 16:58:31 1997 Richard Henderson <rth@tamu.edu>
+1999-04-06 Ian Lance Taylor <ian@zembu.com>
- elf64-alpha multiple .got rewrite:
+ * sysdep.h (LC_MESSAGES): Never define.
- * elf-bfd.h (struct elf_backend_data): Add always_size_sections entry.
- (bfd_elf*_mkobject): Don't define here ...
- * elfxx-target.h: ... but rather here. Default always_size_sections
- hook to NULL.
- * elf.c (elf_mkobject): Rename to bfd_elf_mkobject, since that was
- what the #defines in elf-bfd.h transmuted it to anyway.
+1999-04-06 Chris Torek <torek@bsdi.com>
- * section.c: Add SEC_LINKER_CREATED flag.
+ * reloc.c (bfd_check_overflow): Add addrsize parameter. Change
+ all callers. Rewrite completely.
+ (_bfd_relocate_contents): Rewrite overflow checking.
* bfd-in2.h: Rebuild.
- * elf32-i386.c (elf_i386_check_relocs): Add SEC_LINKER_CREATED to
- relocation section flags.
- (elf_i386_size_dynamic_sections): Use SEC_LINKER_CREATED instead of
- SEC_IN_MEMORY to recognize generated bits.
- * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_size_dynamic_sections):
- Likewise.
- * elf32-mips.c (mips_elf_final_link, mips_elf_create_dynamic_sections,
- mips_elf_create_compact_rel_section, mips_elf_create_got_section,
- mips_elf_check_relocs, mips_elf_size_dynamic_sections): Likewise.
- * elf32-ppc.c (ppc_elf_create_linker_section,
- ppc_elf_size_dynamic_sections): Likewise.
- * elf32-sparc.c (elf32_sparc_check_relocs,
- elf32_sparc_size_dynamic_sections): Likewise.
- * elflink.c (_bfd_elf_create_got_section): Add SEC_LINKER_CREATED to
- section flags.
- (_bfd_elf_create_dynamic_sections): Likewise.
- (_bfd_elf_make_linker_section_rela): Likewise.
- * elflink.h (elf_link_create_dynamic_sections): Likewise.
- (bfd_elf,size_dynamic_sections): Call the always_size_sections hook.
- (elf_bfd_final_link): Use SEC_LINKER_CREATED instead of SEC_IN_MEMORY
- to identify generated bits.
- (elf_link_input_bfd): Likewise.
- * elf64-alpha.c: Rewrite everything touching relocations.
+1999-04-05 Ian Lance Taylor <ian@zembu.com>
-Fri Jan 3 11:42:53 1997 Michael Meissner <meissner@tiktok.cygnus.com>
+ From Gabriel Paubert <paubert@iram.es>:
+ * elf32-ppc.c (ppc_elf_howto_raw): Set R_PPC_GOT16_LO,
+ R_PPC_PLT16_LO and R_PPC_SECTOFF_LO to be complain_overflow_dont.
+ Set R_PPC_PLT16_HA, R_PPC_SECTOFF_HA and R_PPC_EMB_NADDR16_HA to
+ have a rightshift of 16 and use ppc_elf_addr16_ha_reloc.
+ * ppcboot.c (ppcboot_vec): Use little endian routines for
+ headers.
- * elf32-v850.c (all functions and static variables): Go through
- and regularize names to be of the form v850_elf_<xxx>.
- (toplevel): Include <elf/v850.h>.
- (enum reloc_type): Move to include/elf/v850.h.
- (v850_elf_check_relocs): For common variables, if the variable is
- referenced by a R_V850_{SDA,ZDA,TDA} relocation, put the variable
- into the appropriate section.
- (elf_backend_check_relocs): Define.
+ * elf.c (elfcore_strndup): Only define if it will be used.
+ * elf32-ppc.c (ppc_elf_relax_section): Remove unused locals irel
+ and irelend.
+ (ppc_elf_check_relocs): Remove unused local i.
+ (ppc_elf_gc_mark_hook): Add default case to switch.
-Tue Dec 31 15:15:28 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+ From Bernd Nitzler <nitzler@kagcpd01.ag01.kodak.COM>:
+ * srec.c (srec_scan): Accept \r in symbol definitions.
+ (srec_object_p): Set HAS_SYMS if we saw any symbols.
+ (symbolsrec_object_p): Likewise.
- * elf32-v850.c (elf_v850_howto_table): Fix some spacing.
+1999-04-04 Don Bowman <don@pixsci.com>
-Tue Dec 31 14:44:50 1996 Ian Lance Taylor <ian@cygnus.com>
+ * config.bfd: Add mips*el-*-vxworks* and mips*-*-vxworks*.
- * config.bfd (mips*el-*-linux*): New target.
- (mips*-*-linux*): New target.
+1999-04-04 Ian Lance Taylor <ian@zembu.com>
- * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Clean up.
- Return a useful value.
-
- * Makefile.in (ALL_CFLAGS): Add -D_GNU_SOURCE.
-
- * configure.in: Check ac_cv_func_mmap_fixed_mapped, not
- ac_cv_func_mmap.
- * configure: Rebuild.
- * configure.host: Use ac_cv_func_mmap_fixed_mapped instead of
- ac_cv_func_mmap in bfd/configure.host.
-
- * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Add
- filter_shlib and auxiliary_filter_shlib parameters.
- * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_AUXILIARY and
- DT_FILTER.
- * bfd-in.h (bfd_elf32_size_dynamic_sections): Update declaration.
- (bfd_elf64_size_dynamic_sections): Likewise.
- * bfd-in2.h: Rebuild.
+ * dwarf1.c (parse_line_table): Remove unused locals last_pc and
+ last_line.
+ * elf-bfd.h (_bfd_elfcore_section_from_phdr): Declare.
+ * elf32-i386.c (elf_i386_gc_mark_hook): Add default case to
+ switch.
+ * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Remove unused
+ local i.
+ * syms.c (_bfd_stab_section_find_nearest_line): Remove unused
+ local val.
-Mon Dec 30 18:48:52 1996 Ian Lance Taylor <ian@cygnus.com>
+1999-03-31 Nick Clifton <nickc@cygnus.com>
- * xcofflink.c (xcoff_build_ldsyms): When exporting all defined
- symbols, don't export a symbol which is defined by an object in an
- archive which contains shared objects.
+ * config.bfd: Add support for arm-epoc-pe target.
+ * configure.in: Add support for arm-epoc-pe target.
+ * configure: Regenerate.
+ * targets.c: Add support for arm-epoc-pe target.
+ * coff-arm.c: Allow header files to override definition of
+ TARGET_UNDERSCORE and USER_LABEL_PREFIX.
+ * pe-arm.h: Allow previous header files to override definition of
+ TARGET_LITTLE_SYM and TARGET_BIG_SYM.
+ * pei-arm.h: Allow previous header files to override definition of
+ TARGET_LITTLE_SYM and TARGET_BIG_SYM.
+ * epoc-pe-arm.c: New file. Support arm-epoc-pe target.
+ * epoc-pei-arm.c: New file. Support arm-epoc-pei target.
-Mon Dec 30 11:54:56 1996 Ian Lance Taylor <ian@cygnus.com>
+1999-03-30 Nick Clifton <nickc@cygnus.com>
- * libbfd.c: Patch up the mmap code so that it is only built if BFD
- is configured with --with-mmap.
+ * elf.c (elf_map_symbols): Handle the case where section
+ symbols are generated for content-less sections which are
+ not mapped to the output file.
-Fri Dec 27 20:56:41 1996 Fred Fish <fnf@cygnus.com>
+ * linker.c: Replace direct references to fields in BFD structure
+ with accessor macros.
- * TODO: Correct a misspelling.
+ * elflink.h: Replace direct references to fields in BFD structure
+ with accessor macros.
-Fri Dec 27 11:48:12 1996 H.J. Lu <hjl@lucon.org>
+1999-03-25 Philip Blundell <pb@nexus.co.uk>
- * elflink.h (elf_buckets): Add some more values for larger
- binaries.
+ * config.bfd: Eliminate redundancy in checks for Linux/ARM.
-Thu Dec 26 18:36:54 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-arm.h (elf32_arm_relocate_section): Take the rightshift into
+ account when adjusting section symbols during a partial link.
- * Makefile.in (install): Move subdir_do out of conditional. From
- Fred Fish <fnf@cygnus.com>.
+1999-03-24 Nick Clifton <nickc@cygnus.com>
-Wed Dec 18 10:04:30 1996 Jeffrey A Law (law@cygnus.com)
+ * coff-sparc.c (struct coff_reloc_map): Change type of field
+ 'bfd_reloc_val' to bfd_reloc_code_real_type.
+ * elf-m10200.c (struct mn10200_reloc_map): Ditto.
+ * elf-m10300.c (struct mn10300_reloc_map): Ditto.
+ * elf32-arc.c (struct arc_reloc_map): Ditto.
+ * elf32-d10v.c (struct d10v_reloc_map): Ditto.
+ * elf32-d30v.c (struct d30v_reloc_map): Ditto.
+ * elf32-fr30.c (struct fr30_reloc_map): Ditto.
+ * elf32-m32r.c (struct m32r_reloc_map): Ditto.
+ * elf32-sh.c (struct elf_reloc_map): Ditto.
+ * elf32-sparc.c (struct elf_reloc_map): Ditto.
+ * elf32-v850.c (struct v850_reloc_map): Ditto.
+ * elf64-sparc.c (struct elf_reloc_map): Ditto.
+ * elfarm-nabi.c (struct elf32_arm_reloc_map): Ditto.
+ * elfarm-oabi.c (struct elf32_arm_reloc_map): Ditto.
- * elf32-mn10200.c (enum reloc_type): Enable basic 8, 16, and
- 32 bit relocs.
- (elf_mn10200_howto_table): Likewise.
- (mn10200_reloc_map): Likewise.
+1999-03-17 Martin Hunt <hunt@cygnus.com>
-Tue Dec 17 11:09:36 1996 Ian Lance Taylor <ian@cygnus.com>
+ * syms.c (_bfd_stab_section_find_nearest_line): Changed this
+ function so source-level assembly works. If multiple N_SOs
+ are seen without and N_FUNs, create an indextable entry with
+ a NULL function name.
- * elf32-mips.c (mips_elf_add_symbol_hook): Add 1 to the value of a
- mips16 symbol during the link.
- (mips_elf_finish_dynamic_symbol): Subtract 1 from the value of a
- mips16 symbol.
- (mips_elf_link_output_symbol_hook): New static function.
- (elf_backend_link_output_symbol_hook): Define.
+1999-03-16 Gavin Romig-Koch <gavin@cygnus.com>
- * elf.c (bfd_elf_print_symbol): Print the st_other field if it is
- not zero.
+ * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data) Allow merging
+ of certian similar cpus.
-Mon Dec 16 14:38:39 1996 Ian Lance Taylor <ian@cygnus.com>
+1999-03-16 Gavin Romig-Koch <gavin@cygnus.com>
- * elf.c (bfd_section_from_shdr): Don't check for reloc sections
- against SEC_DEBUGGING sections here (revert patch of December 5).
- * elfcode.h (elf_object_p): Check for them here, instead.
+ * elf32-mips.c (_bfd_mips_elf_final_write_processing):
+ Add the 5000. Change the architecture for the 5400 to mips4.
+ (elf_mips_mach): Add r5000.
-Sun Dec 15 14:46:06 1996 Ian Lance Taylor <ian@cygnus.com>
+1999-03-11 Doug Evans <devans@casey.cygnus.com>
- * elfcode.h (elf_slurp_reloc_table): Add dynamic parameter.
- * elf.c (_bfd_elf_canonicalize_reloc): Pass new argument to
- slurp_reloc_table.
- (_bfd_elf_get_dynamic_reloc_upper_bound): New function.
- (_bfd_elf_canonicalize_dynamic_reloc): New function.
- * elf-bfd.h (struct elf_size_info): Update declaration of
- slurp_reloc_table.
- (_bfd_elf_get_dynamic_reloc_upper_bound): Declare.
- (_bfd_elf_canonicalize_dynamic_reloc): Declare.
- * elfxx-target.h: Use new dynamic reloc routines by default.
- * elf64-mips.c (mips_elf64_slurp_reloc_table): Add dynamic
- parameter.
+ * cpu-i960.c (scan_i960_mach): Recognize i960:ka_sa and i960:kb_sb.
-Fri Dec 13 13:18:49 1996 Dan Wilder <dan@gasboy.com>
+1999-03-11 Nick Clifton <nickc@cygnus.com>
- * coffcode.h (coff_set_flags): Use MC68KBCSMAGIC for bfd_arch_m68k
- if NAMES_HAVE_UNDERSCORE is defined.
+ * binary.c (binary_set_section_contents): Generate warning about
+ huge file offsets for any section that will occupy file space, not
+ just those that are loadable.
-Fri Dec 13 11:13:23 1996 Doug Evans <dje@canuck.cygnus.com>
+1999-02-24 Jim Blandy <jimb@zwingli.cygnus.com>
- * libaout.h (enum machine_type): Change M_SPARCLET from 142 to 131.
+ * libbfd.h: Regenerate after Nick Clifton's Feb 17 changes.
-Thu Dec 12 15:07:20 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+1999-02-22 Jim Lemke <jlemke@cygnus.com>
- * elf32-ppc.c (ppc_elf_check_relocs): Move R_PPC_PLTREL24 into the
- supported relocs.
+ * elf32-ppc.c: Add ppc_elf_relax_section() for the ld option mpc860c0.
-Thu Dec 12 14:55:41 1996 Ian Lance Taylor <ian@cygnus.com>
+Mon Feb 22 18:26:51 1999 Ian Lance Taylor <ian@cygnus.com>
- * elflink.h (elf_link_add_object_symbols): Only add a weak
- symbol if the real definition is in the dynamic symbol table.
- After finding the real definition, then, if it is dynamic, add the
- weak symbol to the dynamic symbol table.
+ * elf-bfd.h (ELF_LINK_HASH_REF_REGULAR_NONWEAK): Define.
+ * elflink.h: Revert all changes since Feb 16. Instead:
+ (elf_link_add_object_symbols): Set REF_REGULAR_NONWEAK flag if
+ appropriate. Copy it to version symbols.
+ (elf_fix_symbol_flags): Set REF_REGULAR_NONWEAK for non ELF
+ symbols if appropriate.
+ (elf_adjust_dynamic_symbol): Set REF_REGULAR_NONWEAK for weakdef
+ symbol if appropriate.
+ (elf_link_output_extsym): If symbol is marked as undefined, and
+ has no nonweak references, mark it as weak undefined.
- * coff-aux.c (coff_m68k_aux_link_add_one_symbol): Make static.
+Fri Feb 19 16:01:12 1999 Ian Lance Taylor <ian@cygnus.com>
- * ppcboot.c (ppcboot_set_arch_mach): Don't define; it's a
+ * elflink.h (elf_merge_symbol): When overriding a dynamic
+ definition with a weak undefined symbol, set NEEDS_PLT if it is a
function.
- (ppcboot_bfd_print_private_bfd_data): Don't take the address of an
- array.
-
-Tue Dec 10 23:23:52 1996 Jeffrey A Law (law@cygnus.com)
-
- * elf32-mn10300.c (reloc_type): Remove big endian mn10300 reloc
- variants.
- (elf32_mn10300_howto_table, mn10300_reloc_map): Likewise.
- (bfd_elf32_mn10300_reloc): Write data in little endian format.
- * reloc.c: Remove mn10300 big endian relocs.
- * bfd-in2.h, libbfd.h: Rebuilt.
-
- * elf32-mn10200.c: Update from elf32-mn10300.c.
-
-Fri Dec 6 15:18:05 1996 Jeffrey A Law (law@cygnus.com)
-
- * elf32-mn10300.c (elf_symbol_leading_char): Define.
-
- * elf32-mn10300.c: Add some comments.
-
-Fri Dec 6 17:16:43 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * ihex.c (ihex_scan): Always initialize buf before jumping to
- error_return.
- (ihex_read_section): Likewise.
-
-Thu Dec 5 22:29:18 1996 Jeffrey A Law (law@cygnus.com)
-
- * elf32-mn10300.c (elf_mn10300_howto_table): Don't set partial-
- inplace for most relocs.
+ (elf_link_add_object_symbols): Don't copy the other field if we
+ are overridding.
-Thu Dec 5 13:24:46 1996 Ian Lance Taylor <ian@cygnus.com>
+Thu Feb 18 18:07:43 1999 Ian Lance Taylor <ian@cygnus.com>
- * elflink.h (elf_link_add_object_symbols): Calling check_relocs
- even if SEC_ALLOC is not set.
- * elf32-i386.c (elf_i386_check_relocs): Don't check SEC_ALLOC
- when deciding whether to copy a reloc into a shared object.
- (elf_i386_relocate_section): Likewise.
- * elf32-sparc.c (elf32_sparc_check_relocs): Likewise.
- (elf32_sparc_relocate_section): Likewise.
- * elf32-i386.c (elf_i386_check_relocs): Don't set SEC_ALLOC in a
- reloc section if it is not set in the source section.
- * elf32-sparc.c (elf32_sparc_check_relocs): Likewise.
- * elf.c (bfd_section_from_shdr): Mark a reloc section associated
- with a SEC_DEBUGGING section as SEC_DEBUGGING.
-
-Wed Dec 4 14:18:13 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): #if 0 code that
- expects a .got.plt until we actually create it.
-
-Mon Dec 2 12:13:51 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * cofflink.c (_bfd_coff_generic_relocate_section): Print an error
- message for bfd_reloc_outofrange, rather than aborting. From
- Philippe De Muyter <phdm@info.ucl.ac.be>.
-
- * cofflink.c (_bfd_coff_final_link): If there aren't any relocs in
- a relocateable link, don't try to process them. From Heinz Wrobel
- <wrobel@lpr.e-technik.tu-muenchen.de>.
-
-Mon Dec 2 00:39:24 1996 Jeffrey A Law (law@cygnus.com)
+ * elflink.h (elf_merge_symbol): Do not merge any symbol from a
+ shared object with a weak undefined symbol.
- * elf32-mn10300.c (mn10300_info_howto): Renamed from
- mn10300_info_howto_rel. Tweak reloc argument to be an
- Elf32_Internal_Rela.
- (USE_RELA): Define instead of USE_REL.
- (elf_info_to_howto, elf_info_howto_rel): Corresponding changes.
+1999-02-18 Nick Clifton <nickc@cygnus.com>
-Sun Dec 1 00:18:59 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+ * elfarm-nabi.c: Set partial_inplace back to false.
- * configure.in, configure: Handle mips*-sgi-irix6*.
- * irix-core.c (irix_core_core_file_p): Accept CORE_MAGICN32
- core files.
+1999-02-17 Nick Clifton <nickc@cygnus.com>
-Wed Nov 27 12:10:25 1996 Ian Lance Taylor <ian@cygnus.com>
+ * coff-arm.c (TARGET_UNDERSCORE): Re-enable.
+ (USER_LABEL_PREFIX): Set to "_".
- * elf32-i386.c (elf_i386_relocate_section): Warn about a
- relocation against a symbol defined in a section with no output
- section.
-
-Tue Nov 26 11:07:31 1996 Ian Lance Taylor <ian@cygnus.com>
+ The following patches are from: Scott Bambrough
+ <scottb@corelcomputer.com>
- * aclocal.m4 (BFD_CC_FOR_BUILD): Don't require AC_C_CROSS.
- * configure, config.in: Rebuild with autoconf 2.12.
+ * libaout.h (M_ARM6_NETBSD): Set to 143.
- * elf-bfd.h (struct elf_link_hash_entry): Add other field.
- * elf.c (_bfd_elf_link_hash_newfunc): Initialize other field.
- (swap_out_syms): Set st_other from existing st_other field.
- * elflink.h (elf_link_add_object_symbols): Store st_other in hash
- table other field.
- (elf_link_output_extsym): Set the other field from the global hash
- table entry.
- * elf32-mips.c (enum reloc_type): Add R_MIPS16_26.
- (elf_mips16_jump_howto): New static variable.
- (mips16_jump_reloc): New static function.
- (bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS16_JMP.
- (mips_info_to_howto_rel): Handle R_MIPS16_26.
- (mips_elf_relocate_section): Handle R_MIPS16_26. Handle R_MIPS_26
- to a mips16 symbol.
- * reloc.c (BFD_RELOC_MIPS16_JMP): Add to list of relocs.
- * bfd-in2.h, libbfd.h: Rebuild.
- * cpu-mips.c (arch_info_struct): Add mips:16 entry.
-
-Mon Nov 25 11:23:32 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.host: Use long long for mips-sgi-irix6*.
-
- * coffswap.h (coff_swap_scnhdr_out): Make line number overflow
- only a warning. From Philippe De Muyter <phdemuyt@ulb.ac.be>.
-
-Mon Nov 25 08:52:29 1996 Jeffrey A Law (law@cygnus.com)
-
- * elf32-mn10300.c (bfd_elf32_mn10300_reloc): New function.
- (enum reloc_type): Add more reloc types.
- (elf32_mn10300_howto_table): Update for new reloc types.
- (elf32_mn10300_reloc_map): Update for new reloc types.
- * reloc.c: Add some new relocs for the mn10300 series.
- * bfd-in2.h, libbfd.h: Rebuilt.
-
-Sat Nov 23 13:26:18 1996 Jeffrey A Law (law@cygnus.com)
-
- * som.c (setup_sections): Don't lose for a space which has
- no data, but some symbols.
-
-Fri Nov 22 11:32:13 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * sunos.c (struct sunos_link_hash_table): Add got_needed field.
- (sunos_link_hash_table_create): Initialize got_needed.
- (sunos_create_dynamic_sections): Only set .got section size if it
- is not already set. Set got_needed.
- (bfd_sunos_size_dynamic_sections): Check got_needed. Only set
- sdynptr, and only handle dynamic sections, if dynamic sections are
- needed.
- (sunos_scan_std_relocs): Pass false to create_dynamic_sections.
- Initialize .got section.
- (sunos_scan_ext_relocs): Likewise.
- (sunos_write_dynamic_symbol): Set up PLT entry even if this is not
- a dynamic symbol.
- (sunos_finish_dynamic_link): Check got_needed. Only set up
- dynamic linking information if needed.
+ * reloc.c: Add ARM PIC relocs: BFD_RELOC_ARM_GOT12,
+ BFD_RELOC_ARM_GOT32, BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_COPY,
+ BFD_RELOC_ARM_GLOB_DAT, BFD_RELOC_ARM_PLT32,
+ BFD_RELOC_ARM_RELATIVE, BFD_RELOC_ARM_GOTOFF, BFD_RELOC_ARM_GOTPC.
+ * bfd-in2.h: Regenerate.
-Thu Nov 21 10:31:31 1996 Rob Savoye (rob@cygnus.com)
+ * elfarm-nabi.c (elf32_arm_howto_table): Set partial_inplace to
+ 'true' as REL relocs are now being used. Add new PIC relocs:
+ R_ARM_COPY, R_ARM_GLOB_DAT, R_ARM_JUMP_SLOT, R_ARM_RELATIVE,
+ R_ARM_GOTOFF, R_ARM_GOTPC, R_ARM_GOT32, R_ARM_PLT32.
+
+ * elf32-arm.h (elf32_arm_merge_private_bfd_data): Check byte order
+ of targets.
+ (elf32_arm_final_link_relocate): Change parameters so that entire
+ reloc is passed. Add support for PIC relocs.
+ (elf32_arm_relocate_section): Pass entire reloc to
+ elf32_arm_final_link_relocate.
+ (elf32_arm_check_relocs): Handle new PIC relocs.
+ (elf32_arm_adjust_dynamic_symbol): New function.
+ (elf32_arm_size_dynamic_sections): New function.
+ (elf32_arm_discard_copies): New function.
+ (elf32_arm_finish_dynamic_symbol): New function.
+ (elf32_arm_finish_dynamic_sections): New function.
+ (ELF_MAXPAGE_SIZE): Define.
+ (bfd_elf32_bfd_reloc_type_lookup): Define.
+ (elf_backend_relocate_section): Define.
+ (elf_backend_adjust_dynamic_symbol): Define.
+ (elf_backend_create_dynamic_sections): Define.
+ (elf_backend_finish_dynamic_symbol): Define.
+ (elf_backend_finish_dynamic_sections): Define.
+ (elf_backend_size_dynamic_sections): Define.
+ (elf_backend_plt_readonly): Define.
+ (elf_backend_want_got_plt): Define.
+ (elf_backend_want_plt_sym): Define.
+
+Wed Feb 17 12:02:26 1999 Stan Cox <scox@cygnus.com>
+
+ * elf32-mips.c (_bfd_mips_elf_section_from_shdr): Make reginfo
+ sections SEC_LINK_ONCE and SEC_LINK_DUPLICATES_SAME_SIZE.
+ (_bfd_mips_elf_fake_sections): Likewise.
- * config.bfd: Added VersaDOS format to the Ericsson configuration.
+Wed Feb 17 12:07:23 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
-Wed Nov 20 16:31:31 1996 Jeffrey A Law (law@cygnus.com)
+ * elfarm-oabi.c (bfd_elf32_arm_allocate_interworking_sections,
+ bfd_elf32_arm_get_bfd_for_interworking,
+ bfd_elf32_arm_process_before_allocation): Define to avoid clash
+ with elfarm-nabi.c.
- * elf32-mn10300.c: Rough cut at relocs for the mn10300.
+ * elf32-arm.h: Don't declare elf32_arm_info_to_howto.
+ (elf32_thumb_to_arm_stub, elf32_arm_to_thumb_stub,
+ elf32_arm_find_nearest_line): Make them static.
-Wed Nov 13 08:12:38 1996 Jeffrey A Law (law@cygnus.com)
+Tue Feb 16 22:44:37 1999 Ian Lance Taylor <ian@cygnus.com>
- * Makefile.in (elf32-d10v.o): Don't depend on elf/d10v.h
- anymore.
+ * elflink.h (elf_merge_symbol): Add pflags parameter. Change all
+ callers. Do not merge a definition from a shared object with a
+ weak undefined symbol.
+ (elf_link_add_object_symbols): Do not change the symbol type or
+ size if the old symbol overrides the new one.
-Tue Nov 12 13:30:00 1996 Dawn Perchik <dawn@cygnus.com>
+1999-02-08 Nick Clifton <nickc@cygnus.com>
- * filemode.c: Include sysdep.h.
- * ihex.c: Add casts to eliminate compiler warnings.
- * sunos.c: Add casts to eliminate compiler warnings.
+ * config.bfd: Add support for strongarm target.
-Mon Nov 11 10:37:02 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+Mon Feb 8 11:18:14 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
- * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Create .got.plt
- section.
- (ppc_elf_check_relocs): Add support for R_PPC_LOCAL24PC. Make
- appropriate relocations in the .so file if shared.
- (ppc_elf_relocate_section): Ditto.
+ * elf32-m68k.c (reloc_map): Use the correct types for the struct
+ fields instead of unsigned char.
-Tue Oct 29 15:03:02 1996 Doug Evans <dje@canuck.cygnus.com>
+Fri Feb 5 00:22:36 1999 Ian Lance Taylor <ian@cygnus.com>
- * elf32-m32r.c (elf_m32r_howto_table, R_M32R_24): Use
- complain_overflow_unsigned.
+ * Makefile.am: Rebuild dependencies.
+ * Makefile.in: Rebuild.
-Tue Oct 29 12:53:46 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+Thu Feb 4 22:30:13 1999 Ian Lance Taylor <ian@cygnus.com>
- * elf32-d10v.c (elf_d10v_howto_table): Don't complain on
- overflows for R_D10V_16 and R_D10V_18.
+ * configure.in: Change AC_PREREQ to 2.13. Remove AM_CYGWIN32.
+ Change AM_EXEEXT to AC_EXEEXT and AM_PROG_INSTALL to
+ AC_PROG_INSTALL. Add comments to uses of AC_DEFINE.
+ * acinclude.m4: Add comments to uses of AC_DEFINE.
+ * acconfig.h: Remove.
+ * configure: Rebuild with current autoconf/automake.
+ * aclocal.m4: Likewise.
+ * config.in: Likewise.
+ * Makefile.in: Likewise.
-Tue Oct 29 13:23:53 1996 Ian Lance Taylor <ian@cygnus.com>
+1999-02-04 DJ Delorie <dj@cygnus.com>
- * ieee.c (ieee_write_section_part): Use LMA rather than VMA.
- (do_with_relocs): Likewise.
- (do_as_repeat): Likewise.
- (copy_expression): Likewise.
+ * libbfd.c (real_read): don't call fread for zero bytes. This
+ covers up a bug (or misuse of bfd) that's exposed by Solaris.
-Fri Oct 25 16:56:40 1996 Ian Lance Taylor <ian@cygnus.com>
+Thu Feb 4 12:38:10 1999 Stan Cox <scox@cygnus.com>
- * ieee.c (ieee_write_external_part): Correctly record whether
- there is an external part.
+ * elf32-mips.c (mips_elf_relocate_section): Insure that the target
+ of a jump is in the current 256 MB region.
-Thu Oct 24 14:32:52 1996 Jeffrey A Law (law@cygnus.com)
+Thu Feb 4 12:15:38 1999 Ian Lance Taylor <ian@cygnus.com>
- * elf32-v850.c (elf32_v850_bfd_final_link_relocate): Correctly
- handle tda offsets for sld.w and sst.w instructions.
- Fix alignment check in sld.w and sst.w tda reloc handling.
+ * format.c (bfd_check_format_matches): Change last patch to only
+ take effect for the binary target.
-Thu Oct 24 09:08:47 1996 Stu Grossman (grossman@critters.cygnus.com)
+Wed Feb 3 19:40:12 1999 Ian Lance Taylor <ian@cygnus.com>
- * aclocal.m4, configure: Set USE_BINARY_FOPEN for *-*-windows.
+ * elf32-i386.c (elf_i386_reloc_type_lookup): Add BFD_RELOC_CTOR.
-Wed Oct 23 00:53:16 1996 Jeffrey A Law (law@cygnus.com)
+Wed Feb 3 15:02:44 1999 Catherine Moore <clm@cygnus.com>
- * elf32-v850.c: Add comments about assumptions about
- char, short & long sizes.
- (elf32_v850_bfd_final_link_relocate): Fix sign extension
- problems for several relocs.
+ * elf32-fr30.c (fr30_elf_check_relocs): New routine.
- * elf32-v850.c (elf32_v850_howto_table): Fix typo in
- R_V850_SDA_OFFSET entry.
+Tue Feb 2 21:38:28 1999 Ian Lance Taylor <ian@cygnus.com>
-Wed Oct 23 00:20:34 1996 Ian Lance Taylor <ian@cygnus.com>
+ * format.c (bfd_check_format_matches): If the target was
+ previously specified, don't check other targets when checking for
+ an archive file.
- * xcofflink.c (bfd_xcoff_import_symbol): Don't allocate ldsym.
- Store import file index in ldindx.
- (xcoff_build_ldsyms): Assume that ldsym was not previously
- allocated. For an imported symbol, copy ldindx into l_ifile.
+Tue Feb 2 18:16:43 1999 Catherine Moore <clm@cygnus.com>
-Tue Oct 22 19:20:38 1996 Jeffrey A Law (law@cygnus.com)
+ * elf32-arm.h (elf32_arm_reloc_map): Removed.
+ (elf32_arm_reloc_type_lookup): Removed
+ * elfarm-nabi.c (elf32_arm_reloc_map): New.
+ (elf32_arm_reloc_type_lookup): New.
+ * elfarm-oabi.c (elf32_arm_reloc_map): New.
+ (elf32_arm_reloc_type_lookup): New.
- * elf32-v850.c (elf_v850_howto_table): Fix ordering of
- R_V850_ZDA_OFFSET and R_V850_TDA_OFFSET. Fix various
- fields in R_V850_TDA_OFFSET.
- (elf32_v850_bfd_final_link_relocate): Tweak pc-relative
- relocs to work more like other relocs. Handle R_V850_TDA_OFFSET
- relocations.
+Mon Feb 1 19:49:21 1999 Catherine Moore <clm@cygnus.com>
- * elf32-v850.c: Include bfdlink.h.
- (bfd_elf32_v850_reloc): Return an error if we get a reloc
- we can't handle.
- (elf32_v850_bfd_final_link_relocate): New function.
- (v850_elf_relocation_section): Likewise.
- (elf_backend_relocate_section): Define.
+ * elfarm-nabi.c: Renamed from elf32-arm-newabi.c.
+ * elfarm-oabi.c: Renamed from elf32-arm-oldabi.c
+ * Makefile.am: Use new files.
+ * Makefile.in: Regenerate.
+ * configure.in: Use new files.
+ * configure: Regenerate.
-Tue Oct 22 17:22:43 1996 Ian Lance Taylor <ian@cygnus.com>
+1999-02-01 Nick Clifton <nickc@cygnus.com>
- * binary.c (binary_set_section_contents): Ignore sections which
- don't have SEC_LOAD and SEC_ALLOC set.
+ * elf32-fr30.c (fr30_elf_gc_mark_hook): New function.
+ (fr30_elf_gc_sweep_hook): New function.
+ (elf_backend_can_gc_sections): Define.
-Mon Oct 21 12:13:05 1996 Jeffrey A Law (law@cygnus.com)
+Mon Feb 1 12:21:47 1999 Catherine Moore <clm@cygnus.com>
- * linker.c (_bfd_generic_final_link): Avoid losing static
- symbols in the .bss section.
+ * targets.c (bfd_target_vector): Add bfd_elf32_littlearm_oabi_vec
+ and bfd_elf32_bigarm_oabi_vec.
-Mon Oct 21 10:54:58 1996 Ian Lance Taylor <ian@cygnus.com>
+Mon Feb 1 11:46:31 1999 Catherine Moore <clm@cygnus.com>
- * elf32-mips.c (elf_mips_howto_table): Describe R_MIPS_64.
- (mips32_64bit_reloc): New static function.
- (mips_reloc_map): Add entry for BFD_RELOC_64.
- (mips_elf_relocate_section): Handle R_MIPS_64.
+ * Makefile.am (elf32-arm-oldabi.lo): New.
+ (elf32-arm-newabi.lo): New.
+ * Makefile.in: Regenerate.
+ * config.bfd (thumb-*-elf): Remove definition of targ_underscore.
+ (arm-*-elf): Likewise.
+ (arm-*-oabi): New.
+ (thumb-*-oabi): New.
+ * configure: Regenerate.
+ * configure.in (bfd_elf32_littlearm_oabi_vec): New.
+ (bfd_elf32_bigarm_oabi_vec): New.
+ * elf32-arm-newabi.c: New.
+ * elf32-arm-oldabi.c: New.
+ * elf32-arm.c: Removed.
+ * elf32-arm.h: New.
- * linker.c (default_indirect_link_order): Print an error message
- when attempting to do a relocateable link with different object
- file formats, rather than calling abort.
+Mon Feb 1 11:52:12 1999 Frank Ch. Eigler <fche@cygnus.com>
-Thu Oct 17 10:43:29 1996 Doug Evans <dje@canuck.cygnus.com>
+ * binary.c (binary_set_section_contents): Omit warnings for
+ unloadable sections.
- * reloc.c (m32r relocs): Rename them.
- * bfd-in2.h, libbfd.h: Regenerated.
- * elf32-m32r.c: Update.
- (m32r_elf_10_pcrel_reloc): New function.
- (elf_m32r_howto_table, R_M32R_10_PCREL entry): Use it.
- (elf_m32r_howto_table, R_M32R_24 entry): Fix {src,dst}_masks.
+1999-01-31 Michael Meissner <meissner@cygnus.com>
-Wed Oct 16 11:24:35 1996 Jeffrey A Law (law@cygnus.com)
+ * config.bfd (powerpc{,le}-*-vxworks*): Add aliases to
+ powerpc{,le}-*-eabi.
- * linker.c (_bfd_generic_final_link): Set "linker_mark" for
- all sections that will be included in the output file.
- (_bfd_generic_link_output_symbols): Discard symbols in sections
- which are being discarded.
- * elf32-v850.c (enum reloc_type): Add R_V850_SDA_OFFSET,
- R_V850_TDA_OFFSET and R_V850_ZDA_OFFSET.
- (elf_v850_howto_table): Corresponding changes.
- (elf_v850_reloc_map): Corresponding changes.
- * reloc.c: Add additional V850 relocations.
- * bfd-in2.h, libbfd.h: Rebuilt.
+1999-01-29 Nick Clifton <nickc@cygnus.com>
- * elf32-v850.c (bfd_elf32_v850_reloc): Mask out bits we
- no longer want in pc-relative relocs.
+ * dwarf2.c (read_unsigned_leb128): Remove unused variables.
+ * dwarf2.c (read_signed_leb128): Remove unused variables.
-Tue Oct 15 22:17:37 1996 Jeffrey A Law (law@cygnus.com)
+Fri Jan 29 00:47:21 1999 H.J. Lu <hjl@gnu.org>
- * elf32-v850.c (bfd_elf32_v850_reloc): Don't silently
- accept a reloc against an undefined sybmol!
+ * elf.c (assign_file_positions_for_segments): Only adjust
+ p_align when needed.
-Tue Oct 15 16:17:28 1996 Stu Grossman (grossman@critters.cygnus.com)
+Thu Jan 28 20:05:22 1999 Ian Lance Taylor <ian@cygnus.com>
- * elf32-v850.c: Define elf_symbol_leading_char to be '_'.
+ * binary.c (binary_set_section_contents): Don't return early for a
+ non-loadable section, in case the first section is non-loadable.
+ Don't set the low lma for a SEC_NEVER_LOAD section. From Maciej
+ W. Rozycki <macro@ds2.pg.gda.pl>.
-Tue Oct 15 12:40:41 1996 Ian Lance Taylor <ian@cygnus.com>
+1999-01-28 Nick Clifton <nickc@cygnus.com>
- * VERSION: Bump for new relocation.
+ * elf32-fr30.c (fr30_reloc_map): Add R_FR30_GNU_VTINHERIT and
+ R_FR30_GNU_VTENTRY relocs.
- * hosts/i386bsd.h: If NBPG is not defined, define it as
- PAGE_SIZE, for recent versions of FreeBSD.
+Thu Jan 28 11:08:16 1999 Catherine Moore <clm@cygnus.com>
-Mon Oct 14 12:37:26 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elflink.h (elf_link_output_sym): Zero syms which are
+ part of sections which have been excluded.
- * configure.host: Use `long long' as the 64 bit type on a Solaris
- host, since both gcc and the SunPRO compilers support it.
+Wed Jan 27 13:35:35 1999 Stan Cox <scox@cygnus.com>
-Mon Oct 14 11:17:24 1996 Richard Henderson <rth@tamu.edu>
+ * coff-arm.c (_bfd_coff_arm_set_private_flags): Changed F_PIC
+ to F_PIC_INT.
+ * coffcode.h (coff_set_arch_mach_hook): Removed F_ARM_2a and
+ F_ARM_3M labels. Changed F_PIC to F_PIC_INT.
- * reloc.c: Create a new BFD_RELOC_ALPHA_ELF_LITERAL. It was a
- mistake to have reused the ECOFF LITERAL for ELF since they have
- different semantics.
- * elf64-alpha.c (elf_reloc_map): Map from ELF_LITERAL.
- * bfd-in2.h, libbfd.h: Rebuild.
+1999-01-27 Nick Clifton <nickc@cygnus.com>
- * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Trap .got
- section overflow.
+ * elf32-fr30.c (fr30_elf_howto_table): Fix name of R_FR30_48
+ relocation.
+ (fr30_final_link_relocate): Use computed value as result of
+ relocation.
- * elf64-alpha.c (elf64_alpha_relocate_section): Do not emit a
- dynamic relocation for an undefweak symbol when we are building
- a static executable.
+1999-01-26 Frank Ch. Eigler <fche@cygnus.com>
-Thu Oct 10 11:15:06 1996 Stan Shebs <shebs@andros.cygnus.com>
+ * binary.c (binary_set_section_contents): Emit warning for
+ huge file offsets due to widely-dispersed section LMAs.
- * mpw-make.sed (config.bfd, targmatch.sed): Edit references to
- point explicitly to srcdir.
- (targmatch.h): Edit references to point explicitly to objdir.
+Mon Jan 18 03:35:35 1999 Ian Lance Taylor <ian@cygnus.com>
-Thu Oct 10 14:14:23 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf.c (assign_file_positions_for_segments): If not D_PAGED,
+ align first section to largest section alignment, not first
+ section alignment.
- * config.bfd: When setting targ_cpu, don't get confused by
- linux-gnu.
+1999-01-04 Jason Molenda (jsm@bugshack.cygnus.com)
-Tue Oct 8 08:51:19 1996 Stu Grossman (grossman@critters.cygnus.com)
+ * configure.in: Require autoconf 2.12.1 or higher.
- * configure.host: Add support for windows host (a build done
- under the Microsoft build environment).
+Tue Dec 22 15:21:41 1998 Catherine Moore <clm@cygnus.com>
-Tue Oct 8 11:40:16 1996 Ian Lance Taylor <ian@cygnus.com>
+ * archures.c (bfd_mach_i386_i386_intel_syntax): Define.
+ * bfd-in2.h: Likewise.
+ * cpu-i386.c (bfd_i386_arch_intel_syntax): New.
- * elflink.h (elf_link_add_object_symbols): If a symbol is a weak
- definition in a dynamic object, add it to the dynamic symbol table
- if any dynamic object mentions it. Reverts part of last patch.
+1998-12-16 Gavin Romig-Koch <gavin@cygnus.com>
- * sunos.c (struct sunos_link_hash_table): Add got_base field.
- (sunos_link_hash_table_create): Initialize got_base.
- (bfd_sunos_size_dynamic_sections): If the .got section is more
- than 0x1000 bytes, set __GLOBAL_OFFSET_TABLE_ and got_base to
- 0x1000.
- (sunos_check_dynamic_reloc): Subtract got_base from a base
- relative relocation.
+ * archures.c,bfd-in2.h (bfd_mach_mips4111): New.
+ * cpu-mips.c: Add support for and independent 4111.
+ * elf32-mips.c (elf_mips_mach): E_MIPS_MACH_4111 -> bfd_mach_mips4111.
+ (_bfd_mips_elf_final_write_processing):
+ bfd_mach_mips4111 -> E_MIPS_ARCH_3 | E_MIPS_MACH_4111.
- * elf32-mips.c (elf_mips_isa): New static function.
- (_bfd_mips_elf_merge_private_bfd_data): Don't warn about linking
- -mips1 and -mips2 code together, or -mips3 and -mips4 code.
+1998-12-15 Gavin Romig-Koch <gavin@cygnus.com>
-Mon Oct 7 11:44:17 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-mips.c (elf_mips_abi_name): New.
+ (_bfd_mips_elf_merge_private_bfd_data): Compare EF_MIPS_ABI flags.
- * archive.c (do_slurp_coff_armap): Only treat archive as little
- endian for i960 COFF.
+1998-12-12 Gavin Romig-Koch <gavin@cygnus.com>
-Fri Oct 4 13:49:01 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-mips.c (_bfd_mips_elf_final_write_processing):
+ Handle bfd_mach_mips4300.
- * coffcode.h (coff_compute_section_file_positions): Adjust sofar
- by the change in size of the section when EXEC_P is not set.
+1998-12-11 Ulrich Drepper <drepper@cygnus.com>
- * coff-m68k.c (coff_rtype_to_howto): Define if not defined.
- (m68kcoff_rtype_to_howto): New static function.
- * cf-m68klynx.c (coff_m68k_lynx_rtype_to_howto): Add the section
- VMA to the addend for a PC relative reloc.
+ * elf32-i386.c: Remove leaked development code from patch
+ 1998-12-10 by Richard Henderson.
- * dep-in.sed: Rework backslash loop a bit to avoid bug in sed on
- HP/UX 10.20.
- * Makefile.in: Rebuild dependencies.
+1998-12-10 Richard Henderson <rth@cygnus.com>
- * dep-in.sed: Remove ../bfd/sysdep.h, since it will appear when
- som.h is included.
+ * elf32-i386.c (elf_i386_relocate_section): Don't fail relocations
+ in debug sections for symbol defined externally.
-Fri Oct 4 11:41:39 1996 Jeffrey A Law (law@cygnus.com)
+Thu Dec 10 10:58:38 1998 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
- * Makefile.in: Remove explicit dependencies for mn10200 and
- mn10300 files.
- (ALL_MACHINE_CFILES): Add cpu-mn10200.c and cpu-mn10300.c.
- (BFD32_BACKENDS_CFILES): Add elf32-mn10200.c and elf32-mn10300.c
- (dependencies): Rebuilt.
+ * targets.c (bfd_target_vector): Remove duplicate entry for
+ tekhex_vec.
-Thu Oct 3 16:57:51 1996 Ian Lance Taylor <ian@cygnus.com>
+1998-12-09 Nick Clifton <nickc@cygnus.com>
- * cofflink.c (coff_link_add_symbols): Set obj_coff_keep_syms
- during this function.
+ * elf32-fr30.c (fr30_elf_howto_table): Set src_mask fields to 0
+ since we are using RELAs.
- * elflink.c (_bfd_elf_create_linker_section): Only use an existing
- section if the flags are compatible.
+Tue Dec 8 22:15:48 1998 Ian Lance Taylor <ian@cygnus.com>
- * configure.in: Add havevecs, and put it in tdefaults.
- * mpw-config.in: Likewise.
- * configure: Rebuild.
- * targmatch.sed: New file; a sed script to build targmatch.h from
- config.bfd.
- * config.bfd: Add #if, #endif, and comments for targmatch.h.
- * targets.c: Include "fnmatch.h".
- (struct targmatch): Define.
- (bfd_target_match): Define by including targmatch.h.
- (bfd_find_target): If the target is not found by name, search for
- it as a configuration triplet.
- * Makefile.in: Rebuild dependencies.
- (BFD32_BACKENDS): Add aout-arm.o, aout-sparcle.o, hp300bsd.o,
- i386dynix.o, m68k4knetbsd.o, and riscix.o.
- (BFD32_BACKENDS_CFILES): Add aout-arm.c, aout-sparcle.c,
- hp300bsd.c, i386dynix.c, m68k4knetbsd.c, and riscix.c.
- (HFILES): Add targmatch.h. Also, alphabetize and reindent.
- (CFILES): Remove i386dynix.c and hp300bsd.c.
- (targmatch.h): New target.
- (do_clean): Remove targmatch.h.
-
- * configure.in: Add BFD_NEED_DECLARATION(getenv).
- * acconfig.h: Add NEED_DECLARATION_GETENV.
+ SCO Open Server Release 5 core file support, from Jouke Numan
+ <jnuman@hiscom.nl>:
+ * sco5-core.c: New file.
+ * configure.in (i[3456]86-*-sco3.2v5*): Use sco5-core.lo.
+ (sco5-core.lo): Define SCO5_CORE in COREFLAG.
+ * Makefile.am: Rebuild dependencies.
+ (OPTIONAL_BACKENDS): Add sco5-core.lo.
+ (OPTIONAL_BACKENDS_CFILES): Add sco5-core.c.
+ * bfd.c (struct _bfd): Add sco5_core_data field to tdata.
+ * targets.c (sco5_core_vec): Add to target list if SCO5_CORE.
+ * bfd-in2.h, configure, Makefile.in: Rebuild.
+
+Tue Dec 8 19:38:42 1998 Mark Klein <mklein@dis.com>
+
+ * config.bfd (hppa*-*-mpeix*): New target.
+ * configure.in: Add AC_HEADER_DIRENT.
+ (hppa*-*-mpeix*): New target.
+ * configure.host (hppa*-*-mpeix*): New host.
+ * hpux-core.c: Check HOST_HPPAMPEIX. Use HAVE_DIRENT_H and
+ friends rather than just including <sys/dir.h>.
+ * som.h (struct som_symbol): Add hppa_priv_level and apto
+ tc_data. Change all users.
+ (struct somdata): Add comp_unit field.
+ (obj_som_compilation_unit): Define.
+ (bfd_som_attach_compilation_unix): Declare.
+ * som.c: Check HOST_HPPAMPEIX.
+ (struct som_misc_symbol_info): Add new field priv_level.
+ (som_object_setup): Add current_offset parameter. Change all
+ callers.
+ (setup_sections): Likewise.
+ (som_object_p): For EXECLIBMAGIC, read the lst header.
+ (som_write_symbol_strings): Add compilation_unit parameter.
+ Change all callers.
+ (som_finish_writing): Write out compilation_unit.
+ (som_bfd_derive_misc_symbol_info): Set priv_level.
+ (som_build_and_write_symbol_table): Set xleast field to 3.
+ (som_slurp_symbol_table): Set symbol priv_level.
+ (bfd_som_attach_compilation_unit): New function.
+ (som_bfd_ar_write_symbol_stuff): Set xleast field to 3. Set
+ priv_level into symbol_value.
* configure, config.in: Rebuild.
- * sysdep.h: If NEED_DECLARATION_GETENV, declare getenv.
- * aout-adobe.c (aout_adobe_object_p): Don't declare getenv.
-
-Thu Oct 3 09:29:09 1996 Jeffrey A Law (law@cygnus.com)
-
- * cpu-mn10x00.c, elf32-mn10x00: Removed.
- * cpu-mn10200.c, cpu-mn10300.c: New files.
- * elf32-mn10200.c, elf32-mn10300.c: New files.
- * Makefile.in: Break mn10x00 support into two separate
- configurations, mn10200 and mn10300.
- * archures.c, config.bfd, configure.in, elf.c, targets.c: Likewise.
- * bfd-in2.h, configure: Rebuilt.
-
-Thu Oct 3 15:38:19 1996 Jason Molenda (crash@godzilla.cygnus.co.jp)
-
- * Makefile.in (do_clean): Move config.log to do_distclean.
-
-Wed Oct 2 21:40:55 1996 Jeffrey A Law (law@cygnus.com)
-
- * cpu-mn10x00.c, elf32-mn10x00.c: New files.
- * Makefile.in (ALL_MACHINES): Add cpu-mn10x00.o.
- (BFD32_BACKENDS): Similarly for elf32-mn10x00.o.
- (elf32-mn10x00.o): Add dependencies.
- * archures.c (enum bfd_architecture): Add bfd_arch_mn10x00.
- (bfd_mn10x00_arch): Declare.
- (bfd_archures_list): Add bfd_mn10x00_arch.
- * config.bfd: Add mn10x00-*-*.
- * configure.in: Add bfd_elf32_mn10x00_vec.
- * elf.c (prep_headers): Handle bfd_arch_mn10x00.
- * targets.c (bfd_elf32_mn10x00_vec): Declare.
- (bfd_target_vector): Add bfd_elf32_mn10x00_vec.
- * bfd-in2.h, configure: Rebuilt.
-
-Wed Oct 2 15:46:45 1996 Klaus Kaempf <kkaempf@progis.de>
-
- openVMS/Alpha: Provide filename and case_hack flags via
- symbol table from gas.
- Add case_hack code for symbol output from vax/vms.
- * evax-alpha.c (evax_initialize): Remove filename handling,
- filename is provided via symbol table.
- (evax_get_symtab): Use local symbol count when setting up table.
- * evax-egsd.c (_bfd_evax_slurp_egsd): Print correct name when
- debugging.
- (_bfd_evax_write_egsd): Skip file name symbol.
- * evax-emh.c (get_vms_time_string): Local function now.
- (_bfd_evax_write_emh): Extract source filename and case_hack flags
- from symbol table.
- * evax_write_etir (_bfd_evax_write_etir): Pass all symbol names
- through _bfd_evax_case_hack_symbol.
- * evax-misc.c (hash_string, _bfd_evax_case_hack_symbol): New
- functions.
- (_bfd_evax_basename): Removed.
- (_bfd_get_vms_time_string): Moved to evax-emh.c.
- * evax.h (evax_private_data_struct): Remove filename.
- (flag_hash_long_names, flag_show_after_trunc,
- flag_no_hash_mixed_case, vms_name_mapping): New flags for
- vms_case_hack.
-
-Wed Oct 2 12:02:02 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * freebsd.h (N_GET_MAGIC_NET): Don't use ntohl.
- (N_GETMID_NET, N_GETFLAG_NET): Likewise.
- (NO_SWAP_MAGIC): Don't define.
- (SWAP_MAGIC): Define.
-
- * cofflink.c (_bfd_coff_link_input_bfd): Don't crash if there is
- no hash table entry for a global symbol.
-
-Tue Oct 1 16:14:22 1996 Joel Sherrill <joel@oarcorp.com>
-
- * config.bfd (mips*-*-rtems*): New target, like mips*-*-elf*.
-
-Tue Oct 1 12:31:39 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * cofflink.c (coff_link_add_symbols): Don't override a meaningful
- symbol type with T_NULL. Warn if symbol type changes. Based on
- patch from Philippe De Muyter <phdm@info.ucl.ac.be>.
-
- * elflink.h (elf_link_add_object_symbols): Only put a symbol from
- a dynamic object in the dynamic symbol table if it is referenced
- or defined by a regular object.
-
-Fri Sep 27 18:41:07 1996 Stu Grossman (grossman@critters.cygnus.com)
-
- * elf32-v850.c (bfd_elf32_v850_is_local_label): New function to
- remove dwarf local labels. Shrinks binaries by a factor of 3!
-
-Mon Sep 23 13:33:00 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * elf32-ppc.c (ppc_elf_add_symbol_hook): Create the .sbss section
- by hand, rather than by calling bfd_make_section.
-
-Mon Sep 23 09:23:41 1996 Doug Evans <dje@seba.cygnus.com>
-
- * reloc.c: Rename m32r relocs.
- * bfd-in2.h, libbfd.h: Rebuilt.
- * elf32-m32r.c: Update.
-Fri Sep 20 11:43:43 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * aoutx.h (aout_link_input_section_ext): When doing a relocateable
- link, adjust the symbol index of a base relative reloc. Don't
- change the addend of a PC relative reloc if pcrel_offset is set.
- * sunos.c (bfd_sunos_size_dynamic_sections): Don't do anything for
- a relocateable link.
-
- * reloc.c (bfd_perform_relocation): Apply the relocation even if
- it is zero, in case src_mask matters.
- (bfd_install_relocation): Likewise.
-
-Thu Sep 19 11:03:06 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * xcofflink.c (xcoff_link_add_symbols): Always initialize
- keep_syms.
- (_bfd_xcoff_bfd_final_link): Don't set target_index
- to an uninitialized value.
-
-Tue Sep 17 14:18:31 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * coffcode.h (coff_slurp_line_table): Warn about illegal symbol
- indices, rather than crashing.
- (coff_slurp_reloc_table): Likewise. Check whether the howto field
- is NULL.
- * coff-sh.c (sh_relocate_section): Check for an illegal symbol
- index.
-
-Mon Sep 16 12:39:36 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * coff-arm.c (aoutarm_std_reloc_howto): Change dst_mask for ARM26D
- reloc to 0.
- (coff_arm_adjust_symndx): New static function.
- (coff_adjust_symndx): Define.
-
- * srec.c (srec_scan): Accept multiple symbols on a single line.
- From Pascal Martin <pmartin@alsys.com>.
-
- * README: New file.
-
-Fri Sep 13 14:32:42 1996 Doug Evans <dje@canuck.cygnus.com>
+Tue Dec 8 16:21:35 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * hpux-core.c (hpux_core_core_file_p): Change call to nonexistent
+ warning function to call _bfd_error_handler instead.
+
+ * libbfd.c (COERCE32): Cast through unsigned long and long to
+ avoid bug in old version of gcc.
+
+ * elf64-alpha.c (elf64_alpha_additional_program_headers): Remove.
+ (elf_backend_additional_program_headers): Don't define.
+
+1998-12-08 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-fr30.c (fr30_final_link_relocate): Fix PC relative
+ relocations to include offset of 2 included in the insns, and the
+ offset of the relocs within the section.
+
+Wed Dec 2 15:03:59 1998 David Taylor <taylor@texas.cygnus.com>
+
+ The following changes were made by David Taylor
+ <taylor@texas.cygnus.com>, Edith Epstein
+ <eepstein@sophia.cygnus.com>, Jim Blandy
+ <jimb@zwingli.cygnus.com>, and Elena Zannoni
+ <ezannoni@kwikemart.cygnus.com> as part of the project to merge in
+ changes originally made by HP; HP did not create ChangeLog
+ entries.
+
+ * aclocal.m4, configure, Makefile.in: Rebuilt using latest
+ automake macro library.
+
+ * hpux-core.c (hpux_core_core_file_p): this function now
+ understands HPUX 10.30 thread info. Yes, the thread stacks can be
+ found in the corefile! Also, in hpux_core_core_file_p, if we
+ encounter a section with an unknown type, don't punt. Instead,
+ just skip it. Also, count the number of sections of known type
+ that we encounter. If we encounter at least one good one, then
+ we'll declare that the file is a core file. If we encounter any
+ unknown ones but some known ones, then we'll issue a warning (but
+ still declare it to be a core file). Also, correctly decide when a
+ file is not a core.
+ (PROC_INFO_HAS_THREAD_ID): define if CORE_ANON_SHMEM defined.
+ (CORE_ANON_SHMEM): define if not defined.
+ (hpux_core_struct): add members lwpid and user_tid.
+ (core_kernel_thread_id, core_user_thread_id): new macros.
+ (make_bfd_asection): use bfd_alloc to allocate room for a copy of
+ the name before storing it in the bfd.
+ (hpux_core_core_file_p): handle threads.
+
+ * libhppa.h (GET_FIELD): protect against redefinition.
+ (HPPA_WIDE): define.
+ (GET_FIELD): define.
+ (GET_BIT): define.
+ (MASK): define.
+ (CATENATE): define.
+ (ELEVEN): define.
+ (sign_extend): redefine.
+ (assemble_6): define.
+ (assemble_12): rewrite.
+ (assemble_16): define.
+ (assemble_16a): define.
+ (assemble_17): rewrite.
+ (assemble_22): define.
+
+1998-12-07 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-fr30.c (fr30_final_link_relocate): Using signed
+ relocations for signed values.
+
+Sun Dec 6 16:30:33 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * mipsbsd.c (MY(set_arch_mach)): Make static.
+ * aoutx.h (NAME(aout,machine_type)): For bfd_arch_mips, use
+ bfd_mach_mips* macros rather than simple numbers.
+
+ COFF weak symbol support, based on patches from Mark Elbrecht
+ <snowball3@usa.net>:
+ * coffcode.h (coff_slurp_symbol_table): Handle C_WEAKEXT.
+ * coffgen.c (coff_renumber_symbols): Handle weak symbols.
+ (coff_write_alien_symbol): Likewise.
+ * cofflink.c (coff_link_check_ar_symbols): Likewise.
+ (coff_link_add_symbols): Likewise.
+ (_bfd_coff_link_input_bfd): Likewise.
+ (_bfd_coff_write_global_sym): Likewise.
- * aoutf1.h (MY_bfd_merge_private_bfd_data): Define.
- (sunos_merge_private_bfd_data): New function.
+ * elf.c (copy_private_bfd_data): Always initialize the
+ includes_phdrs field.
-Fri Sep 13 15:50:57 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elflink.h (elf_fix_symbol_flags): Check for case where a non-ELF
+ file defines a symbol first mentioned in an ELF file.
- * bfd.c (bfd_copy_private_bfd_data): Switch on output BFD rather
- than input BFD.
- (bfd_merge_private_bfd_data): Likewise.
- * section.c (bfd_copy_private_section_data): Likewise.
- * syms.c (bfd_copy_private_symbol_data): Likewise.
+ * bfd-in.h: Always define BFD_HOST_64_BIT and BFD_HOST_U_64_BIT if
+ possible, rather than only if BFD64.
+ * elflink.h (compute_bucket_count): Just check BFD_HOST_U_64_BIT,
+ not __GNUC__.
* bfd-in2.h: Rebuild.
- * aout-target.h (MY_bfd_copy_private_section_data): Check that
- both BFD's are the right flavour.
- * ecoff.c (_bfd_ecoff_bfd_copy_private_bfd_data): Likewise.
- * elf.c (_bfd_elf_copy_private_symbol_data): Likewise.
- * elf32-mips.c (_bfd_mips_elf_copy_private_bfd_data): Likewise.
- (_bfd_mips_elf_merge_private_bfd_data): Likewise.
- * elf32-ppc.c (ppc_elf_copy_private_bfd_data): Likewise.
- (ppc_elf_merge_private_bfd_data): Likewise.
- * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Likewise.
- * peicode.h (pe_bfd_copy_private_section_data): Likewise.
-
- * elf32-hppa.c (elf_hppa_howto_table): Fill in some fields for
- R_PARISC_DIR32, so that _bfd_stab_section_find_nearest_line passes
- its sanity check.
-
-Thu Sep 12 11:45:57 1996 Doug Evans <dje@seba.cygnus.com>
-
- * reloc.c: Add m32r relocs.
- * bfd-in2.h, libbfd.h: Rebuilt.
- * cpu-m32r.c,elf32-m32r.c: New files.
-
-Thu Sep 12 11:10:05 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * ieee.c (ieee_vec): Set symbol_leading_char field to '_'.
-
-Wed Sep 11 11:57:56 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * tekhex.c (first_phase): Change type parameter from char to int.
- (out): Likewise.
- (pass_over): Change func to expect int, not char.
-
- * elf.c (assign_file_positions_for_segments): Test SEC_ALLOC
- rather than SEC_LOAD when aligning the file offset for the first
- section in a segment.
-
-Tue Sep 10 16:18:30 1996 Fred Fish <fnf@cygnus.com>
-
- * syms.c (coff_section_type): Make arg const.
- * irix-core.c (irix_core_core_file_p): Remove extraneous extra arg
- to make_bfd_asection().
- * elf-bfd.h (bfd_section_from_phdr): Add prototype.
- * elfcode.h (bfd_section_from_phdr): Remove prototype.
- (_bfd_elf_stringtab_init): Remove prototype.
-
- * netbsd-core.c (swap_abort): Add prototype.
- * aix386-core.c (swap_abort): Ditto & make static
- * hpux-core.c (swap_abort): Ditto & make static.
- * irix-core.c (swap_abort): Ditto & make static.
- * ptrace-core.c (swap_abort): Ditto & make static.
- * trad-core.c (swap_abort): Ditto & make static.
- * coffswap.h (coff_swap_reloc_in): Ditto.
- (coff_swap_reloc_out): Ditto.
- (coff_swap_filehdr_in): Ditto.
- (coff_swap_filehdr_out): Ditto.
- (coff_swap_sym_in): Ditto.
- (coff_swap_sym_out): Ditto.
- (coff_swap_aux_in): Ditto.
- (coff_swap_aux_out): Ditto.
- (coff_swap_lineno_in): Ditto.
- (coff_swap_lineno_out): Ditto.
- (coff_swap_aouthdr_in): Ditto.
- (coff_swap_aouthdr_out): Ditto.
- (coff_swap_scnhdr_in): Ditto.
- (coff_swap_scnhdr_out): Ditto.
- * ihex.c (ihex_sizeof_headers): Ditto.
- * tekhex.c (getsym): Ditto.
- (find_chunk): Ditto & make static.
- (insert_byte): Ditto.
- (first_phase): Ditto.
- (pass_over): Ditto.
- (tekhex_get_symtab): Ditto & make static.
- (tekhex_get_symtab_upper_bound): Ditto & make static.
- (tekhex_mkobject): Ditto.
- (tekhex_object_p): Ditto.
- (move_section_contents): Ditto.
- (tekhex_get_section_contents): Ditto.
- (tekhex_set_arch_mach): Ditto & make static.
- (tekhex_set_section_contents): Ditto.
- (writevalue): Ditto.
- (writesym): Ditto.
- (out): Ditto.
- (tekhex_write_object_contents): Ditto.
- (tekhex_sizeof_headers): Ditto.
- (tekhex_make_empty_symbol): Ditto.
- (tekhex_get_symbol_info): Ditto.
- (tekhex_print_symbol): Ditto.
- * irix-core.c (make_bfd_asection): Ditto.
- (irix_core_core_file_p): Ditto.
- (irix_core_core_file_failing_command): Ditto.
- (irix_core_core_file_failing_signal): Ditto.
- (irix_core_core_file_matches_executable_p): Ditto.
- (irix_core_make_empty_symbol): Ditto.
- * coff-mips.c (mips_bfd_reloc_type_lookup): Ditto.
- * srec.c (srec_new_symbol): Ditto.
- (srec_get_section_contents): Ditto.
- (srec_set_arch_mach): Ditto.
- (srec_set_section_contents): Ditto.
- (internal_srec_write_object_contents): Ditto.
- (srec_write_object_contents): Ditto.
- (symbolsrec_write_object_contents): Ditto.
- (srec_sizeof_headers): Ditto.
- (srec_make_empty_symbol): Ditto.
- (srec_get_symtab_upper_bound): Ditto.
- (srec_get_symtab): Ditto.
- (srec_print_symbol): Ditto and make static.
- * elf.c (elf_read): Ditto
- (assign_section_numbers): Ditto.
- (elf_fake_sections): Ditto.
- (sym_is_global): Ditto.
- (elf_map_symbols): Ditto.
- (get_program_header_size): Ditto.
- * coffgen.c (make_a_section_from_file): Ditto.
- (coff_real_object_p): Ditto.
- (fixup_symbol_value): Ditto.
- (build_debug_section): Ditto.
- (copy_name): Ditto.
- * syms.c (coff_section_type): Ditto.
-
-Mon Sep 9 22:36:01 1996 Jeffrey A Law (law@cygnus.com)
-
- * bfd-in2.h: Rebuilt after m32r changes.
-
-Mon Sep 9 12:31:22 1996 Doug Evans <dje@canuck.cygnus.com>
-
- * config.bfd,configure.in,configure: Add m32r support.
- * Makefile.in,archures.c,elf.c,targets.c: Likewise.
- * config.bfd: Keep target list alphabetically sorted.
-
-Mon Sep 9 11:48:41 1996 Jeffrey A Law (law@cygnus.com)
-
- * elf32-v850.c (bfd_elf32_v850_reloc, case R_V850_HI16): Don't forget
- to add in the constant part found in the instruction itself.
- (case R_V850_HI16_S): Likewise.
-
-Fri Sep 6 17:04:39 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
-
- * elf32-d10v.c (elf_d10v_howto_table): Modify the size of R_D10V_16
- and R_D10V_18 to be 1 (word).
-
-Thu Sep 5 15:23:08 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * stabs.c (_bfd_link_section_stabs): If the output_section field
- of either section is bfd_abs_section, then the linker is
- discarding the section and we should not optimize it.
-
-Tue Sep 3 12:16:20 1996 Doug Evans <dje@canuck.cygnus.com>
-
- * Makefile.in (aout-sparcle.o): New target.
- * aoutf1.h (TARGET_IS_BIG_ENDIAN_P): Don't define if little endian.
- * config.bfd (sparclet-*-aout*): Add case.
- * configure.in (sparcle_aout_vec): Add case.
- * configure: Regenerated.
- * targets.c (sparcle_aout_vec): Declare.
- (bfd_target_vector): Add sparcle_aout_vec.
- * aout-sparcle.c: New file.
-
-Tue Sep 3 00:57:02 1996 Jeffrey A Law (law@cygnus.com)
-
- * elf32-v850.c (bfd_elf32_v850_reloc): Fix handling of
- low order sign bit propogation for R_V850_HI16_S.
-
- * elf32-v850.c (bfd_elf32_v850_reloc): New function for
- handling V850 specific relocs.
- (elf_v850_howto_table): Use the new function for some
- relocations. Twiddle masks & shifts for some relocs.
- Set partial_inplace where needed.
-
-Mon Sep 2 12:12:34 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * cpu-mips.c: Add an explicit mips:3000 entry, and change the
- default architecture to a machine number of 0.
- * elf32-mips.c (_bfd_mips_elf_object_p): Set the machine number
- for E_MIPS_ARCH_1.
- (_bfd_mips_elf_merge_private_bfd_data): If the machine number of
- the output BFD is the default, set it from the first input BFD.
-
-Sun Sep 1 18:38:01 1996 Jeffrey A Law (law@cygnus.com)
-
- * elf32-v850.c (elf_v850_howto_table): All the 16bit relocs
- insert at bitpos zero. The HI16 relocs are shifted right
- by 16 bits. Fix src_mask for all relocs.
- (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Define. The V850 is
- little endian!
- (TARGET_BIG_SYM, TARGET_BIG_NAME): Remove. The V850 is little
- endian!
-
-Sun Sep 1 15:41:08 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * rs6000-core.c (rs6000coff_core_file_matches_executable_p):
- Rewrite to use BFD file read routines and to avoid using a fixed
- length for the file name.
-
-Sat Aug 31 10:22:25 1996 Jeffrey A Law (law@cygnus.com)
-
- * elf32-v850.c (enum reloc_type): Add R_V850_{32,16,8}.
- (elf_v850_howto_table): Add support for R_V850_{32,16,8}.
- (v850_reloc_map): Add translation from BFD_RELOC_{32,16,8}
- to R_V850_{32,16,8}.
-
-Fri Aug 30 18:06:04 1996 J.T. Conklin <jtc@hippo.cygnus.com>
-
- * elf32-v850.c (reloc_type): Add R_V850_HI16_S.
- (elf_v850_howto_table): Add info for HI16_S reloc.
- (v850_reloc_map): Add HI_16_S reloc.
- * reloc.c: Define BFD_RELOC_V850_* relocs.
-Fri Aug 30 11:49:19 1996 Ian Lance Taylor <ian@cygnus.com>
+ * srec.c (srec_set_section_contents): Correct test to avoid
+ switching to 4 byte addresses after seeing a second section which
+ requires 3 byte addresses. From Joel Schantz
+ <joel.schantz@argosys.boeing.com>.
- Add SH ELF support.
- * elf32-sh.c: New file.
- * elf.c (prep_headers): Handle bfd_arch_sh.
- * elfcode.h (write_relocs): Handle absolute symbol.
- * elf-bfd.h (_bfd_elf32_link_read_relocs): Declare.
- (_bfd_elf64_link_read_relocs): Declare.
- * elflink.h (NAME(_bfd_elf,link_read_relocs)): Rename from
- elf_link_read_relocs. Make globally visible. Change all
- callers.
- (elf_link_input_bfd): Get external symbols from cache in
- symtab_hdr->contents. Get contents from cache in
- elf_section_data.
- * elfxx-target.h (bfD_elfNN_bfd_relax_section): Only define if not
- already defined.
- * reloc.c: Define BFD_RELOC_SH_* relocs.
- * libbfd-in.h (_bfd_sh_align_load_span): Declare.
- * coff-sh.c (sh_insns_conflict): Fix a return value.
- (_bfd_sh_align_load_span): New globally visible function, broken
- out of sh_align_load.
- (sh_align_load): Call _bfd_sh_align_load_span.
- (sh_swap_insns): Change relocs parameter to PTR.
- * bfd-in2.h, libbfd.h: Rebuild.
- * targets.c (bfd_elf32_sh_vec): Declare.
- (bfd_elf32_shl_vec): Declare.
- * config.bfd (sh-*-elf*): New target.
- * configure.in (bfd_elf32_sh_vec): New target vector.
- (bfd_elf32_shl_vec): New target vector.
- * configure: Rebuild.
- * Makefile.in: Rebuild dependencies.
- (BFD32_BACKENDS): Add elf32-sh.o.
- (BFD32_BACKENDS_CFILES): Add elf32-sh.c.
-
- * elf.c (map_sections_to_segments): Check that LMA does not skip a
- page before checking D_PAGED.
-
- * ihex.c (ihex_scan): Removed unnecessary extbase variable.
- (ihex_write_object_contents): Remove extbase; always use segbase
- instead.
-
-Thu Aug 29 16:52:17 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+ * config.bfd (m68*-*-gnu*): New target. From Aymeric Vincent
+ <aymeric.vincent@emi.u-bordeaux.fr>.
- * configure.in (i[345]86-*-*): Recognize i686 for pentium pro.
- * configure.host (i[345]86-*-*): Ditto.
- * config.bfd (i[345]86-*-*): Ditto.
- * configure: Regenerate.
+1998-12-04 Jim Blandy <jimb@zwingli.cygnus.com>
- * config.bfd (i[3456]86-*-dgux*): Recognize as a synonym for x86
- elf.
+ * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Fix logic to
+ decide whether the output file is -mrelocatable-lib,
+ -mrelocatable, or neither. (gdb.base/nodebug.exp)
-Tue Aug 27 09:18:18 1996 Jeffrey A Law (law@cygnus.com)
+1998-12-03 Nick Clifton <nickc@cygnus.com>
- * elf32-hppa.c (hppa_elf_gen_reloc_type): Add new argument.
- * elf32-hppa.h (hppa_elf_gen_reloc_type): Update prototype.
- * som.c (hppa_som_gen_reloc_type): Add new argument. If
- we encounter an R_DATA_ONE_SYMBOL reloc against a symbol that
- will have an ST_CODE type, change the symbol's type to ST_DATA.
- * som.c (hppa_som_gen_reloc_type): Update prototype.
+ * elf32-fr30.c: Add support for R_FR30_48 reloc.
+ * reloc.c: Add BFD_RELOC_FR30_48 relocation.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate
-Tue Aug 27 00:12:22 1996 Ian Lance Taylor <ian@cygnus.com>
+Wed Dec 2 00:58:37 1998 Ian Lance Taylor <ian@cygnus.com>
- * elf32-mips.c (mips_elf_check_relocs): Set dynobj if needed for
- R_MIPS_32 and R_MIPS_REL32. Set sgot and g as soon as possible.
- (mips_elf_size_dynamic_sections): Don't require .got to exist.
- (mips_elf_finish_dynamic_sections): Likewise.
+ * elflink.h (elf_adjust_dynamic_symbol): Warn on an attempt to
+ link against a dynamic symbol with no type or size.
-Thu Aug 22 10:54:38 1996 Ian Lance Taylor <ian@cygnus.com>
+1998-12-01 Ulrich Drepper <drepper@cygnus.com>
- * configure.host (HLDENV): New variable to set. Set it for
- *-*-sysv4*, since those linkers may not support -R but they always
- support LD_RUN_PATH.
+ * elf32-i386.c (i386_check_relocs) [R_386_32]: Don't emit
+ relocation for section which does not get loaded.
+ (elf_i386_relocate_section) [R_386_32]: Likewise.
- * libieee.h (NSECTIONS): Don't define.
- (ieee_data_struct): Change section_table to asection **. Add
- section_table_size.
- * ieee.c (get_section_entry): If the table isn't big enough, make
- it bigger.
- (ieee_slurp_sections): Remove assertion about number of sections.
- (ieee_object_p): Adjust initialization of ieee to match changes to
- the structure.
+Tue Dec 1 11:33:33 1998 Jim Wilson <wilson@cygnus.com>
- * xcofflink.c (xcoff_mark): Don't copy relocs for undefined
- symbols merely because we are generating a shared library.
- (xcoff_build_ldsyms): Don't set up global linkage code for an
- undefined symbol merely because we are generating a shared
- library.
+ * coff-h8300.c (h8300_bfd_link_add_symbols): Make reloc_size,
+ reloc_count and i long instead of unsigned long. Handle error
+ return from bfd_canonicalize_reloc.
-Tue Aug 20 15:06:05 1996 J.T. Conklin <jtc@hippo.cygnus.com>
+1998-12-01 Nick Clifton <nickc@cygnus.com>
- * Makefile.in (ALL_MACHINES): Add cpu-v850.o.
- (BFD32_BACKENDS) Add elf32-v850.o.
- * archures.c: Add bfd_v850_arch.
- * bfd-in2.h: Add bfd_v850_arch.
- * config.bfd (v850-*-*): New target.
- * configure: (bfd_elf32_v850_vec) New vector.
- * configure.in: (bfd_elf32_v850_vec) New vector.
- * cpu-v850.c: New file.
- * elf.c (prep_headers): Added case bfd_arch_v850.
- * elf32-v850.c: New file.
- * targets.c (bfd_elf32_v850_vec): New vector.
+ * elf32-v850.c (v850_elf_relocate_section): Detect the absence of
+ a hash table.
-Fri Aug 16 16:25:35 1996 Ian Lance Taylor <ian@cygnus.com>
+Mon Nov 30 15:28:09 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
- * xcofflink.c (xcoff_link_add_dynamic_symbols): Create and define
- a function code symbol for an XMC_XO symbol.
+ * elf32-sh.c (elf/sh.h): Include.
+ sh_reloc_type: Delete. Changed all references to elf_sh_reloc_type.
+ (sh_elf_howto_tab): Add HOWTO for R_SH_SWITCH8.
+ (sh_reloc_map): Map BFD_RELOC_8_PCREL to R_SH_SWITCH8.
+ (sh_elf_relax_delete_bytes): Handle R_SH_SWITCH8.
+ * Makefile.in: Add dependency of elf32-sh.lo on $(INCDIR)/elf/sh.h.
-Thu Aug 15 12:33:29 1996 Stan Shebs <shebs@andros.cygnus.com>
+Fri Nov 27 17:51:38 1998 Geoff Keating <geoffk@ozemail.com.au>
- * mpw-config.in: Update editing of autoconf vars to reflect
- Jul 18 configure.in change.
- * mpw-make.sed: Update editing of include pathnames to be
- more general, add @DASH_C_FLAG@ to explicit compile rule edit.
+ * elflink.h (compute_bucket_count): Don't allow minsize==0, it
+ causes division by zero later on.
-Thu Aug 15 10:35:13 1996 Richard Henderson <rth@tamu.edu>
+Thu Nov 26 11:19:35 1998 Dave Brolley <brolley@cygnus.com>
- * elf64-alpha.c (elf64_alpha_output_extsym): The section from
- which to offset to get the .plt entry address is ".plt".
+ * elf32-fr30.c (fr30_elf_pc9_reloc,fr30_elf_pc12_reloc): Not
+ needed.
-Thu Aug 15 16:40:30 1996 James G. Smith <jsmith@cygnus.co.uk>
+1998-11-25 DJ Delorie <dj@cygnus.com>
- * reloc.c: (BFD_RELOC_ARM_THUMB_ADD, BFD_RELOC_ARM_THUMB_IMM,
- BFD_RELOC_ARM_THUMB_SHIFT, BFD_RELOC_ARM_THUMB_OFFSET):
- Added, for internal use by the ARM gas.
- * libbfd.h: Rebuilt
- * bfd-in2.h: Rebuilt
+ * coff-i386.c (i3coff_object_p): Remove hack. Use new emulation
+ hook now.
-Wed Aug 14 17:02:09 1996 Richard Henderson <rth@tamu.edu>
+Tue Nov 24 10:25:27 1998 Nick Clifton <nickc@cygnus.com>
- * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Correct typo
- in section dynidx start.
+ * elf32-fr30.c (fr30_elf_relocate_section): Call
+ fr30_final_link_relocate.
+ (fr30_final_link_relocate): New function: Handle I20 and I32
+ relocs.
+ (fr30_elf_i32_reloc): New function: Handle I32 relocs.
+ (fr30_elf_pc9_reloc): New function: Handle 9_PCREL relocs.
+ (fr30_elf_pc12_reloc): New function: Handle 12_PCREL relocs.
-Tue Aug 13 14:35:38 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-v850.c (v850_elf_relocate_section): Reset hi16s reloc
+ chain to empty.
- * elf.c (_bfd_elf_make_section_from_shdr): Treat sections whose
- name begins with .gnu.linkonce as SEC_LINK_ONCE. This is an
- optimization for g++.
+ The following changes are based on a patch submitted by Gianluca
+ Moro <glctr@abc.it>:
-Tue Aug 13 17:04:40 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+ (v850_elf_perform_relocation): Only update a hi16s reloc if it has
+ not already been updated.
+ (find_remembered_hi16s_reloc): New parameter 'already_found'
+ returns state of remembered hi16s reloc.
+ (remember_hi16s_reloc): Set 'found' field to false.
+ (hi16s_location): Add 'found' field.
- * elf32-ppc.c (ppc_elf_merge_private_bfd_data): If one module has
- the -mrelocatable-lib bit set and the other doesn't, clear the
- -mrelocatable-lib bit in the header.
+1998-11-23 DJ Delorie <dj@cygnus.com>
-Sat Aug 10 22:59:17 1996 Ian Lance Taylor <ian@cygnus.com>
+ * coff-i386.c (bfd_pe_dll_not_recognized_hack): the linker wants
+ to see .DLL files as unrecognized.
+ (i3coff_object_p): Sorry, had to hack it to not recognize these
+ files (pei-i386) on request.
- * elflink.h (elf_link_add_object_symbols): Do not resolve a common
- symbol against a STT_FUNC symbol in a shared library.
+1998-11-23 DJ Delorie <dj@cygnus.com>
-Fri Aug 9 12:44:57 1996 Ian Lance Taylor <ian@cygnus.com>
+ * opncls.c (bfd_make_readable): need more cleanup for symbols and
+ relents. Call bfd_check_format to reinitialize.
- * xcofflink.c (xcoff_link_add_dynamic_symbols): If a descriptor
- symbol is found, automatically define the corresponding function
- code.
+Fri Nov 20 14:21:36 1998 Nick Clifton <nickc@cygnus.com>
- * cofflink.c (coff_link_add_symbols): Only set (*sym_hash)->numaux
- if sym.n_numaux is not zero.
- (_bfd_coff_link_input_bfd): Permit the symbol and the hash table
- entry to disagree about the number of aux entries if the symbol
- has zero.
-
- * elf32-mips.c (mips_elf_check_relocs): Create the .rel.dyn
- section if it might be needed, not just if info->shared.
- (mips_elf_adjust_dynamic_symbol): Make room for a null element at
- the start of .rel.dyn if we are going to use it.
- (mips_elf_finish_dynamic_sections): Only clear the first element
- of .rel.dyn if the size is greater than zero.
-
-Thu Aug 8 16:24:55 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * xcofflink.c (xcoff_link_input_bfd): If we already called the
- undefined_symbol callback for a symbol, then don't issue any more
- warnings about loader relocs.
- (_bfd_ppc_xcoff_relocate_section): Don't do any further processing
- after calling the undefined_symbol callback.
-
- * xcofflink.c (XCOFF_MULTIPLY_DEFINED): Define.
- (xcoff_link_add_symbols): Permit multiple definitions of a symbol
- as the AIX linker seems to do.
-
-Thu Aug 8 12:21:56 1996 Klaus Kaempf <kkaempf@progis.de>
-
- * evax-alpha.c (evax_alpha_vec): Corrected flags, cleanup.
- (evax_initialize): Remove evax_reloc_table.
- (evax_close_and_cleanup): Ditto.
- (reloc_nil): Ditto.
- (alpha_howto_table): Remove ALPHA_R_SWREL32 and ALPHA_R_SWREL64
- entries.
- (evax_bfd_reloc_type_lookup): Ditto.
- * evax-egsd.c (_bfd_evax_slurp_egsd): Add a few casts; set
- cooked_size == raw_size.
- * evax-emh.c (_bfd_evax_register_filename): Remove.
- * evax-etir.c (etir_stc): Allow ETIR_S_C_STC_xx commands.
- * evax-misc.c (add_new_contents): Malloc section at full size.
- (_bfd_save_evax_section): Memcpy section contents directly.
- * evax.h (ALPHA_R_SWREL32, ALPHA_R_SWREL64): Remove.
- (evax_reloc_table): Remove.
-
- * hosts/alphavms.h (O_ACCMODE): Define if needed.
-
- * makefile.vms: Add better support for DEC C compilation
- Add evax.h dependencies
-
- * reloc.c (bfd_get_reloc_size): Add case for 16 byte reloc.
- (BFD_RELOC_SWREL32,BFD_RELOC_SWREL64): Remove.
- (BFD_RELOC_ALPHA_BASEREG): Remove.
- * bfd-in2.h, libbfd.h: Rebuild.
-
-Thu Aug 8 08:17:32 1996 Stu Grossman (grossman@critters.cygnus.com)
-
- * archive.c (bsd_write_armap): Ifdef around calls to getuid and
- getgid if _WIN32 is defined.
- * opncls.c (bfd_fdopenr): Remove unnecessary WINGDB ifdef.
-
-Wed Aug 7 23:19:00 1996 Stu Grossman (grossman@critters.cygnus.com)
-
- * aoutx.h bfd-in.h bfd-in2.h opncls.c riscix.c som.c targets.c:
- Change NO_FLAGS to BFD_NO_FLAGS to avoid conflict with an HPUX
- include file.
- * libbfd.c: Create dummy getpagesize() macro if HAVE_GETPAGESIZE
- isn't defined.
-
-Wed Aug 7 14:11:44 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
-
- * configure.in: Call BFD_NEEDED_DECLARATION on strstr and
- realloc.
- * acconfig.h (NEED_DECLARATION_STRSTR): New macro.
- (NEED_DECLARATION_REALLOC): New macro.
- * configure, config.in: Rebuild.
- * sysdep.h (strstr): Declare if NEED_DECLARATION_STRSTR.
- (realloc): Declare if NEED_DECLARATION_REALLOC.
+ * elf32-fr30.c (fr30_elf_relocate_section): Remove spurious
+ warnings.
- * aclocal.m4 (BFD_NEED_DECLARATION): Include <string.h> or
- <strings.h> if they exist.
+Thu Nov 19 14:42:15 1998 Geoffrey Noer <noer@cygnus.com>
- * ieee.c (ieee_set_section_contents): Cast bfd_alloc return.
+ * aclocal.m4: regenerate
+ * configure: regenerate
-Wed Aug 7 12:12:03 1996 Ian Lance Taylor <ian@cygnus.com>
+Tue Nov 17 20:23:35 1998 Richard Henderson <rth@cygnus.com>
- * cpu-i386.c (i8086_arch): Architecture info for the i8086.
+ * elf-bfd.h (struct elf_link_hash_entry): Add vtable_entries_size.
+ * elf.c (_bfd_elf_link_hash_newfunc): Clear it.
+ * elflink.h (elf_gc_propagate_vtable_entries_used): Copy it, and
+ respect it as an upper bound on what memory to reference.
+ (elf_gc_smash_unused_vtentry_relocs): Likewise.
+ (elf_gc_record_vtentry): Handle as-yet undefined vtables. Set and
+ update vtable_entries_size appropriately.
- Based on patches from Eric Valette <valette@crf.canon.fr>:
- * elf32-i386.c (enum reloc_type): Add FIRST_INVALID_RELOC,
- LAST_INVALID_RELOC, R_386_16, R_386_PC16, R_386_8, R_386_PC8.
- (elf_howto_table): Add entries for new relocs.
- (elf_i386_reloc_type_lookup): Handle new relocs.
- (elf_i386_info_to_howto): Just call abort.
- (elf_i386_info_to_howto_rel): Check that the reloc type is valid.
- (elf_i386_relocate_section): Likewise.
+Tue Nov 17 15:28:31 1998 Nick Clifton <nickc@cygnus.com>
-Tue Aug 6 12:54:56 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+ * elf32-fr30.c (fr30_reloc_type_lookup): Used integers to hold
+ reloc number.
- * elf32-d10v.c (elf_d10v_howto_table): Added R_D10V_32.
+Mon Nov 16 22:19:21 1998 DJ Delorie <dj@cygnus.com>
-Mon Aug 5 13:42:41 1996 Ian Lance Taylor <ian@cygnus.com>
+ * archive.c (bfd_ar_hdr_from_filesystem): support BFD_IN_MEMORY
+ bfds; they have no "file" so we fake it.
+ * bfd-in2.h: add bfd_make_writable and bfd_make_readable (regen)
+ * libbfd.c (bfd_write): Allow writing to BFD_IN_MEMORY bfds by
+ resizing the memory buffer.
+ * opncls.c (bfd_make_writable): New function; lets you write a
+ bfd_create'd bfd to an in-memory buffer.
+ (bfd_make_readable): New function; lets you read back that buffer
+ as if it were from bfd_openr. Used to build generated archive
+ members (winsup's ld's dlltool)
- * elf.c (_bfd_elf_make_section_from_shdr): For a loadable section,
- only get the LMA from the phdr if they are in the same part of the
- file.
+Mon Nov 16 19:15:19 1998 Dave Brolley <brolley@cygnus.com>
- * elf.c (map_sections_to_segments): Rewrite tests for starting a
- new segment to make them more comprehensible. If the relationship
- between the LMA and the VMA changed, start a new segment. Don't
- check dynsec when deciding whether to start a new segment for a
- writeable section; -N will now handle this.
-
-Thu Aug 1 22:43:08 1996 Jeffrey A Law (law@cygnus.com)
-
- * libhppa.h: Remove "esel" changes. Not the right approach.
- * som.c: Corresponding changes.
- (som_bfd_derive_misc_symbol_info): Use ST_DATA for symbols
- which don't have a SOM symbol type associated with them.
- Reverses a 1994 change.
-
-Wed Jul 31 15:50:55 1996 Ian Lance Taylor <ian@cygnus.com>
-
- Make ld -N more reasonable for ELF:
- * elf.c (map_sections_to_segments): If D_PAGED is not set, set
- phdr_in_section to false, and always use a single load segment.
- (elf_sort_sections): Sort sections by LMA after VMA.
- (assign_file_positions_for_segments): If D_PAGED is not set, don't
- align to maxpagesize.
- (assign_file_positions_except_relocs): Likewise.
- * elfcode.h (elf_object_p): If a section is loaded but not page
- aligned, clear D_PAGED.
-
-Wed Jul 31 15:00:12 1996 James G. Smith <jsmith@cygnus.co.uk>
-
- * reloc.c: (BFD_RELOC_ARM_OFFSETIMM8, BFD_RELOC_ARM_HWLITERAL):
- Added, for internal use by the ARM gas.
- * libbfd.h: Rebuilt
- * bfd-in2.h: Rebuilt
-
-Tue Jul 30 14:14:57 1996 Jeffrey A Law (law@cygnus.com)
-
- * libhppa.h (R_HPPA_ESEL): New field selector.
- (e_esel): Similarly.
- * som.c (hppa_som_gen_reloc_type): If we encounter an e_esel,
- then generate R_COMP2 (PUSH_SYM), R_DATA_EXPR fixup stream.
- (som_write_fixups): Handle R_DATA_EXPR just like R_CODE_EXPR.
-
-Tue Jul 30 13:31:27 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * xcofflink.c (_bfd_xcoff_bfd_link_add_symbols): Do the regular
- archive search before looking for stripped dynamic objects.
-
-Fri Jul 26 17:51:39 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * xcofflink.c (xcoff_build_ldsyms): Make exporting an undefined
- symbol a warning rather than an error.
-
-Wed Jul 24 12:02:53 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * elf.c (assign_file_positions_for_segments): Track the virtual
- memory position separately from the file position, and use it to
- compute the alignment adjustment.
-
-Tue Jul 23 10:43:31 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
-
- * elf32-d10v.c (elf_d10v_howto_table): Changed all relocs to "long"
- and fixed mask on R_D10V_10_PCREL_L.
-
-Mon Jul 22 15:30:30 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * elf64-mips.c: Include "aout/ar.h".
- (mips_elf64_slurp_armap): New static function.
- (mips_elf64_write_armap): New static function.
- (bfd_elf64_archive_*): Define.
- * elfxx-target.h (bfd_elfNN_archive_p): Define if not defined.
- Use instead of bfd_generic_archive_p.
- (bfd_elfNN_write_archive_contents): Define if not defined. Use
- instead of _bfd_write_archive_contents.
- (bfd_elfNN_mkdarchive): Define if not defined. Use instead of
- _bfd_generic_mkarchive.
- (TARGET_BIG_SYM): If bfd_elfNN_archive_functions is defined, use
- bfd_elfNN_archive in BFD_JUMP_TABLE_ARCHIVE rather than
- _bfd_archive_coff.
- (TARGET_LITTLE_SYM): Likewise.
- * archive.c (bfd_slurp_armap): Check for and reject an archive map
- name of /SYM64/.
- * Makefile.in: Rebuild dependencies.
-
- * elf32-mips.c (_bfd_mips_elf_final_write_processing): Handle
- SHT_MIPS_LIBLIST, SHT_MIPS_CONTENT, SHT_MIPS_SYMBOL_LIB, and
- SHT_MIPS_EVENTS sections.
- (_bfd_mips_elf_section_from_shdr): Handle SHT_MIPS_IFACE,
- SHT_MIPS_CONTENT, SHT_MIPS_SYMBOL_LIB, and SHT_MIPS_EVENTS
- sections.
- (_bfd_mips_elf_fake_sections): Likewise.
+ * po/bfd.pot: Regenerated.
- * libecoff.h (ecoff_data_type): Add rdata_in_text field.
- * ecoff.c (ecoff_compute_section_file_positions): Copy
- rdata_in_text from backend info to tdata. Clear it if any data
- section comes before .rdata.
- (_bfd_ecoff_write_object_contents): Use rdata_in_text field in
- tdata rather than backend info.
+Mon Nov 16 10:57:06 1998 Nick Clifton <nickc@cygnus.com>
-Fri Jul 19 18:15:51 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-v850.c (hi16s_location): Replaced fixed size array with
+ linked list.
- * configure.in: Fix test for whether a compiler has a 64 bit
- type. From Jim Wilson <wilson@cygnus.com>.
+Sun Nov 15 20:28:25 1998 Richard Henderson <rth@cygnus.com>
-Thu Jul 18 15:39:10 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf64-alpha.c (elf64_alpha_relax_section): Search for the proper
+ element of the gotentry list for local symbols too.
+ (elf64_alpha_relocate_section): Unify local and global handling.
+ Assert that gotent->use_count > 0.
- * configure.host (mips-sgi-irix6*): New host.
+Sat Nov 14 15:16:01 1998 Ian Lance Taylor <ian@cygnus.com>
- * configure.in: Set and substitute VERSION, BFD_HOST_64BIT_LONG
- (replacing HOST_64BITLONG), BFD_HOST_64_BIT_DEFINED,
- BFD_HOST_64_BIT, and BFD_HOST_U_64_BIT. Add bfd-in2.h:bfd-in2.h
- to AC_OUTPUT call.
+ * configure.in (vms_alpha_vec): Rename from evax_alpha_vec, and
+ update for file name changes of July 2, 1998.
+ (vms_vax_vec): New.
* configure: Rebuild.
- * bfd-in.h (BFD_ARCH_SIZE): Define as @wordsize@, not @WORDSIZE@.
- (BFD_HOST_64_BIT): Define conditionally.
- (BFD_HOST_U_64_BIT): Define when BFD_HOST_64_BIT is defined.
- (bfd_vma): Typedef as BFD_HOST_U_64_BIT.
- (symvalue, bfd_size_type): Likewise.
- * bfd-in2.h: Rebuild.
- * Makefile.in (do_clean): Remove bfd-tmp.h.
- (do_distclean): Remove bfd-in3.h.
- (stmp-bfd.h): Just do copy-if-change bfd-in3.h bfd.h.
- (bfd-in3.h): New target.
-
- * config.bfd (sparc-*-sysv4*): Don't build sunos_big_vec. From
- Andrew Gierth <ANDREWG@microlise.co.uk>.
-
- * configure.host: Set INSTALL_SHLIB.
- * configure.in: Call AC_SUBST (INSTALL_SHLIB).
- * configure: Rebuild.
- * Makefile.in (install): Use @INSTALL_SHLIB@.
-
- * config.bfd (mips*-*-irix6*): New target.
- * configure.host: Handle Irix 6 shared library like Irix 5.
-
- * xcofflink.c (xcoff_link_add_symbols): Don't check an XMC_TD
- symbol for a magic name.
- (xcoff_link_input_bfd): Don't change the reloc symbol for an
- XMC_TD symbol.
- (_bfd_ppc_xcoff_relocate_section): Don't get the TOC offset for an
- XMC_TD symbol.
-
-Thu Jul 18 11:36:31 1996 Stan Shebs <shebs@andros.cygnus.com>
-
- * mpw-config.in: Add ELF support to mips config, create the
- elf32-target.h file in the object dir.
- * mpw-make.sed: Edit elfXX-target.h refs at beginnings of lines.
-
-Wed Jul 17 18:02:32 1996 Kim Knuttila <krk@cygnus.com>
- * coff-ppc.c: Redid debug scheme - numerous fprintf's gone.
- Also removed most abort calls, in favor of using bfd reporting.
+Thu Nov 12 19:19:54 1998 Dave Brolley <brolley@cygnus.com>
-Wed Jul 17 14:51:52 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+ * po/bfd.pot: Regenerated.
- * Makefile.in (ALL_MACHINES): Add cpu-d10v.o.
- (BFD32_BACKENDS) Add elf32-d10v.o.
- * archures.c: Add bfd_d10v_arch.
- * bfd-in2.h: Add bfd_d10v_arch.
- * config.bfd (d10v-*-*): New target.
- * configure: (bfd_elf32_d10v_vec) New vector.
- * configure.in: (bfd_elf32_d10v_vec) New vector.
- * cpu-d10v.c: New file.
- * elf.c (prep_headers): Added case bfd_arch_d10v.
- * elf32-d10v.c: New file.
- * libbfd.h: Rebuild.
- * reloc.c (BFD_RELOC_D10V_10_PCREL_R, BFD_RELOC_D10V_10_PCREL_L,
- BFD_RELOC_D10V_18, BFD_RELOC_D10V_18_PCREL): Define.
- * targets.c (bfd_elf32_d10v_vec): New vector.
-
-Wed Jul 17 10:58:55 1996 Kim Knuttila <krk@cygnus.com>
-
- * coff-ppc.c (coff_ppc_relocate_section): Removed bogus fprintf
-
-Tue Jul 16 23:49:02 1996 Stu Grossman (grossman@critters.cygnus.com)
-
- * archures.c bfd-in2.h: Add bfd_mach_i386_i386 and
- bfd_mach_i386_i8086 machine types.
-
-Wed Jul 10 12:42:56 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * ecoff.c (_bfd_ecoff_new_section_hook): Set SEC_CODE for _INIT
- and _FINI sections.
-
-Wed Jul 10 11:18:21 1996 Richard Henderson <rth@tamu.edu>
-
- * coffcode.h (coff_set_section_contents): A/UX does not require
- special handling of the _LIB section.
-
-Tue Jul 9 15:52:20 1996 Jeffrey A Law (law@cygnus.com)
-
- * coff-h8300.c (h8300_reloc16_extra_cases): Use the correct
- value for R_RELBYTE.
-
- * reloc16.c (bfd_coff_reloc16_relax_section): Only "shrinks"
- array if one was allocated.
-
-Tue Jul 9 12:21:54 1996 Ian Lance Taylor <ian@cygnus.com>
-
- From Kazumoto Kojima <kkojima@kk.info.kanagawa-u.ac.jp>:
- * elf32-mips.c (struct mips_elf_link_hash_table): Add new fields
- use_rld_obj_head and rld_value.
- (mips_elf_link_hash_table_create): Initialize new fields.
- (mips_elf_add_symbol_hook): Mark __rld_obj_head symbol as
- dynamic.
- (mips_elf_create_dynamic_sections): Create .rld_map section. If
- __rld_obj_head symbol not seen, create an __rld_map symbol.
- (mips_elf_size_dynamic_sections): Make space in .rld_map section.
- Create a DT_MIPS_RLD_MAP entry rather than a DT_DEBUG entry.
- (mips_elf_finish_dynamic_symbol): Save value of __rld_map or
- __rld_obj_head symbol.
- (mips_elf_finish_dynamic_sections): Handle DT_MIPS_RLD_MAP.
+Tue Nov 10 16:17:06 1998 Geoffrey Noer <noer@cygnus.com>
-Mon Jul 8 16:18:03 1996 Ian Lance Taylor <ian@cygnus.com>
+ * acinclude.m4, config.bfd: detect cygwin* instead of cygwin32*.
+ * aclocal.m4, configure: regenerate
- * elf32-mips.c (mips_reloc_map): Remove BFD_RELOC_32_PCREL entry.
+Tue Nov 10 15:13:59 1998 Nick Clifton <nickc@cygnus.com>
- * elf32-ppc.c (ppc_elf_howto_raw): For R_PPC_ADDR16_HA, use
- ppc_elf_addr16_ha_reloc.
- (ppc_elf_addr16_ha_reloc): New static function.
+ * elf.c (prep_headers): Add support for bfd_arch_fr30.
- * coff-mips.c (struct mips_hi): Define.
- (mips_refhi_list): New static variable.
- (mips_refhi_addr, mips_refhi_addend): Remove.
- (mips_refhi_reloc): Maintain a list of unmatched REFHI relocs.
- (mips_reflo_reloc): Process mips_refhi_list.
- (mips_relhi_list): New static variable.
- (mips_relhi_addr, mips_relhi_addend): Remove.
- (mips_relhi_reloc): Maintain a list of unmatched RELHI relocs.
- (mips_rello_reloc): Process mips_relhi_list.
- (mips_relocate_section): Permit an arbitrary number of REFHI or
- RELHI relocs before the associated REFLO or RELLO reloc.
+Tue Nov 10 13:37:36 1998 Felix Lee <flee@cygnus.com>
-Fri Jul 5 19:27:49 1996 Ian Lance Taylor <ian@cygnus.com>
+ * acinclude.m4 (BFD_HAVE_SYS_PROCFS_TYPE,
+ BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): didn't define macro when value
+ was cached.
+ * aclocal.m4, configure: regenerated.
- * aout-target.h (MY(callback)): Set reloc_count fields.
+Tue Nov 10 14:31:01 1998 Catherine Moore <clm@cygnus.com>
-Thu Jul 4 12:00:37 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-d10v.c (reloc_type): Add R_D10V_GNU_VTINHERIT and
+ R_D10V_GNU_VTENTRY relocs.
+ (elf_d10v_howto_table): Likewise.
+ (d10v_reloc_map d10v_reloc_map): Likewise.
+ (elf32_d10v_gc_mark_hook): New.
+ (elf32_d10v_gc_sweep_hook): New.
+ (elf32_d10v_check_relocs): New.
+ (elf32_d10v_relocate_section): New.
+ (elf_backend_relocate_section): Define.
+ (elf_backend_can_gc_sections): Define.
- * sunos.c (sunos_add_dynamic_symbols): Don't create dynamic
- sections unless this is a SunOS link.
+Sat Nov 7 18:07:51 1998 Peter Schauer <peter.schauer@regent.e-technik.tu-muenchen.de>
- * VERSION: Set to 2.7.1.
+ * Makefile.am (BFD32_BACKENDS): Move vms files here...
+ (BFD64_BACKENDS): ...from here.
+ (BFD32_BACKENDS_CFILES): Move vms files here...
+ (BFD64_BACKENDS_CFILES): ...from here.
+ * Makefile.in: Rebuild.
- * Released binutils 2.7.
+Wed Nov 4 15:58:48 1998 Nick Clifton <nickc@cygnus.com>
-Wed Jul 3 14:59:47 1996 Ian Lance Taylor <ian@cygnus.com>
+ * Makefile.am: Add FR30 target.
+ * Makefile.in: Add FR30 target.
+ * archures.c: Add support for FR30.
+ * config.bfd: Add support for FR30.
+ * configure.in: Add support for FR30.
+ * reloc.c: Add support for FR30 relocations.
+ * targets.c: Add support for FR30 relocations.
+ * bfd-in2.h: Regenerate.
+ * configure: Regenerate.
+ * libbfd.h: Regenerate.
+ * cpu-fr30.c: New file.
+ * elf32-fr30.c: New file.
- * i386aout.c: Include "aout/aout64.h".
- (i386aout_write_object_contents): New static function.
- (MY_write_object_contents): Define.
+Mon Nov 2 14:59:33 1998 Geoffrey Noer <noer@cygnus.com>
- * netbsd.h (MY(write_object_contents)): Make sure that
- adjust_sizes_and_vmas is called before fiddling with the magic
- number.
+ * configure.in: detect cygwin* instead of cygwin32*
+ * configure: regenerate
-Tue Jul 2 23:30:39 1996 Ian Lance Taylor <ian@cygnus.com>
+Sun Nov 1 19:32:28 1998 Jeffrey A Law (law@cygnus.com)
- * stabs.c (_bfd_link_section_stabs): Fix casts of psinfo.
+ * elf-m10300.c (mn10300_elf_relax_section): Do not use alloca,
+ use bfd_malloc and free instead and check return value from bfd_malloc.
-Sun Jun 30 13:34:33 1996 Ian Lance Taylor <ian@cygnus.com>
+Sun Nov 1 16:20:35 1998 Ian Lance Taylor <ian@cygnus.com>
- * libbfd-in.h (itos, stoi): Don't define.
+ * libbfd-in.h (_bfd_dwarf1_find_nearest_line): Declare.
* libbfd.h: Rebuild.
- * i386lynx.c (KEEPIT): Define as udata.i.
- (NAME(lynx,swap_std_reloc_out)): Don't use stoi.
- (NAME(lynx,swap_ext_reloc_out)): Likewise.
- * riscix.c (riscix_swap_std_reloc_out): Use udata.i rather than
- flags. Don't use stoi.
-
- * elf32-mips.c (ELF_MAGPAGESIZE): Change definition to 0x1000.
-
- * elf.c (map_sections_to_segments): Don't start a new segment for
- a writable section if it's on the same page as the previous
- segment. Reset the writable variable for a readonly section.
-
-Sat Jun 29 16:18:51 1996 Kim Knuttila <krk@cygnus.com>
-
- * peicode.h (coff_swap_aouthdr_in): Missing initializations of
- first_thunk_address, thunk_size, and import_table_size.
- * peicode.h: Improved some diagnostics regarding edata sections.
-
- * coff-ppc.c (coff_ppc_relocate_section): Earlier error check
- on IMGLUE relocs.
- (coff_ppc_relocate_section): Improved diagnostic for large TOCDEFN's.
- (TARGET_LITTLE_SYM): Added missing D_PAGED.
-
-Fri Jun 28 13:48:45 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * xcofflink.c (xcoff_link_check_ar_symbols): An undefined symbol
- with XCOFF_DEF_DYNAMIC set is really defined.
- (xcoff_link_check_dynamic_ar_symbols): Likewise.
- (xcoff_link_add_symbols): Only create special sections if using an
- XCOFF hash table.
-
- * reloc.c (bfd_perform_relocation): Handle xcoff-powermac like
- aixcoff-rs6000.
- (bfd_install_relocation): Likewise.
-
-Fri Jun 28 11:17:00 1996 Richard Henderson <rth@tamu.edu>
- * elf64-alpha.c (struct alpha_elf_link_hash_entry): Add flags
+ * elf32-mips.c (mips_elf_dynsym_sec_names): Comment out.
+ (SIZEOF_MIPS_DYNSYM_SECNAMES): Likewise.
+ (MIPS_TEXT_DYNSYM_SECN): Likewise.
+ (_bfd_mips_elf_fake_sections): Don't set sh_info field of a .hash
+ section.
+ (struct mips_elf_link_hash_table): Remove dynsym_sec_strindex
field.
- (ALPHA_ELF_LINK_HASH_LU_ADDR): Define.
- (ALPHA_ELF_LINK_HASH_LU_MEM): Define.
- (ALPHA_ELF_LINK_HASH_LU_FUNC): Define.
- (elf64_alpha_link_hash_newfunc): Initialize flags field.
- (elf64_alpha_check_relocs): Record types of LITUSE entries that
- are found for LITERAL relocs.
- (elf64_alpha_adjust_dynamic_symbol): If a symbol has its address
- taken, we cannot generate a .plt entry for the symbol.
-
-Thu Jun 27 11:24:29 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Add AC_ISC_POSIX, and check for setitimer and
- sysconf functions (for gprof).
- * configure, config.in: Rebuild.
-
-Wed Jun 26 16:29:02 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * ecoff.c (_bfd_ecoff_archive_p): Check the first object file in
- an archive if it has a map. If the object file has the wrong
- xvec, reject it.
-
- * coff-alpha.c (alpha_adjust_reloc_in): Set the addend for a
- BRADDR, SREL16, SREL32, or SREL64 reloc against an external
- symbol.
- (alpha_relocate_section): Likewise.
-
- * coffswap.h (coff_swap_reloc_out): Use RELSZ, not sizeof.
- (coff_swap_filehdr_out): Use FILHSZ, not sizeof.
- (coff_swap_sym_out): Use SYMESZ, not sizeof.
- (coff_swap_aux_out): Use AUXESZ, not sizeof.
- (coff_swap_lineno_out): Use LINESZ, not sizeof.
- (coff_swap_aouthdr_out): Use AOUTSZ, not sizeof.
- (coff_swap_scnhdr_out): Use SCNHSZ, not sizeof.
- * peicode.h: Corresponding changes.
-
-Tue Jun 25 15:28:34 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * elflink.h (elf_create_pointer_linker_section): Comment out code
- dealing with making GOT pointers negative of the GOT symbol for
- now.
-
-Tue Jun 25 11:41:24 1996 Richard Henderson <rth@tamu.edu>
-
- * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't
- increment the .rela.plt size until after we're done creating the
- .plt entry.
- (elf64_alpha_finish_dynamic_symbol): Change .plt entry to load the
- .rela.plt offset directly rather than calculating it.
-
-Mon Jun 24 17:15:10 1996 Jason Molenda (crash@godzilla.cygnus.co.jp)
-
- * Makefile.in, (bindir, libdir, datadir, mandir, infodir, includedir):
- Use autoconf-set values.
- * doc/Makefile.in (bindir, libdir, datadir, mandir, infodir,
- includedir, INSTALL, INSTALL_PROGRAM, INSTALL_DATA): Use autoconf-set
- values.
- (docdir): Deleted.
- * configure.in (AC_PREREQ): autoconf v2.5 or higher.
- * configure: Rebuilt.
-
-Mon Jun 24 22:50:35 1996 Jeffrey A Law (law@cygnus.com)
-
- * som.c (som_write_fixups): Fix typo in R_END_TRY for exception
- handling code > 1k away.
-
-Mon Jun 24 18:41:06 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * elflink.h (elf_create_pointer_linker_section): If DEBUG is
- defined, output whenever the symbol is updated.
-
-Mon Jun 24 17:58:12 1996 Jouke Numan <jnuman@bazis.nl>
-
- * elf.c (elf_fake_sections): Don't set sh_addr of a non SEC_ALLOC
- section to 0 if user_set_vma is set.
- * elflink.h (elf_bfd_final_link): Likewise.
-
-Sun Jun 23 20:42:51 1996 Doug Evans <dje@canuck.cygnus.com>
-
- Partially undo patch of Jun 20.
- * coffcode.h (coff_set_alignment_hook): Use COFF_IMAGE_WITH_PE.
- (coff_compute_section_file_positions): Likewise.
- (coff_write_object_contents): Likewise. Re-add deleted code, but
- use #ifdef COFF_WITH_PE, not COFF_OBJ_WITH_PE.
- * peicode.h (pe_bfd_copy_private_bfd_data): Re-add #ifdef.
-
-Fri Jun 21 17:38:15 1996 Joel Sherrill <joel@merlin.gcs.redstone.army.mil>
-
- * config.bfd: Add support for *-*-rtems* configurations.
-
-Fri Jun 21 15:19:59 1996 Ian Lance Taylor <ian@cygnus.com>
+ (mips_elf_link_hash_table_create): Don't initialize
+ dynsym_sec_strindex.
+ (mips_elf_gc_mark_hook): Add default case to avoid warning.
+ (mips_elf_size_dynamic_sections): Generate a section symbol for
+ every output section.
+ (mips_elf_finish_dynamic_sections): Count all sections for
+ DT_MIPS_UNREFEXTNO.
+ (mips_elf_finish_dynamic_sections): Use dynamic symbols for all
+ output sections.
- * elf.c (prep_headers): Add bfd_arch_alpha case.
+Sun Nov 1 12:46:53 1998 Geoff Keating <geoffk@ozemail.com.au>
-Fri Jun 21 12:35:27 1996 Richard Henderson <rth@tamu.edu>
+ * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Allocate two slots
+ for later PLT entries in large PLTs.
+ (ppc_elf_finish_dynamic_symbol): Allow for the extra slots.
- * elf64-alpha.c: New file.
- * config.bfd (alpha-*-linuxecoff*): New target.
- (alpha-*-linux*, alpha-*-elf*): New targets.
- * configure.in (bfd_elf64_alpha_vec): New vector.
- * configure: Rebuild.
- * targets.c (bfd_elf64_alpha_vec): Declare.
- (bfd_target_vector): Add bfd_elf64_alpha_vec if BFD64.
- * reloc.c (BFD_RELOC_ALPHA_GPDISP): Define.
- * bfd-in2.h, libbfd.h: Rebuild.
- * Makefile.in: Rebuild dependencies.
- (BFD64_BACKENDS): Add elf64-alpha.o.
- (BFD64_BACKENDS_CFILES): Add elf64-alpha.c.
-
-Thu Jun 20 18:14:25 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * ecoff.c (ecoff_armap_hash): If hlog is 0, just return 0, rather
- than relying on a right shift of 32.
-
-Thu Jun 20 11:00:57 1996 Doug Evans <dje@canuck.cygnus.com>
+Sat Oct 31 20:10:09 1998 Jeffrey A Law (law@cygnus.com)
- * coffcode.h (coff_set_alignment_hook): Change COFF_IMAGE_WITH_PE
- ifdef to COFF_WITH_PE.
- (coff_compute_section_file_positions): Likewise.
- (coff_write_object_contents): Likewise. Delete COFF_OBJ_WITH_PE.
- * pe-{arm,i386,ppc}.c (COFF_OBJ_WITH_PE): Delete.
- * peicode.h (pe_bfd_copy_private_bfd_data): Delete ifdef
- COFF_IMAGE_WITH_PE, always include.
+ * elf32-ppc.c (ppc_elf_reload_section): Fix typo.
- * peicode.h (coff_swap_scnhdr_out): ".drectve" doesn't have trailing 0.
+1998-10-26 15:58 Ulrich Drepper <drepper@cygnus.com>
-Wed Jun 19 11:37:52 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf-bfd.h (struct elf_link_hash_entry): Add new field elf_hash_value.
+ * elflink.h (elf_collect_hash_codes): New function. This function is
+ called for each exported symbol and we compute the ELF hash value for
+ it.
+ (compute_bucket_value): New function. It is called from
+ size_dynamic_sections to determine the hash table size. When we are
+ optimizing a better, but slower, algorithm is used.
+ (size_dynamic_sections): Call compute_bucket_value.
- * elf.c (map_sections_to_segments): Fix up the test for -Ttext to
- approximate the correct answer if SIZEOF_HEADERS was not used.
+ * elf.c (bfd_elf_hash): Optimize the hash function a bit.
- * binary.c (binary_set_section_contents): Set section file
- position based on LMA rather than VMA.
+Mon Oct 19 20:03:21 1998 Catherine Moore <clm@cygnus.com>
-Wed Jun 19 11:19:25 1996 Manfred Hollstein KS/EIC5 60/3/142 #40283 <manfred@lts.sel.alcatel.de>
+ * elf32-sh.c: Add HOWTO entries for R_SH_GNU_VTINHERIT and
+ R_SH_GNU_VTENTRY.
+ (sh_elf_gc_mark_hook): New.
+ (sh_elf_gc_sweep_hook): New.
+ (sh_elf_check_relocs): New.
+ (elf_backend_can_gc_sections): Define.
- * linker.c (_bfd_generic_link_output_symbols): Don't output any
- symbols if info->strip == strip_all.
+Mon Oct 19 16:57:05 1998 Felix Lee <flee@cygnus.com>
-Tue Jun 18 15:17:36 1996 Jeffrey A. Law <law@rtl.cygnus.com>
+ * acinclude.m4: undo previous gettext change
+ * aclocal.m4: rebuild with right version of aclocal.
- * coff-h8300.c: Remove #if 0 code.
- (compatable): Don't allow mixing/matching of different architectures.
+Mon Oct 19 01:47:21 1998 Felix Lee <flee@cygnus.com>
- * archures.c (bfd_mach_h8300s): Add.
- * bfd-in2.h: Rebuilt.
- * coff-h8300.c (funcvec_hash_newfunc): Handle H8/S too.
- (BADMAG): Likewise.
- (h8300_reloc16_estimate): Likewise.
- (h8300_reloc16_extra_cases): Likewise.
- (h8300_bfd_link_add_symbols): Likewise.
- * coffcode.h (coff_set_arch_mach_hook): Likewise.
- (coff_set_flags): Likewise.
- * cpu-h8300.c (h8300_scan): Likewise.
- Add H8/S to bfd_h8300_arch list.
+ * acinclude.m4, aclocal.m4: move gettext-related fragments from
+ aclocal.m4 to acinclude.m4, so they don't get lost.
-Tue Jun 18 14:42:58 1996 Klaus Kaempf <kkaempf@progis.de>
+ * elfcore.h: rewrite for better corefile support.
+ * elf.c (elfcore_*): new functions.
+ * elf-bfd.h (elf_obj_tdata): new structure members.
+ * acconfig.h, acinclude.m4, configure.in: add feature-tests for
+ flavor of procfs.
+ * aclocal.m4, config.in, configure, Makefile.in: regenerated.
- Added support for Alpha OpenVMS:
- * evax.h, evax-alpha.c, evax-egsd.c, evax-emh.c: New files.
- * evax-etir.c, evax-misc.c, hosts/alphavms.h: New files.
- * config.h-vms, makefile.vms: New files.
- * config.bfd (alpha-*-*vms*): New target.
- * configure.in (evax_alpha_vec): New target vector.
- * configure: Rebuild.
- * reloc.c (BFD_RELOC_SWREL32, BFD_RELOC_SWREL64): Define.
- (BFD_RELOC_ALPHA_LINKAGE, BFD_RELOC_ALPHA_BASEREG): Define.
- * targets.c (bfd_target_evax_flavour): Define.
- (evax_alpha_vec): Declare.
- (bfd_target_vector): Add ecoffalpha_little_vec and evax_alpha_vec
- if BFD64 is defined.
- * bfd-in2.h, libbfd.h: Rebuild.
- * Makefile.in: Rebuild dependencies.
- (BFD64_BACKENDS): Add evax-alpha.o, evax-egsd.o, evax-etir.o,
- evax-emh.o, and evax-misc.o.
- (BFD64_BACKENDS_CFILES): Add evax-alpha.c, evax-egsd.c,
- evax-etir.c, evax-emh.c, and evax-misc.c.
- (HFILES): Add evax.h.
+Fri Oct 16 14:07:45 1998 Catherine Moore <clm@cygnus.com>
-Tue Jun 18 13:54:18 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-m32r.c: Add HOWTO entries for R_M32R_GNU_VTINHERIT
+ and R_M32R_GNU_VTENTRY.
+ (elf_backend_can_gc_sections): Define.
+ (m32r_elf_check_relocs): New.
+ (m32r_elf_gc_mark_hook): New.
+ (m32r_elf_gc_sweep_hook): New.
+ (m32r_elf_relocate_section): Handle VT relocs.
- * coff-h8300.c (h8300_reloc16_extra_cases): Make name a const
- pointer.
- (h8300_bfd_link_add_symbols): Likewise.
+Mon Oct 12 14:18:40 1998 Nick Clifton <nickc@cygnus.com>
-Mon Jun 17 10:06:50 1996 Jeffrey A. Law <law@rtl.cygnus.com>
+ * coff-arm.c (arm_relocate_section): Remove redundant test.
- * som.h (R_HPPA_BEGIN_TRY, R_HPPA_END_TRY): Define.
- * som.c (som_write_fixups): Handle R_BEGIN_TRY and R_END_TRY.
+ * bfd-in2.h (struct reloc_howto_struct): Improve comment to make
+ cleat that the 'bitsize' field is the size of the bitfield AFTER
+ relocation not before.
-Mon Jun 17 12:49:11 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-m32r.c (R_M32R_18_PCREL): Fix size of bitfield.
- * elf32-mips.c (mips_elf_relocate_section): Don't create a reloc
- for R_MIPS_REL32 and R_MIPS_32 relocs if no dynamic sections were
- created.
- (mips_elf_check_relocs): Only create .rel.dyn for R_MIPS_REL32 and
- R_MIPS_32 relocs if creating a shared library.
+ * coff-mips.c (mips_relocate_hi): Cope with missing refhi or reflo
+ relocs.
-Thu Jun 13 20:14:51 1996 Doug Evans <dje@canuck.cygnus.com>
+Tue Oct 6 09:20:44 1998 Catherine Moore <clm@cygnus.com>
- * peicode.h (add_data_entry): Use pei_section_data rather than
- _cooked_size. Corresponds to May 13 change in coffcode.h.
+ * elf32-sparc.c: Add HOWTO entries for R_SPARC_GNU_VTINHERIT and
+ R_SPARC_GNU_VTENTRY.
+ (elf32_sparc_check_relocs): Handle them.
+ (elf32_sparc_reloc_type_lookup): Likewise.
+ (elf32_sparc_relocate_section): Likewise.
+ (elf32_sparc_gc_mark_hook): New.
+ (elf32_sparc_gc_sweep_hook): New.
-Thu Jun 13 10:23:40 1996 Ian Lance Taylor <ian@cygnus.com>
+Mon Oct 5 14:55:30 1998 Jeffrey A Law (law@cygnus.com)
- * cofflink.c (_bfd_coff_final_link): Handle long section names.
- * coffcode.h (coff_write_object_contents): If there are long
- section names, always set the f_symptr field, even if there are no
- symbols.
- * peicode.h (coff_swap_filehdr_in): Don't clear the f_symptr field
- if there are no symbols.
+ * som.c (som_finish_writing): Perform some sanity checks when
+ writing an executable or shared library.
- * coffgen.c (make_a_section_from_file): Check return value of
- _bfd_coff_read_string_table.
- (coff_real_object_p): Check return value of
- make_a_section_from_file.
- (_bfd_coff_read_string_table): Check that there are some symbols
- before trying to read the string table size.
+Mon Oct 5 12:02:31 1998 Gavin Romig-Koch <gavin@cygnus.com>
-Wed Jun 12 11:16:37 1996 Ian Lance Taylor <ian@cygnus.com>
+ * dwarf1.c : New file. Adds _bfd_dwarf1_find_nearest_line.
+ * configure.in (elf): Add dwarf1.lo.
+ * elf_bfd.h (elf_ob_tdata): Add dwarf1_find_line_info.
+ * elf.c (_bfd_elf_find_nearest_line): Add call to
+ _bfd_dwarf1_find_nearest_line.
+ * elf32-mips.c (_bfd_mips_elf_find_nearest_line):
+ Add call to _bfd_dwarf1_find_nearest_line.
+ * configure: Rebuilt.
- * xcofflink.c (xcoff_link_add_symbols): When considering whether
- to replace a symbol in a dynamic object with a symbol from another
- dynamic object, do the replacement if the existing symbol is
- global linkage code.
+Mon Oct 5 10:06:22 1998 Catherine Moore <clm@cygnus.com>
- * xcofflink.c (_bfd_ppc_xcoff_relocate_section): Check explicitly
- for _ptrgl, and treat it as global linkage code.
+ * elflink.h (elf_gc_sections): Do not allow garbage
+ collection if dynamic sections have been created.
- * aoutx.h (NAME(aout,find_nearest_line)): Notice if we find a
- filename or N_SO symbol past the offset, and use it to indicate
- that there is no line number or function when appropriate.
+Mon Oct 5 09:07:37 1998 Catherine Moore <clm@cygnus.com>
-Tue Jun 11 15:24:48 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-v850.c: Add HOWTO entries for R_V850_GNU_VTINHERIT and
+ R_V850_GNU_VTENTRY.
+ (v850_elf_check_relocs): Handle VTINHERIT and VTENTRY relocs.
+ (v850_elf_perform_relocation): Likewise.
+ (v850_elf_final_link_relocate): Likewise.
+ (v850_elf_relocate_section): Likewise.
+ (v850_elf_gc_sweep_hook): New routine.
+ (v850_elf_gc_mark_hook): New routine.
+ (elf_backend_can_gc_sections): Define.
- * xcofflink.c (xcoff_build_ldsyms): Set XCOFF_DEF_REGULAR for a
- common symbol defined by the linker. Don't export function code
- even if export_defineds is set.
+Mon Oct 5 09:04:25 1998 Catherine Moore <clm@cygnus.com>
-Mon Jun 10 11:57:27 1996 Jeffrey A Law (law@cygnus.com)
+ * elf32-m68k.c (elf_m68k_gc_sweep_hook): Don't assume
+ that dynobj exists.
- * coff-h8300.c (howto_table): Add new entries for R_BCC_INV
- and R_JMP_DEL.
- (rtype2howto): Handle R_BCC_INV and R_JMP_DEL.
- (h8300_symbol_address_p): New function.
- (h8300_reloc16_estimate): Eliminate jumps made unnecessary by
- relaxing.
+Sun Oct 4 23:29:34 1998 David Edelsohn <edelsohn@mhpcc.edu>
-Sun Jun 9 16:30:20 1996 Jeffrey A Law (law@cygnus.com)
+ * rs6000-core.c (rs6000coff_core_file_matches_executable_p):
+ Declare size as bfd_size_type.
+ (rs6000coff_get_section_contents): Declare count as bfd_size_type.
- * coff-h8300.c (h8300_reloc16_estimate): Fix many minor spacing
- problems.
- (h8300_reloc16_estimate, cases R_JMP1, R_JMP2): Adjust "dot"
- correctly for the two variants. Allow relaxing if the target
- is 128 bytes away since after relaxation it'll be 126 bytes away.
- (h8300_reloc16_estimate, case R_PCRWORD): Correctly adjust
- "dot" and "value". Allow relaxing if the target is 128 bytes
- away since after relaxation it'll be 126 bytes away.
- * reloc16.c (bfd_coff_reloc16_relax_section): Keep relaxing
- the given section until nothing changes.
+Sun Oct 4 20:38:29 1998 Jeffrey A Law (law@cygnus.com)
-Thu Jun 6 15:24:45 1996 Richard Henderson <rth@tamu.edu>
+ * cpu-hppa.c (bfd_hppa20_arch): Define. Link it into the bfd_hppa_arch
+ structure.
+ * som.c (CPU_PA_RISC2_0): Define.
+ (_PA_RISC2_0_ID): Likewise.
+ (som_finish_writing): Use CPU_PA_RISC2_0 for the system_id as needed.
- * ecoff.c (_bfd_ecoff_new_section_hook): Remove the _PDATA
- alignment hack--we can get the lnnoptr info another way without
- suddenly increasing the alignment requirements. Set the flags for
- the _PDATA section.
- (ecoff_compute_section_file_positions): Do so.
+Sun Oct 4 21:19:09 1998 Ian Lance Taylor <ian@cygnus.com>
-Thu Jun 6 11:24:37 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elflink.h (elf_link_add_object_symbols): When a versioned symbol
+ has a base which is already defined, only add the referenced
+ symbol to the dynamic symbol table if it is defined or referenced
+ by a regular file.
- * ieee.c (ieee_write_object_contents): Put a timestamp in the file
- to keep the HP emulator database happy.
+ * elf32-i386.c (elf_i386_info_to_howto_rel): Handle vtable relocs
+ correctly.
- * config.bfd: Recognize powerpc-*-linux* and powerpcle-*-linux*.
- From Kevin Buettner <kev@primenet.com>.
+1998-09-27 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-Wed Jun 5 15:16:04 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elflink.h (elf_link_add_object_symbols): Undo last change.
- * aoutx.h (translate_to_native_sym_flags): Don't try to print the
- name of a NULL section.
+Wed Sep 23 16:09:31 1998 Richard Henderson <rth@cygnus.com>
-Tue Jun 4 18:53:58 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elflink.h (elf_link_add_object_symbols): Don't record a dynamic
+ symbol for the indirect alias to a versioned symbol.
- * linker.c (_bfd_generic_link_add_one_symbol): If notice_all is
- set, always call the notice callback.
+Mon Sep 21 12:15:22 1998 Catherine Moore <clm@cygnus.com>
- * VERSION: Increment for bfdlink.h change.
+ * elf32-i386.c (elf32_i386_vtinherit_howto): New.
+ (elf32_i386_vtentry_howto): New.
+ (elf_i386_reloc_type_lookup): Return elf32_i386_vtentry_howto
+ or elf32_i386_vtinherit_howto on lookup.
-Mon Jun 3 11:01:53 1996 Ian Lance Taylor <ian@cygnus.com>
+Sun Sep 20 00:48:07 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
- * coff-sh.c (COFF_DEFAULT_SECTION_ALIGNMENT_POWER): Set to 4.
- (sh_relax_delete_bytes): Correct handling of differently sized
- trailing alignment reloc.
+ * elf32-m68k.c: Include "elf/m68k.h". Remove definition of enum
+ reloc_type. Rename R_68K__max to R_68K_max.
+ (howto_table): Use _bfd_elf_rel_vtable_reloc_fn for a VTENTRY
+ reloc.
- * bfd-in.h: Use #error if BFD_HOST_64_BIT can not be defined.
- * bfd-in2.h: Rebuild.
- * configure.in: Warn if there is no known 64 bit type.
- * configure: Rebuild.
+Sun Sep 20 00:09:25 1998 Chris Torek <torek@bsdi.com>
- * Makefile.in: Rebuild dependencies.
- (BFD32_BACKENDS): Add ppcboot.o.
- (BFD32_BACKENDS_CFILES): Add ppcboot.c.
-
- * elf32-mips.c (mips_elf_size_dynamic_sections): Initialize c.
- From Per Fogelstrom <per.fogelstrom@mailbox200.swipnet.se>.
-
-Sat Jun 1 21:49:58 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * elf64-mips.c (bfd_mips_elf64_swap_reginfo_in)
- (bfd_mips_elf64_swap_reginfo_out): Move from here...
- * elf32-mips.c (bfd_mips_elf64_swap_reginfo_in)
- (bfd_mips_elf64_swap_reginfo_out): ...to here.
-
-Fri May 31 13:51:28 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * elf64-mips.c: Improve reloc special_functions and handling of
- SHT_MIPS_OPTIONS section.
- * elf32-mips.c (_bfd_mips_elf_hi16_reloc): Rename from
- mips_elf_hi16_reloc and make globally visible.
- (_bfd_mips_elf_lo16_reloc): Rename from mips_elf_lo16_reloc and
- make globally visible.
- (_bfd_mips_elf_got16_reloc): Rename from mips_elf_got16_reloc and
- make globally visible.
- (_bfd_mips_elf_gprel16_reloc): Rename from mips_elf_gprel16_reloc
- and make globally visible.
- (gprel16_with_gp): Check howto->src_mask before using value in
- insn.
- (_bfd_mips_elf_gprel32_reloc): Rename from mips_elf_gprel32_reloc
- and make globally visible.
- (gprel32_with_gp): Check howto->src_mask before fetching value.
- (bfd_mips_elf_swap_options_in): New function.
- (bfd_mips_elf_swap_options_out): New function.
- (_bfd_mips_elf_set_private_flags): Rename from
- mips_elf_set_private_flags and make globally visible.
- (_bfd_mips_elf_copy_private_bfd_data): Rename from
- mips_elf_copy_private_bfd_data and make globally visible.
- (_bfd_mips_elf_merge_private_bfd_data): Rename from
- mips_elf_merge_private_bfd_data and make globally visible.
- (_bfd_mips_elf_section_from_shdr): Accept .MIPS.options as a name
- for a SHT_MIPS_OPTIONS section.
- (mips_elf32_section_from_shdr): Handle SHT_MIPS_OPTIONS section.
- (_bfd_mips_elf_fake_sections): Consider .MIPS.options to be the
- name of a SHT_MIPS_OPTIONS section.
- (_bfd_mips_elf_set_section_contents): New function.
- (mips_elf32_section_processing): Set the GP value in a
- SHT_MIPS_OPTIONS section.
- (_bfd_mips_elf_find_nearest_line): Rename from
- mips_elf_find_nearest_line and make globally visible.
- (bfd_elf32_set_section_contents): Define.
- * elf-bfd.h (_bfd_mips_elf_hi16_reloc): Declare.
- (_bfd_mips_elf_lo16_reloc): Declare.
- (_bfd_mips_elf_gprel16_reloc): Declare.
- (_bfd_mips_elf_got16_reloc): Declare.
- (_bfd_mips_elf_gprel32_reloc): Declare.
- (_bfd_mips_elf_set_private_flags): Declare.
- (_bfd_mips_elf_copy_private_bfd_data): Declare.
- (_bfd_mips_elf_merge_private_bfd_data): Declare.
- (_bfd_mips_elf_find_nearest_line): Declare.
- (_bfd_mips_elf_set_section_contents): Declare.
-
- * elf32-hppa.c (elf32_hppa_info_to_howto): Rename from
- elf_info_to_howto.
- (elf_info_to_howto): Define.
- * elf32-sparc.c (elf32_sparc_info_to_howto): Rename from
- elf_info_to_howto.
- (elf_info_to_howto): Define.
- * elf64-sparc.c (sparc64_elf_info_to_howto): Rename from
- elf_info_to_howto.
- (elf_info_to_howto): Define.
-
- * coff-w65.c (h8300_reloc16_estimate): Rename R_MOVB[12] to
- R_MOV16B[12], to match change in coff/internal.h.
-
-Thu May 30 12:38:49 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * elf64-mips.c: Extensive additions to provide better support for
- writing files and for gas.
- * elf32-mips.c (_bfd_mips_elf_object_p): New function, broken out
- of mips_elf_object_p.
- (mips_elf32_object_p): Rename from mips_elf_object_p; call
- _bfd_mips_elf_object_p.
- (_bfd_mips_elf_final_write_processing): Rename from
- mips_elf_final_write_processing and make globally visible.
- (_bfd_mips_elf_fake_sections): Rename from
- mips_elf_fake_sections and make globally visible.
- (_bfd_mips_elf_section_from_bfd_section): Rename from
- mips_elf_section_from_bfd_section and make globally visible.
- (_bfd_mips_elf_section_processing): New function, broken out of
- mips_elf_section_processing.
- (mips_elf32_section_processing): Rename from
- mips_elf_section_processing; call
- _bfd_mips_elf_section_processing.
- (_bfd_mips_elf_symbol_processing): Rename from
- mips_elf_symbol_processing and make globally visible.
- (_bfd_mips_elf_read_ecoff_info): Rename from
- mips_elf_read_ecoff_info and make globally visible.
- (mips_elf32_ecoff_debug_swap): Rename from
- mips_elf_ecoff_debug_swap.
- * elf.c (_bfd_elf_symbol_from_bfd_symbol): Use asymbol rather than
- struct symbol_cache_entry.
- (_bfd_elf_validate_reloc): New function, moved in from
- elfcode.h:validate_reloc.
- * elfcode.h (validate_reloc): Remove; moved into elf.c and renamed
- to _bfd_elf_validate_reloc. Change all callers.
- * elf-bfd.h (bfd_section_from_shdr): Declare.
- (_bfd_elf_symbol_from_bfd_symbol): Declare.
- (_bfd_elf_validate_reloc): Declare.
- (_bfd_mips_elf_object_p): Declare.
- (_bfd_mips_elf_fake_sections): Declare.
- (_bfd_mips_elf_section_from_bfd_section): Declare.
- (_bfd_mips_elf_section_processing): Declare.
- (_bfd_mips_elf_symbol_processing): Declare.
- (_bfd_mips_elf_read_ecoff_info): Declare.
- (_bfd_mips_elf_final_write_processing): Declare.
- * elfxx-target.h (bfd_elfNN_get_reloc_upper_bound): Don't define
- if already defined.
-
- * elf32-mips.c (mips_elf_object_p): Handle E_MIPS_ARCH_4.
- (mips_elf_final_write_processing): Likewise.
-
-Wed May 29 16:15:29 1996 Ian Lance Taylor <ian@cygnus.com>
-
- 64-bit MIPS ELF ABI objdump support:
- * elf64-mips.c: New file.
- * Makefile.in: Rebuild dependencies.
- (BFD64_BACKENDS): Add elf64-mips.o.
- (BFD64_BACKENDS_CFILES): Add elf64-mips.c.
- * config.bfd (mips*el-*-elf*) Add bfd_elf64_bigmips_vec and
- bfd_elf64_littlemips_vec to targ_selvecs.
- (mips*-*-elf*): Likewise.
- * confingure.in: Add bfd_elf64_bigmips_vec and
- bfd_elf64_littlemips_vec to vector switch.
- * configure: Rebuild.
- * elf32-mips.c (_bfd_mips_elf_section_from_shdr): New function,
- broken out of mips_elf_section_from_shdr.
- (mips_elf32_section_from_shdr): Rename from
- mips_elf_section_from_shdr. Call new function.
- (elf_backend_section_from_shdr): Update name of renamed function.
- * elf-bfd.h (struct elf_size_info): Change second parameter of
- write_out_phdrs to be const. Likewise for second parameter of
- swap_symbol_out.
- (struct bfd_elf_section_data): Add rel_hdr2 field.
- (bfd_elf32_swap_symbol_in): Change second parameter to be const.
- (bfd_elf32_swap_symbol_out): Likewise.
- (bfd_elf32_swap_reloc_in): Likewise.
- (bfd_elf32_swap_reloc_out): Likewise.
- (bfd_elf32_swap_reloca_in): Likewise.
- (bfd_elf32_swap_reloca_out): Likewise.
- (bfd_elf32_swap_phdr_in): Likewise.
- (bfd_elf32_swap_phdr_out): Likewise.
- (bfd_elf32_swap_dyn_in): Likewise.
- (bfd_elf32_swap_dyn_out): Likewise.
- (bfd_elf32_slurp_symbol_table): Declare.
- (bfd_elf32_write_shdrs_and_ehdr): Declare.
- (bfd_elf32_write_out_phdrs): Declare.
- (bfd_elf64_swap_symbol_in): Change second parameter to be const.
- (bfd_elf64_swap_symbol_out): Likewise.
- (bfd_elf64_swap_reloc_in): Likewise.
- (bfd_elf64_swap_reloc_out): Likewise.
- (bfd_elf64_swap_reloca_in): Likewise.
- (bfd_elf64_swap_reloca_out): Likewise.
- (bfd_elf64_swap_phdr_in): Likewise.
- (bfd_elf64_swap_phdr_out): Likewise.
- (bfd_elf64_swap_dyn_in): Likewise.
- (bfd_elf64_swap_dyn_out): Likewise.
- (bfd_elf64_slurp_symbol_table): Declare.
- (bfd_elf64_write_shdrs_and_ehdr): Declare.
- (bfd_elf64_write_out_phdrs): Declare.
- (_bfd_mips_elf_section_from_shdr): Declare.
- * elf.c (bfd_section_from_shdr): Remove assertion requiring
- SHT_REL/SHT_RELA to match use_rela_p. If there is already a reloc
- section for the section, add the new one to rel_hdr2. Increment
- reloc_count rather than setting it.
- * elfcode.h (elf_slurp_symbol_table): Define name as macro.
- Remove static declaration.
- (elf_write_shdrs_and_ehdr): Define name as macro.
- (elf_write_out_phdrs): Likewise.
- (elf_swap_ehdr_in, elf_swap_ehdr_out): Declare.
- (elf_swap_shdr_in, elf_swap_shdr_out): Declare.
- (elf_swap_symbol_in): Change second parameter to be const.
- (elf_swap_symbol_out): Likewise.
- (elf_swap_ehdr_in, elf_swap_ehdr_out): Likewise.
- (elf_swap_shdr_in, elf_swap_shdr_out): Likewise.
- (elf_swap_phdr_in, elf_swap_phdr_out): Likewise.
- (elf_swap_reloc_in, elf_swap_reloc_out): Likewise.
- (elf_swap_reloca_in, elf_swap_reloca_out): Likewise.
- (elf_write_out_phdrs): Rename from write_out_phdrs. Change second
- parameter to be const. Make non-static.
- (elf_write_shdrs_and_ehdr): Rename from write_shdrs_and_ehdr.
- Make non-static.
- (elf_slurp_symbol_table): Make non-static.
- (NAME(_bfd_elf,size_info)): Update names of renamed functions.
- * elfxx-target.h (elf_info_to_howto): Define if not defined.
- (elf_backend_size_info): Likewise.
- (elfNN_bed): Use elf_backend_size_info.
- * targets.c (bfd_elf64_bigmips_vec): Declare.
- (bfd_elf64_littlemips_vec): Declare.
- (bfd_target_vector): Add bfd_elf64_bigmips_vec and
- bfd_elf64_littlemips_vec if BFD64 is defined.
-
- * libbfd.c (bfd_get_file_window): Add cast to fprintf argument.
-
-Tue May 28 11:42:08 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * coff-sh.c (sh_relax_delete_bytes): Insert nop instructions, not
- zeroes, in alignment holes.
-
- * configure: Rebuild with autoconf 2.10.
-
- * aoutx.h (NAME(aout,find_nearest_line)): Make room for the
- potential leading underscore in the allocated buffer.
-
-Fri May 24 14:28:38 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * elf32-ppc.c (ppc_elf_add_symbol_hook): Do not put small common
- symbols into .sbss if this is a relocatable link.
-
-Thu May 23 12:26:24 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * xcofflink.c (_bfd_ppc_xcoff_relocate_section): Warn about
- undefined symbols when creating a shared library.
-
-Fri May 17 13:54:15 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * coff-sh.c: Add a bunch of new code and static const arrays to
- support aligning loads and stores on four byte memory boundaries.
- Also:
- (sh_coff_howtos): Add entries for R_SH_CODE, R_SH_DATA and
- R_SH_LABEL.
- (sh_relax_section): Look for R_SH_CODE relocs. If we find one,
- call sh_align_loads.
- (sh_relax_delete_bytes): Don't mark R_SH_CODE or R_SH_DATA relocs
- as unused.
-
-Thu May 16 16:34:13 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * cache.c (bfd_open_file): Unlink the file before opening it for
- write. From Marty Leisner <leisner@sdsp.mc.xerox.com>.
-
- * opncls.c (bfd_fdopenr): Set opened_once.
-
-Tue May 14 12:35:32 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * som.c (som_slurp_reloc_table): Clear external_relocs cache after
- freeing it.
-
- * libbfd.c: Remove #ifdef FILE_OFFSET_IS_CHAR_INDEX, and compile
- the code unconditionally.
-
-Mon May 13 19:51:37 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * libcoff-in.h (struct pei_section_tdata): Define structure.
- (pei_section_data): Define macro.
- * libcoff.h: Rebuild.
- * coffcode.h (coff_set_alignment_hook): If COFF_IMAGE_WITH_PE,
- store s_paddr field in pei_section_data.
- (coff_compute_section_file_positions): Use pei_section_data rather
- than _cooked_size, and don't overwrite an existing value.
- (coff_write_object_contents): If COFF_OBJ_WITH_PE, set s_paddr to
- 0. If COFF_IMAGE_WITH_PE, set s_paddr to pei_section_data.
- * peicode.h (coff_bfd_copy_private_section_data): Define if
- COFF_IMAGE_WITH_PE.
- (pe_bfd_copy_private_section_data): New static function if
- COFF_IMAGE_WITH_PE.
+ * libbfd.c (bfd_getb32): Rewrite expression to get better code.
+ (bfd_getl32, bfd_getb_signed_32, bfd_getl_signed_32): Likewise.
-Wed May 8 16:10:38 1996 Ian Lance Taylor <ian@cygnus.com>
+ * libbfd.c (bfd_log2): Cast to bfd_vma before shifting, not
+ after.
- * srec.c (srec_set_arch_mach): Write as a function rather than a
- macro definition.
+Sat Sep 19 22:42:23 1998 Doug Rabson <dfr@nlsystems.com>
- * xcofflink.c (_bfd_xcoff_bfd_link_add_symbols): If an archive has
- no map, just check each member in turn to see whether it is
- required.
+ * elflink.h (elf_link_add_object_symbols): Ensure that the warning
+ message has a null byte terminator.
-Wed May 8 09:17:34 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+Fri Sep 18 14:35:29 1998 Nick Clifton <nickc@cygnus.com>
- * ppcboot.c (ppcboot_object_p): Check for type 0x41 in partition
- table. Call BFD_ASSERT to validate header size, instead of
- calling fatal.
- (ppcboot_bfd_print_private_bfd_data): Put quotes around partition
- name.
+ * elf32-v850.c (v850_elf_perform_relocation): Ignore contents of
+ word subject to R_V850_32 relocation.
-Tue May 7 16:10:19 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+Thu Sep 17 17:20:36 1998 Nick Clifton <nickc@cygnus.com>
- * ppcboot.c: New target for looking at PPCbug boot records.
+ * dwarf2.c: Add comment describing problem computing line numbers
+ for undefined symbols at link time.
- * config{ure.in,.bfd}: Add support for ppcboot target.
- * targets.c: Ditto.
- * configure: Regenerate.
+Thu Sep 17 16:03:28 1998 Richard Henderson <rth@cygnus.com>
-Tue May 7 11:15:19 1996 Jeffrey A Law (law@cygnus.com)
+ * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't
+ transform a defweak into a plt entry.
+ (elf64_alpha_calc_dynrel_sizes): Allow room for secondary
+ plt entry references to receive a RELATIVE reloc.
+ (elf64_alpha_finish_dynamic_symbol): Fill them in.
+ (elf64_alpha_relocate_section): Assert we don't overrun
+ the allocated relocation space.
- * coff-h8300.c (howto_table): Update names to match recent
- changes to include/coff/internal.h. Fix minor errors in the
- existing relocs. Add R_MOVL1 and R_MOVL2.
- (rtype2howto): Similarly.
- (h8300_reloc16_estimate): Rewrite to simplify, fix bugs in the
- existing relaxing code and peform more relaxing.
- (h8300_reloc16_extra_cases): Likewise.
+Wed Sep 16 18:03:13 1998 Nick Clifton <nickc@cygnus.com>
-Mon May 6 18:24:09 1996 Jeffrey A Law (law@cygnus.com)
+ * elf.c (swap_out_syms): Always treat section symbols as
+ special, even if they are attached to a common section.
- * reloc16.c (bfd_coff_reloc16_get_value): Handle common
- symbols correctly.
+Wed Sep 16 10:34:13 1998 Nick Clifton <nickc@cygnus.com>
-Sat May 4 05:08:45 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+ * elf32-v850.c (v850_elf_symbol_processing): Move symbols in
+ sections with v850 common section attributes into named v850
+ common sections.
+ (v850_elf_add_symbol_hook): Move symbols in sections with v850
+ common section attributes into named v850 common sections.
- * elfcode.h (elf_object_p): Reject generic ELF target if
- e_machine matches an alternate machine code in a specific backend.
+Wed Sep 16 11:26:49 CDT 1998 Catherine Moore <clm@cygnus.com>
- * netbsd-core.c (netbsd_core_vec): Remove initializer for
- obsolete align_power_min field.
+ * elf32-arm.c (elf32_arm_gc_mark_hook): Remove print
+ statement.
-Fri May 3 13:07:35 1996 Jeffrey A Law (law@cygnus.com)
+1998-09-15 Geoff Keating <geoffk@ozemail.com.au>
- * coff-h8300.c (reloc_howto_type): Add howto entry for
- R_PCRWORD_B.
- (rtype2howto): Handle R_PCRWORD_B.
- (h8300_reloc16_extra_cases): Handle R_PCRWORD_B.
- (h8300_reloc_16_estimate): Likewise. Try to turn a 16bit
- pc-relative branch (R_PCRWORD) into an 8bit pc-relative
- branch (R_PCWORD_B).
+ * elf32-ppc.c (ppc_elf_relocate_section): Reverse output_offset
+ part of Vladimir's change of 1998-08-19. Make a R_PPC_SDAREL16
+ reloc to the wrong section a warning, not an error. .dynsbss
+ is not an output section, so there is no need to check for it.
-Fri May 3 10:47:41 1996 Ian Lance Taylor <ian@cygnus.com>
+Tue Sep 15 12:40:05 1998 Catherine Moore <clm@cygnus.com>
- * aoutx.h (translate_from_native_sym_flags): Set the section for
- BSF_CONSTRUCTOR symbols.
+ * elf-bfd.h: Add argument to elf_backend_get_symbol_type.
- * cofflink.c (_bfd_coff_link_input_bfd): Correct setting of
- last_bf_index.
+Tue Sep 15 08:34:40 1998 Catherine Moore <clm@cygnus.com>
-Wed May 1 18:39:32 1996 Doug Evans <dje@canuck.cygnus.com>
+ * elf.c (swap_out_syms): Pass type to elf_backend_get_symbol_type.
+ * elf32-arm.c: Add HOWTO entries for R_ARM_GNU_VTINHERIT and
+ R_ARM_GNU_VTENTRY.
+ (elf32_arm_gc_mark_hook): New.
+ (elf32_arm_gc_sweep_hook): New.
+ (elf32_arm_check_relocs): New.
+ (elf32_arm_final_link_relocate): Handle VTINHERIT and VTENTRY
+ relocations.
+ (elf32_arm_relocate_section): Handle VTINHERIT and VTENTRY
+ relocations.
- * coffcode.h (coff_write_object_contents): In comdat section lookup,
- stop looking when section is found.
+1998-09-10 Geoff Keating <geoffk@ozemail.com.au>
-Wed May 1 14:17:57 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-ppc.c (ppc_elf_relocate_section): If dynobj is NULL,
+ assume there is no PLT or GOT.
- * coffcode.h (STRING_SIZE_SIZE): Define.
- (styp_to_sec_flags): Handle long symbol names when looking for the
- section symbol.
- (bfd_coff_backend_data): Add _bfd_coff_long_section_names field.
- (bfd_coff_long_section_names): Define.
- (coff_write_object_contents): Handle long section names.
- (bfd_coff_std_swap_table): Initialize new field.
- * libcoff.h: Rebuild.
- * coffgen.c (make_a_section_from_file): Handle long section
- names.
- (coff_write_symbols): Handle long section names.
- * coff-alpha.c (alpha_ecoff_backend_data): Initialize new field.
- * coff-mips.c (mips_ecoff_backend_data): Likewise.
- * pe-arm.c (COFF_LONG_SECTION_NAMES): Define.
- * pei-arm.c (COFF_LONG_SECTION_NAMES): Define.
- * pe-i386.c (COFF_LONG_SECTION_NAMES): Define.
- * pei-i386.c (COFF_LONG_SECTION_NAMES): Define.
- * pe-ppc.c (COFF_LONG_SECTION_NAMES): Define.
- * pei-ppc.c (COFF_LONG_SECTION_NAMES): Define.
+Wed Sep 9 14:24:12 1998 Nick Clifton <nickc@cygnus.com>
- * bout.c (b_out_callback): Set lma of sections.
- (b_out_bfd_get_relocated_section_contents): Rename in_abfd
- parameter to output_bfd. Used input_bfd instead of output_bfd in
- several places.
+ * elf32-arm.c (elf32_arm_find_nearest_line): New function: just
+ like _elf_bfd_find_nearest_line() except that STT_ARM_TFUNC is
+ also accepted as a function symbol type.
-Tue Apr 30 17:56:39 1996 Ian Lance Taylor <ian@cygnus.com>
+Mon Sep 7 13:24:03 1998 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
- * aoutx.h (translate_from_native_sym_flags): Don't create
- SEC_CONSTRUCTOR sections.
- * ecoff.c (ecoff_set_symbol_info): Likewise.
+ * rs6000-core.c (_LONG_LONG): Define for AIX 4.x only.
- * elf32-mips.c (mips_elf_copy_private_bfd_data): Copy elf_gp.
- From Don Bowman <bowman@waterloo.hp.com>.
+Sat Sep 5 20:40:18 1998 Ian Lance Taylor <ian@cygnus.com>
-Tue Apr 30 17:06:32 1996 Doug Evans <dje@canuck.cygnus.com>
-
- * coff-arm.c (armcoff_little_vec): If COFF_WITH_PE is defined, add
- SEC_LINK_ONCE and SEC_LINK_DUPLICATES to section_flags.
-
-Mon Apr 29 13:15:17 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * elf32-mips.c (struct mips_elf_link_hash_entry): Add
- mips_32_relocs field.
- (mips_elf_link_hash_newfunc): Initialize mips_32_relocs field.
- (mips_elf_relocate_section): Copy R_MIPS_REL32 and R_MIPS_32
- relocs against a global symbol which is not defined in a regular
- file.
- (mips_elf_check_relocs): For a R_MIPS_REL32 or R_MIPS_32 reloc
- against a global symbol, increment mips_32_relocs.
- (mips_elf_adjust_dynamic_symbol): If mips_32_relocs is set, and
- the symbol is not defined in a regular file, make room in the
- .rel.dyn section.
-
-Fri Apr 26 18:00:37 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * ecoff.c (ecoff_compute_section_file_positions): Track the real
- file position and the virtual file position separately. Set
- filepos information bsaed on the real file position.
- (_bfd_ecoff_set_section_contents): Handle .lib sections like the
- Jan 23 change to coffcode.h.
-
- * som.c (som_slurp_symbol_table): Set the symbol count to the
- number of BFD symbols created.
-
-Fri Apr 26 12:34:29 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * elf32-ppc.c (ppc_elf_check_relocs): Forward relocations to the
- output file if linking shared objects. Loop to check all relocs,
- rather than returning false on first error.
-
-Thu Apr 25 13:25:12 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * elf32-ppc.c (ppc_elf_create_linker_section): Add PLT case.
- (ppc_elf_additional_program_headers): If .interp section, bump #
- of program headers by 1.
- (ppc_elf_adjust_dynamic_symbol): Flesh out support.
- (ppc_elf_size_dynamic_sections): Add support for .plt section.
- (ppc_elf_check_relocs): Print out filename in debug code. Enable
- PLT support.
- (ppc_elf_finish_dynamic_symbol): Add support for PLT's, beef up
- debug output.
- (ppc_elf_relocate_section): If the output section isn't defined,
- don't abort, just give an error message.
-
- * elflink.c (_bfd_elf_create_dynamic_sections): If the section
- being created is .sdata or .sdata2, don't make the symbol dynamic.
-
-Wed Apr 24 14:04:07 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * xcofflink.c (_bfd_xcoff_bfd_link_add_symbols): Look through the
- members of an archive for dynamic objects with no symbols, and
- pass them directly to check_archive_element.
- (xcoff_link_check_ar_symbols): Pass dynamic objects to
- xcoff_link_check_dynamic_ar_symbols.
- (xcoff_link_check_dynamic_ar_symbols): New static function.
-
- * coff-rs6000.c (rs6000coff_vec): Change BFD_JUMP_TABLE_DYNAMIC
- from _bfd_nodynamic to _bfd_xcoff.
- * libcoff-in.h (_bfd_xcoff_get_dynamic_symtab_upper_bound):
- Declare.
- (_bfd_xcoff_canonicalize_dynamic_symtab): Declare.
- (_bfd_xcoff_get_dynamic_reloc_upper_bound): Declare.
- (_bfd_xcoff_canonicalize_dynamic_reloc): Declare.
- * libcoff.h: Rebuild.
- * xcofflink.c (xcoff_swap_ldrel_in): New static function.
- (xcoff_get_section_contents): New static function.
- (_bfd_xcoff_get_dynamic_symtab_upper_bound): New function.
- (_bfd_xcoff_canonicalize_dynamic_symtab): New function.
- (_bfd_xcoff_get_dynamic_reloc_upper_bound): New function.
- (xcoff_dynamic_reloc): New static variable.
- (_bfd_xcoff_canonicalize_dynamic_reloc): New function.
- (xcoff_link_add_dynamic_symbols): Use xcoff_get_section_contents.
-
-Tue Apr 23 12:48:42 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * coff-sparc.c (bfd_coff_generic_reloc): Return bfd_reloc_ok even
- if reloc_entry->addend is not 0.
- (CALC_ADDEND): Just set the addend to reloc.r_offset.
-
-Mon Apr 22 18:29:01 1996 Doug Evans <dje@canuck.cygnus.com>
-
- * elf32-sparc.c (_bfd_sparc_elf_howto_table): Fix spelling of
- R_SPARC_GLOB_JMP.
- * elf64-sparc.c (sparc64_elf_howto_table): Likewise.
- Add entries for R_SPARC_[56].
- (sparc_reloc_map): Add entries for R_SPARC_[56].
-
-Mon Apr 22 15:07:24 1996 Ian Lance Taylor <ian@cygnus.com>
-
- Optimize linking of stabs in sections as used in ELF and COFF.
- * stabs.c: New file.
- * libbfd-in.h (_bfd_link_section_stabs): Declare.
- (_bfd_write_section_stabs): Declare.
- (_bfd_write_stab_strings): Declare.
+ * libbfd-in.h (_bfd_nolink_bfd_gc_sections): Correct definition to
+ match definition of _bfd_gc_sections field.
* libbfd.h: Rebuild.
- * libcoff-in.h (struct coff_section_tdata): Add stab_info field.
- (struct coff_link_hash_table): Add stab_info field.
- * libcoff.h: Rebuild.
- * cofflink.c (_bfd_coff_link_hash_table_init): Initialize
- stab_info field.
- (coff_link_add_symbols): Call _bfd_link_section_stabs if
- appropriate.
- (_bfd_coff_final_link): Write out stab strings hash table.
- (_bfd_coff_link_input_bfd): Handle optimized stabs sections.
- * coff-ppc.c (ppc_bfd_coff_final_link): Write out stab strings
- hash table.
- * elf-bfd.h (struct elf_link_hash_table): Add stab_info field.
- (struct bfd_elf_section_data): Add stab_info field.
- * elf.c (_bfd_elf_link_hash_table_init): Initialize stab_info
- field.
- * elflink.h (elf_link_add_object_symbols): If appropriate, call
- _bfd_link_section_stabs.
- (elf_bfd_final_link): Write out stab strings hash table.
- (elf_link_input_bfd): Handle optimized stabs sections.
- * reloc.c (_bfd_final_link_relocate): Check address against
- _raw_size rather than _cooked_size.
- * Makefile.in: Rebuild dependencies.
- (BFD_LIBS): Add stabs.o
- (BFD_LIBS_CFILES): Add stabs.c.
-
- * VERSION: Increment for bfdlink.h change.
-
- * coffgen.c (coff_renumber_symbols): Correct handling of
- BSF_NOT_AT_END common symbols.
-
-Fri Apr 19 19:21:56 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * coff-ppc.c (record_toc): Add cast to avoid warning.
- (ppc_allocate_toc_section): Likewise.
- (coff_ppc_relocate_section): Remove ANSI C string concatenation.
- (ppc_coff_reloc_type_lookup): Remove unreached code.
- * coffcode.h (coff_write_object_contents): Don't take the address
- of an array.
- * peicode.h (pe_print_idata): Add casts to avoid warning.
- (pe_print_edata): Likewise.
- (pe_print_reloc): Remove ANSI C string concatenation.
-Thu Apr 18 18:51:18 1996 Ian Lance Taylor <ian@cygnus.com>
+Fri Sep 4 13:54:23 1998 David Miller <davem@dm.cobaltmicro.com>
- * libcoff-in.h (struct coff_final_link_info): Add last_bf_index
- and last_bf fields.
- * libcoff.h: Rebuild.
- * coffswap.h (coff_swap_aux_in): Swap endndx field for C_FCN
- symbols.
- (coff_swap_aux_out): Likewise.
- * peicode.h (coff_swap_aux_in): Likewise.
- (coff_swap_aux_out): Likewise.
- * coffgen.c (coff_pointerize_aux): Check endndx field for C_FCN
- symbols.
- * cofflink.c (_bfd_coff_final_link): Initialize last_bf_index
- field.
- (_bfd_coff_link_input_bfd): Check endndx field for C_FCN symbols.
- Fix up .bf endndx link fields.
- * coff-ppc.c (ppc_bfd_coff_final_link): Initialize last_bf_index
- field.
- * xcofflink.c (xcoff_link_input_bfd): Check endndx field for C_FCN
- symbols.
-
-Wed Apr 17 12:08:24 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * pe{,i}-ppc.c (PPC_PE): Define instead of PPC, so that compiling
- on Solaris PowerPC systems doesn't get confused.
-
- * ccffcode.h (coff_write_object_contents): Use #ifdef PPC_PE, not
- #ifdef PPC.
-
- * elfcore.h (bfd_prstatus, bfd_fpregset): Add thread argument.
- (elf_corefile_note): If HAVE_SYS_PROCFS_H is not defined, don't
- update did_reg and did_reg2.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Properly adjust
+ the addend of a dynamic relocation referencing a section.
+ * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
+ (sparc64_elf_finish_dynamic_symbol): Fix the PLT relocation offset.
-Wed Apr 17 13:07:37 1996 Ian Lance Taylor <ian@cygnus.com>
+Thu Sep 3 17:28:50 1998 Richard Henderson <rth@cygnus.com>
- * xcofflink.c (xcoff_link_input_bfd): Check for TOC overflow.
+ * elflink.h (bfd_elfNN_size_dynamic_sections): Verify that the
+ bed has a size_dynamic_sections routine before trying to use it.
- * linker.c (_bfd_generic_link_add_one_symbol): When calling the
- callback routines, pass h->root.string rather than name, in case
- copy is true and name is transient.
+Mon Aug 31 14:49:22 1998 Richard Henderson <rth@cygnus.com>
-Tue Apr 16 16:36:38 1996 Stu Grossman (grossman@lisa.cygnus.com)
+ * elf32-mips.c (elf_mips_gnu_vtentry_howto): Use
+ _bfd_elf_rel_vtable_reloc_fn.
- * elfcore.h: Add support for core files with multiple threads.
- (Primarily for Solaris.)
+Mon Aug 31 10:23:40 1998 Catherine Moore <clm@cygnus.com>
-Tue Apr 16 13:44:08 1996 Ian Lance Taylor <ian@cygnus.com>
+ * Makefile.am: Add elf32-arm.c.
+ * Makefile.in: Rebuild.
+ * elf-bfd.h: Add elf_backend_get_symbol_type.
+ * elf.c (swap_out_syms): If defined, call
+ elf_backend_get_symbol_type.
+ * elf32-arm.c: Define elf_backend_get_symbol_type.
+ (elf32_arm_get_symbol-type): New routine.
+ (record_thumb_to_arm_glue): Change to use STT_ARM_TFUNC.
+ (bfd_elf32_arm_process_before_allocation): Change to
+ check for STT_ARM_TFUNC.
+ (elf32_arm_final_link_relocate): Likewise.
+ * elfxx-target.h: Add elf_backend_get_symbol_type.
- * aoutx.h (NAME(aout,squirt_out_relocs)): Don't do anything if
- section->orelocation is NULL.
+Fri Aug 28 19:44:07 1998 Richard Henderson <rth@cygnus.com>
- * coffgen.c (bfd_coff_get_syment): New function.
- (bfd_coff_get_auxent): New function.
- * bfd-in.h (bfd_coff_get_syment): Declare.
- (bfd_coff_get_auxent): Declare.
+ * archures.c (bfd_mach_alpha_ev[456]): New.
+ * cpu-alpha.c: Rework to match these types.
* bfd-in2.h: Rebuild.
-Mon Apr 15 19:06:59 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * elf32-mips.c (struct mips_hi16): Define.
- (mips_hi16_addr, mips_hi16_addend): Remove.
- (mips_hi16_list): New static variable.
- (mips_elf_hi16_reloc): Maintain a list of unmatched HI16 relocs.
- (mips_elf_lo16_reloc): Process mips_hi16_list.
- (mips_elf_relocate_section): Permit an arbitrary number of HI16
- relocs before the associated LO16 reloc.
+Fri Aug 28 19:38:53 1998 Richard Henderson <rth@cygnus.com>
-Wed Apr 10 00:23:53 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf-bfd.h (_bfd_elf_rel_vtable_reloc_fn): Declare.
+ * elf.c (_bfd_elf_rel_vtable_reloc_fn): New.
- * versados.c (versados_scan): Check bfd_alloc return value.
- (versados_object_p): Check all bfd_read return values. Require
- that lang field be less than 10, to avoid confusion with Intel Hex
- files.
+ * elf32-i386.c (elf_howto_table): Add vtable relocs.
+ (elf_i386_reloc_type_lookup): Recognize them.
+ (elf_i386_check_relocs): Pass them off to generic code.
+ (elf_i386_relocate_section): Ignore them.
+ (elf_i386_gc_mark_hook, elf_i386_gc_sweep_hook): New.
+ (elf_backend_can_gc_sections): True.
- * libaout.h (WRITE_HEADERS): Write out the relocs even if there
- aren't any symbols.
- * aoutx.h (NAME(aout,swap_std_reloc_out)): Set r_index to N_ABS,
- not 0, for an absolute symbol.
- (NAME(aout,swap_ext_reloc_out)): Likewise.
+Thu Aug 20 15:03:45 1998 Nick Clifton <nickc@cygnus.com>
- * ihex.c (ihex_scan): Accept a length of 4 for record type 5.
- (ihex_write_object_contents): For a large start address, output
- the full 32 bit address in record type 5.
+ * elf32-arm.c (elf32_thumb_to_arm_stub): Check sym_sec is not NULL
+ before looking at owner field.
+ (elf32_arm_to_thumb_stub): Ditto.
+ (elf32_arm_relocate_section): Compute name before calling
+ elf32_arm_final_link_relocate().
- * ieee.c (ieee_write_byte): Change second parameter from bfd_byte
- to int to avoid promotion problems in prototype.
+Thu Aug 20 11:30:17 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
-Tue Apr 9 11:44:21 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf.c: comment and formatting cleanups.
+ * elfcore.h: ditto.
- * configure.host: Use ${srcdir} when looking for picfrag.
+Wed Aug 19 15:43:26 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
- * configure.host: Switch on ${libdir}, not $(libdir). From
- alan@spri.levels.unisa.edu.au (Alan Modra).
+ * elfcode.h (elf_object_p): Reject files of header type ET_CORE
+ (core files are treated differently than object files).
+ * elf-bfd.h (_bfd_elf_write_corefile_contents,
+ bfd_elf_mkcorefile): declare.
+ * elfxx-target.h (_bfd_elf_write_corefile_contents,
+ bfd_elf_mkcorefile): add to bfd_target vector.
+ * elfcore.h (elf_core_file_p): save the program header table,
+ and set the bfd architecture from the elf file header.
+ * elf.c (bfd_elf_mkcorefile): new function.
+ (_bfd_elf_write_corefile_contents): new function.
+ (assign_file_positions_for_segments): add cases for handling
+ PT_NOTE segments. (assign_file_positions_except_relocs):
+ core files should be handled the same as exec files.
+ (prep_headers): identify core files as type ET_CORE.
+ (copy_private_bfd_data): identify the sections belonging to
+ the PT_NOTE segment.
- * aoutx.h (aout_link_add_symbols): Always call add_dynamic_symbols
- entry point, not just for DYNAMIC objects.
- * sunos.c (sunos_add_dynamic_symbols): Always call
- sunos_create_dynamic_sections. If called with a non DYNAMIC
- object, don't do anything else.
- (sunos_add_one_symbol): Don't call sunos_create_dynamic_sections.
+ * elf32-sparc.c (elf32_sparc_final_write_processing):
+ add break statement to default case.
-Mon Apr 8 12:09:36 1996 Ian Lance Taylor <ian@cygnus.com>
+1998-08-19 Vladimir N. Makarov <vmakarov@cygnus.com>
- * configure.in: Permit --enable-shared to specify a list of
- directories.
- * configure: Rebuild.
+ * elf32-ppc.c (ppc_elf_relocate_section): Check that output
+ section (not input) will be in sections ".sbss", ".sbss2",
+ ".sdata", and ".sdata" for R_PPC_SDAREL16, R_PPC_EMB_SDA2REL,
+ R_PPC_EMB_SDA21, R_PPC_EMB_RELSDA. In all these cases also ignore
+ output_offset for correct evaluation of addend.
- * configure.host: Set HLDFLAGS and SHLIB_CFLAGS for *-dec-osf*
- host when configuring with --enable-shard.
+Tue Aug 18 11:48:12 1998 Catherine Moore <clm@cygnus.com>
-Fri Apr 5 12:24:13 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-arm.c: Add prefix bfd_ to elf32_arm_get_bfd_for_interworking,
+ elf32_arm_allocate_interworking_sections and
+ elf32_arm_process_before_allocation.
- * config.bfd: Add i[345]86-*-freebsdelf* target; from John Polstra
- <jdp@polstra.com>.
+Tue Aug 18 11:46:00 1998 Nick Clifton <nickc@cygnus.com>
- * linker.c (link_action): For WARN_ROW/warn, use MWARN, not CYCLE,
- to avoid crashing in bfd_hash_replace.
+ * bfd-in.h: Ammend prototype for
+ elf32_arm_process_before_allocation to remove surplus third
+ argument.
- * sysdep.h: Use #ifdef, not #if.
-
-Thu Apr 4 23:32:23 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * config.in: Rebuild.
-
-Thu Apr 4 18:49:09 1996 Fred Fish <fnf@cygnus.com>
-
- * configure.in (mips-sony-bsd*): Fix typo in AC_DEFINE.
- (AC_CHECK_HEADERS): Check for sys/time.h
- (AC_HEADER_TIME): Add macro.
- * configure: Rebuild.
- * sysdep.h: Use TIME_WITH_SYS_TIME and HAVE_SYS_TIME_H
- to control what combination of <time> and <sys/time.h>
- get included.
-
-Tue Apr 2 13:11:53 1996 Doug Evans <dje@canuck.cygnus.com>
-
- * aoutf1.h (sunos_32_set_arch_mach): Handle M_SPARCLET.
- (aout_32_sunos4_write_object_contents): Likewise.
- * aoutx.h (NAME(aout,machine_type)): Handle
- bfd_mach_sparc_{sparclet,sparclite}.
- * archures.c (bfd_mach_sparc_{sparclet,sparclite}): Define.
- (bfd_mach_sparc_v9_p): Update.
- * cpu-sparc.c (arch_info_struct): Add entries for sparclet,sparclite.
- * libaout.h (enum machine_type): Add M_SPARCLET.
- * sunos.c (MACHTYPE_OK): Define.
- * bfd-in2.h: Regenerated.
-
-Tue Apr 2 00:33:18 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * elf-bfd.h (struct elf_link_hash_table): Add hgot field.
- * elf.c (_bfd_elf_link_hash_table_init): Initialize hgot field.
- * elflink.c (_bfd_elf_create_got_section): Store the
- _GLOBAL_OFFSET_TABLE_ hash table entry in the hgot field.
- * elf32-sparc.c (elf32_sparc_check_relocs): If the size of the
- global offset table goes over 0x1000, set the value of
- _GLOBAL_OFFSET_TABLE_ to 0x1000 into the section.
- (elf32_sparc_relocate_section): Subtract the offset of
- _GLOBAL_OFFSET_TABLE_ when handling GOT relocations.
-
- * elfcode.h: Don't include <string.h>.
-
-Mon Apr 1 10:39:24 1996 Jeffrey A Law (law@cygnus.com)
+ * bfd-in2.h: Regenerate.
- * linker.c (_bfd_generic_link_hash_newfunc): Renamed from
- generic_link_hash_newfunc. All references changed.
- * genlink.h (_bfd_generic_link_hash_newfunc): Declaration
- moved here from libbfd-in.h.
- * libbfd-in.h: Corresponding changes.
- * libbfd.h: Regenerated.
+Sat Aug 15 20:55:08 1998 Richard Henderson <rth@cygnus.com>
-Mon Apr 1 12:35:36 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf64-alpha.c (elf64_alpha_relax_section): Handle indirect symbols.
- * aoutx.h (aout_link_input_section_std): When reporting an
- overflow error, use the name of the symbol in the hash table if
- available.
- (aout_link_input_section_ext): Likewise.
+Fri Aug 14 09:12:28 1998 Stan Cox <scox@cygnus.com>
- * elflink.h (elf_adjust_dynamic_symbol): If a common symbol got
- defined in a regular file, set ELF_LINK_HASH_DEF_REGULAR.
+ * aoutx.h (aout_link_input_section_ext): Use the relocation already
+ calculated for RELOC_SPARC_REV32 case.
-Sun Mar 31 01:58:41 1996 steve chamberlain <sac@slash.cygnus.com>
+Thu Aug 13 14:02:02 1998 Catherine Moore <clm@cygnus.com>
- * peicode.h (coff_swap_aouthdr_out): Delete test for .junk.
- * coffcode.h (coff_compute_section_file_positions): Likewise.
- (coff_write_object_contents): Likewise.
+ * bfd-in.h: Add prototypes for elf32_arm_get_bfd_for_interworking,
+ elf32_arm_allocate_interworking_sections and
+ elf32_arm_process_before_allocation.
+ * bfd-in2.h: Regenerated.
+ * elf32-arm.c Define elf32_arm_link_hash_table.
+ (insert_thumb_branch): New routine.
+ (find_thumb_glue): New routine.
+ (find_arm_glue): New routine.
+ (record_arm_to_thumb_glue): New routine.
+ (record_thumb_to_arm_glue): New routine.
+ (elf32_arm_link_hash_table_create): New routine.
+ (elf32_arm_get_bfd_for_interworking): New routine.
+ (elf32_arm_allocate_interworking_sections) New routine.
+ (elf32_arm_process_before_allocation) New routine.
+ (elf32_thumb_to_arm_stub): New routine.
+ (elf32_arm_to_thumb_stub): New routine.
+ (elf32_print_private_bfd_data): Fix typo.
+ (elf32_arm_final_link_relocate): Add argument sym_sec.
+ Check for branches to thumb symbols in case R_ARM_PC24.
+ Check for branches to arm symbols in case R_ARM_THM_PC22.
+ (elf32_arm_relocate_section): Pass symbol section to
+ elf32_arm_final_link_relocate.
-Fri Mar 29 12:44:36 1996 Ian Lance Taylor <ian@cygnus.com>
+Wed Aug 12 19:00:39 1998 Geoff Keating <geoffk@ozemail.com.au>
- * section.c (SEC_LINK_ONCE): Define.
- (SEC_LINK_DUPLICATES): Define.
- (SEC_LINK_DUPLICATES_DISCARD): Define.
- (SEC_LINK_DUPLICATES_ONE_ONLY): Define.
- (SEC_LINK_DUPLICATES_SAME_SIZE): Define.
- (SEC_LINK_DUPLICATES_SAME_CONTENTS): Define.
- * bfd-in2.h: Rebuild.
- * coffcode.h (sec_to_styp_flags): If COFF_WITH_PE, turn
- SEC_LINK_ONCE into IMAGE_SCN_LNK_COMDAT.
- (styp_to_sec_flags): If COFF_WITH_PE, turn IMAGE_SCN_LNK_REMOVE
- into SEC_EXCLUDE. If IMAGE_SCN_LNK_COMDAT is set, set
- SEC_LINK_ONCE, and look through the symbol table for the setting
- for SEC_LINK_DUPLICATES.
- (coff_write_object_contents): If COFF_WITH_PE, if SEC_LINK_ONCE is
- set for a section, find the section symbol in the symbol table,
- and set the aux entry based on SEC_LINK_DUPLICATES.
- * coffgen.c (coff_print_symbol): Add a space before "checksum".
- * coff-arm.c (armcoff_big_vec): If COFF_WITH_PE is defined, add
- SEC_LINK_ONCE and SEC_LINK_DUPLICATES to section_flags.
- * coff-i386.c (i386coff_vec): Likewise.
- * coff-ppc.c (TARGET_LITTLE_SYM, TARGET_BIG_SYM): Likewise.
-
- * VERSION: Bump to 2.6.1.
- * Makefile.in (stamp-h): Depend upon VERSION.
-
-Thu Mar 28 23:48:49 1996 Jeffrey A Law (law@cygnus.com)
-
- * libbfd-in.h (generic_link_hash_newfunc): Add declaration.
- * libbfd.h: Rebuilt.
- * linker.c (generic_link_hash_newfunc): No longer static.
- * coffcode.h (coff_bfd_link_hash_create): Allow specific targets
- to override.
- * coff-h8300.c: Add two derived hash tables and their associated
- funtions and #defines for use by the h8300 linker.
- (h8300_reloc16_extra_cases, case R_MEM_INDIRECT): Create entries in
- the function vector as needed. Place the address of the function
- vector entry in the location specified by the R_MEM_INDIRECT reloc.
- Rewrite the vectors section contents as necessary.
- (h8300_bfd_link_add_symbols): New function for the h8300 linker.
- (coff_bfd_link_add_symbols): Define to use h8300 specific version.
- (coff_bfd_link_hash_table_create): Likewise.
-
-Thu Mar 28 17:44:08 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * libhppa.h: If gcc 2.7 or higher, declare all the functions with
- __attribute__ ((__unused__)) so that -Wall doesn't warn about
- them.
- (hppa_rebuild_insn): Pass pointer to correct type to
- low_sign_unext and dis_assemble_21.
-
-Thu Mar 28 11:00:36 1996 Doug Evans <dje@canuck.cygnus.com>
-
- * config.bfd (sparc64-{sysv4*,solaris2*}): Delete.
- Stick with sparc-*-{sysv4*,solaris2*}.
-
-Wed Mar 27 10:43:34 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * peicode.h (coff_swap_aux_in): Swap in extra PE x_scn fields.
- (coff_swap_aux_out): Swap out extra PE x_scn fields.
- * coffswap.h (coff_swap_aux_in): Zero out extra PE x_scn fields.
- * coffgen.c (coff_print_symbol): If any of the extra PE x_scn
- fields is non-zero, print them.
-
- * coff-ppc.c (ppc_record_toc_entry): Put inside COFF_IMAGE_WITH_PE
- ifdef. Remove unused variables.
- (ppc_record_data_in_toc_entry): Ifdef out. Removed unused
- variables.
- (ppc_mark_symbol_as_glue): Put inside COFF_IMAGE_WITH_PE ifdef.
- (get_symbol_value): Ifdef out.
- (pe_ppc_reloc): Ifdef out. Remove unused variables.
- (coff_ppc_relocate_section): Remove unused variables. Make
- fprintf strings and argument types correspond. Put before_addr in
- DEBUG_RELOC ifdef.
- (dump_toc): Make fprintf strings and argument types correspond.
- (ppc_process_before_allocation): Remove unused variables. Always
- return a value.
- (ppc_reflo_reloc): Ifdef out.
- (ppc_addr32nb_reloc): Ifdef out.
- (ppc_coff_rtype2howto): Make fprintf strings and argument types
- correspond.
- (coff_ppc_rtype_to_howto): Likewise.
- (ppc_coff_swap_sym_in_hook): Remove unused variables.
-
- * peicode.h (pe_print_idata): Move otherwise unused variables into
- the #ifdef where they are used. Always return a value.
- (pe_print_edata): Make fprintf strings and argument types
- correspond. Always return a value.
- (pe_print_pdata): Removed unused variable addr_value. Always
- return a value.
- (pe_print_reloc): Remove unused variable onaline. Make fprintf
- strings and argument types correspond. Always return a value.
-
- * elf32-ppc.c (ppc_elf_fake_sections): Return true.
- (ppc_elf_finish_dynamic_symbol): Move definition of unused
- variable rela inside #if 0 section where it is used.
-
- * ns32k.h: New file.
- * cpu-ns32k.h: Include ns32k.h. Rename externally visible
- functions to start with _bfd_.
- * aout-ns32k.c: Include ns32k.h. Change references to renamed
- functions in cpu-ns32k.h.
- * Makefile.in: Rebuild dependencies.
- (HFILES): Add ns32k.h.
-
- * section.c (struct sec): Add linker_mark field. Change
- user_set_vma and reloc_done to be single bit fields.
- (STD_SECTION): Update accordingly.
- * bfd-in2.h: Rebuild.
- * aoutx.h (NAME(aout,final_link)): Mark sections included in the
- link.
- (aout_link_input_bfd): Don't link unmarked sections.
- * cofflink.c (_bfd_coff_final_link): Mark sections included in the
- link.
- (_bfd_coff_link_input_bfd): Don't link unmarked sections.
- * coff-ppc.c (ppc_bfd_coff_final_link): Mark sections included in
- the link.
- * elflink.h (elf_bfd_final_link): Mark sections included in the
- link.
- (elf_link_input_bfd): Don't link unmarked sections.
- * xcofflink.c (_bfd_xcoff_bfd_final_link): Mark sections included
- in the link.
- (xcoff_link_input_bfd): Don't link unmarked sections.
+ * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Generate PLT
+ entries unless the symbol is defined in the executable; in
+ particular, undefined weak symbols get a PLT entry.
- * coffswap.h (coff_swap_scnhdr_out): Include section name in
- overflow error messages.
+Wed Aug 12 14:48:33 1998 Ian Lance Taylor <ian@cygnus.com>
-Tue Mar 26 15:46:18 1996 Ian Lance Taylor <ian@cygnus.com>
+ * libaout.h: Remove nested comment to avoid warning.
- * bfd.c (_bfd_default_error_handler): If _bfd_error_program_name
- is not set, print "BFD: " before the error message.
+Wed Aug 12 08:10:11 1998 Catherine Moore <clm@cygnus.com>
- * configure.in: Use AC_CHECK_TOOL to find ar and ranlib. From
- Miles Bader <miles@gnu.ai.mit.edu>.
- * configure: Rebuild.
+ * elf32-arm.c (elf32_arm_final_link_relocate): Rework
+ R_ARM_PC24 relocation.
-Fri Mar 22 12:17:00 1996 Ian Lance Taylor <ian@cygnus.com>
+Tue Aug 11 14:42:26 1998 Catherine Moore <clm@cygnus.com>
- * xcofflink.c (xcoff_link_input_bfd): Fix scan for C_BINCL/C_EINCL
- symbols.
+ * elf32-arm.c (elf32_arm_final_link_relocate): Remove unused
+ argument is_local. Add argument sym_flags. Check sym_flags
+ in R_ARM_ABS32 case. Include addend for R_ARM_THM_PC22 case.
+ (elf32_arm_relocate_section): Don't pass local sym and pass
+ sym_flags to elf32_arm_final_link_relocate.
- * config.bfd: Add ieee_vec to targ_selvecs for i960 targets and
- m68k-aout, m68k-coff, and m68k-elf targets.
+Mon Aug 10 20:38:39 1998 Richard Henderson <rth@cygnus.com>
-Fri Mar 22 11:33:44 1996 Martin Anantharaman <martin@goofy.imech.uni-duisburg.de>
+ * elf64-alpha.c (elf64_alpha_calc_dynrel_sizes): Correct last change
+ to not count too few relocs for dynamicly linked executables.
- * ieee.c: Changed #ifdef KEEPMINUSPCININST to #if KEEPMINUSPCININST.
- (ieee_generic_stat_arch_elt): Restructured to prevent
- ieee_object_p from being called repeatedly.
+Mon Aug 10 15:35:34 1998 Richard Henderson <rth@cygnus.com>
-Thu Mar 21 11:00:47 1996 steve chamberlain <sac@slash.cygnus.com>
+ * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Never consider
+ symbols without a dynamic index dynamic. Consider all weak
+ symbols dynamic.
+ (elf64_alpha_strip_section_from_output): Don't assume 1-1
+ correspondance between input and output sections.
- * coffcode.h (coff_write_object_contents): Allocate
- buffers large enough for any FILEHDR or AOUTHDR.
+Mon Aug 10 15:31:39 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-Thu Mar 21 16:28:17 1996 David Mosberger-Tang <davidm@azstarnet.com>
+ * elflink.h (elf_gc_common_finalize_got_offsets): For backends
+ that use a .got.plt section start the got offset at zero.
- * ecofflink.c (lookup_line): New static function, renamed and
- slighly changed from old _bfd_ecoff_locate_line.
- (_bfd_ecoff_locate_line): Cache line number information. Use
- lookup_line for actual lookup.
+Mon Aug 10 17:31:21 1998 Ian Lance Taylor <ian@cygnus.com>
-Thu Mar 21 14:59:11 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+ * ieee.c (ieee_write_processor): Correct the processor ID written
+ out for bfd_arch_m68k, accommodating change of March 25.
- * peicode.h (pe_print_pdata): Warn if the .pdata section is not a
- multiple of 20 bytes.
+Sun Aug 9 20:55:44 1998 Catherine Moore <clm@cygnus.com>
-Thu Mar 21 13:54:40 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-arm.c (elf32_arm_final_link_relocate): Rework
+ R_ARM_THM_RPC22 relocations.
- * ecoff.c (_bfd_ecoff_find_nearest_line): Use bfd_zalloc to
- allocate ecoff_find_line, and don't initialize by hand.
- * elf32-mips.c (mips_elf_find_nearest_line): Use bfd_zalloc for
- mips_elf_find_line, and don't call memset.
+Sat Aug 8 15:15:30 1998 Richard Henderson <rth@cygnus.com>
- * coffcode.h (coff_compute_section_file_positions): If not
- producing a final executable, don't consider sofar when aligning
- the section to the correct size.
+ * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Undef weak symbols
+ are always dynamic.
+ (elf64_alpha_calc_dynrel_sizes): Allow enough room for RELATIVE
+ .got relocs in -Bsymbolic shared objects.
-Wed Mar 20 16:53:12 1996 Ian Lance Taylor <ian@cygnus.com>
+Wed Aug 5 15:48:08 1998 Nick Clifton <nickc@cygnus.com>
- * coffcode.h (coff_add_missing_symbols): Ifdef out.
- (coff_write_object_contents): Don't call coff_add_missing_symbols.
- * coffgen.c (coff_section_symbol): Ifdef out.
+ * elf32-arm.c: Add private flags to ELF header.
+ (elf32_arm_print_private_bfd_data): New Function.
+ (elf32_arm_set_private_flags): New Function.
+ (elf32_arm_copy_private_flags): New Function.
+ (elf32_arm_merge_private_bfd_data): New Function.
-Mon Mar 18 12:54:41 1996 Ian Lance Taylor <ian@cygnus.com>
+Mon Aug 3 17:10:15 1998 Ian Lance Taylor <ian@cygnus.com>
- * elf32-mips.c (mips_elf_gprel32_reloc): Initialize gp if
- output_bfd is not NULL.
+ * elf32-sparc.c (elf32_sparc_check_relocs): Permit WPLT30 against
+ a local symbol.
+ (elf32_sparc_relocate_section): Likewise.
-Thu Mar 14 17:12:06 1996 Doug Evans <dje@charmed.cygnus.com>
+Sun Aug 2 03:19:23 1998 Richard Henderson <rth@cygnus.com>
- * coffgen.c (coff_get_normalized_symtab): Call bfd_zalloc instead
- of bfd_alloc (fixes fix_line not being initialized).
- Delete zeroing of fix_{value,tag,end,scnlen} fields.
+ * elf32-ppc.c (ppc_elf_check_relocs): Init sgot to NULL. Create the
+ .got if any relocation referrs to _GLOBAL_OFFSET_TABLE_.
+ (ppc_elf_relocate_section): Pull sgot and splt search to the start
+ of the function. Recognize no .plt as static linking.
-Thu Mar 14 16:06:06 1996 Jeffrey A Law (law@cygnus.com)
+1998-08-01 Ulrich Drepper <drepper@cygnus.com>
- * coffcode.h: Allow specific backends to override the
- bfd_link_add_symbols routine.
+ * elf32-mips.c (_bfd_mips_elf_section_from_shdr): Don't pass
+ ".liblist" string through gettext.
- * coff-h8300.c: Include genlink.h.
- (howto_table): Add R_MEM_INDIRECT.
- (rtype2howto): Support R_MEM_INDIRECT.
- (h8300_reloc16_extra_cases): Handle R_MEM_INDIRECT like R_RELBYTE
- for now.
+Fri Jul 31 16:38:14 1998 Catherine Moore <clm@cygnus.com>
-Tue Mar 12 12:41:17 1996 David Mosberger-Tang <davidm@koala.azstarnet.com>
+ * Makefile.am: Add support for elf32-arm.lo.
+ * Makefile.in: Rebuild.
+ * config.bfd (arm-*-elf): Define targ_defvec and targ_selvecs.
+ (thumb-*-elf): Define targ_defvec and targ_selvecs.
+ * configure.in: Handle bfd_elf32_littlearm_vec and bfd_elf32_bigarm_vec.
+ * configure: Regenerate.
+ * elf.c: (prep_headers): Support arch_type of EM_ARM.
+ * targets.c: Support new targets bfd_elf32_bigarm_vec and
+ bfd_target bfd_elf32_littlearm_vec.
+ * elf32-arm.c: New file.
- * coff-alpha.c (alpha_relocate_section): Use
- info->callbacks_warning, rather than _bfd_error_handler, for
- "multiple gp" warning.
+Tue Jun 28 19:05:28 1998 Stan Cox <scox@cygnus.com>
-Tue Mar 12 12:10:55 1996 Ian Lance Taylor <ian@cygnus.com>
+ * libaout.h (M_SPARCLITE_LE): New machine.
+ * sunos.c (MACHTYPE_OK): Add machine M_SPARCLITE_LE.
+ * aoutf1.h (sunos_set_arch_mach): Add machine M_SPARCLITE_LE.
+ (sunos_write_object_contents): Add machine bfd_mach_sparc_sparclite_le
+ * aoutx.h (howto_table_ext): Add relocation R_SPARC_REV32.
+ (NAME(aout,machine_type)) Add machine bfd_mach_sparc_sparclite_le
+ (aout_link_input_section_ext): Add RELOC_SPARC_REV32 support.
+ * elf32-sparc.c (_bfd_sparc_elf_howto_table, sparc_reloc_map,
+ elf32_sparc_relocate_section): Rename R_SPARC_32LE to be R_SPARC_REV32
+ * libbfd.h (bfd_reloc_code_real_names): Rename BFD_RELOC_SPARC_32LE to
+ be BFD_RELOC_SPARC_REV32.
+ * reloc.c: Ditto.
+ * config.bfd (sparc86x-*-aout): New
- * linker.c (bfd_wrapped_link_hash_lookup): New function.
- (_bfd_generic_link_add_one_symbol): Remove BFD_ASSERT on hash
- table string. Use bfd_wrapped_link_hash_lookup.
- (_bfd_generic_link_write_global_symbol): Remove BFD_ASSERT on hash
- table string.
- * aoutx.h (aout_link_write_symbols): Use the name from the hash
- table, if any, when writing out symbols.
- (aout_link_input_section_std): Use the name from the hash table,
- if any, when reporting undefined symbols.
- (aout_link_input_section_ext): Likewise.
- (aout_link_reloc_link_order): Use bfd_wrapped_link_hash_lookup.
- * bout.c (get_value): Likewise.
- * cofflink.c (_bfd_coff_reloc_link_order): Likewise.
- * ecoff.c (ecoff_reloc_link_order): Likewise.
- * elflink.h (elf_link_add_object_symbols): Likewise.
- (elf_reloc_link_order): Likewise.
- * linker.c (_bfd_generic_link_output_symbols): Likewise.
- (_bfd_generic_reloc_link_order): Likewise.
- (default_indirect_link_order): Likewise.
- * reloc16.c (bfd_coff_reloc16_get_value): Likewise.
- * sunos.c (sunos_add_one_symbol): Likewise.
- * xcofflink.c (xcoff_link_add_symbols): Likewise.
- (bfd_xcoff_link_count_reloc): Likewise.
- (xcoff_reloc_link_order): Likewise.
+Fri Jul 24 13:54:19 1998 Nick Clifton <nickc@cygnus.com>
- * ecoffswap.h (ecoff_swap_fdr_in): If ECOFF_64, turn 0xffffffff
- into -1 for intern->rss.
+ * linker.c (_bfd_generic_final_link): Allocate NULL symbol before
+ actually mapping the output sections.
- * configure: Rebuild with autoconf 2.8.
+Fri Jul 24 11:24:29 1998 Jeffrey A Law (law@cygnus.com)
-Mon Mar 11 12:28:31 1996 Ian Lance Taylor <ian@cygnus.com>
- * stab-syms.c (__define_stab_duplicate): Define.
- (bfd_get_stab_name): Rename from aout_stab_name. Rewrite to use a
- switch.
- * bfd-in.h (bfd_get_stab_name): Declare.
- * bfd-in2.h: Rebuild.
- * Makefile.in: Rebuild dependencies.
- (BFD_LIBS): Add stab-syms.o.
- (BFD_LIBS_CFILES): Add stab-syms.c.
- (BFD32_BACKENDS): Remove stab-syms.o.
- (BFD32_BACKENDS_CFILES): Remove stab-syms.c.
- * configure.in: Don't list stab-syms.o in bfd_backends.
- * configure: Rebuild.
- * libaout.h (aout_stab_name): Don't declare.
- * aoutx.h (NAME(aout,get_symbol_info)): Call bfd_get_stab_name,
- not aout_stab_name.
+ * elf-m10300.c (mn10300_elf_howto): Add R_MN10300_24 entry.
+ (mn10300_elf_reloc_map): Similarly.
+ (mn10300_elf_final_link_relocate): Handle R_MN10300_24.
-Fri Mar 8 11:26:20 1996 Ian Lance Taylor <ian@cygnus.com>
+Fri Jul 24 12:36:04 1998 Ian Lance Taylor <ian@cygnus.com>
- * elf.c (assign_file_positions_for_segments): Adjust file offset
- for section alignment even if SEC_LOAD is not set.
+ * elf32-mips.c (elf_mips_howto_table): Add reloc types used on
+ Irix 6.
+ (bfd_elf32_bfd_reloc_type_lookup): Add default case.
+ * elf64-mips.c: Replace all uses of mips_elf64_reloc_type with
+ elf_mips_reloc_type defined in elf/mips.h.
-Tue Mar 5 12:02:23 1996 Ian Lance Taylor <ian@cygnus.com>
+1998-07-24 Ulrich Drepper <drepper@cygnus.com>
- * configure.in: Don't set SHLIB or SHLINK to an empty string,
- since they appear as targets in Makefile.in.
- * configure: Rebuild.
+ * elf64-mips.c: Remove reloc_type definition completely. It's now
+ in elf/mips.h.
- * sunos.c (sunos_scan_ext_relocs): If not making a shared library,
- don't fiddle with a symbol which is not defined anywhere.
+Thu Jul 23 13:33:19 1998 Doug Evans <devans@canuck.cygnus.com>
-Mon Mar 4 12:49:16 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf64-mips.c (mips_elf64_reloc_type): #if 0 out more relocations
+ as they are defined in elf/mips.h now.
- * xcofflink.c (xcoff_mark): Treat undefined imported symbols as
- though they are defined in a shared library.
- (xcoff_build_ldsyms): Likewise.
+Thu Jul 23 11:29:43 1998 Jeffrey A Law (law@cygnus.com)
- * coffgen.c (coff_find_nearest_line): Don't look at the line
- numbers for the section if section->lineno is NULL.
- * elf.c (_bfd_elf_symbol_from_bfd_symbol): Print a useful error
- message rather than calling BFD_ASSERT.
- * elfcode.h (write_relocs): Check return value of
- _bfd_elf_symbol_from_bfd_symbol.
+ * Re-add lost change:
+ * elf-m10300.c (elf32_mn10300_link_hash_entry): Add new field
+ "movm_stack_size".
+ (mn10300_elf_relax_section): Include stack space for register saves
+ in the imm8 field of a "call" instruction.
+ (compute_function_info): Determine how much stack is allocated by
+ the movm instruction. Fix typo.
+ (elf32_mn10300_link_hash_newfunc): Initialize movm_stack_size.
-Fri Mar 1 09:42:59 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+Thu Jul 23 11:38:05 1998 Ian Lance Taylor <ian@cygnus.com>
- * elf32-ppc.c (ppc_elf_add_symbol_hook): Don't set SEC_LOAD flag
- for .sbss section.
+ * elf32-sparc.c (elf_backend_got_header_size): Define as 4.
+ * elf64-sparc.c (elf_backend_got_header_size): Define as 8.
-Wed Feb 28 11:25:47 1996 Jeffrey A Law (law@cygnus.com)
+1998-07-22 Ulrich Drepper <drepper@cygnus.com>
- * libhppa.h (hppa_reloc_field_selector_type): Add R_HPPA_NLSEL
- and R_HPPA_NLRSEL.
- (e_nsel, e_nlsel, e_nlrsel): Undefine. Add to
- hppa_reloc_field_selector_type_alt.
- (hppa_field_adjust): Handle e_nlsel, e_nlrsel. Fix e_nsel handling.
- * som.c (hppa_som_gen_reloc_type): Handle N', NL' NLR' field
- selectors.
- (som_write_fixups): Finish handling of R_N0SEL and R_N1SEL.
+ * elf32-ppc.c: Change use of pp_reloc_type to elf_ppc_reloc_type.
-Wed Feb 28 11:00:24 1996 Ian Lance Taylor <ian@cygnus.com>
+Wed Jul 22 16:27:18 1998 Nick Clifton <nickc@cygnus.com>
- * elf.c (assign_file_positions_for_segments): Adjust the segment
- memory size for the alignment of a SEC_ALLOC section, not just a
- SEC_LOAD section.
+ * elf32-hppa.h: Let ELF header define the enum containing the
+ external reloc numbers.
+ * elf32-i386.h: Likewise.
-Tue Feb 27 14:17:31 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+1998-07-22 14:57 Ulrich Drepper <drepper@cygnus.com>
- * m68klinux.c: New file.
- * hosts/m68klinux.h: New file.
- * config.bfd (m68*-*-linuxaout*, m68*-*-linux*): New targets.
- * configure.in (m68*-*-linux*): New native host.
- (m68klinux_vec): New vector.
- * configure: Rebuild.
- * targets.c (m68klinux_vec): Declare.
- * i386linux.c (bfd_i386linux_size_dynamic_sections): Renamed from
- bfd_linux_size_dynmic_sections to avoid clash with m68klinux.c.
- * bfd-in.h (bfd_i386linux_size_dynamic_sections): Rename
- declaration from bfd_linux_size_dynamic_sections.
- (bfd_m68klinux_size_dynamic_sections): Declare.
- * bfd-in2.h: Rebuild.
- * Makefile.in: Rebuild dependencies.
- (BFD32_BACKENDS): Add m68klinux.o.
- (BFD32_BACKENDS_CFILES): Add m68klinux.c.
+ * elf-m10300.c: Let ELF header now define the macros to get the enum.
+ * elf32-mips.c: Likewise.
+ * elf32-ppc.c: Likewise.
-Tue Feb 27 11:31:34 1996 Jeffrey A Law (law@cygnus.com)
+Wed Jul 22 13:53:52 1998 Nick Clifton <nickc@cygnus.com>
- * libhppa.h (pa_arch): Add pa20.
- (hppa_reloc_field_selector_type): Add R_HPPA_NSEL.
- (e_nsel): Undefine. Add to hppa_reloc_field_selector_type_alt.
- (hppa_field_adjust): Handle e_nsel.
- * som.c: Provide default definitions for many new relocs found only
- in hpux10 include files.
- (som_fixup_formats): Add several new relocs from hpux10.
- (som_hppa_howto_table): Add hpux10 relocs.
- (som_write_fixups): Handle R_N0SEL and R_N1SEL hpux10 relocs.
+ * bfd-in2.h: Change type of 'class' parameter to 'unsigned int' in
+ bfd_coff_set_symbol_class(), in order to avoid K&R compatability
+ prblems.
+ * bfd-in.h: Regenerate.
+ * coffgen.c (bfd_coff_set_symbol_class): Change type of 'class'
+ parameter to 'unsigned int' to avoid K&R compatability problems.
-Mon Feb 26 12:52:48 1996 Stan Shebs <shebs@andros.cygnus.com>
+Wed Jul 22 16:43:24 1998 Ian Lance Taylor <ian@cygnus.com>
- * mpw-make.sed: Edit out recent shared library support, and
- rules to rebuild .h files using doc/chew.
+ * ieee.c (ieee_find_nearest_line): Change filename_ptr and
+ functionname_ptr to be const. Change line_ptr to be unsigned.
-Mon Feb 26 14:48:39 1996 David Mosberger-Tang <davidm@AZStarNet.com>
+ * coffcode.h (coff_link_output_has_begun): Simplify handling when
+ macro is not defined. Change second parameter from bfd_link_info
+ to coff_final_link_info. Add prototype.
+ (coff_final_link_postscript): Simplify handling when macro is not
+ defined. Add prototype.
- * ecoff.c (ecoff_compute_section_file_positions): Adjust the file
- size even of sections with no contents.
+1998-07-22 13:08 Ulrich Drepper <drepper@cygnus.com>
-Mon Feb 26 14:01:13 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf-mn10300.c: Before include system specific ELF header define
+ START_RELOC_NUMBERS, RELOC_NUMBER, and END_RELOC_NUMBERS.
+ * elf32-mips.c: Likewise.
+ * elf32-ppc.c: Likewise.
- * cofflink.c (_bfd_coff_link_input_bfd): When merging, skip names
- starting with '$' the way we skip names starting with '.'. When
- updating x_endndx, don't be fooled by an index which has been
- merged.
+Wed Jul 22 13:46:51 1998 Ian Lance Taylor <ian@cygnus.com>
- * cofflink.c (_bfd_coff_link_input_bfd): Don't try to optimize a
- struct/union/enum type with no elements.
+ * elf64-mips.c (mips_elf64_reloc_type): Copy Ulrich's elf32-mips.c
+ temporary patch over to elf64-mips.c as well.
-Sat Feb 24 11:38:58 1996 Ian Lance Taylor <ian@cygnus.com>
+1998-07-21 Ulrich Drepper <drepper@cygnus.com>
- * bfd.c (bfd_errmsg): Handle a NULL return from strerror.
+ * elf32-mips.c (reloc_type): Temporarily disable definition of
+ standard relocation since they are now defined in elf/mips.h.
- * archive.c (bfd_generic_archive_p): If the first file in the
- archive can not be recognized as an object, don't assume that this
- is the wrong format.
+Tue Jul 21 09:47:00 1998 Catherine Moore <clm@cygnus.com>
- * elf.c (bfd_elf_set_dt_needed_name): Don't do anything if the
- format is not bfd_object.
- (bfd_elf_get_dt_soname): Likewise.
+ * elf-m10200.c (mn10200_elf_final_link_relocate):
+ Modify range test for case R_MN10200_8.
-Wed Feb 21 13:58:04 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf-m10300.c (mn10300_elf_final_link_relocate):
+ Modify range test for case R_MN10300_8.
- * coff-sh.c (sh_relax_delete_bytes): Correct range of R_SH_USES
- reloc.
+Mon Jul 20 18:50:54 1998 Richard Henderson <rth@cygnus.com>
-Tue Feb 20 16:22:44 1996 J.T. Conklin <jtc@rtl.cygnus.com>
+ * elf-bfd.h (struct elf_backend_data): Add got_ & plt_header_size.
+ * elf32-i386.c (elf_backend_got_header_size): Define.
+ (elf_backend_plt_header_size): Define.
+ * elf32-m68k.c, elf32-mips.c, elf32-ppc.c: Likewise.
+ * elf32-sparc.c, elf64-alpha.c, elf64-sparc.c: Likewise.
+ * elfxx-target.h: Provide a default of zero.
+ * elflink.c (_bfd_elf_create_got_section): Use got_header_size.
+ * elflink.h (elf_gc_common_finalize_got_offsets): Likewise.
- * bfd.c (tdata): Add netbsd_core_data.
- * bfd-in2.h: Regenerated.
+ * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't remove a PLT
+ entry from an executable, even if the plt refcount goes to 0.
-Tue Feb 20 16:50:02 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * sunos.c (SUNOS_CONSTRUCTOR): Define.
- (sunos_add_one_symbol): Don't let a symbol from a dynamic object
- override a constructor symbol. Set SUNOS_CONSTRUCTOR when
- appropriate.
-
- * bout.c (b_out_squirt_out_relocs): Use udata.i rather than flags
- to get the symbol index, matching 14 Jul 95 change.
-
-Tue Feb 20 08:26:27 1996 Fred Fish <fnf@phydeaux.cygnus.com>
-
- * coff-alpha.c (alpha_ecoff_get_relocated_section_contents):
- Remove duplicate definition of gp.
-
-Mon Feb 19 12:37:41 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Don't
- assume that we can set the GP value and then get the same value,
- since it won't be true if the output file is neither ELF nor
- ECOFF.
- * coff-mips.c (mips_adjust_reloc_in): Don't bother to use
- _bfd_get_gp_value here.
- (mips_gprel_reloc): Don't assume we can set and get the GP value.
- * elf32-mips.c (mips_elf_hi16_reloc): Get gp value from
- mips_elf_final_gp.
- (mips_elf_lo16_reloc): Likewise.
- (mips_elf_final_gp): Add pgp parameter. Set it to the GP value.
- Don't require that the BFD be ELF.
- (mips_elf_gprel16_reloc): Get gp value from mips_elf_final_gp.
- (mips_elf_gprel32_reloc): Likewise.
- (mips_elf_relocate_section): Don't assume we can set and get the
- GP value.
- (mips_elf_finish_dynamic_symbol): Don't bother to use
- _bfd_get_gp_value here.
-
- * elf32-mips.c (mips_elf_create_procedure_table): Initialize sv.
- Don't change epdr between malloc and free. Be careful not to free
- NULL pointers. Zero out the first RPDR.
-
- * configure.host: On Linux, only pass -rpath option if $(libdir)
- is neither /lib nor /usr/lib. From Alan Modra
- <alan@mullet.Levels.UniSA.Edu.Au>.
-
- * elf-bfd.h (struct elf_obj_tdata): Rename dt_needed_name to
- dt_name.
- (elf_dt_name): Rename from elf_dt_needed_name.
- * elf.c (bfd_elf_set_dt_needed_name): Use elf_dt_name, not
- elf_dt_needed_name.
- (bfd_elf_get_dt_soname): New function.
- * elflink.h (elf_link_add_object_symbols): Use elf_dt_name, not
- elf_dt_needed_name. Save the SONAME back in elf_dt_name.
- * bfd-in.h (bfd_elf_get_dt_soname): Declare.
- * bfd-in2.h: Rebuild.
+Mon Jul 20 12:47:26 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-Mon Feb 19 02:50:23 1996 Doug Evans <dje@charmed.cygnus.com>
+ * aoutx.h (NAME(aout,find_nearest_line)): Also remember the
+ directory name at the line number.
- * elf32-sparc.c (elf32_sparc_reloc_type_lookup): Renamed from
- _bfd_sparc_elf_reloc_type_lookup.
- (bfd_elf32_bfd_reloc_type_lookup): Update.
- * elf64-sparc.c (SPARC64_OLD_RELOCS): Define.
- (sparc64_elf_howto_table): Define.
- (sparc_reloc_map): Define.
- (sparc64_elf_reloc_type_lookup): New function.
- (sparc_elf_wdisp16_reloc): New function.
- (elf_info_to_howto): Use sparc64_elf_howto_table.
- (sparc64_elf_relocate_section): Likewise.
- (bfd_elf64_bfd_reloc_type_lookup): Update.
+ * elf.c (_bfd_elf_find_nearest_line): Also consider symbols
+ with an unspecified type.
-Sun Feb 18 15:02:25 1996 Ian Lance Taylor <ian@cygnus.com>
+Wed Jul 15 11:20:01 1998 Ian Lance Taylor <ian@cygnus.com>
- * configure.host: Check for 'do not mix' from native linker before
- trying to use -rpath.
+ * sunos.c: Add undef of valid to avoid problem on SunOS.
-Fri Feb 16 12:46:18 1996 Ian Lance Taylor <ian@cygnus.com>
+Tue Jul 14 15:30:59 1998 Richard Henderson <rth@cygnus.com>
- * bfd.c (_bfd_get_gp_value): New function.
- (_bfd_set_gp_value): New function.
- * libbfd-in.h (_bfd_get_gp_value): Declare.
- (_bfd_set_gp_value): Declare.
- * libbfd.h: Rebuild.
- * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Use
- _bfd_get_gp_value and _bfd_set_gp_value rather than referring
- directly to the fields in the tdata information.
- (alpha_relocate_section): Likewise.
- * coff-mips.c (mips_adjust_reloc_in): Likewise.
- (mips_gprel_reloc): Likewise.
- (mips_relocate_section): Likewise.
- * elf32-mips.c (mips_elf_hi16_reloc): Likewise.
- (mips_elf_lo16_reloc): Likewise.
- (mips_elf_final_gp): Likewise.
- (mips_elf_gprel16_reloc): Likewise.
- (mips_elf_gprel32_reloc): Likewise.
- (mips_elf_relocate_section): Likewise.
- (mips_elf_finish_dynamic_symbol): Likewise.
+ * config.bfd (i?86-pc-beos{pe,elf,}*): Recognize.
- * bout.c (b_out_set_arch_mach): Recognize bfd_mach_i960_jx.
+Tue Jul 14 11:22:21 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-Thu Feb 15 11:29:13 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf32-m68k.c (elf_m68k_check_relocs): Also reference count
+ R_68K_PCxx and R_68K_xx relocations. Make sure that
+ ELF_LINK_HASH_NEEDS_PLT is always set for a PLT reloc reference.
+ (elf_m68k_gc_sweep_hook): Also reference count R_68K_PCxx and
+ R_68K_xx relocations.
+ (elf_m68k_adjust_dynamic_symbol): Reset the plt offset of a symbol
+ that has no plt entry.
+ (elf_m68k_relocate_section): Ignore the plt offset in a static
+ link.
+ * elflink.h (elf_adjust_dynamic_symbol): Reset the plt offset for
+ an ignored symbol.
+ (elf_gc_common_finalize_got_offsets): Set the got offsets also in
+ a static link.
- * configure.in: Call AC_PROG_CC before configure.host.
- * configure: Rebuild.
- * configure.host: Don't set information which autoconf should
- figure out, namely CC, CFLAGS, LDFLAGS, AR, and RANLIB.
+ * elf32-m68k.c (R_68K_GNU_VTINHERIT, R_68K_GNU_VTENTRY): New reloc
+ types.
+ (howto_table, reloc_map): Add entries for them.
+ (elf_m68k_check_relocs): Handle them. Implement reference
+ counting for got and plt entries.
+ (elf_m68k_gc_mark_hook, elf_m68k_gc_sweep_hook): New functions.
+ (elf_m68k_adjust_dynamic_symbol): Handle unreferenced plt
+ symbols.
+ (rtype_to_howto_rel, elf_info_to_howto_rel): Delete.
+ (elf_m68k_relocate_section): Handle the new reloc types.
+ (bfd_elf32_bfd_final_link, elf_backend_gc_mark_hook,
+ elf_backend_gc_sweep_hook, elf_backend_can_gc_sections): Define.
+ * elflink.h (elf_link_add_object_symbols): When creating an
+ indirect reference for symbol versioning also copy the plt
+ offset.
+ (elf_fix_symbol_flags): When clearing the ELF_LINK_HASH_NEEDS_PLT
+ flag also reset the plt offset.
+ (elf_link_assign_sym_version): Likewise.
+ (elf_gc_common_finalize_got_offsets): Increment the got offset by
+ the size of the entry in bytes.
+ (elf_gc_allocate_got_offsets): Likewise.
- * configure.host: Remove go32 and win32 host information, since it
- should no longer be needed.
+Tue Jul 14 11:18:14 1998 Ian Lance Taylor <ian@cygnus.com>
- * elf.c (map_sections_to_segments): If we have a .dynamic section,
- then start a new segment rather than put a writable section in a
- readonly segment.
+ * elflink.h (elf_gc_sections): Return true rather than falling off
+ the bottom.
- * configure.host: Set RPATH_ENVVAR.
+ * coffgen.c (bfd_coff_set_symbol_class): Call bfd_alloc, not
+ xmalloc.
- * Makefile.in: Rebuild dependencies.
+Mon Jul 13 11:06:31 1998 Nick Clifton <nickc@cygnus.com>
- * elflink.c (_bfd_elf_create_linker_section): Remove unused
- zero_section variable.
+ * coff-arm.c: Supress definition of TARGET_UNDERSCORE and add a
+ comment describing when it should be enabled.
+ Changed definition of USER_LABEL_PREFIX to "", to fall into line
+ with GCC sources.
-Thu Feb 15 10:39:17 1996 H.J. Lu <hjl@zoom.com>
+Mon Jul 13 13:06:54 1998 Ian Lance Taylor <ian@cygnus.com>
- * Makefile.in ($(srcdir)/bfd-in2.h): Rename target from bfd-in2.h.
- ($(srcdir)/libbfd.h): Rename from libbfd.h.
- ($(srcdir)/libcoff.h): Rename from libcoff.h.
+ * ieee.c (ieee_slurp_external_symbols): Handle call optimization
+ information ATN records.
-Wed Feb 14 16:29:07 1996 Martin Anantharaman <martin@mail.imech.uni-duisburg.de>
+Fri Jul 10 16:31:06 1998 Ian Lance Taylor <ian@cygnus.com>
- * ieee.c (ieee_write_expression): Only use an R variable for a
- local symbol. Don't output a zero offset. Handle a zero address.
- (SRC_MASK, PCREL_OFFSET): Define based on KEEPMINUSPCININST.
- (rel32_howto, rel16_howto, rel8_howto): Use SRC_MASK and
- PCREL_OFFSET.
- (parse_expression): Don't try to handle multiple occurrences of a
- P variable. Handle I variables differently from X variables. Fix
- the order of minus expressions.
- (ieee_slurp_external_symbols): Generate an I variable for an NN
- record. Fix handling of ATI and ATX records.
- (ieee_slurp_sections): Only set minimal section attributes.
- Adjust them later, based on the section contents.
- (ieee_object_p): Read in the file until just after the ME record.
- Call ieee_slurp_section_data to set the section flags.
- (do_one): Add iterations parameter. Only repeat the first load
- item. Set the section and file reloc flags.
- (ieee_slurp_section_data): Set section flags. Pass iterations to
- do_one.
- (ieee_canonicalize_reloc): Handle I variables.
- (do_with_relocs): Only emit relocation size when necessary.
- Increase MAXRUN to 127. Change ov to be assigned, and take
- src_mask and pcrel_offset into account.
- (ieee_write_data_part): Skip sections that are not loaded.
- (ieee_write_external_part): Don't output optional last entry of WX
- records.
- (ieee_write_me_part): Make setting of me_record neater.
- (ieee_generic_stat_arch_elt): Get the size of an archive element.
-
- * syms.c (stt): Add entries for zerovars, vars, and code.
-
- * elfcode.h (validate_reloc): New static function.
- (write_relocs): Call validate_reloc for non ELF relocs.
-
- * elfxx-target.h (elf_symbol_leading_char): Define if not defined.
- (TARGET_BIG_SYM): Use elf_symbol_leading_char.
- (TARGET_LITTLE_SYM): Likewise.
-
- * config.bfd (m68*-*-psos*): New target.
-
-Tue Feb 13 15:56:22 1996 Bryan Ford <baford@snake.cs.utah.edu>
-
- * i386msdos.c: Remove some #if 0 code.
- (msdos_write_object_contents): Don't include empty sections in the
- size computation, regardless of their address.
-
-Tue Feb 13 15:36:37 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * elf32-ppc.c (ppc_elf_relocate_section): Don't segfault if dynboj
- is NULL, ie, the -r switch is used.
-
-Tue Feb 13 14:35:15 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * reloc.c (BFD_RELOC_MIPS_GOT_HI16): Define.
- (BFD_RELOC_MIPS_GOT_LO16): Define.
- (BFD_RELOC_MIPS_CALL_HI16, BFD_RELOC_MIPS_CALL_LO16): Define.
- * bfd-in2.h, libbfd.h: Rebuild.
- * elf32-mips.c (mips_reloc_map): Map new relocs.
-
- * configure.host: Set HDLFLAGS for *-*-hpux with --enable-shared.
-
- * Makefile.in ($(SHLINK)): Check ts against $(SHLIB), not
- $(SHLINK).
-
- * ieee.c (get_symbol): Set the section to bfd_abs_section.
- (do_with_relocs): If EXEC_P is set and there are no relocs, use a
- simple number for the section address, rather than an expression.
- Limit the number of bytes between relocs to MAXRUN.
- (ieee_write_me_part): Set me_record to the file offset after the
- start address.
- (ieee_write_processor): New static function.
- (ieee_write_object_contents): Use ieee_write_processor.
-
-Fri Feb 9 10:53:00 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.host: Use ${CC-gcc} when testing for -rpath on SunOS.
-
- * coff-aux.c: Change include of aux.h to aux-coff.h.
+ * ieee.c (ieee_slurp_external_symbols): Select an appropriate
+ section for an absolute symbol in a fully linked file. Based on
+ patch from Christian Holland <CHolland@de.lucent.com>.
-Thu Feb 8 14:01:03 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * elf32-m68k.c (elf_m68k_relocate_section): For a R_68K_RELATIVE
- relocation put the addend both in the reloc entry and the data.
- (elf_m68k_finish_dynamic_symbol): Likewise. Mask out marker in
- GOT offset value.
+Wed Jul 8 11:29:56 1998 Manfred Hollstein <manfred@s-direktnet.de>
- * elf32-m68k.c (elf_m68k_relocate_section): If -Bsymbolic, resolve
- a R_68K_PCxx reloc against a defined global symbol directly.
- (elf_m68k_check_relocs): Don't count such a reloc.
-
- * elf32-m68k.c (elf_m68k_check_relocs): Don't record a symbol with
- a PLTxx reloc as dynamic. Disallow PLTxxO reloc against a local
- symbol for now, otherwise always record the symbol as dynamic.
- (elf_m68k_adjust_dynamic_symbol): If a symbol with a PLTxx reloc
- is not referenced by a dynamic object, and we are not making a
- shared object, then don't make a PLT entry. If we do make a PLT
- entry, make sure the symbol has been recorded as dynamic.
-
-Wed Feb 7 13:56:06 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.host: When making a shared library, set HLDFLAGS to
- pass an appropriate -rpath option. Use the make variable SONAME
- as the shared library soname, rather than computing it here. On
- SunOS, build stamp-tshlink in place of $(SHLINK).
- * Makefile.in (SONAME): New variable.
- ($(SHLINK)): Make a link to the transformed name, as well.
- (stamp-tshlink): New target.
- (install): Skip stamp-tshlink during install.
-
-Wed Feb 7 13:37:39 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * elf32-ppc.c (ppc_elf_add_symbol_hook): Do not assume that the
- linker sections have been set up yet.
+ * coff-m88k.c (m88k_special_reloc): Don't lose the information
+ that a symbol is undefined.
- * elf.c (make_mapping): Add an additional argument to suppress
- making the first section include the program headers.
- (map_sections_to_segments): If the user used -Ttext such that the
- program headers are on a different page, do not set the flags
- saying that this section includes the program headers.
+Tue Jul 7 21:47:02 1998 Jeffrey A Law (law@cygnus.com)
-Tue Feb 6 14:04:49 1996 J.T. Conklin <jtc@rtl.cygnus.com>
+ * som.c (som_bfd_gc_sections): Define.
- * configure.in (*-*-netbsd*): Set COREFILE to netbsd-core.c.
- don't define TRAD_HEADER.
- * configure: Rebuild.
+Mon Jul 6 11:35:50 1998 Nick Clifton <nickc@cygnus.com>
- * netbsd-core.c: New file, support for NetBSD core files.
- * hosts/*nbsd.h: Removed.
-
-Tue Feb 6 11:47:49 1996 Doug Evans <dje@charmed.cygnus.com>
-
- * reloc.c (BFD_RELOC_SPARC_[567]): New reloc types.
- (BFD_RELOC_SPARC_LO7 reloc type): Deleted.
- * libbfd.h, bfd-in2.h: Regenerated.
- * elf32-sparc.c (_bfd_sparc_elf_reloc_type_lookup): Renamed from
- bfd_elf32_bfd_reloc_type_lookup.
- (reloc_type{,_names}): Deleted.
- (_bfd_sparc_elf_howto_table): Renamed from elf_sparc_howto_table.
- Add sparc64 relocs.
- (sparc_reloc_map): Add sparc64 relocs.
- (sparc_elf_notsupported_reloc): New static function.
- (sparc_elf_wdisp16_reloc): New static function.
- (elf32_sparc_check_relocs): Handle R_SPARC_WDISP{16,19}.
- (elf32_sparc_relocate_section): Likewise.
- (bfd_elf32_bfd_reloc_type_lookup): Define.
- * elf64-sparc.c (sparc64_elf_wdisp16_reloc): Deleted.
- (reloc_type{,_names}): Deleted.
- (elf_sparc_howto_table): Deleted.
- (sparc_reloc_map): Deleted.
- (_bfd_sparc_elf_howto_table): Renamed from elf_sparc_howto_table.
- (bfd_elf64_bfd_reloc_type_lookup): Change from function to #define.
+ * coff-arm.c (aoutarm_std_reloc_howto): Do not complain about
+ overflows in ARM_26D patches, since they have already been
+ implmented. Patch submitted by Dr. R.J. Black <rjb@dcs.gla.ac.uk>
-Tue Feb 6 12:12:22 1996 Ian Lance Taylor <ian@cygnus.com>
+Sat Jul 4 12:25:36 1998 Ian Lance Taylor <ian@cygnus.com>
- * configure.host: Make SHLIB_CFLAGS include $(PICFLAG) on a
- *-*-hpux* host.
+ * coffcode.h (coff_write_object_contents): If we have any long
+ section names, call coff_write_symbols even if there are no
+ symbols.
- * Makefile.in (program_transform_name): New variable.
- (install): Transform library name before installing it.
+Fri Jul 3 13:11:35 1998 Ian Lance Taylor <ian@cygnus.com>
-Mon Feb 5 10:38:27 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf.c (copy_private_bfd_data): Only set phdr_included once for a
+ PT_LOAD segment, rather than only setting it once for the entire
+ file.
- * archures.c (bfd_mach_i960_hx): Define.
+ * elf.c (_bfd_elf_make_section_from_shdr): When setting the LMA,
+ rather than ignoring every phdr with a p_paddr of 0, ignore all
+ the phdrs if they all have a p_paddr of 0.
+
+ * stabs.c (_bfd_write_stab_strings): Check whether the .stabstr
+ section was discarded from the link.
+
+Fri Jul 3 14:39:05 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * coff-sh.c (sh_insn_uses_freg): Ignore lowest bit of register number.
+
+Fri Jul 3 14:35:48 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * coff-sh.c (sh_insns_conflict): Load of fpscr conflicts with
+ floating point operations.
+
+Thu Jul 2 18:37:25 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * cofflink.c (_bfd_coff_link_input_bfd): Skip undefined global
+ function symbols.
+
+Thu Jul 2 14:59:42 1998 Klaus Kaempf <kkaempf@rmi.de>
+
+ Merge of vax/vms (read-only) support
+ * configure.com: Support Vax target.
+ * makefile.vms: Support Vax target.
+ * vms.h: Renamed from evax.h, merged vax/vms (read-only) support.
+ * vms.c: Renamed from evax-alpha.c, merged vax/vms (read-only)
+ support.
+ * vms-hdr.c: Renamed from evax-emh.c, merged vax/vms (read-only)
+ support.
+ * vms-gsd.c: Renamed from evax-egsd.c, merged vax/vms (read-only)
+ support.
+ * vms-tir.c: Renamed from evax-etir.c, merged vax/vms (read-only)
+ support.
+ * vms-misc.c: Renamed from evax-misc.c, merged vax/vms (read-only)
+ support.
+ * libbfd.c (real_read): Use unbuffered read on VMS/Vax.
+ * targets.c (bfd_target_ovax_flavour): New flavour.
+ (vms_alpha_vec): Renamed from evax_alpha_vec.
+ (vms_vax_vec): New.
+ (target_vector): Update accordingly.
+ * config.bfd (alpha*-*-*vms*): Use vms_alpha_vec, not
+ evax_alpha_vec.
+ (vax*-*-*vms*): New target.
+ * Makefile.am: Update for renamed files. Rebuild dependencies.
* bfd-in2.h: Rebuild.
- * cpu-i960.c (scan_960_mach): Accept machine "hx".
- (MATRIX): Expand entries for HX.
- (arch_info_struct): Add i960:hx entry.
- * bout.c (b_out_set_arch_mach): Handle bfd_mach_i960_hx.
- * coffcode.h (coff_set_arch_mach_hook): Handle F_I960HX.
- (coff_set_flags): Handle bfd_mach_i960_hx.
-
- Support for building as a shared library, based on patches from
- Alan Modra <alan@spri.levels.unisa.edu.au>:
- * configure.in: Add AC_ARG_ENABLE for shared and commonbfdlib.
- New substitutions: ALLLIBS, PICFLAG, SHLIB, SHLIB_CC,
- SHLIB_CFLAGS, COMMON_SHLIB, PICLIST, SHLINK.
- * configure: Rebuild.
- * configure.host: If --enable-shared, adjust shared library stuff
- based on the host. If the host is SunOS, and the linker supports
- -rpath, set HLDFLAGS to use it.
- * Makefile.in (ALLLIBS): New variable.
- (PICFLAG, SHLIB, SHLIB_CC, SHLIB_CFLAGS): New variables.
- (COMMON_SHLIB, SHLINK): New variables.
- (.c.o): If PICFLAG is set, compile twice, once PIC, once normal.
- (STAGESTUFF): Remove variable.
- (all): Depend upon $(ALLLIBS) and @PICLIST@ rather than
- $(TARGETLIB).
- (stamp-ofiles): New target, like old ofiles target, but build
- using a temporary file and move-if-change, and touch stamp-ofiles
- when done.
- (ofiles): Just depend upon stamp-ofiles.
- (stamp-piclist, piclist): New targets.
- ($(SHLIB), $(SHLINK)): New targets.
- (targets.o, archures.o): Build twice if PICFLAG is set.
- (do_mostlyclean): Remove pic/*.o.
- (do_clean): Remove stamp-ofiles, $(SHLIB), $(SHLINK), piclist, and
- stamp-piclist.
- (do_distclean): Remove pic and stamp-picdir.
- (install): Install shared libraries.
- ($(OFILES)): Depend upon stamp-picdir.
- (stamp-picdir): New target.
-
- * libcoff-in.h: Add comment reminding people that libcoff.h is a
- generated file.
- * libcoff.h: Rebuild.
+ * configure.in, Makefile.in, aclocal.m4: Rebuild.
- * elflink.h (elf_adjust_dynamic_symbol): Don't try to get the
- flavour of a section with no owner.
+Thu Jul 2 13:31:55 1998 Ian Lance Taylor <ian@cygnus.com>
- * elf32-mips.c (mips_elf_create_dynamic_sections): Clear
- ELF_LINK_NON_ELF flag.
- (mips_elf_create_got_section): Likewise.
+ Based on patch from Matt Semersky <matts@scd.hp.com>:
+ * linker.c (_bfd_generic_final_link): Force a trailing NULL
+ pointer on abfd->outsymbols.
+ (generic_add_output_symbol): Handle NULL sym parameter.
- * elf.c: Revert last change, since it breaks dynamic linking.
- * elf-bfd.h (struct elf_backend_data): Remove want_hdr_in_seg
- field.
- * elf32-mips.c (elf_backend_want_hdr_in_seg): Don't define.
- * elfxx-target.h (elf_backend_want_hdr_in_seg): Don't define.
- (elfNN_bed): Don't initialize want_hdr_in_seg field.
-
-Sun Feb 4 20:45:13 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * elf.c (assign_file_positions_for_segments): If the backend does
- not want the elf header or the program headers in the address
- space, do not include them in the calculations.
-
- * elf32-ppc.c (ppc_elf_additional_program_headers): New hook
- function to determine if we need additional program headers.
- (ppc_elf_modify_segment_map): Define as a NOP function for now.
- (ppc_elf_create_linker_section): .sdata2 is a read-only section.
-
-Sat Feb 3 23:00:03 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * coffcode.h: Move today's libcoff.h change into coffcode.h.
-
-Sat Feb 3 15:43:44 1996 Fred Fish <fnf@cygnus.com>
+Wed Jul 1 17:05:53 1998 Nick Clifton <nickc@cygnus.com>
- * libcoff.h (bfd_coff_link_add_one_symbol): Combine macro args
- back into one line. Some compilers (sunos 4.1.3 for example)
- won't accept args split across more than one line.
+ * elf.c (copy_private_bfd_data): Add support for changing VMA or
+ LMA of sections.
-Fri Feb 2 11:42:15 1996 Steve Chamberlain <sac@slash.cygnus.com>
+Wed Jul 1 16:58:50 1998 Ian Lance Taylor <ian@cygnus.com>
- * aclocal.m4 (BFD_BINARY_FOPEN): Understand cygwin32.
- * configure: Regenerate.
-
-Fri Feb 2 12:12:16 1996 Jeffrey A Law (law@cygnus.com)
+ * coff-sh.c (sh_relax_delete_bytes): Correct address comparisons
+ when handling 32 bit immediate relocs.
+ * elf32-sh.c (sh_elf_relax_delete_bytes): Likewise.
- * elf32-hppa.c (elf32_hppa_backend_symbol_table_processing): Don't
- try to do arithmetic on a void *, cast it to a unsigned char * first.
+Tue Jun 30 09:55:03 1998 Jeffrey A Law (law@cygnus.com)
+
+ * section.c (STD_SECTION): Account for recently added gc_mark
+ field in struct asection.
+
+ * elf-m10300.c (bfd_mn10300_elf_merge_private_bfd_data): New function.
+ (bfd_elf32_bfd_merge_private_bfd_data): Define.
+
+Thu Jun 25 18:31:41 1998 Richard Henderson <rth@cygnus.com>
+
+ ELF Section-level Garbage Collection:
+ * bfd.c (bfd_gc_sections): New.
+ * aout-adobe.c: Hook to default implementation.
+ * aout-target.h, aout-tic30.c, binary.c, bout.c: Likewise.
+ * coff-alpha.c, coff-mips.c, coff-rs6000.c, coffcode.h: Likewise.
+ * evax-alpha.c, i386msdos.c, i386os9k.c, ieee.c: Likewise.
+ * ihex.c, nlm-target.h, oasys.c, ppcboot.c, srec.c: Likewise.
+ * tekhex.c, versados.c: Likewise.
+ * libbfd-in.h (_bfd_nolink_bfd_gc_sections): New.
+ * targets.c (BFD_JUMP_TABLE_LINK): Add _bfd_gc_sections.
+
+ * reloc.c (BFD_RELOC_VTABLE_INHERIT, BFD_RELOC_VTABLE_ENTRY): New.
+ (bfd_generic_gc_sections): New.
+ * section.c (SEC_KEEP): New.
+ (asection): Add gc_mark member.
+
+ * elfcode.h (elf_gc*): New name remappings.
+ * elflink.h (elf_link_input_bfd): Don't set contents on stabs
+ sections to be excluded.
+ (elf_gc_mark, elf_gc_sweep, elf_gc_sweep_symbol): New.
+ (elf_gc_propogate_vtable_entries_used): New.
+ (elf_gc_smash_unused_vtentry_relocs): New.
+ (elf_gc_sections, elf_gc_record_vtinherit, elf_gc_record_vtentry): New.
+ (elf_gc_common_finalize_got_offsets): New.
+ (elf_gc_allocate_got_offsets, elf_gc_common_final_link): New.
+ * elfxx-target.h: Add and default gc hooks.
+
+ * elf-bfd.h (struct elf_link_hash_entry): Swap got_offset/plt_offset
+ for unions.
+ (struct elf_obj_tdata): Likewise for local_got_offsets.
+ * elf.c, elf-i386.c, elf32-m68k.c, elf32-mips.c: Update all uses.
+ * elf32-ppc.c, elf32-sparc.c, elf64-alpha.c: Likewise.
+ * elf64-sparc.c, elflink.h: Likewise.
+
+ * elf-bfd.h (struct elf_link_hash_entry): Add vtable members.
+ (ELF_LINK_HASH_MARK): Define.
+ (struct elf_backend_data): Add GC hooks.
+ * elf.c (_bfd_elf_link_hash_newfunc): Zero vtable members.
+
+ * elf-m10300.c (mn10300_elf_check_relocs): New.
+ (mn10300_elf_gc_mark_hook): New.
+ (R_MN10300_GNU_VTINHERIT, R_MN10300_GNU_VTENTRY): New.
+ (elf_mn10300_howto, mn10300_reloc_map): Handle them.
+ (mn10300_elf_final_link_relocate): Likewise.
+ (mn10300_elf_relocate_section): Likewise.
+ (elf_backend_can_gc_sections): Define.
+ * elf32-mips.c (R_MIPS_GNU_VTINHERIT, R_MIPS_GNU_VTENTRY): New.
+ (elf_mips_gnu_vtinherit_howto, elf_mips_gnu_vtentry_howto): New.
+ (bfd_elf32_bfd_reloc_type_lookup): Handle them.
+ (mips_info_to_howto_rel): Likewise.
+ (mips_elf_relocate_section): Likewise.
+ (mips_elf_check_relocs): Likewise.
+ (mips_elf_gc_mark_hook, mips_elf_gc_sweep_hook): New.
+ (elf_backend_can_gc_sections): Define.
+ * elf32-ppc.c (R_PPC_GNU_VTINHERIT, R_PPC_GNU_VTENTRY): New.
+ (ppc_elf_howto_raw): Handle them.
+ (ppc_elf_reloc_type_lookup): Likewise.
+ (ppc_elf_relocate_section): Likewise.
+ (ppc_elf_check_relocs): Reference count .got and .plt entires.
+ Handle new vtable relocs.
+ (ppc_elf_adjust_dynamic_symbol): Recognize unused .plt entries.
+ (ppc_elf_gc_mark_hook, ppc_elf_gc_sweep_hook): New.
+ (elf_backend_can_gc_sections): Define.
-Thu Feb 1 16:04:06 1996 Ian Lance Taylor <ian@cygnus.com>
+Fri Jun 26 10:48:23 1998 Jeffrey A Law (law@cygnus.com)
- * elf-bfd.h (ELF_LINK_NON_ELF): Define.
- * elf.c (_bfd_elf_link_hash_newfunc): Set elf_link_hash_flags to
- ELF_LINK_NON_ELF.
- * elflink.h (elf_link_add_object_symbols): Reset ELF_LINK_NON_ELF
- flag for a newly defined symbol.
- (NAME(bfd_elf,record_link_assignment)): Likewise.
- (elf_adjust_dynamic_symbol): If ELF_LINK_NON_ELF is set, try to
- set the DEF or REF_REGULAR flags correctly.
+ * archures.c (bfd_mach_mn10300): Define.
+ * elf-m10300.c: Include elf/mn10300.h
+ (elf_mn10300_mach): New function.
+ (_bfd_mn10300_elf_final_write_processing): Likewise.
+ (_bfd_mn10300_elf_object_p): Likewise.
+ (elf_backendfinal_write_processing): Define.
+ (elf_backend_object_p): Likewise.
- * Makefile.in (bfd-in2.h): Make bfd.h, not protos, in docdir.
- (libbfd.h, libcoff.h): Corresponding change.
+Thu Jun 25 18:31:08 1998 Nick Clifton <nickc@cygnus.com>
- * elf32-i386.c (elf_i386_check_relocs): Don't record a symbol with
- a PLT32 reloc as dynamic.
- (elf_i386_adjust_dynamic_symbol): If a symbol with a PLT32 reloc
- is not referenced by a dynamic object, and we are not making a
- shared object, then don't make a PLT entry. If we do make a PLT
- entry, make sure the symbol has been recorded as dynamic.
+ * elf32-v850.c (v850_elf_perform_relocation): Fix HI16_S
+ relocation.
-Wed Jan 31 17:23:32 1996 Steve Chamberlain <sac@slash.cygnus.com>
+Wed Jun 24 17:17:57 1998 Ian Lance Taylor <ian@cygnus.com>
- * coff-i386.c (coff_i386_reloc_type_lookup): Add BFD_RELOC_32_PCREL.
- * config.bfd (i[345]86-*-win32): Becomes i[345]86-*-cygwin32.
- (powerpcle-*-cygwin32): New.
- * peicode.h (add_data_entry): Get address from vma.
+ * elflink.h (elf_bfd_final_link): Loop over input_bfds using the
+ link_next field, not the next field.
-Wed Jan 31 16:23:57 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+Sun Jun 21 19:38:39 1998 Ian Lance Taylor <ian@cygnus.com>
- * elflink.c (_bfd_elf_create_linker_section): If the symbol
- attached to the section has already been created as an undefined
- symbol, treat it as if it hasn't been created yet.
+ * elf.c (map_sections_to_segments): Check the section address
+ against the phdr size both with and without a modulo of
+ maxpagesize.
-Wed Jan 31 16:16:53 1996 Ian Lance Taylor <ian@cygnus.com>
+Fri Jun 19 17:08:18 1998 Ian Lance Taylor <ian@cygnus.com>
- * elflink.h (elf_bfd_final_link): Don't output initial dummy
- symbol or section symbols if stripping all symbols and this is not
- a relocateable link. Don't output the symbol string table if
- there are no symbols.
- (elf_link_flush_output_syms): Don't do anything if there are no
- symbols to flush.
+ * elf32-mips.c (mips_elf_size_dynamic_sections): Only strip a
+ linker created empty input section if the output section has the
+ same name.
-Wed Jan 31 12:55:49 1996 Richard Henderson <rth@tamu.edu>
+ * elflink.h (elf_link_output_extsym): Print an error message if
+ _bfd_elf_section_from_bfd_section fails.
- * coff-aux.c: New file.
- * hosts/m68kaux.h: New file.
- * config.bfd (m68*-apple-aux*): New target.
- * configure.in (m68*-apple-aux*): New native host.
- (m68kaux_coff_vec): New vector.
- * configure: Rebuild.
- * targets.c (m68kaux_coff_vec): Declare.
- * coffcode.h (bfd_coff_backend_data): Add field
- _bfd_coff_link_add_one_symbol.
- (bfd_coff_link_add_one_symbol): Define.
- (compare_arelent_ptr): New static function if TARG_AUX.
- (coff_write_relocs): If TARG_AUX, sort the relocs.
- (coff_write_object_contents): Set A/UX aouthdr magic number.
- (coff_link_add_one_symbol): Define if not defined.
- (bfd_coff_std_swap_table): Initialize new field.
- * libcoff.h: Rebuild.
- * cofflink.c (coff_link_add_symbols): Call
- bfd_coff_link_add_one_symbol rather than
- _bfd_generic_link_add_one_symbol.
- * coff-m68k.c (COFF_PAGE_SIZE): Don't define if already defined.
- * coff-alpha.c (alpha_ecoff_backend_data): Initialize new field.
- * coff-mips.c (mips_ecoff_backend_data): Likewise.
- * Makefile.in: Rebuild dependencies.
- (BFD32_BACKENDS): Add coff-aux.o.
- (BFD32_BACKENDS_CFILES): Add coff-aux.c.
+ * elf.c (_bfd_elf_section_from_bfd_section): Call bfd_set_error on
+ failure.
-Wed Jan 31 11:37:46 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+Tue Jun 16 11:55:55 1998 Ian Lance Taylor <ian@cygnus.com>
- * elf32-m68k.c (elf_m68k_relocate_section): Fix R_68K_GOT*
- relocation; ignore addend with R_68K_{GOT,PLT}*O relocation.
+ * elf.c (copy_private_bfd_data): Improve handling of Solaris
+ native linker output. Avoid putting an empty section in more than
+ one segment.
-Tue Jan 30 12:09:04 1996 Ian Lance Taylor <ian@cygnus.com>
+Fri Jun 12 13:30:17 1998 Tom Tromey <tromey@cygnus.com>
- * Makefile.in (do_maintainer_clean): Remove $(srcdir)/bfd-in2.h,
- $(srcdir)/libbfd.h and $(srcdir)/libcoff.h.
- (maintainer-clean): Warn about deleting special files.
- (bfd-in2.h, libbfd.h, libcoff.h): New targets.
+ * po/Make-in (all-yes): If maintainer mode, depend on .pot file.
+ ($(PACKAGE).pot): Unconditionally depend on POTFILES.
- * elf32-hppa.c (elf32_hppa_relocate_section): Handle indirect and
- warning symbols correctly.
- * elf32-i386.c (elf_i386_relocate_section): Likewise.
- * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
- * elf32-mips.c (mips_elf_relocate_section): Likewise.
- * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
- * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
- * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
+Fri Jun 12 13:34:02 1998 Doug Evans <devans@canuck.cygnus.com>
- * syms.c (_bfd_stab_section_find_nearest_line): Add casts to avoid
- warnings.
+ * elf.c (swap_out_syms): New arg relocatable_p.
+ Don't add section VMA to symbols for relocatable output.
+ (_bfd_elf_compute_section_file_positions): Update call to
+ swap_out_syms.
-Mon Jan 29 14:27:24 1996 Kim Knuttila <krk@cygnus.com>
+Mon Jun 8 15:20:57 1998 Nick Clifton <nickc@cygnus.com>
- * libcoff-in.h: aligned newly exported names with bfd naming
- conventions. Removed an erroneous define of POWERPC_LE_PE.
- * libcoff.h: Rebuild.
- * cofflink.c, coff-ppc.c: the above function name changes
+ * elf32-v850.c (v850_elf_perform_relocation): Make comparisons
+ against 'addend' be signed rather than unsigned.
-Mon Jan 29 13:06:28 1996 Ian Lance Taylor <ian@cygnus.com>
+Sat Jun 6 00:31:21 1998 Nick Clifton <nickc@cygnus.com>
- From Basim Kadhim <kadhim@spock.cs.colorado.edu>:
- * ecoff.c (struct extsym_info): Define.
- (_bfd_ecoff_bfd_final_link): Pass a pointer to struct extsym_info
- to ecoff_link_write_external.
- (ecoff_link_write_external): Accept a struct extsym_info pointer.
- Strip symbols when appropriate.
+ * elf32-m32r.c: Add prototyps for static functions.
- Based on patches from Ronald F. Guilmette <rfg@monkeys.com>:
- * syms.c (BSF_OBJECT): Define.
- (bfd_print_symbol_vandf): Print 'O' for BSF_OBJECT.
- * bfd-in2.h: Rebuild.
- * elfcode.h (elf_slurp_symbol_table): Set BSF_OBJECT for an
- STT_OBJECT symbol.
- * elf.c (swap_out_syms): Only set type to STT_OBJECT if BSF_OBJECT
- is set.
-
- * elf32-i386.c (elf_i386_relocate_section): If -Bsymbolic, when
- copying relocs into a shared object, treat a defined global symbol
- as a local symbol.
- * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
- * elf32-mips.c (mips_elf_relocate_section): Likewise.
- * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+ * coff-arm.c: Add prototypes for static functions.
- * elflink.h (elf_link_add_object_symbols): Only set weakdef to a
- real defined symbol, not to a weak defined symbol.
+Fri Jun 5 17:21:51 1998 Nick Clifton <nickc@cygnus.com>
-Mon Jan 29 11:34:36 1996 Kim Knuttila <krk@cygnus.com>
+ * elf.c (elf_sort_sections): Sort by LMA first then VMA, since the
+ LMA is used to order sections in a segment.
- * cofflink.c: removed the POWERPC_LE_PE hack, promoted some types
- and made a few static functions externs.
+ * elf32-v850.c: Add prototypes for static functions.
+ Change type of addend parameter to bfd_vma in various functions.
- * coff-ppc.c (ppc_bfd_coff_final_link): new function, replaces the
- POWERPC_LE_PE hack in cofflink.
+Fri Jun 5 18:09:58 1998 Ian Lance Taylor <ian@cygnus.com>
- * libcoff-in.h: promoted the following from cofflink.c to allow
- _bfd_coff_final_link to be overridden - STRING_SIZE_SIZE,
- coff_debug_merge_element, struct coff_debug_merge_type,
- coff_debug_merge_hash_entry, coff_debug_merge_hash_table,
- coff_debug_merge_hash_table_init, coff_debug_merge_hash_table_free,
- coff_debug_merge_hash_lookup, coff_link_section_info,
- coff_final_link_info, coff_debug_merge_hash_newfunc,
- coff_write_global_sym, coff_link_input_bfd, coff_reloc_link_order.
+ * aoutx.h (howto_table_ext): Change RELOC_BASE13 to use
+ complain_overflow_signed instead of complain_overflow_bitfield.
- * libcoff.h: re-gen'd
+Fri Jun 5 15:11:11 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-Fri Jan 26 18:33:35 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf.c (elf_map_symbols): Don't add section VMA to symbol value
+ when comparing against 0.
- * syms.c: Include "bfdlink.h".
- (struct stab_find_info): Define.
- (_bfd_stab_section_find_nearest_line): New function.
- * libbfd-in.h (_bfd_stab_section_find_nearest_line): Declare.
- * libbfd.h: Rebuild.
- * elf-bfd.h (struct elf_obj_tdata): Add line_info field.
- * elf.c (_bfd_elf_find_nearest_line): Try calling
- _bfd_stab_section_find_nearest_line before searching the ELF
- symbol table. Find the closest STT_FUNC symbol, not the last one.
- * libcoff-in.h (coff_data_type): Add line_info field.
- * libcoff.h: Rebuild.
- * coffgen.c (coff_find_nearest_line): Try calling
- _bfd_stab_section_find_nearest_line before searching the COFF
- symbol table.
- * Makefile.in: Rebuild dependencies.
-
-Fri Jan 26 16:11:19 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * elf32-ppc.c (R_PPC_EMB_SDA21 relocations): Make relocation size
- 4 bytes, so we get the correct value when updating the register
- field in little endian mode.
-
-Thu Jan 25 12:14:16 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * libcoff-in.h (struct xcoff_tdata): Remove toc_section and
- entry_section fields. Add sntoc and snentry fields.
- * libcoff.h: Rebuild.
- * coffcode.h (coff_mkobject_hook): Initialize sntoc and snentry,
- not toc_section and entry_section (the COFF file does not have any
- sections at this point).
- (coff_write_object_contents): Set o_snentry and o_sntoc from
- snentry and sntoc rather than entry_section and toc_section.
- * coff-rs6000.c (xcoff_copy_private_bfd_data): Copy sntoc and
- snentry, not toc_section and entry_section.
- * xcofflink.c (bfd_xcoff_size_dynamic_sections): Don't set
- entry_section from hentry.
- (xcoff_link_input_bfd): If a defined symbol has XCOFF_ENTRY set,
- set snenty.
- (xcoff_link_input_bfd): Set sntoc, not toc_section.
- (xcoff_write_global_symbol): Get toc_section from sntoc, rather
- than using toc_section directly.
-
- * archures.c: Add missing `.' in enum bfd_architecture.
- * bfd-in2.h: Rebuild.
+Wed Jun 3 17:52:49 1998 Ian Lance Taylor <ian@cygnus.com>
- * config.bfd (i[345]86-*-sco*elf*): Use bfd_elf32_i386_vec. From
- Robert Lipe <robertl@arnet.com>.
+ * Makefile.am (config.status): New target.
+ * Makefile.in: Rebuild.
-Thu Jan 25 12:08:51 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+Wed Jun 3 12:18:24 1998 Stan Cox <scox@equinox.cygnus.com>
- * elf32-ppc.c (ppc_elf_size_dynamic_sections): Add .rela.sdata{,2}
- to sections we allocate. Use bfd_zalloc to allocate initialial
- sections, not bfd_alloc.
- (ppc_elf_check_relocs): Remove BFD_ASSERTs for !shared from
- SDA{,2}I16 relocations.
- (ppc_elf_add_symbol_hook): Use the value of -G nn to determine
- whether to put something in .sbss or not.
- (ppc_elf_relocate_section): Add support for more relocations. Add
- in sec->output_offset where appropriate. Make error messages
- include the symbol name.
+ * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Give an
+ error if previous object endianness doesn't match current object.
- * elflink.c (_bfd_elf_create_linker_section): Lookup symbol before
- trying to add it to the symbol table, so _GLOBAL_OFFSET_TABLE_
- doesn't get redefined messages if -shared.
+Tue Jun 2 17:50:59 1998 Nick Clifton <nickc@cygnus.com>
- * elflink.h (elf_create_pointer_linker_section) Only bump RELA
- section if the rel_section field has been set up.
+ * elf32-v850.c (v850_elf_print_private_bfd_data): Call
+ _bfd_elf_print_private)bfd_data ().
-Wed Jan 24 20:40:26 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+Tue Jun 2 15:29:35 1998 Ian Lance Taylor <ian@cygnus.com>
- * elf32-ppc.c (ppc_elf_relocate_section): Fix typo in eabi
- relocations.
+ * elflink.h (elf_merge_symbol): Don't always set type_change_ok
+ and size_change_ok.
+ (elf_link_add_object_symbols): Set type_change_ok and
+ size_change_ok before calling elf_merge_symbol.
-Wed Jan 24 10:38:34 1996 Doug Evans <dje@charmed.cygnus.com>
+ * elf32-mips.c (mips_elf_relocate_section): If we issue an
+ undefined symbol error, don't also issue an overflow error.
- * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Delete checking
- of flags, only flags used are controlled by mach number. Bump up
- output file mach number to highest of input file mach numbers.
- (elf32_sparc_object_p): Watch for EF_SPARC_SUN_US1.
- (elf32_sparc_final_write_processing): Set EF_SPARC_SUN_US1 if v8plusa.
+Tue Jun 2 13:51:00 1998 Geoff Keating <geoffk@ozemail.com.au>
- * config.bfd (sparc64-*-{sysv4*,solaris2*}): Comment out
- bfd_elf64_sparc_vec support.
+ * elf32-ppc.c (ppc_elf_relocate_section): The target of an
+ R_PPC_LOCAL24PC relocation should be local; if not, print an error
+ message instead of crashing.
-Tue Jan 23 14:33:05 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+Mon Jun 1 18:23:12 1998 Yuli Barcohen <yuli.barcohen@telrad.co.il>
- * elf32-ppc.c (ppc_elf_copy_private_bfd_data): Don't complain if
- the embedded bit is set on some objects and not on others. Just
- or it together.
- (ppc_elf_relocate_section): Implement R_PPC_EMB_{SDA21,RELSDA}
- relocations.
+ * archures.c (bfd_mach_cpu32): Define.
+ (bfd_default_scan): Add case for 68060. Fix 68332 case to use
+ bfd_mach_cpu32.
+ * cpu-m68k.c (arch_info_struct): Add m68k:cpu32.
+ * ieee.c: Include <ctype.h>.
+ (ieee_object_p): Parse out process ID string to make it more
+ likely to be acceptable for bfd_scan_arch.
+ * bfd-in2.h: Rebuild.
-Tue Jan 23 14:22:45 1996 Ian Lance Taylor <ian@cygnus.com>
+Mon Jun 1 11:12:02 1998 Nick Clifton <nickc@cygnus.com>
- * coffcode.h (coff_new_section_hook): Don't try to align the
- .stabstr section.
+ * elf32-m32r.c (m32r_elf_print_private_bfd_data): Also call
+ _bfd_elf_print_private_bfd_data() so that the program header will
+ be displayed.
- * coffcode.h (coff_set_section_contents): Fix the handling of the
- .lib section to work even if the entire section contents are
- written at once. From Gvran Uddeborg <gvran@uddeborg.pp.se> and
- Robert Lipe <robertl@arnet.com>.
+Mon Jun 1 12:14:28 1998 Ian Lance Taylor <ian@cygnus.com>
-Mon Jan 22 18:45:51 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+ * peicode.h (coff_swap_sym_in): Check for C_SECTION rather than
+ 0x68. Reindent. Add some comments.
- * elflink.h (elf_finish_pointer_linker_section): Don't allocate
- memory here for contents.
+Fri May 29 09:58:08 1998 Nick Clifton <nickc@cygnus.com>
- * elf32-ppc.c (ppc_elf_relocate_section): Bump up _SDA_BASE_ and
- _SDA2_BASE_ by 32768.
- (ppc_elf_size_dynamic_sections): #if out PLT code which we haven't
- started using. Allocate contents for .sdata and .sdata2 sections
- also.
- (ppc_elf_check_relocs): Use bfd_get_section_name in debug message,
- rather than _name.
- (ppc_elf_finish_dynamic_symbol): Remove code that attempted to
- size _SDA{,2}_BASE_.
- (ppc_elf_relocate_section): Change how sdata{,2} relocations are
- done.
+ * elf.c (copy_private_bfd_data): Adjust physical address of
+ segment in output BFD to contain LMAs of its sections.
-Mon Jan 22 08:52:04 1996 Doug Evans <dje@charmed.cygnus.com>
+Tue May 26 19:37:47 1998 Stan Cox <scox@equinox.cygnus.com>
- * elflink.h (elf_finish_pointer_linker_section): Fix typo.
+ * elf32-sparc.c (_bfd_sparc_elf_howto_table, sparc_reloc_map,
+ elf32_sparc_relocate_section): Added R_SPARC_32LE for little
+ endian data 32 bit relocations.
+ (elf32_sparc_merge_private_bfd_data): Check if linking little
+ endian objects with big endian objects.
+ (elf32_sparc_object_p): Set bfd_mach_sparc_sparclite_le.
+ (elf32_sparc_final_write_processing): Set EF_SPARC_LEDATA in e_flags.
+ * libbfd.h (bfd_reloc_code_real_names): Added BFD_RELOC_SPARC_32LE.
+ * reloc.c: Same.
+ * cpu-sparc.c (arch_info_struct): Added sparc:sparclite_le
+ * archures.c (bfd_mach_sparc_sparclite_le): New.
+ * bfd-in2.h (BFD_RELOC_SPARC_32LE, bfd_mach_sparc_sparclite_le): New.
- * archures.c (bfd_mach_sparc_v9): Renamed from bfd_mach_sparc64.
- (bfd_mach_sparc_{v8plus,v8plusa}): Define.
- (bfd_mach_sparc_v9a): Define.
- (bfd_mach_sparc_v9_p): Define.
- * bfd-in2.h: Regenerated.
- * aoutx.h (aout,machine_type): bfd_mach_sparc64 renamed to
- bfd_mach_sparc_v9.
- * elf64-sparc.c (sparc64_elf_object_p): Likewise.
- * config.bfd (sparc64-*-sysv4*,sparc64-*-solaris2*): Set targ_defvec
- to bfd_elf32_sparc_vec.
- * cpu-sparc.c (arch_info_struct): Renamed from sparc_arch_info.
- Add v8plus{,a} support.
- Add v9a support.
- (sparc_compatible): New function.
- * elf32-sparc.h: #include "elf/sparc.h".
- (elf32_sparc_merge_private_bfd_data, elf32_sparc_object_p,
- elf32_sparc_final_write_processing): New functions.
- (bfd_elf32_bfd_merge_private_bfd_data, elf_backend_object_p,
- elf_backend_final_write_processing): Define.
-
-Mon Jan 22 11:21:51 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * elf-bfd.h (struct elf_link_hash_entry): Add
- linker_section_pointer field.
- (enum elf_linker_section_enum): Enumeration for new way of
- creating linker dynamic sections and symbols.
- (elf_linker_section{,_pointers}): New structures for creating
- dynamic sections and symbols.
- (elf_obj_tdata): Add linker_section_pointers and linker_section
- fields.
- (elf_local_ptr_offsets,elf_linker_section): New accessor macros.
- (_bfd_elf_create_linker_section): New declarations.
- (_bfd_elf_find_pointer_linker_section): Ditto.
- (bfd_elf{32,64}_{create,finish}_pointer_linker_section): Ditto.
- (_bfd_elf_make_linker_section_rela): Ditto.
-
- * elf.c (_bfd_elf_link_hash_newfunc): Initialize new fields.
-
- * elf32-ppc.c (ppc_elf_create_dynamic_sections): Delete.
- (ppc_elf_create_linker_section): New function to create the
- sections .got, .sdata, and .sdata2.
- (ppc_elf_size_dynamic_sections): Zap .rela.{sdata,sdata2} if
- needed.
- (ppc_elf_check_relocs): Support more of the eabi relocations.
- (ppc_elf_relocate_section): Ditto.
- (ppc_elf_finish_dynamic_symbols): Adjust _SDA{,2}_BASE_ by 32768
- if the .sdata{,2} + .sbss{,2} section size is > 32k.
-
- * elflink.h (elf_create_pointer_linker_section): New function to
- create initialized pointers in dynamic linker sections.
- (elf_finish_pointer_linker_section): Actually intialize the
- pointers created above.
-
- * elfcode.h (bfd_elf{32,64}_create_pointer_linker_section): New
- macros to provide both 32 and 64 bit versions of
- elf_create_pointer_linker_section.
- (bfd_elf{32,64}_finish_pointer_linker_section): New macros to
- provide both 32 and 64 bit versions of
- elf_finish_pointer_linker_section.
-
- * elflink.c (_bfd_elf_create_linker_section): New function to
- create a linker section.
- (_bfd_elf_find_pointer_linker_section): Find a unique pointer to a
- given address in the linker pointer offsets created for a given
- symbol.
- (_bfd_elf_make_linker_section_rela): Make a RELA section
- corresponding to the generated linker section.
+Thu May 21 16:59:28 1998 Nick Clifton <nickc@cygnus.com>
-Sat Jan 20 08:36:10 1996 Doug Evans <dje@canuck.cygnus.com>
+ * peicode.h (add_data_entry): Fix precedence of operators in if ()
+ statement.
- * elf32-sparc.c (ELF_MACHINE_ALT1): Define.
+Tue May 19 18:41:19 1998 Ian Lance Taylor <ian@cygnus.com>
-Thu Jan 18 18:25:34 1996 Kim Knuttila <krk@cygnus.com>
+ * bfd-in.h: Move over patch to bfd-in2.h.
- * coff-ppc.c (coff_ppc_relocate_section): changed TOCDEFN relocs.
- (coff_ppc_relocate_section): Handle special values for gcc built dlls.
- (dump_toc): fix diagnosing code to identify out-of-toc-bounds entries.
- Also begin the toc at 4 as an eye catcher ('31313131' marks the first
- toc entry in an objdump) for now.
- (ppc_do_last, ppc_get_last): New function - needed to save processing
- the toc owner to the end.
- (ppc_coff_swap_sym_in_hook): Removed an incorrect hack for doing the
- toc owner last.
+ * reloc.c (bfd_check_overflow): Add casts before shifts which may
+ not fit in 32 bits.
+ (_bfd_relocate_contents): Likewise.
- * cofflink.c (_bfd_coff_final_link): Added a new hack to keep the
- toc owner from being done till last. Must define POWERPC_LE_PC
- to enable it.
+Mon May 18 14:44:15 1998 Nick Clifton <nickc@cygnus.com>
- * coffcode.h (coff_set_alignment_hook): alignment setting for .stab
+ * peicode.h (add_data_entry): If the section has no private data
+ then do not create a Data Dictionary entry for it.
- * peicode.h (coff_swap_scnhdr_out): set section flags for stab/str
- to INFO.
- (coff_swap_aouthdr_out): Removed a non-working hack for computing the
- SizeOfImage for PowerPC. Ignore the size of the .junk section.
+Mon May 18 00:09:28 1998 Richard Henderson <rth@cygnus.com>
-Thu Jan 18 17:42:12 1996 Ian Lance Taylor <ian@cygnus.com>
+ * elf64-alpha.c (elf64_alpha_relax_section): Set again on changes.
+ (elf64_alpha_can_merge_gots, elf64_alpha_merge_gots,
+ elf64_alpha_size_got_sections): Rewrite, handling multiple got
+ subsections during relaxation more correctly.
- * elfcore.h: Include <signal.h> before <sys/procfs.h>.
+Thu May 14 14:22:58 1998 Nick Clifton <nickc@cygnus.com>
-Wed Jan 17 12:40:14 1996 Ian Lance Taylor <ian@cygnus.com>
+ * bfd-in2.h: Add new prototype: bfd_coff_set_symbol_class ().
+ Add extra argument to bfd_arm_process_before_allocation ().
+ * bfd-in.h: Reflect changes made in bfd-in2.h.
+ * coffgen.c (bfd_coff_set_symbol_class): New function. Set the
+ coff class of a BFD symbol.
+ * coff-arm.c: Add support for interworking between Thumb code and
+ non-interworking aware ARM code.
- * cpu-powerpc.c (arch_info_struct): Change last entry to not point
- back to first.
- (bfd_powerpc_arch): Point at first entry in arch_info_struct.
+Sun May 10 22:33:59 1998 Jeffrey A Law (law@cygnus.com)
-Tue Jan 16 15:10:49 1996 Ian Lance Taylor <ian@cygnus.com>
+ * po/Make-in (install-info): New target.
- * elf.c (assign_file_positions_for_segments): Don't increment file
- offset for a segment which contains no loadable sections.
+Thu May 7 17:40:56 1998 Ian Lance Taylor <ian@cygnus.com>
-Mon Jan 15 17:46:27 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+ * filemode.c: Remove; not used.
- * reloc.c: Add new PowerPC relocations.
- * {bfd-in2,libbfd}.h: Regenerate.
+ If sysdep.h includes a header file, don't include it again:
+ * aix386-core.c: Don't include <stdio.h>, <stddef.h>, or
+ <errno.h>.
+ * aoutx.h: Don't include <string.h>. Use "sysdep.h" rather than
+ <sysdep.h>.
+ * archive.c: Don't include <string.h> or <errno.h>.
+ * evax-alpha.c; Don't include <stdio.h>.
+ * evax-egsd.c: Likewise.
+ * evax-etir.c: Likewise.
+ * evax-misc.c: Likewise.
+ * evax-emh.c: Likewise. Also, don't include <sys/types.h>.
+ * hppabsd-core.c: Don't include <stdio.h>, <sys/types.h>, or
+ <errno.h>.
+ * hpux-core.c: Likewise.
+ * netbsd-core.c: Likewise.
+ * som.c: Likewise.
+ * libbfd.c: Don't include <sys/types.h>.
+ * nlmcode.h: Don't include <string.h>.
+ * osf-core.c: Don't include <string.h> or <stdio.h>.
+ * ptrace-core.c: Don't include <stdio.h>, <sys/types.h>,
+ <errno.h>, or <unistd.h>.
+ * trad-core.c: Don't include <stdio.h> or <sys/types.h>.
- * elf32-ppc.c (ppc_elf_howto_raw): Add more PPC relocations.
- (ppc_elf_reloc_type_lookup): Lookup new relocations.
+Thu May 7 13:12:50 1998 Klaus Kaempf <kkaempf@progis.de>
-Mon Jan 15 14:29:44 1996 Ian Lance Taylor <ian@cygnus.com>
+ * configure.com: If the version number can not be found in
+ configure.in, set it to "unknown" rather than "2.8.1".
- * aoutx.h (howto_table_ext): Fix RELOC_BASE10 and RELOC_BASE22
- entries.
+Wed May 6 09:46:05 1998 Gavin Koch <gavin@cygnus.com>
- * sunos.c (sunos_scan_ext_relocs): Don't fail assert if
- info->shared.
+ * elf32-mips.c (elf_mips_mach): New.
+ (_bfd_mips_elf_object_p): Use elf_mips_mach.
+ (_bfd_mips_elf_final_write_processing): Use the names
+ of machines, rather than the numbers. Set both the ARCH
+ and MACH in e_flags. Handle a few more specific machines.
+ (_bfd_mips_elf_merge_private_bfd_data): Merge both
+ EF_MIPS_ARCH and EF_MIPS_MACH.
- * coffgen.c (coff_find_nearest_line): Don't try to cache
- information in sections that are not owned by a BFD. From Richard
- Henderson <richard@atheist.tamu.edu>.
+Tue May 5 21:01:53 1998 Richard Henderson <rth@cygnus.com>
- * elf32-mips.c: Numerous changes to dynamic linking code, mostly
- from Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>.
- * elflink.h (elf_link_output_extsym): Remove special check for
- _rld_new_interface.
+ * syms.c (bfd_is_local_label): Revert last change.
+ * srec.c (srec_write_symbols): Discard debugging symbols.
- * ecoffswap.h: Add prototypes for static functions.
+Tue May 5 23:36:06 1998 Ian Lance Taylor <ian@cygnus.com>
-Sun Jan 14 21:36:08 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+ * som.c: Include <ctype.h>.
+ * som.h: Don't include sysdep.h.
- * elf32-ppc.c (ppc_elf_{unsupported,std}_reloc): Remove functions.
- (ppc_elf_howto_raw): Remove ppc_elf_{unsupported,std}_reloc
- references.
- (ppc_elf_relocate_section): No longer allow .sdata/.sbss sections
- to satisfy a TOC16 relocation. Rewrite unsupported relocation
- support. Begin support for R_PPC_SDA{2,}REL.
+Tue May 5 18:29:24 1998 Tom Tromey <tromey@cygnus.com>
-Sat Jan 13 09:36:52 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+ * libbfd.h: Rebuilt.
+ * libbfd-in.h: Removed gettext includes and defines.
+ * sysdep.h: Moved gettext-related includes and defines here.
- * elf32-ppc.c (ppc_elf_create_dynamic_sections): New function to
- create the .got and .got.neg sections.
- (ppc_elf_size_dynamic_sections): Call it.
- (ppc_elf_check_relocs): Call it.
- (ppc_elf_size_dynamic_sections): Support .got.neg, just like .got.
- (ppc_elf_check_relocs): Add error messages for relocations we
- don't yet support. Do not include R_PPC_SDAREL16 like a GOT
- relocation.
+Tue May 5 16:47:54 1998 Richard Henderson <rth@cygnus.com>
-Fri Jan 12 15:27:59 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+ * srec.c (srec_write_symbols): Use bfd_is_local_label rather than
+ an ad-hoc test. Kill bogus #if 0 code.
+ * syms.c (bfd_is_local_label): Consider BSF_DEBUGGING symbols local.
- * elf32-ppc.c (ppc_elf_fake_sections): Define, and handle the new
- section flags for V.4 and eabi.
+Mon May 4 16:10:33 1998 Ian Lance Taylor <ian@cygnus.com>
-Fri Jan 12 13:59:16 1996 Ian Lance Taylor <ian@cygnus.com>
+ * sunos.c (sunos_check_dynamic_reloc): Don't use the PLT address
+ when generating a normal executable for a symbol defined in a
+ regular file. When copying a reloc into the output file, adjust
+ the addend for a PC relative reloc against a global symbol.
- * elf.c (assign_file_positions_for_segments): If a segment
- contains no sections, don't mark it as readable.
+Mon May 4 10:08:18 1998 Tom Tromey <tromey@cygnus.com>
- * elf-bfd.h (_bfd_elf_section_from_bfd_section): Declare.
- * elfcode.h (_bfd_elf_section_from_bfd_section): Don't declare.
+ * libbfd.h: Rebuilt.
+ * libbfd-in.h (_): Define as dgettext.
- * elf.c (_bfd_elf_print_private_bfd_data): Dump contents of
- dynamic section, if there is one.
- * elf-bfd.h (struct elf_size_info): Add swap_dyn_in field.
- (bfd_elf32_swap_dyn_in): Change type of second parameter to PTR.
- (bfd_elf64_swap_dyn_in): Likewise.
- * elfcode.h (elf_swap_dyn_in): Change type of second parameter to
- PTR.
- (NAME(_bfd_elf,size_info)): Initialize swap_dyn_in field.
+Mon May 4 11:02:23 1998 Ian Lance Taylor <ian@cygnus.com>
- * elf32-i386.c (elf_i386_size_dynamic_sections): Don't create a
- DT_TEXTREL entry because of .rel.plt. From Martin Pirker
- <pirker@eiunix.tuwien.ac.at>.
+ * coff-arm.c (coff_arm_relocate_section): Cast to bfd_signed_vma,
+ not signed.
+ * peicode.h (pe_saved_coff_bfd_print_private_bfd_data): Use PARAMS
+ when declaring parameter types.
+ (pe_saved_coff_bfd_copy_private_bfd_data): Likewise.
-Thu Jan 11 17:06:14 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+Wed Apr 29 15:35:03 1998 Ian Lance Taylor <ian@cygnus.com>
- * section.c (SEC_{EXCLUDE,SORT_ENTRIES}): New section flags for
- PowerPC V.4 and eabi.
- * bfd-in2.h: Regenerate.
- * libfd.h: Regenerate.
+ * config.bfd: If we include any ELF targets in targ_defvec and/or
+ targ_selvecs, then add the generic ELF targets to targ_selvecs.
+ * elf32-gen.c (dummy): New static const variable.
+ (elf_generic_info_to_howto): New static function.
+ (elf_generic_info_to_howto_rel): New static function.
+ (elf_info_to_howto): Define as elf_generic_info_to_howto.
+ (elf_info_to_howto_rel): Define as elf_generic_info_to_howto_rel.
+ * elf64-gen.c: Same changes as elf32-gen.c.
+ * elfcode.h (elf_object_p): For the generic target, ignore a
+ failure of bfd_default_set_arch_mach. Fix indentation a bit.
- * elfxx-target.h (TARGET_{BIG,LITTLE}_SYM): Add new flags.
+Tue Apr 28 20:05:52 1998 Ian Lance Taylor <ian@cygnus.com>
- * elf32-ppc.c (ppc_elf_section_from_shdr): Support SHT_ORDERED
- section type and SHF_EXCLUDE section flag, turning them into the
- appropriate bfd section flag.
+ * configure.in (WIN32LIBADD): Add -lintl on cygwin32.
+ * configure: Rebuild.
-Thu Jan 11 11:23:30 1996 Ian Lance Taylor <ian@cygnus.com>
+Tue Apr 28 12:16:57 1998 Jason Molenda (crash@bugshack.cygnus.com)
- * xcofflink.c (xcoff_link_add_symbols): Create the special
- sections if we see a DYNAMIC object, in case that is the only
- XCOFF input object we see.
+ * config.bfd: Update OSR5/Unixware patterns.
- * elf32-mips.c: Extensive changes for a start at dynamic linking
- support, from Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>.
+Mon Apr 27 18:02:24 1998 Richard Henderson <rth@cygnus.com>
- * elf-bfd.h (struct elf_backend_data): Add type_change_ok field.
- (struct elf_backend_data): Remove
- elf_backend_create_program_headers field. Add
- elf_backend_additional_program_headers and
- elf_backend_modify_segment_map fields.
- * elfxx-target.h (elf_backend_type_change_ok): Define if not
- defined.
- (elf_backend_additional_program_headers): Likewise.
- (elf_backend_modify_segment_map): Likewise.
- (elf_backend_create_program_headers): Don't define.
- (elfNN_bed): Change to account for field changes.
- * elf.c (assign_file_positions_for_segments): Call new
- modify_segment_map backend function. Don't call old
- create_program_headers backend function.
- (get_program_header_size): Call additional_program_headers rather
- than create_program_headers.
- * elflink.h (elf_link_add_object_symbols): Initialize
- type_change_ok from new backend field.
- (elf_link_output_extsym): Don't warn if _rld_new_interface is
- defined.
- (elf_reloc_link_order): Treat a reloc against a defined symbol as
- a reloc against the appropriate section.
-
- * elf-bfd.h (struct bfd_elf_section_data): Add tdata field.
- (struct elf_obj_tdata): Rename ppc_flags_init field to flags_init.
- (elf_flags_init): Rename from elf_ppc_flags_init.
- * elf32-ppc.c (ppc_elf_set_private_flags): Use elf_flags_init, not
- elf_ppc_flags_init.
- (ppc_elf_copy_private_bfd_data): Likewise.
- (ppc_elf_merge_private_bfd_data): Likewise.
-
- * elf32-m68k.c (howto_table): Change src_mask to 0 for all
- relocation entries.
-
-Tue Jan 9 15:22:53 1996 David Mosberger-Tang <davidm@azstarnet.com>
-
- * coff-alpha.c (alpha_relocate_section): During final link, allow
- output .lita section to be bigger than 64k by adjusting gp value
- on a per-input section basis.
- * libecoff.h (struct ecoff_tdata): Add issued_multiple_gp_warning
- field.
- (struct ecoff_section_tdata): Add gp field.
+ * elf.c (assign_file_positions_for_segments): Allow for holes
+ between sections added by a link script.
-Tue Jan 9 12:00:36 1996 Ian Lance Taylor <ian@cygnus.com>
+Mon Apr 27 11:49:55 1998 Ian Lance Taylor <ian@cygnus.com>
- Handle Alpha ECOFF changes in OSF/1 3.2.
- * libecoff.h (struct ecoff_backend_data): Add get_elt_at_filepos
- field.
- * coff-alpha.c: Include "aout/ar.h".
- (alpha_ecoff_get_relocated_section_contents): Don't require an
- ALPHA_R_IGNORE reloc after an ALPHA_R_GPDISP reloc, since OSF/1
- 3.2 doesn't generate one.
- (alpha_relocate_section): Likewise.
- (alpha_ecoff_slurp_armap): Define.
- (alpha_ecoff_slurp_extended_name_table): Define.
- (alpha_ecoff_construct_extended_name_table): Define.
- (alpha_ecoff_truncate_arname): Define.
- (alpha_ecoff_write_armap): Define.
- (alpha_ecoff_generic_stat_arch_elt): Define.
- (alpha_ecoff_update_armap_timestamp): Define.
- (ARFZMAG): Define.
- (alpha_ecoff_read_ar_hdr): New static function.
- (alpha_ecoff_get_elt_at_filepos): New static function.
- (alpha_ecoff_openr_next_archived_file): New static function.
- (alpha_ecoff_get_elt_at_index): New static function.
- (alpha_ecoff_backend_data): Initialize get_elt_at_filepos field.
- (ecoffalpha_little_vec): Change BFD_JUMP_TABLE_ARCHIVE from
- _bfd_ecoff to alpha_ecoff.
- * ecoff.c (ecoff_link_add_archive_symbols): Use get_elt_at_filepos
- field from backend structure, rather than always calling
- _bfd_get_elt_at_filepos.
- * coff-mips.c (mips_ecoff_backend_data): Initialize
- get_elt_at_filepos field.
- * archive.c (_bfd_generic_read_ar_hdr_mag): New function, copied
- from _bfd_generic_read_ar_hdr with minor changes.
- (_bfd_generic_read_ar_hdr): Use _bfd_generic_read_ar_hdr_mag.
- * libbfd-in.h (_bfd_generic_read_ar_hdr_mag): Declare.
- * libbfd.h: Rebuild.
+ * configure.in: Change version number to 2.9.4
+ * configure: Rebuild.
- * bfd-in.h (BFD_IN_MEMORY): Define.
- * libbfd-in.h (struct bfd_in_memory): Define.
- * libbfd.c (bfd_read): Handle BFD_IN_MEMORY flag.
- (bfd_get_file_window): Don't try to map a BFD_IN_MEMORY file.
- (bfd_write, bfd_stat): Abort if BFD_IN_MEMORY is set.
- (bfd_tell, bfd_flush, bfd_seek): Handle BFD_IN_MEMORY flag.
- * bfd.c (struct _bfd): Change iostream field from char * to PTR.
- (bfd_get_size): Handle BFD_IN_MEMORY flag.
- * cache.c (bfd_cache_close): Ignore BFD_IN_MEMORY files.
- (bfd_open_file): Cast to PTR, not char *, when setting iostream.
- (bfd_cache_lookup_worker): Abort if BFD_IN_MEMORY is set.
- * opncls.c (bfd_fdopenr): Cast to PTR, not char *, when setting
- iostream.
- (bfd_openstreamr): Likewise.
- * aoutx.h (NAME(aout,some_aout_object_p)): Only fstat iostream if
- BFD_IN_MEMORY is not set.
- * riscix.c (riscix_some_aout_object_p): Likewise.
- * bfd-in2.h, libbfd.h: Rebuild.
-
- * targets.c (bfd_target): Add _bfd_get_elt_at_index field.
- (BFD_JUMP_TABLE_ARCHIVE): Add _get_elt_at_index.
- (bfd_get_elt_at_index): Define.
- * archive.c (_bfd_generic_get_elt_at_index): Rename from
- bfd_get_elt_at_index. Change index parameter from int to
- symindex.
- * libbfd-in.h (_bfd_generic_get_elt_at_index): Declare.
- (_bfd_noarchive_get_elt_at_index): Define.
- (_bfd_archive_bsd_get_elt_at_index): Define.
- (_bfd_archive_coff_get_elt_at_index): Define.
- * bfd-in2.h, libbfd.h: Rebuild.
- * aout-target.h (MY_get_elt_at_index): Define if not defined.
- * coff-rs6000.c (xcoff_get_elt_at_index): Define.
- * ieee.c (ieee_get_elt_at_index): Define.
- * libecoff.h (_bfd_ecoff_get_elt_at_index): Define.
- * oasys.c (oasys_get_elt_at_index): Define.
- * som.c (som_get_elt_at_index): Define.
-
- * ecoff.c (_bfd_ecoff_find_nearest_line): Don't restrict line
- numbers to the .text section.
-
-Mon Jan 8 17:00:57 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * ieee.c (ieee_write_debug_part): Change return type to boolean.
- If there is a SEC_DEBUGGING section, get the contents of the debug
- information part from it.
- (ieee_set_section_contents): Store the contents of a SEC_DEBUGGING
- section in memory.
- (ieee_write_object_contents): Check ieee_write_debug_part return.
-
-Thu Jan 4 17:12:37 1996 Fred Fish <fnf@cygnus.com>
-
- * config.bfd (i[345]86-*-freebsd*): Add target.
- * configure.in (i386freebsd_vec): Add vec.
- * configure: Regenerate.
- * Makefile.in (BFD32_BACKENDS): Add i386freebsd.o.
- (BFD32_BACKENDS_CFILES): Add i386freebsd.c.
- Rebuild dependencies..
- * freebsd.h: New file.
- * i386freebsd.c: New file.
- * targets.c (i386freebsd_vec): Declare.
- (bfd_target_vector): Add i386freebsd_vec.
- * i386linux.c (SEGMENT_SIZE): Define as TARGET_PAGE_SIZE
- * i386netbsd.c (SEGMENT_SIZE): Define as TARGET_PAGE_SIZE
-
-Thu Jan 4 16:27:46 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * ieee.c (ieee_slurp_debug): New static function.
- (ieee_object_p): Call it.
- (ieee_slurp_section_data): Skip debugging sections.
- (ieee_get_reloc_upper_bound): Likewise.
- (ieee_get_section_contents): Likewise.
- (ieee_canonicalize_reloc): Likewise.
- (ieee_write_section_part): Likewise.
- (ieee_write_debug_part): Likewise.
- (ieee_write_data_part): Likewise.
- (init_for_output): Likewise.
-
-Wed Jan 3 19:42:47 1996 Michael Meissner <meissner@wogglebug.tiac.net>
-
- * elf32-ppc.c (ppc_elf_relocate_section): Make @GOT relocations
- work.
- (ppc_elf_howto_raw): Just use bfd_elf_generic_reloc for all howto
- relocs, since ppc_elf_relocate_section handles the linker case.
- (ppc_elf_{addr16_ha,got16,toc16,brtaken}_reloc): Delete, no longer
- used.
- (ppc_elf_{addr16_ha,got16,toc16,brtaken}_inner): Merge these into
- ppc_elf_relocate_section since that is now the only caller.
- (ppc_elf_relocate_section): Ditto.
-
-Wed Jan 3 15:11:30 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * coffcode.h (coff_write_object_contents): If we don't know the
- section of the entry point for an XCOFF executable, always set the
- entry address to -1.
-
-Tue Jan 2 14:17:15 1996 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * elf.c (bfd_section_from_shdr): Add support for note sections.
-
-Tue Jan 2 13:10:25 1996 Ian Lance Taylor <ian@cygnus.com>
-
- * bfd-in.h (struct _symbol_info): Add stab_type field.
+ Based on patch from H.J. Lu <hjl@gnu.org>:
+ * elf.c (bfd_elf_get_bfd_needed_list): New function.
+ * bfd-in.h (bfd_elf_get_bfd_needed_list): Declare.
* bfd-in2.h: Rebuild.
- * aoutx.h (NAME(aout,get_symbol_info)): Set stab_type.
-
- * elf32-ppc.c: Remove trailing newline from calls to
- _bfd_error_handler.
- (ppc_elf_merge_private_bfd_data): Only warn about endianness
- difference if target endianness is known.
-
-Thu Dec 21 12:43:49 1995 Michael Meissner <meissner@tiktok.cygnus.com>
- * elf32-ppc.c (ppc_elf_howto_raw): Add a phony reloc to handle the
- old style TOC16 references without using R_PPC_GOT.
- (ppc_reloc_type): Ditto.
- (ppc_elf_reloc_type_lookup): Add support for TOC16.
- (ppc_elf_toc16_inner): Renamed from ppc_elf_got16_inner.
- (ppc_elf_toc16_reloc): Renamed from ppc_elf_toc16_reloc.
- (ppc_elf_got16_{inner,reloc}): Stubs for real GOT support.
- (ppc_elf_check_relocs): New function for GOT/PLT support that is
- work in progress.
- (ppc_elf_adjust_dynamic_symbol): Ditto.
- (ppc_elf_adjust_dynindx): Ditto.
- (ppc_elf_size_dynamic_sections): Ditto.
- (ppc_elf_finish_dynamic_symbol): Ditto.
- (ppc_elf_finish_dynamic_sections): Ditto.
- (ELF_DYNAMIC_INTERPRETER): Define.
+Sat Apr 25 20:07:53 1998 Richard Henderson <rth@cygnus.com>
-Wed Dec 20 19:14:18 1995 Ken Raeburn <raeburn@cygnus.com>
+ * elf64-alpha.c (struct alpha_relax_info): Replace elfsym with other.
+ Change all users.
- * elf.c (copy_private_bfd_data): When attaching sections to
- segments ignore sections that won't be allocated. Patch from
- Andreas Schwab.
+Sat Apr 25 18:29:07 1998 Richard Henderson <rth@cygnus.com>
-Tue Dec 19 20:01:43 1995 Ken Raeburn <raeburn@cygnus.com>
+ * elf64-alpha.c (struct alpha_relax_info): Add tsec & elfsym members.
+ (elf64_alpha_relax_section): Fill them in.
+ (elf64_alpha_relax_opt_call): Implement more than a stub.
+ (elf64_alpha_add_symbol_hook): Don't set SEC_LOAD or default
+ alignment on .scommon.
+ (elf64_alpha_merge_gots): Merge use counts as well.
- * config.bfd: Match on m68k-cbm-* only if OS doesn't match
- anything else.
+Sat Apr 25 14:07:29 1998 Richard Henderson <rth@cygnus.com>
-Tue Dec 19 16:38:59 1995 Ian Lance Taylor <ian@cygnus.com>
+ * elf64-alpha.c (elf64_alpha_relax_section): Use the proper section
+ for calculating a local symbol's address.
+ (elf64_alpha_calc_got_offsets): Skip entries with 0 use count.
+ Set the .got's cooked size as well as the raw size.
- * coff-i960.c (CALC_ADDEND): Define.
- (coff_i960_relocate_section): Add the input section VMA to the
- addend for PC relative relocs.
+Fri Apr 24 09:16:00 1998 Nick Clifton <nickc@cygnus.com>
-Sun Dec 17 20:11:55 1995 Kim Knuttila <krk@cygnus.com>
+ * elf32-v850.c (v850_elf_print_private_bfd_data): Add
+ internationalisation of printed information.
- * peicode.h (pe_print_pdata): Must test the entire entry for zero
- to correctly terminate.
+ * coff-arm.c (coff_arm_print_private_bfd_data): Add
+ internationalisation of printed information.
-Fri Dec 15 12:05:57 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * targets.c (enum bfd_endian): Define.
- (bfd_target): Rename byteorder_big_p to byteorder, and change it
- from boolean to enum bfd_endian. Change header_byteorder_big_p
- correspondingly.
- * bfd-in.h (bfd_big_endian, bfd_little_endian): New macros.
- (bfd_header_big_endian, bfd_header_little_endian): New macros.
- * bfd-in2.h: Rebuild.
- * All targets: Change initialization of byteorder and
- header_byteorder to use enum bfd_endian values rather than
- booleans.
- * All files: Change all references to byteorder_big_p and
- header_byteorder_big_p to use new bfd_*_endian macros.
-
- * coffgen.c (make_a_section_from_file): Set lma to s_paddr, not
- s_vaddr.
- * coffcode.h (coff_write_object_contents): Set s_paddr to lma, not
- vma.
- * ecoff.c (_bfd_ecoff_write_object_contents): Likewise.
-
-Fri Dec 15 07:32:09 1995 steve chamberlain <sac@slash.cygnus.com>
-
- * pe[i]-i386.c (TARGET_UNDERSCORE): Define to '_'.
-
-Thu Dec 14 13:45:37 1995 Ian Lance Taylor <ian@cygnus.com>
+Fri Apr 24 12:09:18 1998 Ian Lance Taylor <ian@cygnus.com>
- * ieee.c: Lots of minor cleanups. Make many functions return
- errors rather than calling abort. Also:
- (ieee_write_twobyte): Remove; change callers to call existing
- ieee_write_2bytes function.
- (ieee_write_expression): Don't output the section twice when
- outputting a local symbol. Don't emit an extraneous zero if there
- is only one term.
- (ieee_slurp_sections): Set the lma as well as the vma.
- (ieee_archive_p): Use bfd_alloc_grow rather than an obstack.
+ * syms.c (struct indexentry): Change directory_name, file_name,
+ and function_name fields to char *.
+ (struct stab_find_info): Change cached_file_name field to char *.
- * ihex.c (ihex_set_arch_mach): Don't accept any architecture, just
- a recognized one or bfd_arch_unknown.
- (ihex_get_symtab_upper_bound): Define as bfd_0l, to permit objcopy
- to succeed.
- (ihex_get_symtab): Likewise.
+Thu Apr 23 08:13:04 1998 Nick Clifton <nickc@cygnus.com>
-Wed Dec 13 15:44:06 1995 Ian Lance Taylor <ian@cygnus.com>
+ * peicode.h (dir_names): Add missing N_() macros to dir_names array.
- * aoutx.h: Include <ctype.h>.
- (struct aout_link_includes_table): Define.
- (struct aout_link_includes_totals): Define.
- (struct aout_link_includes_entry): Define.
- (aout_link_includes_lookup): Define macro.
- (struct aout_final_link_info): Add includes field.
- (aout_link_includes_newfunc): New static function.
- (NAME(aout,final_link)): Initialize includes hash table.
- (aout_link_write_symbols): Eliminate duplicate N_BINCL entries.
+Wed Apr 22 13:06:15 1998 Tom Tromey <tromey@cygnus.com>
-Wed Dec 13 10:52:14 1995 Stan Shebs <shebs@andros.cygnus.com>
+ * po/Make-in (MKINSTALLDIRS): Don't look in $(top_srcdir).
- * mpw-config.in: Match on mips-*-* instead of mips-idt-ecoff.
+Wed Apr 22 17:48:48 1998 Ian Lance Taylor <ian@cygnus.com>
-Wed Dec 13 11:07:45 1995 Kim Knuttila <krk@cygnus.com>
+ * Makefile.am (install-data-local): Make $(includedir).
+ * Makefile.in: Rebuild.
- * coff-ppc.c (coff_ppc_relocate_section): removed debugging code.
+Wed Apr 22 13:06:15 1998 Tom Tromey <tromey@cygnus.com>
-Tue Dec 12 17:42:06 1995 Kim Knuttila <krk@cygnus.com>
+ * libbfd-in.h: Use `gettext' and not `dgettext' for now.
- * peicode.h (pe_print_reloc): New function to dump the .reloc section.
- (pe_print_private_bfd_data): call pe_print_reloc.
- * coffcode.h (coff_set_alignment_hook): .reloc section alignment.
- * coff-ppc.c (in_reloc_p): Added missing non-eligible relocs. Spiffed
- up some debugging as well.
+Wed Apr 22 12:53:40 1998 Ian Lance Taylor <ian@cygnus.com>
-Tue Dec 12 11:34:23 1995 Ian Lance Taylor <ian@cygnus.com>
+ * Makefile.am (INCLUDES): Add -I$(srcdir)/../intl -I../intl.
+ * Makefile.in: Rebuild.
- * config.bfd: Handle sparc-*-elf*. From Ronald F. Guilmette
- <rfg@monkeys.com>.
+ * bfd-in2.h: Rebuild for Nick's changes.
-Fri Dec 8 17:47:07 1995 Ian Lance Taylor <ian@cygnus.com>
+Tue Apr 21 23:11:51 1998 Richard Henderson <rth@cygnus.com>
- * elflink.h (elf_link_add_object_symbols): Set section_count to 0
- when setting sections to NULL.
+ * archive.c (_bfd_generic_read_ar_hdr_mag): Fix lossage in last
+ change wrt length == max_namelen.
-Wed Dec 6 17:05:37 1995 Ian Lance Taylor <ian@cygnus.com>
+Tue Apr 21 21:19:36 1998 Tom Tromey <tromey@scribbles.cygnus.com>
- * xcofflink.c (struct xcoff_loader_info): Add export_defineds
- field.
- (bfd_xcoff_size_dynamic_sections): Add export_defineds parameter.
- (xcoff_build_ldsyms): If export_defineds is set, set XCOFF_EXPORT
- for all symbols.
- * bfd-in.h (bfd_xcoff_size_dynamic_sections): Update declaration.
- * bfd-in2.h: Rebuild.
+ * Many files: Added gettext invocations around user-visible
+ strings.
+ * libbfd-in.h: Added gettext includes and defines.
+ * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_STPCPY,
+ HAVE_LC_MESSAGES): Define.
+ * configure.in: Call CY_GNU_GETTEXT. Create po/Makefile.in and
+ po/Makefile.
+ * Makefile.am (SUBDIRS): Added po.
+ (POTFILES): New macro.
+ (po/POTFILES.in): New target.
+ (SOURCE_HFILES): New macro.
+ (HFILES): Use it.
+ * po/Make-in, po/POTFILES.in, po/bfd.pot: New files.
-Mon Dec 4 16:40:47 1995 Kim Knuttila <krk@cygnus.com>
+Tue Apr 21 13:38:18 1998 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
- * coffcode.h (coff_set_alignment_hook): Removed some debugging printf's
+ * elfcore.h (bfd_prstatus): Copy core_prstatus from the first
+ NT_PRSTATUS note section encountered, it contains the status of
+ the currently executing thread when the core file was written.
-Mon Dec 4 11:25:39 1995 Ian Lance Taylor <ian@cygnus.com>
+Tue Apr 21 10:00:12 1998 Nick Clifton <nickc@cygnus.com>
- * ihex.c (ihex_scan): Handle record types 4 and 5.
- (ihex_object_p): Permit types 4 and 5.
- (ihex_set_section_contents): Remove check for out of range
- addresses.
- (ihex_write_object_contents): Generate types 4 and 5.
+ * libcoff.h: Add extra parameter to
+ bfd_coff_link_output_has_begun overrideable function.
+ * cofflink.c: Pass extra parameter to
+ bfd_coff_link_output_has_begun function.
+ * bfd-in.h: Add prototypes for exported ARM interworking
+ functions.
+ * peicode.h: ARM specific code reorganised to conform to BFD
+ coding conventions.
+ * coffcode.h: ARM specific code reorganised to conform to BFD
+ coding conventions.
+ * coff-arm.c: Code reorganised to conform to the BFD coding
+ conventions. Global variables have been moved into an ARM
+ specific hash table structure and a new function:
+ bfd_arm_get_bfd_for_interworking() has been created which is
+ called from the linker scripts.
- * elflink.h (elf_link_output_extsym): Just ignore warning and
- indirect references to symbols which don't really exist.
+Tue Apr 21 00:11:51 1998 Richard Henderson <rth@cygnus.com>
-Sun Dec 3 19:00:27 1995 Kim Knuttila <krk@cygnus.com>
+ * archive.c (_bfd_generic_read_ar_hdr_mag): Simplify end-of-name test.
- * peicode.h (pe_print_idata): Minor format fixes
- (pe_print_edata): New function. Under private printing, this formats
- the edata section of a PE file.
- (pe_print_private_bfd_data): Added call to pe_print_edata.
+ * elf64-alpha.c (elf64_alpha_find_reloc_at_ofs): Renamed from
+ elf64_alpha_relax_find_reloc_ofs. Changed all callers.
+ (elf64_alpha_add_symbol_hook): Put small commons in .scommon not .sbss.
+ (elf64_alpha_size_got_sections): Don't merge .got sections twice.
-Sun Dec 3 16:46:54 1995 Richard Earnshaw (rearnsha@armltd.co.uk)
+Sat Apr 18 01:21:04 1998 Stan Cox <scox@cygnus.com>
- * aout-arm.c (MY_swap_std_reloc_out): Use KEEPIT to get the symbol
- index, don't call stoi.
+ * config.bfd: Added sparc86x support.
-Fri Dec 1 14:46:51 1995 Ian Lance Taylor <ian@cygnus.com>
+Fri Apr 17 22:29:04 1998 Ian Lance Taylor <ian@cygnus.com>
- * srec.c (srec_scan): Set lma as well as vma.
+ * elf32-mips.c (mips_elf_relocate_section): Do not complain about
+ an out of range pc-relative jump/call to an undefined weak symbol.
- * ihex.c: New file; support for Intel Hex format.
- * targets.c (enum bfd_flavour): Add bfd_target_ihex_flavour.
- (ihex_vec): Declare.
- (bfd_target_vector): Always include ihex_vec.
- * bfd.c (struct _bfd): Add ihex_data field to tdata union.
- * Makefile.in: Rebuild dependencies.
- (BFD_LIBS): Add ihex.o
- (BFD_LIBS_CFILES): Add ihex.c.
- * bfd-in2.h: Rebuild.
+Thu Apr 16 13:49:00 1998 Richard Henderson <rth@cygnus.com>
- * elf.c (assign_file_positions_for_segments): Sort the sections in
- each segment.
- (get_program_header_size): Return the right size if segment_map is
- not NULL.
- (copy_private_bfd_data): Don't bother to sort the sections.
+ * elf64-alpha.c (elf64_alpha_do_reloc_gpdisp): Do all gpdisp
+ comparisons signed.
- * bfd.c (bfd_record_phdr): New function.
- * bfd-in.h (bfd_record_phdr): Declare.
- * bfd_in2.h: Rebuild.
+Thu Apr 16 11:43:33 1998 Ian Lance Taylor <ian@cygnus.com>
- * elf32-sparc.c (elf32_sparc_relocate_section): Remove bogus
- BFD_ASSERT.
+ * archive.c (bfd_generic_archive_p): If a slurp subroutine returns
+ an error other than bfd_error_system_call, set the error to
+ bfd_error_wrong_format.
- * libbfd.c (bfd_malloc, bfd_realloc): New functions.
- (bfd_zmalloc): Return PTR, not char *. Take size_t, not
- bfd_size_type.
- * libbfd-in.h (bfd_malloc, bfd_realloc): Declare.
- (bfd_zmalloc): Change declaration.
- * libbfd.h: Rebuild.
- * Many files: Use bfd_malloc and bfd_realloc rather than malloc
- and realloc. Don't set bfd_error_no_memory if they fail.
-
-Thu Nov 30 19:32:26 1995 Kim Knuttila <krk@cygnus.com>
-
- * coff-ppc.c: Added macros to tidy up toc cell treatment. Numerous
- uses as well. Added a new howto to deal with TOCREL16 relocs that
- are TOCDEFN as well.
- (coff_ppc_relocate_section): Expanded treatment of ADDR32NB relocs
- to handle RVA relocs from dlltool.
- (ppc_coff_rtype2howto): TOCDEFN reloc addition.
- (coff_ppc_rtype_to_howto): TOCDEFN reloc addition.
- (ppc_coff_reloc_type_lookup): TOCDEFN reloc addition.
-
- * coffcode.h (coff_set_alignment_hook): check idata$X sections
- to get the right section alignment.
-
-Thu Nov 30 16:48:18 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * elf.c (_bfd_elf_make_section_from_shdr): Don't set lma based on
- p_paddr if p_paddr is zero.
- (make_mapping): Set includes_filehdr and includes_phdrs for first
- PT_LOAD segment.
- (map_sections_to_segments): Set includes_phdrs for PT_PHDR
- segment.
- (assign_file_positions_for_segments): Handle includes_filehdr and
- includes_phdrs. Remove special handling of PT_PHDR and first
- PT_LOAD segments.
- (copy_private_bfd_data): Set includes_filehdr and includes_phdr
- when appropriate. Remove special handling of PT_PHDR segment.
- Use a more complex condition for when a section is included in a
- segment to handle Solaris linker oddities.
-
-Thu Nov 30 11:17:33 1995 Manfred Hollstein KS/EF4A 60/1F/110 #40283 <manfred@lts.sel.alcatel.de>
-
- * coff-m88k.c (howto_table): Reformatted for easier reading;
- special_function now points to new function m88k_special_reloc.
- (howto_hvrt16): Function previously used for handling HVRT16 relocs
- removed.
- (rtype2howto): Do not add reloc's r_offset to the addend, this will
- be done correctly by m88k_special_reloc.
- (reloc_processing): New function to be used by RELOC_PROCESSING.
- (RELOC_PROCESSING): Define to call reloc_processing.
-
-Wed Nov 29 12:42:36 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * peicode.h (pe_print_idata): Call malloc rather than xmalloc.
- (pe_print_pdata): Likewise.
-
- * opncls.c (bfd_alloc_by_size_t): Set bfd_error_no_memory if
- obstack_alloc fails.
- (bfd_alloc_finish): Set bfd_error_no_memory if obstack_finish
- fails.
- * libbfd.c (bfd_zmalloc): Set bfd_error_no_memory if malloc fails.
- * Many files: don't set bfd_error_no_memory if one of the above
- routines fails.
-
- * elf.c (assign_file_positions_for_segments): Don't adjust p_paddr
- if p_paddr_valid is set.
- (copy_private_bfd_data): New static function.
- (_bfd_elf_copy_private_section_data): Call copy_private_bfd_data.
-
- * elf.c (assign_file_positions_for_segments): Fix case where extra
- program headers were allocated.
-
- * elf.c (_bfd_elf_print_private_bfd_data): New function.
- * elf-bfd.h (_bfd_elf_print_private_bfd_data): Declare.
- * elfxx-target.h (bfd_elfNN_bfd_print_private_bfd_data): Define to
- _bfd_elf_print_private_bfd_data.
-
- * coff-alpha.c (alpha_ecoff_swap_reloc_in): Don't abort if
- r_symndx is RELOC_SECTION_NONE for an ALPHA_R_IGNORE reloc.
- Change a RELOC_SECTION_LITA symndx to RELOC_SECTION_ABS.
- (alpha_ecoff_swap_reloc_out): Change RELOC_SECTION_ABS to
- RELOC_SECTION_LITA for ALPHA_R_IGNORE.
- (alpha_adjust_reloc_out): For ALPHA_R_IGNORE, don't change
- RELOC_SECTION_ABS to RELOC_SECTION_NONE.
-
-Tue Nov 28 16:59:50 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * elf-bfd.h (struct elf_obj_tdata): Add segment_map field.
- * elf.c (make_mapping): New static function.
- (map_sections_to_segments): New static function.
- (elf_sort_sections): New static function.
- (assign_file_positions_for_segments): New static function.
- (map_program_segments): Remove.
- (get_program_header_size): Remove sorted_hdrs, count, and
- maxpagesize parameters. Simplify.
- (assign_file_positions_except_relocs): When generating an
- executable, use assign_file_positions_for_segments.
- (elf_sort_hdrs): Remove.
- (_bfd_elf_sizeof_headers): Remove eliminated parameters from call
- to get_program_header_size.
-
-Mon Nov 27 12:27:46 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * hp300hpux.c (MY(callback)): Set lma as well as vma.
-
- * configure, config.in: Regenerate with autoconf 2.7.
-
- * elf32-i386.c (elf_backend_plt_readonly): Set correctly, to 1.
- * elf32-sparc.c (elf_backend_plt_readonly): Set correctly, to 0.
-
-Wed Nov 22 12:02:09 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * ecoff.c (_bfd_ecoff_new_section_hook): Handle .rconst section.
- (ecoff_sec_to_styp_flags): Likewise.
- (_bfd_ecoff_styp_to_sec_flags): Handle STYP_RCONST.
- (ecoff_set_symbol_info): Handle scRConst.
- (ecoff_slurp_reloc_table): Handle RELOC_SECTION_RCONST.
- (ecoff_compute_section_file_positions): Handle .rconst section.
- (_bfd_ecoff_write_object_contents): Likewise.
- (ecoff_link_check_archive_element): Handle scRConst.
- (ecoff_link_add_externals): Likewise.
- (ecoff_link_write_external): Handle .rconst section.
- (ecoff_reloc_link_order): Likewise.
- * ecofflink.c (bfd_ecoff_debug_accumulate): Handle scRConst.
- * coff-alpha.c (alpha_convert_external_reloc): Handle .rconst
- section.
- (alpha_relocate_section): Handle RELOC_SECTION_RCONST.
+ * targets.c (bfd_target_vector) [SELECT_VECS not defined]: Add
+ bfd_elf32_powerpcle_vec.
- * sunos.c (sunos_scan_dynamic_symbol): Only set written if the
- DEF_DYNAMIC flag is set.
+ * elf.c (copy_private_bfd_data): If all the p_paddr fields in the
+ program segments are zero, don't set p_paddr_valid.
-Tue Nov 21 13:25:29 1995 Ken Raeburn <raeburn@cygnus.com>
+Wed Apr 15 22:15:16 1998 Richard Henderson <rth@cygnus.com>
+
+ * elf64-alpha.c: Initial implementation of relaxation --
+ (struct alpha_elf_link_hash_entry): Add use_count member.
+ (elf64_alpha_check_relocs): Initialize and increment it.
+ (elf64_alpha_can_merge_gots): Check it when considering merging.
+ (elf64_alpha_merge_gots): Drop entries with zero use.
+ (elf64_alpha_calc_got_offsets_for_symbol): Likewise.
+ (elf64_alpha_always_size_sections): Split out got sizing ...
+ (elf64_alpha_size_got_sections): ... here. New function.
+ (elf64_alpha_relax_find_reloc_ofs): New function.
+ (elf64_alpha_relax_with_lituse): Likewise.
+ (elf64_alpha_relax_without_lituse): Likewise.
+ (elf64_alpha_relax_opt_call): Likewise.
+ (elf64_alpha_relax_section): Likewise.
+ (elf64_alpha_add_symbol_hook): Likewise.
+ (elf64_alpha_howto_table): Implement GPRELHIGH/LOW & IMMED_GP_16.
+ (elf64_alpha_relocate_section): Likewise.
+ (bfd_elf64_bfd_relax_section): Define.
+ (elf_backend_add_symbol_hook): Likewise.
+
+Wed Apr 15 16:08:46 1998 Richard Henderson <rth@cygnus.com>
+
+ * elf.c (prep_headers): Use new EM_SPARCV9 symbol.
+ * elf64-sparc.c (ELF_MACHINE_CODE): Likewise.
+ (ELF_MACHINE_ALT1): New. Set to EM_OLD_SPARC64.
+
+Wed Apr 15 11:34:33 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Add -lkernel32 to WIN32LIBADD on cygwin32.
+ * configure: Rebuild.
- * host-aout.c: If TRAD_HEADER is defined, include it.
+Mon Apr 13 16:46:27 1998 Ian Lance Taylor <ian@cygnus.com>
-Tue Nov 21 13:03:57 1995 Ian Lance Taylor <ian@cygnus.com>
+ * Makefile.am (libbfd_la_LIBADD): Add @WIN32LIBADD@.
+ (libbfd_la_LDFLAGS): Add @WIN32LDFLAGS@.
+ * configure.in: Define and substitute WIN32LDFLAGS and
+ WIN32LIBADD.
+ * aclocal.m4: Rebuild with new libtool.
+ * configure, Makefile.in: Rebuild.
- * aclocal.m4 (AC_PROG_CC): Remove local definition.
- (BFD_BINARY_FOPEN): Require AC_CANONICAL_SYSTEM.
- (BFD_NEED_DECLARATION): New function.
- * configure.in: Use BFD_NEED_DECLARATION.
- * acconfig.h: Put NEED_DECLARATION_* in @TOP@ section.
- * configure, config.in: Rebuild with autoconf 2.6.
+Fri Apr 10 13:44:27 1998 Ian Lance Taylor <ian@cygnus.com>
- * xcofflink.c (bfd_xcoff_size_dynamic_sections): Clear
- special_sections before returning when called with a non XCOFF
- BFD.
+ * coffcode.h (coff_write_object_contents): Move a PE COMDAT symbol
+ before any other symbols in the same section.
- * coffgen.c (coff_renumber_symbols): Sort common symbols with
- global symbols.
+Wed Apr 8 14:50:23 1998 Michael Meissner <meissner@cygnus.com>
- * coffcode.h (coff_compute_section_file_positions): Only pad the
- previous section to force file alignment when creating an
- executable.
+ * config.bfd (powerpc*-*-*): Remove PowerPC NT support from ELF
+ systems.
-Mon Nov 20 14:54:09 1995 Ian Lance Taylor <ian@cygnus.com>
+Tue Apr 7 16:25:31 1998 Gavin Romig-Koch <gavin@cygnus.com>
- * coffcode.h (coff_compute_section_file_positions): If
- RS6000COFF_C, set up the .debug section.
+ * dwarf2.c (comp_unit): Move it earlier in the source. Add
+ addr_size.
+ (read_address): Replace 'bdf*' argument with 'comp_unit*' argument.
+ Use addr_size for address size, rather than sizeof(bfd_vma).
+ (read_attribute): Replace bdf* argument with 'comp_unit*' argument.
+ Fix call to read_address.
+ (decode_line_info): Replace bdf* argument with 'comp_unit*' argument.
+ Scrap other unneeded arguments. Fix call to read_address.
+ (scan_unit_for_functions): Fix call to read_attribute.
+ (parse_comp_unit): We now handle more values for addr_size.
+ Set addr_size in unit. Fix call to read_attribute and
+ decode_line_info.
- * xcofflink.c (xcoff_link_input_bfd): Adjust the TOC anchor value
- if it is not large enough to accomodate the entire TOC area with
- signed 16 bit offsets.
- (xcoff_write_global_symbol): Handle negative TOC offsets in global
- linkage code.
- (_bfd_ppc_xcoff_relocate_section): Adjust relocations against a
- TOC anchor to use the TOC value used in the output file.
+Tue Apr 7 15:44:47 1998 Gavin Romig-Koch <gavin@cygnus.com>
-Sat Nov 18 18:01:41 1995 Ian Lance Taylor <ian@cygnus.com>
+ * dwarf2.c (parse_comp_unit): Drop use of unit->name when it is null.
- * coffgen.c (_bfd_coff_get_external_symbols): Cast malloc return.
- (_bfd_coff_read_string_table): Likewise.
+Tue Apr 7 12:35:18 1998 Ian Lance Taylor <ian@cygnus.com>
-Sat Nov 18 19:43:04 1995 Richard Earnshaw (rearnsha@armltd.co.uk)
+ * archures.c (bfd_default_scan): Add m68k cases back to default
+ switch, reverting patch of March 25, since IEEE support depends
+ upon them.
- * pe-arm.c: Fix typos.
- * coff-arm.c: Likewise.
+Mon Apr 6 14:06:40 1998 Ian Lance Taylor <ian@cygnus.com>
-Fri Nov 17 16:22:04 1995 Kim Knuttila <krk@cygnus.com>
+ * Makefile.am (diststuff): New target.
+ * Makefile.in: Rebuild.
- * coff-ppc.c (list_ele): Added "cat"egory member.
- (record_toc): New category parameter (priv or pub).
- (ppc_record_toc_entry): Check to see if toc bounds exceeded.
- (ppc_process_before_allocation): Removed embrionic data-in-toc from
- the mainline. It addes extra toc cells in error.
- (ppc_coff_swap_sym_in_hook): Added some documentation.
- (dump_toc): Can now diagnose "virtual toc" chicanery.
+Sun Apr 5 16:21:44 1998 Jeffrey A Law (law@cygnus.com)
-Fri Nov 17 10:41:25 1995 Philippe De Muyter <phdm@info.ucl.ac.be>
+ * som.c (som_bfd_ar_write_symbol_stuff): Fix computation of
+ som_offset when we have an extended name table.
- * elf-bfd.h (struct elf_link_hash_table): Change type of
- dynsymcount and bucketcount fields from size_t to bfd_size_type.
+Sun Apr 5 16:04:39 1998 H.J. Lu <hjl@gnu.org>
-Fri Nov 17 10:02:58 1995 Ian Lance Taylor <ian@cygnus.com>
+ * Makefile.am (stamp-lib): Check that .libs/libbfd.a exists before
+ trying to copy it.
+ * Makefile.in: Rebuild.
- * coffcode.h (coff_pointerize_aux_hook): I960 version: don't
- pointerize C_LEAFSTAT or C_LEAFEXT entries.
+Fri Apr 3 11:09:42 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
- * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Only create
- DT_INIT and DT_FINI entries if the _init or _fini symbol is
- defined or mentioned in a regular file.
+ * elf32-m68k.c (elf_m68k_size_dynamic_sections): Generate section
+ symbols when creating a shared library.
+ (elf_m68k_adjust_dynindx): New function, used by above code.
+ (elf_m68k_finish_dynamic_sections): Initialize the section
+ symbols.
+ (elf_m68k_relocate_section): Change abort to BFD_ASSERT.
-Thu Nov 16 15:16:42 1995 Kim Knuttila <krk@cygnus.com>
+Wed Apr 1 16:04:02 1998 Nick Clifton <nickc@cygnus.com>
- * coff-ppc.c (ppc_record_data_in_toc_entry): new function
- (coff_ppc_relocate_section): Handle TOCDEFN attribute
- (coff_ppc_relocate_section): Correct REL24 handling
- (ppc_process_before_allocation): Correct TOCDEFN handling
+ * coff-arm.c (in_reloc_p): Use ARM_RVA32 in place of constant
+ value 11.
- * peicode.h (dir_names): Added name descriptions
+Wed Apr 1 13:36:58 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-Thu Nov 16 03:38:03 1995 Ken Raeburn <raeburn@cygnus.com>
+ * elf32-m68k.c (elf_m68k_relocate_section, case R_68K_PLT*O): Fix
+ assertion.
- * VERSION: Updated to cygnus-2.6.
+Tue Mar 31 00:12:12 1998 Jeffrey A Law (law@cygnus.com)
-Wed Nov 15 19:30:07 1995 Ken Raeburn <raeburn@cygnus.com>
+ * elf-m10300.c (mn10300_elf_relax_section): Correctly handle
+ absolute symbols.
- * targets.c (m68k4knetbsd_vec): Declare.
+Mon Mar 30 12:46:15 1998 Ian Lance Taylor <ian@cygnus.com>
-Wed Nov 15 18:05:52 1995 Ian Lance Taylor <ian@cygnus.com>
+ * configure.in: Set version to 2.9.1.
+ * configure: Rebuild.
- * targets.c (bfd_target): Change type of second argument to
- _bfd_print_private_bfd_data from void * to PTR.
- * libbfd-in.h (_bfd_generic_bfd_print_private_bfd_data): Cast
- using PTR rather than void *.
- * bfd-in2, libbfd.h: Rebuild.
- * peicode.h (pe_print_private_bfd_data): Change vfile from void *
- to PTR.
- * elfxx-target.h (bfd_elfNN_bfd_print_private_bfd_data): Define as
- _bfd_generic_bfd_print_private_bfd_data rather than casting
- bfd_true.
+ * Branched binutils 2.9.
-Wed Nov 15 04:09:14 1995 Ken Raeburn <raeburn@cygnus.com>
+Mon Mar 30 12:20:50 1998 Brent Baccala <baccala@freesoft.org>
- * Makefile.in (.dep1): Fix stupid typo in last change. Remove any
- "DO NOT DELETE" lines or blank lines that mkdep writes on some
- systems.
- (BFD_LIBS_CFILES, ALL_MACHINES_CFILES, BFD32_BACKENDS_CFILES,
- BFD64_BACKENDS_CFILES): New variables.
- (CFILES): Use them.
-
-Tue Nov 14 11:52:23 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * peicode.h (coff_swap_aouthdr_out): For PPC PE, start isize at 0,
- not at the file position of the first section.
- * coffcode.h (coff_compute_section_file_positions): Avoid using
- unportable #elif.
- (coff_write_object_contents): When generating a PPC PE executable
- with no symbols, round up the file size to a COFF_PAGE_SIZE
- boundary.
- * cofflink.c (_bfd_coff_final_link): If there are no symbols,
- don't write out a string table.
-
- * elf.c (bfd_section_from_shdr): When using a different section
- header, pass the new one to _bfd_elf_make_section_from_shdr.
- (elf_fake_sections): Don't set sh_info and sh_entsize fields.
- (elf_map_symbols): Add section VMA to symbol value when comparing
- against 0.
- (_bfd_elf_compute_section_file_positions): Only build symbol table
- if there are some symbols. Set file offset of symtab and strtab
- sections.
- (assign_file_positions_except_relocs): Remove dosyms parameter.
- Change all callers. Never set file offset of symtab and strtab
- sections.
- (_bfd_elf_copy_private_section_data): New function.
- (MAP_ONESYMTAB, MAP_DYNSYMTAB, MAP_STRTAB, MAP_SHSTRTAB): Define.
- (_bfd_elf_copy_private_symbol_data): New function.
- (swap_out_syms): Check for special mapping of st_shndx created by
- copy_private_symbol_data.
- * elfxx-target.h: Use new copy routines.
- * elf-bfd.h (_bfd_elf_copy_private_symbol_data): Declare.
- (_bfd_elf_copy_private_section_data): Declare.
+ * syms.c (ENABLE_CACHING): Define.
+ (struct indexentry): Define.
+ (struct stab_cache): Remove.
+ (cmpindexentry): New static function.
+ (struct stab_find_info): Add new fields: indextable,
+ indextablesize, cached_indexentry, cached_offset, cached_stab, and
+ cached_file_name. Remove fields: file_cache, function_cache, and
+ line_cache.
+ (_bfd_stab_section_find_nearest_line): Rewrite to build a sorted
+ index table and search it.
- * config.bfd (sh-*-*): Set targ_defvec to shcoff_vec.
+Mon Mar 30 10:39:34 1998 Ian Lance Taylor <ian@cygnus.com>
- * coffcode.h (coff_slurp_symbol_table): If COFF_WITH_PE, handle
- C_NT_WEAK.
+ * elf.c (_bfd_elf_copy_private_section_data): Call
+ copy_private_bfd_data once we've seen the last SEC_ALLOC section.
- * coff-sh.c (shlcoff_vec): Use _bfd_generic_archive_p, not
- _bfd_dummy_target, matching the recent change to archive
- recognition.
+ * cpu-mips.c: Remove trailing comma at end of enumeration list.
-Mon Nov 13 13:24:38 1995 Ian Lance Taylor <ian@cygnus.com>
+Sat Mar 28 16:33:02 1998 Ian Lance Taylor <ian@cygnus.com>
- * libbfd.c (bfd_get_file_window): Use casts to avoid doing
- arithmetic on PTR types.
+ * coff-arm.c: Define all globally visible variables and functions
+ only when COFF_WITH_PE is not defined.
+ * configure.in (armpe_little_vec, armpe_big_vec): Add
+ coff-arm.lo.
+ * configure: Rebuild.
- * aout-target.h (MY(callback)): Set the lma of the sections.
+Fri Mar 27 16:06:02 1998 Ian Lance Taylor <ian@cygnus.com>
- * ecoff.c (ecoff_reloc_link_order): Turn a reloc against a defined
- symbol into a reloc against the section.
+ Fix some gcc -Wall warnings:
+ * aout-arm.c (MY(fix_pcrel_26)): Add casts to avoid warnings.
+ * archive.c (_bfd_generic_read_ar_hdr_mag): Likewise.
+ * archures.c (bfd_default_scan): Likewise.
+ * bfd.c (bfd_scan_vma): Likewise.
+ * binary.c (mangle_name): Likewise
+ * coff-arm.c (aoutarm_fix_pcrel_26): Likewise.
+ * coff-sh.c (sh_relocate_section): Likewise.
+ * coff-stgo32.c (create_go32_stub): Likewise.
+ * coffcode.h (coff_slurp_line_table): Likewise.
+ * ecoff.c (_bfd_ecoff_write_armap): Likewise.
+ * elf.c (_bfd_elf_make_section_from_shdr): Likewise.
+ (assign_file_positions_for_segments): Likewise.
+ * elf32-mips.c (mips_elf_relocate_section): Likewise.
+ * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
+ * oasys.c (oasys_write_sections): Likewise.
+ * ppcboot.c (ppcboot_object_p): Likewise.
+ (mangle_name): Likewise.
+ * riscix.c (riscix_fix_pcrel_26): Likewise.
+ * srec.c (srec_scan): Likewise.
+ * stabs.c (_bfd_write_section_stabs): Likewise.
+ * sunos.c (sunos_add_dynamic_symbols): Likewise.
+ * aout-ns32k.c (_bfd_ns32k_relocate_contents): Add default case to
+ switch. Declare parameters for function pointers.
+ * archures.c (bfd_default_scan): Add braces to avoid ambiguous if
+ warning.
+ * elf.c (elf_sort_sections): Likewise.
+ * coff-arm.c (coff_thumb_pcrel_common): Initialize relocation.
+ Add default cases to switches.
+ (coff_arm_relocate_section): Remove unused local variables.
+ Always set rstat.
+ (coff_arm_bfd_set_private_flags): Change flag variable to type
+ flagword.
+ * coff-mips.c (mips_relocate_section): Initialize use_lo.
+ * coff-ppc.c (ppc_record_toc_entry): Change i to unsigned int.
+ (dump_toc): Change cat to const, and initialize it.
+ * coff-sh.c (sh_relax_delete_bytes): Initialize start and voff.
+ * elf32-sh.c (sh_elf_relax_delete_bytes): Likewise.
+ (sh_elf_relocate_section): Initialize r_symndx.
+ * coffcode.h (coff_compute_section_file_positions): Only declare
+ old_sofar if ALIGN_SECTIONS_IN_FILE.
+ (coff_write_object_contents): Initialize csym.
+ * coffgen.c (coff_pointerize_aux): Make type and class unsigned.
+ * cpu-ns32k.c (_bfd_ns32k_get_displacement): Add default case to
+ switch.
+ * dwarf2.c: Include libiberty.h.
+ (read_2_signed_bytes, read_4_signed_bytes): Comment out.
+ (decode_line_info): Remove unused local variables.
+ * elf32-m32r.c (m32r_elf_sda16_reloc): Likewise.
+ (m32r_elf_relocate_section): Likewise.
+ * elf32-v850.c (v850_elf_store_addend_in_insn): Likewise.
+ (v850_elf_reloc): Likewise.
+ * elf-bfd.h (elf_linker_section_t): Make alignment unsigned.
+ (struct elf_obj_tdata): Make cverdefs and cverrefs unsigned.
+ * elf.c (assign_file_positions_for_segments): Always set adjust.
+ * elf32-d30v.c (bfd_elf_d30v_reloc): Initialize tmp_addr. Fully
+ parenthesize expression.
+ * elf32-m32r.c (m32r_elf_relocate_section): Always initialize h.
+ (m32r_elf_object_p): Return a value.
+ (m32r_elf_print_private_bfd_data): Change fprintf format string.
+ * elf32-mips.c (mips_elf_final_link): Initialize last.
+ (mips_elf_finish_dynamic_sections): Initialize last and dindx.
+ * elf32-v850.c (v850_elf_object_p): Return a value.
+ (v850_elf_print_private_bfd_data): Change fprintf format string.
+ * elfcode.h (elf_slurp_symbol_table): Change symcount and i to
+ unsigned long.
+ * elflink.h (elf_link_add_object_symbols): Change vernum to
+ unsigned int, and initialize it. Change fprintf format string.
+ (NAME(bfd_elf,size_dynamic_sections)): Cast -1 to bfd_size_type
+ when setting or comparing to soname_indx.
+ (elf_create_pointer_linker_section): Change num_symbols to
+ unsigned int.
+ * libcoff-in.h (coff_data_type): Change flags to flagword.
+ * peicode.h (pe_print_idata): Initialize idx. Change j to
+ bfd_size_type. Initialize hint_member. Remove useless test to
+ time_stamp.
+ (pe_print_edata): Change num_functions and num_names in struct
+ EDT_type to unsigned long. Remove cast. Change fprintf format
+ string.
+ * ppcboot.c (ppcboot_object_p): Change i to size_t.
+ * reloc.c (bfd_get_reloc_size): Change return type to unsigned
+ int.
+ * reloc16.c (bfd_coff_reloc16_relax_section): Change shrinks to
+ int *. Update uses. Change j to long.
+ * bfd-in2.h, libcoff.h: Rebuild.
-Mon Nov 13 07:31:35 1995 Kim Knuttila <krk@cygnus.com>
+Fri Mar 27 10:10:46 1998 Catherine Moore <clm@cygnus.com>
+
+ * elf32-v850.c Remove definition of USE_REL.
+ (v850_elf_info_to_howto_rela): New function.
+ (v850_elf_perform_relocation): Renamed from
+ v850_elf_store_addend_in_insn. Removed replace argument.
+ (v850_elf_reloc): store the relocation in the addend field instead
+ of the insn.
+ (v850_elf_final_link_relocate): Now calls
+ v850_elf_perform_relocation.
+ (v850_elf_relocate_section): Remove code to generate REL
+ relocations.
- * coff-ppc.c (ppc_coff_link_hash_entry): added support for inline
- glue for the relocs: IMGLUE and IFGLUE.
- (record_toc): new function - tracks toc contents
- (ppc_mark_symbol_as_glue): new function - supports the IMGLUE reloc
- (coff_ppc_relocate_section): Added support and fixes for IMGLUE/IFGLUE
- (ppc_coff_rtype2howto): removed invalid IMGLUE hack
- (coff_ppc_rtype_to_howto): removed invalid IMGLUE hack
- (ppc_record_toc_entry): Removed a debug define (duh)
+Thu Mar 26 13:32:17 1998 Ian Lance Taylor <ian@cygnus.com>
- * peicode.h (coff_swap_scnhdr_out): Fixed invalid strcmp for ".reldata"
- (pe_print_idata): New function - formats the idata section data
- (pe_print_pdata): New function - formats the pdata section data
- (pe_print_private_bfd_data): calls to above
+ * coffcode.h (coff_new_section_hook): Set the type and storage
+ class in the native symbol information allocated for a new section
+ symbol.
-Sun Nov 12 12:23:24 1995 Stan Shebs <shebs@andros.cygnus.com>
+Thu Mar 26 10:13:41 1998 Nick Clifton <nickc@cygnus.com>
- * Makefile.in (bfd_libs_here, etc): Provide empty definitions.
- * coff-rs6000.c (rs6000coff_vec): Add conditional defines
- TARGET_SYM and TARGET_NAME for vector and BFD name.
- * coff-pmac.c (pmac_xcoff_vec): Remove.
- (TARGET_SYM, TARGET_NAME): Define.
- * coffcode.h (coff_set_arch_mach_hook) [POWERMAC]: Set the
- machine to 0, not all PowerMacs are 601s.
+ * peicode.h: Chain together calls to
+ coff_bfd_copy_private_bfd_data and
+ coff_bfd_print_private_bfd_data.
-Fri Nov 10 12:10:14 1995 Ian Lance Taylor <ian@cygnus.com>
+ * coff-arm.c: Add prototypes for
+ coff_arm_bfd_print_private_bfd_data and
+ coff_arm_bfd_copy_private_bfd_data.
- * elfcode.h (elf_object_p): Read in any program headers.
- * elf.c (_bfd_elf_make_section_from_shdr): Adjust section lma
- based on the program headers, if any.
- (elf_fake_sections): Set sh_addr from the vma, not the lma.
- (map_program_segments): Set p_paddr of program headers based on
- the lma.
+Wed Mar 25 15:45:55 1998 Nick Clifton <nickc@cygnus.com>
-Thu Nov 9 13:01:31 1995 Ian Lance Taylor <ian@cygnus.com>
+ * coffcode.h (coff_mkobject_hook): Set private falgs even for a PE
+ build.
- * archive.c (bfd_generic_archive_p): Preserve tdata in case of
- failure.
+ * peicode.h: Call arm-coff private data functions after handling
+ pe private data.
- * aoutx.h (NAME(aout,final_link)): Report a reasonable error when
- trying to do a relocateable link with a non-a.out object file.
+ * coff-arm.c: Turn statics into globals so that they can be shared
+ both pe and pei backends.
- * archive.c (bfd_generic_archive_p): Check the first object file
- in an archive even if target_defaulted is set. If the object file
- has the wrong xvec, reject it.
+Wed Mar 25 15:19:38 1998 Ian Lance Taylor <ian@cygnus.com>
- * aoutx.h (NAME(aout,set_section_contents)): If a section can not
- be represented, report the name via _bfd_error_handler.
- (translate_to_native_sym_flags): Likewise.
- * elf32-mips.c (mips_elf_final_link): Likewise.
- * oasys.c (oasys_write_sections): Likewise.
+ * aoutf1.h (sunos_set_arch_mach): Use bfd_mach_m68* rather than
+ plain numbers.
+ (sunos_write_object_contents): Likewise.
+ * aoutx.h (NAME(aout,machine_type)): Likewise.
+ * coffcode.h (coff_set_arch_mach_hook): Likewise.
- * coffcode.h (coff_set_alignment_hook): Write RS6000COFF_C version
- which checks for STYP_OVRFLO sections.
- (coff_compute_section_file_positions): If RS6000COFF_C, handle
- reloc and lineno count overflows.
- (coff_write_object_contents): Call coff_count_linenumbers before
- coff_compute_section_file_positions. If RS6000COFF_C, handle
- reloc and lineno count overflows.
- * xcofflink.c (_bfd_xcoff_bfd_final_link): Count line numbers and
- relocs before dealing with .pad sections. Count overflow section
- headers when handling .pad sections.
-
- * coffcode.h (coff_write_object_contents): Set a.out vstamp to 1
- if RS6000COFF_C.
-
- * xcofflink.c (XCOFF_DESCRIPTOR): Define.
- (struct xcoff_link_hash_table): Add descriptor_section and
- special_sections fields.
- (_bfd_xcoff_bfd_link_hash_table_create): Initialize new fields.
- (xcoff_link_add_symbols): Set linkage section alignment. Create
- descriptor section. Check for magic symbol names (_text, etc.),
- and record them in special_sections if found. Set
- XCOFF_DESCRIPTOR flag for a function descriptor, and set its
- descriptor field to point back to the function code symbol.
- (xcoff_sweep): Always mark the special descriptor_section.
- (bfd_xcoff_export_symbol): Check whether the symbol might be a
- function descriptor, and mark it if it is.
- (bfd_xcoff_size_dynamic_sections): Add new special_sections
- parameter, and fill it in. Allocate space for the descriptor
- section.
- (xcoff_build_ldsyms): Set XCOFF_DEF_REGULAR flag when defining
- global linkage code. If an undefined function descriptor is
- exported, arrange to define it. Warn about any other undefined
- exported symbol.
- (_bfd_xcoff_bfd_final_link): Write out the descriptor section.
- (xcoff_write_global_symbol): Create a function descriptor when
- necessary.
- * bfd-in.h (bfd_xcoff_size_dynamic_sections): Update declaration.
- * bfd-in2.h: Rebuild.
+Wed Mar 25 13:59:24 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-Thu Nov 9 08:40:23 1995 Kim Knuttila <krk@cygnus.com>
-
- * coff-ppc.c (ppc_coff_link_hash_entry): new types for hashing
- (ppc_coff_link_hash_table): new types for hashing
- (ppc_coff_link_hash_newfunc): hash entry constructor
- (ppc_coff_link_hash_table_init): hash table initializer
- (ppc_coff_link_hash_table_create): hash table constructor
- (ppc_record_toc_entry): changed references to hash table
- (coff_ppc_relocate_section): changed references to hash table
-
- * libcoff-in.h (coff_link_hash_entry): removed toc_offset
- * libcoff.h: Rebuild
-
- * cofflink.c (_bfd_coff_link_hash_newfunc): removed toc_offset init
- (coff_link_add_symbols): removed toc_offset init
-
-Thu Nov 9 04:00:38 1995 Ken Raeburn <raeburn@cygnus.com>
-
- * Makefile.in (.dep1): Make sure the file mkdep is to write exists
- first.
-
- * configure.in: Added new option --with[out]-mmap. Set USE_MMAP
- if it is given and mmep is available.
- * acconfig.h: Undef USE_MMAP.
- * configure, config.in: Regenerated.
- * aoutx.h: If USE_MMAP is not defined, do all symbol and string
- table handling the old way.
- (aout_get_external_symbols): Don't complain if last byte of string
- table is nonzero.
- * libbfd.c [HAVE_MADVISE]: Include sys/types.h and sys/mman.h.
- (bfd_free_window) [! USE_MMAP]: Don't define.
- (bfd_get_file_window,
- _bfd_generic_get_section_contents_in_window) [! USE_MMAP]: Abort.
-
-Wed Nov 8 20:03:44 1995 Eric Freudenthal <freudenthal@nyu.edu>
-
- * coff-a29k.c (SIGN_EXTEND_HWORD): Use ~0xffff rather than
- 0xffff0000.
-
-Wed Nov 8 11:31:11 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * coff-a29k.c (a29k_reloc): Change handling of R_IREL reloc to be
- compatible with AMD generated COFF files. Try to support both AMD
- and GNU formats simultaneously.
- (coff_a29k_relocate_section): Likewise.
-
- * libbfd.c (bfd_get_file_window): Change writable parameter from
- int to boolean; update all callers. Pass MAP_SHARED if not
- writable--it's required on Solaris. Cast fprintf argument to
- avoid warning.
- * bfd-in.h (bfd_get_file_window): Update declaration.
- * bfd-in2.h: Rebuild.
- * aoutx.h: Update calls to bfd_get_file_window.
-
- * xcofflink.c (XCOFF_DEF_DYNAMIC): Rename from XCOFF_REF_DYNAMIC.
- Change all uses.
- (xcoff_swap_ldhdr_in): New static function.
- (xcoff_swap_ldsym_in): New static function.
- (xcoff_find_reloc): Handle the case of a single reloc correctly.
- (xcoff_link_add_symbols): If we just created a descriptor, pass it
- to _bfd_generic_link_add_one_symbol, to save a hash lookup.
- Handle XTY_ER/XMC_XO symbols correctly.
- (xcoff_link_add_dynamic_symbols): Rewrite to read .loader symbols
- rather than normal symbol table.
- (bfd_xcoff_import_symbol): It's not an error if the symbol is
- already defined with the same absolute value.
- (xcoff_mark): When considering called symbols, check whether the
- descriptor is from a dynamic object, rather than the symbol
- itself.
- (xcoff_build_ldsyms): Likewise.
-
- * libbfd.c (bfd_get_file_window): Change return type to boolean.
- Cast realloc and malloc return values. If malloc or realloc fail,
- set bfd_error_no_memory.
- * bfd-in.h (bfd_get_file_window): Change type to boolean.
+ * archures.c (bfd_mach_m68*): Add definitions for various m68k
+ variants.
+ (bfd_default_scan): Remove m68k special cases.
* bfd-in2.h: Rebuild.
+ * mipsbsd.c (MY(write_object_contents)): Use bfd_mach_m68* rather
+ than plain numbers.
+ * sparclynx.c (NAME(lynx,set_arch_mach)): Likewise.
+ * cpu-m68k.c (arch_info_struct): Likewise. Add entry for
+ m68k:68000.
+ (bfd_m68k_arch): Set mach field to zero to signal no explicit
+ selection, change printable_name to just "m68k" and make that the
+ default instead of m68k:68020.
-Tue Nov 7 11:53:48 1995 Kim Knuttila <krk@cygnus.com>
+ * aout-tic30.c (NAME): Define this to avoid multiple definitions
+ from aoutx.h.
+ (MY_get_section_contents): Define as aout_32_get_section_contents
+ rather than NAME(aout,get_section_contents).
- * coff-ppc.c (ppc_record_toc_entry): new function.
- (in_reloc_p): changed return value.
- (coff_ppc_relocate_section): much rework.
- (ppc_allocate_toc_section): new function.
- (ppc_process_before_allocation): new function.
- (ppc_coff_swap_sym_in_hook): new function.
+ * elf-m10300.c (elf32_mn10300_link_hash_table_create): Fix cast.
- * cofflink.c (_bfd_coff_link_hash_newfunc): initialize toc_offset.
- (coff_link_add_symbols): initialize toc_offset.
+ * evax-alpha.c (evax_set_arch_mach): Only accept bfd_arch_alpha
+ and call bfd_default_set_arch_mach to do the real work.
- * peicode.h (coff_swap_sym_in): Added coff_swap_sym_in_hook
- (coff_swap_aouthdr_out): Added more sections to the data
- dictionary for the pe file header. Also changed linker version
- number on the ppc side.
- (dir_names): small improvements to the dictionary printing.
- (pe_mkobject_hook): save the file level flags.
+Wed Mar 25 10:41:35 1998 Richard Henderson <rth@cygnus.com>
- * libcoff-in.h (coff_link_hash_entry): added toc_offset field
- (pe_tdata): added real_flags field
- (coff_tdata): added local_toc_sym_map and access macro
+ * bout.c (BALX): Include return register g14 as part of the insn.
+ (BALX_MASK): New.
+ (calljx_callback): Use it.
- * libcoff.h (coff_link_hash_entry): added toc_offset field
- (pe_tdata): added real_flags field
- (coff_tdata): added local_toc_sym_map and access macro
+Wed Mar 25 11:19:28 1998 Ian Lance Taylor <ian@cygnus.com>
- * coffcode.h (coff_set_alignment_hook): added hook for PE.
- (coff_mkobject): init for local_toc_sym_map
- (coff_write_object_contents): set the internal_a.magic to
- IMAGE_NT_OPTIONAL_HDR_MAGIC which appears to be what other
- ppc compilers use.
+ * libbfd-in.h (BFD_ALIGN): Cast this parameter to bfd_vma.
+ * libbfd.h: Rebuild.
-Tue Nov 7 13:48:58 1995 Ian Lance Taylor <ian@cygnus.com>
+ * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Change
+ byte_count to unsigned int.
+ (mn10300_elf_relax_section): Initialize internal_relocs. Remove
+ unused local variables.
- * ecofflink.c (_bfd_ecoff_locate_line): Keep looking through stabs
- entries until both the line number address and the function name
- address are too large.
+ * evax-alpha.c (evax_close_and_cleanup): Remove unused local
+ variables er and er1.
- * configure.in: Call AC_CHECK_PROG to find and cache AR.
- * configure: Rebuilt.
+ * cpu-v850.c: Include <ctype.h>.
+ (scan): Case isdigit argument to unsigned char.
- * aclocal.m4 (BFD_CC_FOR_BUILD): Don't define CC_FOR_BUILD if it
- is defined in the environment.
+ From Yan Meroth <YAN.MEROTH@st.com>:
+ * ihex.c (ihex_scan): Add extbase variable so that getting an
+ extended linear address record does not ignore any previous
+ extended address.
+ (ihex_write_object_contents): When writing out an extended linear
+ address record, zero out any previous extended address.
-Tue Nov 7 10:57:24 1995 Jeffrey A Law (law@cygnus.com)
+Tue Mar 24 16:09:43 1998 Manfred Hollstein <manfred@s-direktnet.de>
- * som.c (som_get_section_contents_in_window): Define to use
- generic version.
+ * ieee.c (do_one): Check section before dereferencing it.
+ (ieee_canonicalize_reloc): Likewise with src->relent.sym_ptr_ptr.
+ (ieee_generic_stat_arch_elt): Likewise with abfd->my_archive.
-Mon Nov 6 17:13:15 1995 Harry Dolan <dolan@ssd.intel.com>
+Mon Mar 23 18:51:47 1998 Joel Sherrill <joel@OARcorp.com>
- * coff-i860.c: New file, based on coff-i386.c.
- * cpu-i860.c: New file, based on cpu-i386.c.
- * hosts/i860mach3.h: New file, based on hosts/i386mach3.h.
- * config.bfd (i860-*-mach3*, i860-*-osf1*, i860-*-coff*): New
- targets, using i860coff_vec.
- * configure.in (i860-*-mach3*, i860-*-osf1*): New hosts, using
- trad-core.o and hosts/i860mach3.h.
- (i860coff_vec): Use coff-i860.o and cofflink.o.
- * configure: Rebuild.
- * Makefile.in: Rebuild dependencies.
- (ALL_MACHINES): Add cpu-i860.o.
- (BFD32_BACKENDS): Add coff-i860.o.
- (CFILES): Add cpu-i860.c and coff-i860.c.
- * targets.c (i860coff_vec): Declare.
- (bfd_target_vector): Add &i860coff_vec.
- * archures.c (bfd_i860_arch): Declare.
- (bfd_archures_list): Add &bfd_i860_arch.
- * coffcode.h (coff_set_arch_mach_hook): Handle I860 magic number.
- (coff_set_flags): Handle bfd_arch_i860.
- (coff_write_object_contents): Handle I860 a.out magic number.
-
-Mon Nov 6 14:34:07 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * xcofflink.c (xcoff_link_add_symbols): Set the alignment power of
- the created .tc section to 2.
- (xcoff_mark): Don't keep a .loader reloc for a call to an
- undefined symbol when creating a shared library.
- (xcoff_build_ldsyms): When creating a shared library, generate
- global linkage code for a call to an undefined symbol.
-
-Sun Nov 5 21:44:13 1995 Ken Raeburn <raeburn@cygnus.com>
-
- * Makefile.in (CFILES): Rebuild list from BFD_LIBS, ALL_MACHINES,
- BFD32_BACKENDS, BFD64_BACKENDS.
- (.dep1): Put mkdep output in a separate file.
- Rebuilt dependencies.
-
- * ecoff.c (_bfd_ecoff_slurp_armap): Cast _bfd_read_ar_hdr return
- value.
-
- Permit use of mmap when available:
-
- * configure.in: Check for mmap, madvise, mprotect.
- * config.in, configure: Regenerated.
-
- * libbfd.c (struct _bfd_window_internal): Define type.
- (bfd_init_window, bfd_free_window, bfd_get_file_window): New
- functions.
- (ok_to_map): New static variable for debugging.
- (_bfd_generic_get_section_contents_in_window): New function.
- * bfd-in.h (bfd_window_internal): Declare type.
- (bfd_window): Define type.
- (bfd_init_window, bfd_free_window, bfd_get_file_window): Declare.
- * libbfd-in.h (_bfd_generic_get_section_contents_in_window):
- Declare.
-
- * libaout.h (struct aoutdata): Add two window fields.
- (obj_aout_sym_window, obj_aout_string_window): New macros.
- * aoutx.h (some_aout_object_p): Initialize windows.
- (aout_get_external_symbols): Get symbol data and strings in
- windows instead of explicitly allocated buffers.
- (slurp_symbol_table): Free window instead of memory.
- (bfd_free_cached_info): Release windows instead of freeing storage
- directly.
- (aout_link_free_symbols): Ditto.
-
- * targets.c (bfd_target): Add new field for
- get_section_contents_in_window.
- (BFD_JUMP_TABLE_GENERIC): Updated.
- * aout-adobe.c, aout-target.h, binary.c, bout.c, coff-alpha.c,
- coff-mips.c, elfxx-target.h, i386msdos.c, i386os9k.c, ieee.c,
- libcoff-in.h, oasys.c, srec.c, tekhex.c, versados.c: Added new
- macros for get_section_contents_in_window field.
-
-Sat Nov 4 12:23:26 1995 Fred Fish <fnf@cygnus.com>
-
- * core.c: Renamed to corefile.c
- * makefile.dos (OBJS): Change core.o to corefile.o
- * Makefile.in (CFILES, BFD_LIBS): Use corefile.c instead of core.c
-
-Fri Nov 3 15:54:59 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * xcofflink.c (xcoff_link_add_symbols): Rename local variable sub
- to o. Clobber and restore the list of new csects around the call
- to _bfd_generic_link_add_one_symbol, in case it wants to report a
- linker error and the linker wants to read the symbol table. Reset
- the line number count of a real section even if it has no relocs.
- (_bfd_xcoff_bfd_final_link): If shared, set the DYNAMIC flag.
-
- * coffgen.c (_bfd_coff_read_string_table): Warn if the string size
- is too small.
-
-Thu Nov 2 23:16:39 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * xcofflink.c (_bfd_ppc_xcoff_relocate_section): Don't warn about
- an undefined symbol in a shared link.
-
- * linker.c (_bfd_generic_link_add_one_symbol): Correct type of
- oldtype from bfd_link_order_type to bfd_link_hash_type. From
- phdm@info.ucl.ac.be (Philippe De Muyter).
-
-Wed Nov 1 14:26:02 1995 Manfred Hollstein KS/EF4A 60/1F/110 #40283 <manfred@lts.sel.alcatel.de>
-
- * coff-m88k.c (rtype2howto): New static function.
- (RTYPE2HOWTO): Use it rather than a macro definition.
-
- * coffcode.h (coff_write_object_contents): set internal_a.magic
- to PAGEMAGICPEXECPAGED #if defined (M68) && !defined (LYNXOS).
-
- * configure.in: m68*-motorola-sysv* does not use ptrace-core.o;
- define TRAD_HEADER to new file hosts/delta68.h.
- m88*-motorola-sysv*, however, does use ptrace-core.o.
- * hosts/delta68.h: New file.
-
- * ptrace-core.c (ptrace_unix_core_file_p): change bfd_zmalloc to
- bfd_zalloc; provide proper parm abfd to calls to bfd_zalloc.
-
-Wed Nov 1 13:51:54 1995 Ken Raeburn <raeburn@cygnus.com>
-
- * i386linux.c (MY(vec)): Declare before use.
-
-Wed Nov 1 11:45:07 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * reloc16.c (bfd_coff_reloc16_get_relocated_section_contents):
- Pass input_bfd, not in_bfd, to bfd_coff_reloc16_extra_cases.
-
- * elf.c (bfd_elf_set_dt_needed_name): Don't do anything if the
- BFD is not of the right type.
- (bfd_elf_get_needed_list): Likewise.
- * i386linux.c (bfd_linux_size_dynamic_sections): Likewise.
- * sunos.c (bfd_sunos_get_needed_list): Likewise.
- * xcofflink.c (XCOFF_XVECP): Define.
- (bfd_xcoff_link_record_set): Don't do anything if the BFD is not
- of the right type.
- (bfd_xcoff_import_symbol): Likewise.
- (bfd_xcoff_export_symbol): Likewise.
- (bfd_xcoff_link_count_reloc): Likewise.
- (bfd_xcoff_record_link_assignment): Likewise.
- (bfd_xcoff_size_dynamic_sections): Likewise.
-
- * sunos.c (sunos_scan_ext_relocs): Only check the reloc symbol
- table index against the number of symbols for a base relative
- reloc.
+ * config.bfd: (sh*-*-rtems*): Switched from ELF to COFF.
- * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Change from macro to
- static function.
- * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Set
- full_aouthdr flag here...
- (_bfd_xcoff_bfd_final_link): ...not here.
-
-Tue Oct 31 12:52:02 1995 Fred Fish <fnf@cygnus.com>
-
- * libelf.h: Rename to elf-bfd.h to avoid conflict with
- 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.
-
-Tue Oct 31 15:30:07 1995 David Mosberger-Tang <davidm@azstarnet.com>
-
- * ecoff.c (ecoff_set_symbol_info): Add new parameter weak. If
- set, set BSF_WEAK in symbol. Change all callers.
- (ecoff_get_extr): Set weakext based on BSF_WEAK.
- (ecoff_link_add_externals): If weakext is set, pass BSF_WEAK to
- _bfd_generic_link_add_one_symbol.
- (ecoff_indirect_link_order): Check that the section tdata relocs
- are not NULL before using them.
-
- * configure.in (alpha*-*-linux*): Set COREFILE to trad-core.o and
- define TRAD_HEADER as hosts/alphalinux.h.
- * configure: Rebuild.
- * hosts/alphalinux.h: New file.
- * trad-core.c (trad_unix_core_file_p): Cast u.u_ar0 to bfd_vma,
- not int.
+Mon Mar 23 14:23:36 1998 Nick Clifton <nickc@cygnus.com>
-Tue Oct 31 12:34:11 1995 Ian Lance Taylor <ian@cygnus.com>
+ * coff-arm.c: Add interworking functions to pe backends.
- * coffcode.h (coff_slurp_symbol_table): Accept C_BCOMM and
- C_ECOMM storage classes.
+Fri Mar 20 18:47:20 1998 Ian Lance Taylor <ian@cygnus.com>
- * xcofflink.c (xcoff_mark_symbol): New static function, broken out
- of xcoff_mark.
- (xcoff_mark): Call xcoff_mark_symbol.
- (bfd_xcoff_export_symbol): Call xcoff_mark_symbol.
- (bfd_xcoff_link_count_reloc): Call xcoff_mark_symbol rather than
- doing it by hand.
- (xcoff_build_ldsyms): Build a .loader symbol for an export symbol.
+ * configure.in: Use AM_DISABLE_SHARED.
+ * aclocal.m4, configure: Rebuild with libtool 1.2.
-Mon Oct 30 14:53:48 1995 Ian Lance Taylor <ian@cygnus.com>
+Fri Mar 20 11:25:41 1998 Nick Clifton <nickc@cygnus.com>
- * xcofflink.c (struct xcoff_final_link_info): Add new line_filepos
- field.
- (xcoff_find_reloc): New static function.
- (xcoff_link_add_symbols): Use it.
- (_bfd_xcoff_bfd_final_link): Set finfo.line_filepos.
- (xcoff_link_input_bfd): Handle C_BINCL and C_EINCL. Don't
- relocate the value of C_DECL.
+ * coff-arm.c (coff_arm_relocate_section): Better error messages
+ when interowrking conflucts occur. Courtesy of Jonathan Walton
+ and Tony Thompson.
+ (aoutarm_std_reloc_howto): Fixed bitsize fields of rightshifted
+ relocations. Patch courtesy of Jonathan Walton and Tony
+ Thompson.
- * elf.c (elf_fake_sections): Remove bogus BFD_ASSERT.
+Fri Mar 20 02:26:43 1998 Richard Henderson <rth@cygnus.com>
-Sat Oct 28 01:25:34 1995 steve chamberlain <sac@slash.cygnus.com>
+ * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Revert
+ part of Feb 22 change controling when to override the existing
+ symbol with the .plt entry.
- * cofflink.c (_bfd_coff_generic_relocate_section): Make
- callback decide what goes in .relocs.
- * pe[i]-i386.c (TARGET_UNDERSCORE): Define.
- * peicode.h (pe_mkobject_hook): Only copy aouthdr if
- there is one.
+Wed Mar 18 09:26:25 1998 Nick Clifton <nickc@cygnus.com>
-Sat Oct 28 01:51:02 1995 Ian Lance Taylor <ian@cygnus.com>
+ * config.bfd (targ_cpu): Add thumb-pe target.
- * xcofflink.c (xcoff_link_add_symbols): Handle csects in the
- absolute section.
+ * coffcode.h (OTHER_GLOBAL_CLASS): Support thumb external
+ functions in PE build.
-Fri Oct 27 18:14:39 1995 Ian Lance Taylor <ian@cygnus.com>
+Sun Mar 8 23:37:26 1998 Stan Cox <scox@equinox.cygnus.com>
- * xcofflink.c: More improvements, mostly to fix handling of
- constructors and a few other special cases.
- * coff-rs6000.c (rs6000coff_vec): Set symbol_leading_char back to
- zero, reverting yesterday's change.
- * bfd-in.h (bfd_xcoff_link_record_set): Declare.
- (bfd_xcoff_link_count_reloc): Declare.
- (bfd_xcoff_record_link_assignment): Declare.
- * bfd-in2.h: Rebuild.
+ * config.bfd (sparclite-*-elf*): Added.
-Fri Oct 27 14:42:15 1995 Niklas Hallqvist <niklas@appli.se>
+Mon Feb 23 19:31:19 1998 Ian Lance Taylor <ian@cygnus.com>
- * PORTING, aout-arm.c, aout-encap.c, aout-target.h,
- aoutx.h, gen-aout.c, host-aout.c, hp300bsd.c, i386aout.c
- i386bsd.c, i386dynix.c, i386linux.c, i386lynx.c, i386mach3.c,
- i386netbsd.c, m68klynx.c, m88kmach3.c, mipsbsd.c, newsos3.c,
- ns32knetbsd.c, pc532-mach.c, riscix.c, sparclynx.c, sparcnetbsd.c:
- Change PAGE_SIZE to TARGET_PAGE_SIZE.
+ * configure.in: Add elf.lo to elf shell variable.
+ * Makefile.am (BFD_LIBS): Remove elf.lo.
+ (BFD_LIBS_CFILES): Remove elf.c.
+ (BFD32_BACKENDS): Add elf.lo.
+ (BFD32_BACKENDS_CFILES): Add elf.c.
+ * configure, Makefile.in: Rebuild.
- * m68knetbsd.c: Ditto as well as add support for the m68k4k object
- format.
+1998-02-23 15:53 Richard Henderson <rth@cygnus.com>
- * netbsd.h: Double ditto (incl. m68k4k support). NetBSD's text
- segments includes the a.out header. See to that the magic number
- *always* is big-endian.
+ * elf32-i386.c (elf_i386_relocate_section): A pc-relative
+ relocation against a now-local symbol should not have a dynamic
+ relocation.
- * config.bfd: Add m68*-hp*-netbsd* case. Cross-pollinate m68k and
- m68k4k NetBSD configurations.
+Mon Feb 23 16:17:08 1998 Ian Lance Taylor <ian@cygnus.com>
- * configure.in, configure: Separate i386 & mips NetBSD
- configurations from other BSD ones. Don't assume DEC is the only
- thing NetBSD/mips run on. Add {m68k,ns32k,sparc}-*-netbsd*
- configurations. Add support for m68k4k NetBSD object format.
+ * peicode.h (coff_swap_filehdr_in): Don't set BFD flag HAS_SYMS in
+ COFF filehdr flags.
+ (pe_print_private_bfd_data): Print PE flags. From Mikey
+ <jeffdb@netzone.com>.
- * libaout.h: Added M_68K4K_NETBSD magic.
+Sun Feb 22 20:39:00 1998 Richard Henderson <rth@cygnus.com>
- * m68k4knetbsd.c: New file.
+ * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Don't create
+ a plt entry when we can determine that we authoritatively define
+ the symbol.
- * hosts/{m68k,sparc}nbsd.h: Don't define HOST_BIG_ENDIAN_P.
+Sun Feb 22 20:33:05 1998 Richard Henderson <rth@cygnus.com>
- * hosts/nbsd.h: Define HOST_BIG_ENDIAN_P according to
- <machine/endian.h>.
+ * configure.in (COREFILE selection): Remove sparc-*-linux*. They
+ don't actually use trad-core, but a SunOS-style core file handled
+ by gdb directly.
+ * hosts/sparclinux.h: Remove.
- * hosts/mipsnbsd.h: New file.
+Wed Feb 18 15:31:06 1998 Ian Lance Taylor <ian@cygnus.com>
-Thu Oct 26 14:16:47 1995 Ian Lance Taylor <ian@cygnus.com>
+ * peicode.h (pe_print_idata): If there is no .idata section, look
+ for the import tables in some other section. Make the initial
+ label line up better with the data. Print the import address
+ table even if there is no import name table. If the import
+ address table holds actual addresses, print them.
- * xcofflink.c: Numerous changes to get closer to a working XCOFF
- linker.
- * libcoff-in.h (struct xcoff_tdata): Add full_aouthdr,
- toc_section, and entry_section fields.
- (struct xcoff_section_tdata): Remove ldrel_count field.
- * libcoff.h: Rebuild.
- * coffcode.h (coff_mkobject_hook): Initialize new xcoff_data
- fields.
- (coff_compute_section_file_positions): If RS6000COFF_C, generate
- full a.out header if full_aouthdr is set in xcoff_data.
- (coff_write_object_contents): Likewise. Set o_snentry and o_sntoc
- based on sections stored in xcoff_data.
- * coff-rs6000.c (xcoff_copy_private_bfd_data): Copy new xcoff_data
- fields.
- (xcoff_reloc_type_lookup): Handle BFD_RELOC_CTOR.
- (rs6000coff_vec): Set symbol_leading_char to '.'.
- * coffgen.c (coff_get_symbol_info): If fix_value is set, fix the
- value stored in ret rather than returning a pointer value.
+Tue Feb 17 12:58:34 1998 Ian Lance Taylor <ian@cygnus.com>
-Wed Oct 25 23:10:39 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+ * libbfd.c (bfd_seek): If fseek fails, save errno around call to
+ bfd_tell. If errno is EINVAL, set bfd_error_file_truncated, not
+ bfd_error_system_call.
- * config.bfd (powerpc{,le}-{elf,sysv4,eabi,solaris2}): Remove MAC
- format for now.
+Fri Feb 13 13:11:33 1998 Ian Lance Taylor <ian@cygnus.com>
-Wed Oct 25 16:19:27 1995 Jeffrey A Law (law@cygnus.com)
+ * Makefile.am (AUTOMAKE_OPTIONS): Define.
+ * configure, Makefile.in, aclocal.m4: Rebuild with automake 1.2e.
- * som.c (som_slurp_string_table): Allocate the strings with malloc
- since they're free'd by free_cached_info.
- (som_slurp_symbol_table): Similarly for the symbol table.
+ From H.J. Lu <hjl@gnu.org>:
+ * Makefile.am (libbfd_la_LDFLAGS): Define.
+ * Makefile.in: Rebuild.
-Wed Oct 25 14:59:22 1995 Per Bothner <bothner@kalessin.cygnus.com>
+Thu Feb 12 17:31:11 1998 Ian Lance Taylor <ian@cygnus.com>
- * Makefile.in (diststuff): Don't make headers.
+ NetBSD patches from Gordon W. Ross <gwr@mc.com>:
+ * netbsd.h (MACHTYPE_OK): Define.
+ (MY(write_object_contents)): Use DEFAULT_ARCH and DEFAULT_MID when
+ calling N_SET_MACHTYPE, rather than having a switch.
+ * libaout.h (enum machine_type): Add M_PMAX_NETBSD, M_VAX_NETBSD,
+ and M_ALPHA_NETBSD.
+ * i386netbsd.c (MACHTYPE_OK): Don't define.
+ (DEFAULT_MID): Define.
+ * m68k4knetbsd.c (SEGMENT_SIZE): Don't define.
+ (MACHTYPE_OK): Don't define.
+ (DEFAULT_MID): Define.
+ * m68knetbsd.c: (MACHTYPE_OK): Don't define.
+ (DEFAULT_MID): Define.
+ * ns32knetbsd.c (MACHTYPE_OK): Don't define.
+ (DEFAULT_MID): Define.
+ * sparcnetbsd.c (MACHTYPE_OK): Don't define.
+ (DEFAULT_MID): Define.
-Wed Oct 25 11:32:54 1995 Ian Lance Taylor <ian@cygnus.com>
+ NetBSD patches from Gordon W. Ross <gwr@mc.com>:
+ * vaxnetbsd.c: New file.
+ * netbsd-core.c: Clean up. Remove unused macros. Use netbsd
+ rather than netbsd_core.
+ * targets.c (vaxnetbsd_vec): Declare.
+ (bfd_target_vector): Add vaxnetbsd_vec. If NETBSD_CORE is
+ defined, add netbsd_core_vec.
+ * configure.in: Set COREFILE for alpha*-*-netbsd* and
+ powerpc-*-netbsd* to netbsd-core.lo. If COREFILE is
+ netbsd-core.lo, set COREFLAG to -DNETBSD_CORE.
+ * config.bfd (alpha*-*-netbsd*): New target.
+ * Makefile.am: Rebuild dependencies.
+ (BFD32_BACKENDS): Add vaxnetbsd.lo.
+ (BFD32_BACKENDS_CFILES): Add vaxnetbsd.c.
+ * configure, Makefile.in: Rebuild.
- * Makefile.in: Rebuild dependencies.
+ * configure.host: Remove the old shared library build stuff. We
+ now use libtool instead.
- * sunos.c (bfd_sunos_record_link_assignment): Don't do anything if
- output_bfd is not SunOS.
- (bfd_sunos_size_dynamic_sections): Likewise. Don't scan relocs of
- non-SunOS input files.
+Wed Feb 11 17:13:09 1998 Richard Henderson <rth@cygnus.com>
- * xcofflink.c: Extensive changes to support linking shared objects
- and generating a .loader section.
- * libcoff-in.h (struct xcoff_tdata): Add import_file_id field.
- (struct xcoff_section_tdata): Add lineno_count, first_symndx,
- last_symndx, and ldrel_count fields.
- * libcoff.h: Rebuild.
- * coff-rs6000.c (xcoff_howto_table): Correct reloc names.
- * coffcode.h (styp_to_sec_flags): Don't set any flags if STYP_PAD
- is set.
- * bfd-in.h (bfd_xcoff_import_symbol): Declare.
- (bfd_xcoff_export_symbol): Declare.
- (bfd_xcoff_size_dynamic_sections): Declare.
- * bfd-in2.h: Rebuild.
+ * tekhex.c (tekhex_write_object_contents): Call tekhex_init.
-Tue Oct 24 17:44:20 1995 Stan Shebs <shebs@andros.cygnus.com>
+Tue Feb 10 19:23:28 1998 H.J. Lu <hjl@gnu.org>
- * configure.in: Add xcofflink.o to pmac_xcoff_vec.
+ * configure.in: Take stab-syms.lo out of sparclinux_vec list.
* configure: Rebuild.
- * mpw-config.in: Add xcofflink.c.o to powerpc-apple-macos.
- * coff-pmac.c: Include coff-rs6000.c instead of duplicating its
- contents.
- (pmac_xcoff_vec): Update to use new xcoff support.
- * coff-rs6000.c (xcoff_generic_stat_arch_elt): Make static.
- (xcoff_write_armap): Declare buf as unsigned char.
- * xcofflink.c (xcoff_link_add_symbols): Declare a local as PTR.
-
- * mpw-make.sed: Generalize subdir_do edit.
-
-Tue Oct 24 10:25:01 1995 Jeffrey A Law (law@cygnus.com)
-
- * hppabsd-core.c (make_bfd_asection): Initialize asect->filepos
- correctly. Don't initialize asect->vma.
-
-Fri Oct 20 13:23:48 1995 Ken Raeburn <raeburn@cygnus.com>
-
- * opncls.c (_bfd_new_bfd): If _bfd_chunksize wasn't preset, use
- something a little less than the page size.
-
-Thu Oct 19 13:06:09 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * coff-i960.c (coff_i960_adjust_symndx): Clear *adjustedp.
-
-Wed Oct 18 16:20:08 1995 steve chamberlain <sac@slash.cygnus.com>
-
- * coff-i386.c (coff_i386_reloc_type_lookup): New.
- * coffcode.h (coff_write_object_contents): If .bss is before
- .data us that as data_start.
- * cofflink.c (_bfd_coff_generic_relocate_section): Get reloc
- calc correct.
- * peicode.h (add_data_entry): Use _cooked_size of data directory.
- (coff_swap_outhdr_out): Hardwire in version number.
-
-Wed Oct 18 16:50:54 1995 Ken Raeburn <raeburn@cygnus.com>
-
- * sunos.c (sunos_add_dynamic_symbols): Rename local variables
- major and minor to *_vno, since the former are also macros in
- SunOS header files. Cast result of bfd_alloc to appropriate
- type.
-
- * coffgen.c (coff_find_nearest_line): Cast used_by_bfd value
- before assigning to sec_data.
-
-Wed Oct 18 13:25:17 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * ecoff.c (_bfd_ecoff_find_nearest_line): The offset argument is
- now relative to the section, not absolute.
- * ecofflink.c (_bfd_ecoff_locate_line): Use the right symbol to
- get the file name when there is a N_SO directory name. When
- handling stabs, remember that section->vma was added to the
- offset.
-
-Tue Oct 17 18:24:54 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * sunos.c (struct sunos_link_hash_table): Add needed field.
- (sunos_link_hash_table_create): Call bfd_release, not free.
- (sunos_link_hash_table_create): Initialize needed field.
- (sunos_add_dynamic_symbols): Record needed objects.
- (bfd_sunos_get_needed_list): New function.
- * bfd-in.h (bfd_sunos_get_needed_list): Declare.
- * bfd-in2.h: Rebuild.
-
-Mon Oct 16 14:43:59 1995 steve chamberlain <sac@slash.cygnus.com>
-
- * libcoff-in.h (pe_data_type.in_reloc_p): New.
-Mon Oct 16 10:52:50 1995 Ian Lance Taylor <ian@cygnus.com>
+Tue Feb 10 15:16:38 1998 Nick Clifton <nickc@cygnus.com>
+ * elf32-v850.c (remember_hi16s_reloc): New function.
+ (find_remembered_hi16s_reloc): New function.
+ (v850_elf_store_addend_in_insn): Use the above new functions to
+ match up HI6S relocs with LO16 relocs.
- * bfd-in.h (struct bfd_link_needed_list): Rename from
- bfd_elf_link_needed_list.
- * bfd-in2.h: Rebuild.
- * elf.c, elflink.h, libelf.h: Corresponding changes.
+Tue Feb 10 15:01:39 1998 Ian Lance Taylor <ian@cygnus.com>
- Add start at AIX linker support; no shared libraries yet.
- * xcofflink.c: New file.
- * configure.in (rs600coff_vec): Use xcofflink.o.
+ * configure.in: Change -linux* to -linux-gnu*.
+ * config.bfd, configure.host: Likewise.
* configure: Rebuild.
- * libcoff-in.h (struct xcoff_tdata): Add csects and debug_indices
- fields.
- (struct xcoff_section_tdata): Define.
- (xcoff_section_data): Define macro.
- (_bfd_xcoff_bfd_link_hash_table_create): Declare.
- (_bfd_xcoff_bfd_link_add_symbols): Declare.
- (_bfd_xcoff_bfd_final_link): Declare.
- (_bfd_ppc_xcoff_relocate_section): Declare.
- * libcoff.h: Rebuild.
- * coff-rs6000.c: Clean up a bit.
- (xcoff_mkobject): Default modtype to 1L, not RE. Initialize
- cputype, csects, and debug_indices.
- (xcoff_copy_private_bfd_data): Copy cputype.
- (xcoff_howto_table): Rename from rs6000coff_howto_table.
- (xcoff_rtype2howto): Rename from rs6000coff_rtype2howto.
- (xcoff_reloc_type_lookup): Rename from
- rs6000coff_reloc_type_lookup.
- (coff_relocate_section): Define.
- (_bfd_xcoff_sizeof_headers): Define.
- (_bfd_xcoff_bfd_get_relocated_section_contents): Define.
- (_bfd_xcoff_bfd_relax_section): Define.
- (_bfd_xcoff_bfd_link_split_section): Define.
- (rs6000coff_vec): For BFD_JUMP_TABLE_LINK, use _bfd_xcoff, not
- coff.
- * coffcode.h (coff_compute_section_file_positions): If AIX,
- increment sofar by SMALL_AOUTSZ if not executable.
- (coff_write_object_contents): If AIX, always output an a.out
- header; if not executable, header size of SMALL_AOUTSZ.
- * hash.c (struct bfd_strtab_hash): Add xcoff field.
- (_bfd_stringtab_init): Initialize xcoff field.
- (_bfd_xcoff_stringtab_init): New function.
- (_bfd_stringtab_add): In XCOFF mode, leave two bytes for length.
- (_bfd_stringtab_emit): In XCOFF mode, write out length.
- * libbfd-in.h (_bfd_xcoff_stringtab_init): Declare.
- * libbfd.h: Rebuild.
- * Makefile.in: Rebuild dependencies.
- (BFD32_BACKENDS): Add xcofflink.o.
- (CFILES): Add xcofflink.c.
-
- * elf32-mips.c (mips_elf_symbol_processing): Set SEC_ALLOC, not
- SEC_NO_FLAGS, for .acommon section. From Peter Schauer
- <Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE>.
-
-Sat Oct 14 21:36:02 1995 Michael Meissner <meissner@tiktok.cygnus.com>
- * coff-ppc.c (in_reloc_p): Add, clone from coff-i386.c.
-
-Fri Oct 13 17:48:43 1995 Ken Raeburn <raeburn@cygnus.com>
-
- * acconfig.h (HAVE_SYS_PROCFS_H): Undef, with comment.
- * config.in: Regenerated.
-
- * opncls.c (getpagesize) [!HAVE_GETPAGESIZE]: Define as 2048.
- (_bfd_chunksize): New variable.
- (_bfd_new_bfd): Set it to getpagesize() if negative, and use it
- for obstack chunk size.
- * configure.in: Check for getpagesize.
- * configure: Regenerated.
-
- Mon Sep 25 22:49:32 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * trad-core.c (rawptr): Make it a local variable of
- ptrace_unix_core_file_p.
-
-Fri Oct 13 11:22:01 1995 steve chamberlain <sac@slash.cygnus.com>
-
- * coff-arm.c (in_reloc_p): New.
- * coff-i386.c (in_reloc_p): New.
- * coffcode.h: Allways include peicode.h if COFF_WITH_PE.
- (coff_write_object_contents): Only set has_reloc_section
- if PE_IMAGE.
- * cofflink.c (_bfd_coff_generic_relocate_section): Call
- in_reloc_p to decide if reloc should be emitted.
- * libcoff.h (pe_data_type.in_reloc_p): New.
- * peicode.h (pe_mkobject): Initialize in_reloc_p.
-
-Wed Oct 11 00:49:29 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * cofflink.c (_bfd_coff_internal_syment_name): Move to coffgen.c.
- (_bfd_coff_read_internal_relocs): Likewise.
- * coffgen.c (_bfd_coff_internal_syment_name): Copy from coffgen.c.
- (_bfd_coff_read_internal_relocs): Likewise.
+Mon Feb 9 19:40:59 1998 Nick Clifton <nickc@cygnus.com>
- * elflink.h (elf_link_add_object_symbols): Correct conditions
- under which type and size change warnings are issued.
+ * elf32-v850.c (v850_elf_store_addend_in_insn): Fix another
+ LO16/HI16S bug and improve comments about what is going on.
-Tue Oct 10 18:32:46 1995 Ian Lance Taylor <ian@cygnus.com>
+Sat Feb 7 15:27:03 1998 Ian Lance Taylor <ian@cygnus.com>
- * coffgen.c (coff_count_linenumbers): Don't count line numbers for
- a symbol which is not in a real section.
- (coff_write_native_symbol): Corresponding change.
+ * configure, aclocal.m4: Rebuild with new libtool.
- * cofflink.c (_bfd_coff_link_hash_newfunc): Rename from
- coff_link_hash_newfunc and make non-static.
- (_bfd_coff_link_hash_table_init): New function, broken out of
- _bfd_coff_link_hash_table_create.
- (_bfd_coff_link_hash_table_create): Use it.
- (process_embedded_commands): Make static.
- * libcoff-in.h ((_bfd_coff_link_hash_newfunc): Declare.
- (_bfd_coff_link_hash_table_init): Declare.
- * libcoff.h: Rebuild.
+Fri Feb 6 14:48:20 1998 Nick Clifton <nickc@cygnus.com>
- * coffcode.h (coff_mkobject_hook): If RS6000COFF_C, set cputype
- field in XCOFF tdata.
- (coff_set_arch_mach_hook): Check ifdef RS6000COFF_C, not ifdef
- U802ROMAGIC, for clarity. Try to set arch and machine correctly
- based on cputype stored in a.out header, or in n_type of initial
- .file symbol.
- (coff_write_object_contents): Set cputype correctly in a.out
- header.
- (coff_slurp_symbol_table): Add casts to file_ptr to avoid
- warnings.
- * coffswap.h (coff_swap_aouthdr_in): Swap in cputype field.
- (coff_swap_aouthdr_out): Swap out cputype field. Don't clear
- old resv1 field.
- * libcoff-in.h (struct xcoff_tdata): Add cputype field.
- * libcoff.h: Rebuild.
+ * elf32-v850.c (v850_elf_merge_private_bfd_data): Do not complain
+ when merging v850 code into v850e/v850ea code. Do not initialise
+ output flags if the input is the default architecture.
- * cpu-rs6000.c (rs6000_compatible): New static function.
- (bfd_rs6000_arch): Use it.
- * cpu-powerpc.c (powerpc_compatible): New static function.
- (arch_info_struct): Define various flavours of PowerPC.
- (bfd_powerpc_arch): Use powerpc_compatible. Point at
- arch_info_struct.
+Fri Feb 6 11:50:22 1998 Jeffrey A Law (law@cygnus.com)
-Tue Oct 10 10:50:46 1995 Fred Fish <fnf@cygnus.com>
+ * elf32-mips.c (bfd_elf32_bfd_reloc_type_lookup): For BFD_RELOC_CTOR
+ get the size from bfd_arch_bits_per_address instead of directly
+ from the isa.
- * Makefile.in (FLAGS_TO_PASS): Remove BISON.
+Thu Feb 5 14:21:34 1998 Michael Meissner <meissner@cygnus.com>
-Tue Oct 10 01:28:29 1995 Ian Lance Taylor <ian@cygnus.com>
+ * libbfd-in.h (BFD_ALIGN): If rounding up would cause the address
+ to wrap, just return all 1's bits instead.
+ * libbfd.h: Regenerate.
- * elflink.h (elf_link_add_object_symbols): Don't warn about
- changing the size or type if the old definition was weak.
+Thu Feb 5 11:51:05 1998 Ian Lance Taylor <ian@cygnus.com>
-Mon Oct 9 11:24:08 1995 Ian Lance Taylor <ian@cygnus.com>
+ * coff-i386.c (coff_pe_i386_relocate_section): New static function
+ if COFF_WITH_PE.
+ (coff_relocate_section): If COFF_WITH_PE, define as
+ coff_pe_i386_relocate_section.
+ * coffcode.h (coff_write_object_contents): If COFF_IMAGE_WITH_PE,
+ skip empty sections, to match coff_write_object_contents.
- * coffcode.h (combined_entry_type): Add fix_line field.
- (coff_slurp_line_table): Warn if we try to set the lineno field of
- a symbol twice.
- (coff_slurp_symbol_table): If RS6000COFF_C, handle C_BINCL and
- C_EINCL by setting fix_line. Fix C_BSTAT symbol value.
- * coffgen.c (coff_mangle_symbols): Handle fix_line.
- (coff_write_symbol): Only use N_DEBUG if the symbol is in the
- absolute section.
- (coff_print_symbol): Print fix_value symbols in a useful fashion.
- * libcoff.h: Rebuild.
+ * elf64-mips.c (mips_elf64_swap_reloca_out): Swap out r_addend,
+ rather than swapping out r_offset twice. From Luke Deller
+ <luked@cse.unsw.edu.au>.
- * libcoff-in.h (struct xcoff_tdata): Define.
- (xcoff_data): Define.
- * bfd.c (struct _bfd): Add xcoff_obj_data field to tdata union.
- * bfd-in2.h, libcoff.h: Rebuild.
- * coff-rs6000.c (xcoff_mkobject): New static function.
- (coff_mkobject): Define.
- (xcoff_copy_private_bfd_data): New static function.
- (coff_bfd_copy_private_bfd_data): Define.
- (rs6000coff_howto_table): Change R_TOC complain_on_overflow from
- signed to bitfield.
- (rs6000coff_vec): Add DYNAMIC to object_flags.
- * coffcode.h (sec_to_styp_flags): If RS6000COFF_C, handle .pad and
- .loader sections specially.
- (coff_new_section_hook): If RS6000COFF_C, get the .text and .data
- section alignment from the XCOFF tdata information.
- (coff_mkobject_hook): If RS6000COFF_C, set DYNAMIC based on
- F_SHROBJ, and copy the extra a.out header information into the
- XCOFF tdata structure.
- (coff_write_object_contents): If RS6000COFF_C, set F_SHROBJ,
- F_DYNLOAD and the extra a.out header information.
- (coff_slurp_symbol_table): Set BSF_NOT_AT_END for a C_EXT or
- C_HIDEXT symbol with attached csect information.
- * coffswap.h (coff_swap_aouthdr_in): If RS6000COFF_C, swap
- in the o_maxdata field.
- (coff_swap_aouthdr_out): If RS6000COFF_C, swap extra XCOFF fields.
- * coffgen.c (coff_renumber_symbols): Don't move any symbol to the
- end if BSF_NOT_AT_END is set.
-
- * targets.c (bfd_target): Rename _bfd_read_ar_hdr field to
- _bfd_read_ar_hdr_fn.
- * libbfd-in.h (_bfd_read_ar_hdr): Update accordingly.
- * bfd-in2.h, libbfd.h: Rebuild.
- * archive.c (_bfd_get_elt_at_filepos): Cast _bfd_read_ar_hdr
- return value.
- (do_slurp_bsd_armap, do_slurp_coff_armap): Likewise.
- (bfd_slurp_bsd_armap_f2): Likewise.
- (_bfd_slurp_extended_name_table): Likewise.
-
-Fri Oct 6 16:18:35 1995 Ken Raeburn <raeburn@cygnus.com>
-
- Mon Sep 25 22:49:32 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * archive.c (bfd_get_next_mapent): Return BFD_NO_MORE_SYMBOLS
- when the symbol table is empty.
-
- * elf32-m68k.c (elf_m68k_size_dynamic_sections): Don't reserve
- space for section symbols, since we don't output them either.
- (elf_m68k_adjust_dynindx): Removed.
-
- * ptrace-core.c (rawptr): Make it a local variable of
- ptrace_unix_core_file_p.
-
-Fri Oct 6 12:24:47 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * coff-rs6000.c (xcoff_write_archive_contents): Return false, not
- NULL.
-
- * config.bfd (powerpc{,le}-{elf,sysv4,eabi,solaris2}): Add NT, and
- Mac object file formats.
-
-Fri Oct 6 12:04:02 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * coffgen.c (coff_fix_symbol_name): Don't try to set up file
- auxent if there isn't one.
- (coff_write_symbols): If there is no file auxent, use SYMNMLEN
- rather than FILNMLEN as the maximum name length.
-
- * coffcode.h (bfd_coff_backend_data): Add new field
- _bfd_coff_print_aux.
- (bfd_coff_print_aux): New static function.
- (coff_pointerize_aux_hook (RS6000COFF_C version)): Pointerize the
- scnlen field of an XTY_LD csect aux entry.
- (coff_print_aux): New static function.
- (coff_slurp_symbol_table): Don't pointerize scnlen field; now done
- in coff_pointerize_aux_hook.
- (bfd_coff_std_swap_table): Initialize new field.
- * coffgen.c (coff_print_symbol): Call bfd_coff_print_aux.
- * libcoff.h: Rebuild.
- * coff-alpha.c (alpha_ecoff_backend_data): Initialize new field.
- * coff-mips.c (mips_ecoff_backend_data): Likewise.
+Wed Feb 4 19:11:28 1998 Ian Lance Taylor <ian@cygnus.com>
- * coffcode.h (coff_write_object_contents): On AIX, clear F_RELFLG
- if there are symbols, for native AIX ld compatibility.
+ * configure.in: Set libtool_enable_shared rather than
+ libtool_shared. Remove diversion hack.
+ * configure, Makefile.in, doc/Makefile.in, aclocal.m4: Rebuild
+ with new libtool.
- * coffcode.h (bfd_coff_backend_data): Add new field
- _bfd_coff_pointerize_aux_hook.
- (coff_pointerize_aux_hook): Define as a function if RS6000COFF_C
- or I960, and as 0 otherwise.
- (bfd_coff_std_swap_table): Initialize new field.
- * libcoff.h: Rebuild.
- * coffgen.c (coff_pointerize_aux): Change parameters to take
- symbol pointer instead of type and class, and to take aux index.
- Call _bfd_coff_pointerize_aux_hook if it is defined.
- (coff_get_normalized_symtab): Always call coff_pointerize_aux.
- * coff-alpha.c (alpha_ecoff_backend_data): Initialize all fields.
- * coff-mips.c (mips_ecoff_backend_data): Likewise.
+Wed Feb 4 16:10:21 1998 Brent Baccala <baccala@freesoft.org>
- * coff-rs6000.c: Add full support for AIX archives. Rewrite old
- read-only/host-only support.
-
- * coffcode.h (coff_slurp_symbol_table): Set C_HIDEXT symbols to be
- BSF_LOCAL.
- (OTHER_GLOBAL_CLASS): Do not define to be C_HIDEXT if
- RS6000COFF_C.
-
- * targets.c (bfd_target): Add _bfd_read_ar_hdr field. Modify
- BFD_JUMP_TABLE_ARCHIVE accordingly.
- * libbfd-in.h (_bfd_snarf_ar_hdr): Don't declare.
- (_bfd_compute_and_write_armap): Declare.
- (_bfd_generic_read_ar_hdr): Declare.
- (_bfd_read_ar_hdr): Define.
- (_bfd_noarchive_read_ar_hdr): Define.
- (_bfd_archive_bsd_read_ar_hdr): Define.
- (_bfd_archive_coff_read_ar_hdr): Define.
- * archive.c: Change all callers of _bfd_snarf_ar_hdr to call
- _bfd_read_ar_hdr instead.
- (_bfd_generic_read_ar_hdr): Rename from _bfd_snarf_ar_hdr.
- (_bfd_compute_and_write_armap): Rename from
- compute_and_write_armap. Make non-static. Change all callers.
- * ecoff.c (_bfd_ecoff_slurp_armap): Call _bfd_read_ar_hdr rather
- than _bfd_snarf_ar_hdr.
- * aout-target.h (MY_read_ar_hdr): Define if not defined.
- * ieee.c (ieee_read_ar_hdr): Define.
- * libecoff.h (_bfd_ecoff_read_ar_hdr): Define.
- * oasys.c (oasys_read_ar_hdr): Define.
- * som.c (som_read_ar_hdr): Define.
- * bfd-in2.h, libbfd.h: Rebuild.
-
-Thu Oct 5 14:04:07 1995 steve chamberlain <sac@slash.cygnus.com>
-
- * peicode.c (coff_swap_filehdr_in): If symptr is
- zero, there aren't any symbols, even if nsyms is set.
-
-Thu Oct 5 11:45:02 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * libecoff.h (struct ecoff_backend_data): Add adjust_headers
- field.
- * ecoff.c (ecoff_sec_to_styp_flags): Check for various Alpha
- sections, and set styp correctly for them: .got, .hash, .dynamic,
- .liblist, .rel.dyn, .conflic, .dynstr, .dynsym, .comment.
- (_bfd_ecoff_styp_to_sec_flags): Check for various Alpha section
- types.
- (ecoff_sort_hdrs): New static function.
- (ecoff_compute_section_file_positions): Return boolean, not void.
- Sort the sections by VMA before looking through them. Put the
- first non SEC_ALLOC section on a new page. Put every SEC_ALLOC
- section on an appropriate boundary within the page.
- (ecoff_compute_reloc_file_positions): Check return value of
- ecoff_compute_section_file_positions.
- (_bfd_ecoff_set_section_contents): Likewise.
- (_bfd_ecoff_write_object_contents): Check for various Alpha
- section types when incrementing text_size and data_size. Call
- adjust_headers backend function if it exists.
- * coff-alpha.c (alpha_adjust_headers): New static function.
- (alpha_ecoff_backend_data): Initialize adjust_headers field.
- * coff-mips.c (mips_ecoff_backend_data): Likewise.
+ * syms.c (struct stab_cache): Define.
+ (struct stab_find_info): Remove cached_offset, cached_stab,
+ cached_str, and cached_stroff fields. Add file_cache,
+ function_cache, and line_cache fields.
+ (_bfd_stab_section_find_nearest_line): Use extensive caching to
+ speed up searches.
- * hosts/i386bsd.h: Restore file incorrectly deleted on Sep 6.
+Wed Feb 4 13:34:22 1998 Ian Lance Taylor <ian@cygnus.com>
-Wed Oct 4 18:15:02 1995 Jeff Law (law@hurl.cygnus.com)
+ * peicode.h (pe_print_idata): Check for import of ordinal rather
+ than name.
+ (pe_print_edata): If there is no .edata section, look for the
+ export data in some other section.
- * rs6000-core.c (CORE_VERSION_1): Use CORE_VERSION_1 instead
- of ALTERNATE_AIX_CORE_FORMAT.
- * configure.in (aix4): No longer need CORE_FLAGS.
- * configure: Updated.
+Mon Feb 2 20:05:42 1998 Jason Molenda (crash@bugshack.cygnus.com)
-Wed Oct 4 15:36:36 1995 Ken Raeburn <raeburn@cygnus.com>
+ * configure.in: Change version to 2.8.4.
+ * configure: Regenerated.
- NS32k changes from Ian Dall:
- * aoutx.h (MY_final_link_relocate, MY_relocate_contents): New
- macros.
- (aout_link_input_section_std, aout_link_input_section_ext,
- aout_link_reloc_link_order): Call them instead of _bfd_*
- versions.
- * aout-target.h (MY_exec_header_not_counted): New macro, defaults
- to zero.
- (backend_data): Use it instead of hardcoded zero.
+Mon Feb 2 17:39:39 1998 Steve Haworth <steve@pm.cse.rmit.EDU.AU>
- * aout-ns32k.c (CTOR_TABLE_RELOC_HOWTO): New macro.
- (MY_swap_std_reloc_out): Use udata.i for KEEPIT, don't call stoi.
+ Add tms320c30 support:
+ * cpu-tic30.c: New file.
+ * aout-tic30.c: New file.
+ * coff-tic30.c: New file.
+ * archures.c (bfd_arch_tic30): Define.
+ (bfd_tic30_arch): Declare.
+ (bfd_archures_list): Add bfd_tic30_arch.
+ * targets.c (bfd_target_vector): Add tic30_aout_vec and
+ tic30_coff_vec.
+ * reloc.c (BFD_RELOC_TIC30_LDP): Define.
+ * coffcode.h (coff_set_arch_mach_hook): Add tic30 case.
+ (coff_set_flags): Likewise.
+ * config.bfd (tic30-*-*aout*, tic30-*-*coff*): New targets.
+ * configure.in (tic30_aout_vec, tic30_coff_vec): New vectors.
+ * Makefile.am: Rebuild dependencies.
+ (ALL_MACHINES): Add cpu-tic30.lo.
+ (ALL_MACHINES_CFILES): Add cpu-tic30.c.
+ (BFD32_BACKENDS): Add aout-tic30.lo and coff-tic30.lo.
+ (BFD32_BACKENDS_CFILES): Add aout-tic30.c and coff-tic30.c.
+ * configure, Makefile.in, bfd-in2.h, libbfd.h: Rebuild.
- * ns32knetbsd.c: Include bfd.h.
- (MY_text_includes_header, MY_bfd_reloc_type_lookup): New macros.
- (MY_bfd_reloc_type_lookup): Declare function too.
- * pc532-mach.c (set_sizes): Don't declare.
- (MY_text_includes_header, MY_exec_header_not_counted): Define.
- (backend_data, MY_backend_data): Don't define.
+Mon Feb 2 12:25:12 1998 Nick Clifton <nickc@cygnus.com>
- * config.bfd: Treat ns32k-pc532-ux* like ns32k-pc532-mach*, and
- ns32k-*-lites* like ns32k-*-netbsd*.
+ * elf32-v850.c (v850_elf_store_addend_in_insn): Allow HI16_S reloc
+ to lag behind LO16 reloc by a couple of instructions.
- * hosts/nbsd.h: Swap order of sys/vmparam.h and sys/param.h, to
- compile on lites.
+Mon Feb 2 14:09:46 1998 Ian Lance Taylor <ian@cygnus.com>
-Wed Oct 4 14:15:52 1995 Ian Lance Taylor <ian@cygnus.com>
+ * Makefile.am ($(srcdir)/bfd-in2.h): Add dummy command to force
+ make to reexamine the file timestamp.
+ ($(srcdir)/libbfd.h, $(srcddir)/libcoff.h): Likewise.
- * coffcode.h (coff_write_object_contents): Restore setting
- f_timdat to 0, deleted on August 22.
+ * elf64-alpha.c (ELF_MAXPAGESIZE): Change to 0x10000 from
+ 0x100000.
-Tue Oct 3 16:28:32 1995 steve chamberlain <sac@slash.cygnus.com>
+Fri Jan 30 19:07:07 1998 Geoff Keating <geoffk@ozemail.com.au>
- * coffcode.h (coff_bfd_copy_private_symbol_data,
- coff_bfd_copy_private_section_data,
- coff_bfd_copy_private_bfd_data): ifdef to allow overrides.
- * peicode.h (coff_bfd_copy_private_bfd_data): New
- (pe_bfd_copy_private_bfd_data): New.
- (coff_swap_scnhdr_in): Swap bss size into the right place.
- (pe_print_private_bfd_data): Add some newlines.
+ * elf32-ppc.c (ppc_elf_create_dynamic_sections): New procedure
+ to create .dynsbss and .rela.sbss sections.
+ (ppc_elf_adjust_dynamic_symbol): Put space for small data to be
+ copied from dynamic objects into .sbss.
+ (ppc_elf_size_dynamic_sections): Strip .rela.sbss if we don't
+ use it. Correct typo of .rela.sdata2.
+ (ppc_elf_finish_dynamic_symbol): Generate reloc to where we
+ put the data, which may now be in .sbss.
+ (ppc_elf_relocate_section): A SDAREL16 reloc can be in dynsbss.
+ (elf_backend_create_dynamic_sections): Define as
+ ppc_elf_create_dynamic_sections.
-Tue Oct 3 11:53:04 1995 Jeff Law (law@hurl.cygnus.com)
+ * elf32-ppc.c (ppc_elf_check_relocs): Don't emit R_PPC_REL* relocs
+ against _GLOBAL_OFFSET_TABLE_.
+ (ppc_elf_relocate_section): Don't emit R_PPC_REL32 relocs in
+ shared libraries which refer to local symbols. Make sure that the
+ test for allocating space for a reloc in a shared object is the
+ same as the test for emitting a reloc.
- * som.c (setup_sections): Don't die if a space has no subspaces.
+Thu Jan 29 15:55:35 1998 J.J. van der Heijden <J.J.vanderHeijden@student.utwente.nl>
-Mon Oct 2 14:08:55 1995 Ian Lance Taylor <ian@cygnus.com>
+ * config.bfd (i[3456]-*-mingw32*): New target.
+ * acinclude.m4 (BFD_BINARY_OPEN): Check for mingw32.
+ * aclocal.m4, configure: Rebuild.
- * elflink.h (elf_link_add_object_symbols): Don't let a weak
- dynamic symbol override a common symbol. Don't change the size or
- type if they have been set and the new symbol is not a definition.
- Warn if the size or type changes.
+Wed Jan 28 13:41:26 1998 Ian Lance Taylor <ian@cygnus.com>
-Sun Oct 1 01:34:41 1995 Jeff Law (law@hurl.cygnus.com)
+ * elf.c (_bfd_elf_close_and_cleanup): Only check the strtab if we
+ have a bfd_object.
- * som.c (som_begin_writing): Don't write the symbol table or
- symbol strings.
- (som_finish_writing): Write them here. Place them after the
- subspace data, but before the relocs.
+Tue Jan 27 21:43:55 1998 Richard Henderson <rth@cygnus.com>
-Fri Sep 29 11:01:55 1995 Ian Lance Taylor <ian@cygnus.com>
+ Sparc v9 ABI compliant PLT:
+ * elf64-sparc.c (PLT_HEADER_SIZE): V9 ABI uses 4 entries.
+ (plt_templates, sparc64_elf_build_plt_entry): Delete.
+ (LARGE_PLT_THRESHOLD): New define.
+ (GOT_RESERVED_ENTRIES): V9 ABI only uses 1.
+ (sparc64_elf_build_plt): New function.
+ (sparc64_elf_plt_entry_offset): Likewise.
+ (sparc64_elf_plt_ptr_offset): Likewise.
+ (sparc64_elf_adjust_dynamic_symbol): Change h->plt_offset to
+ contain the index for convenience. Skip the initial entries
+ in .rela.plt.
+ (sparc64_elf_size_dynamic_sections): Zero the allocated contents
+ memory for the benefit of .rela.plt.
+ (sparc64_elf_relocate_section): Call sparc64_elf_plt_entry_offset.
+ (sparc64_elf_finish_dynamic_symbol): Kill template stuff. Use
+ sparc64_elf_plt_entry_offset & sparc64_elf_plt_ptr_offset for reloc.
+ (sparc64_elf_finish_dynamic_sections): DT_PLTGOT points to .plt.
+ Call sparc64_elf_build_plt.
+ (elf_backend_want_got_plt): No.
+ (elf_backend_plt_readonly): No.
+ (elf_backend_plt_alignment): 8.
- * sunos.c (sunos_add_one_symbol): Just pass false, not
- info->shared_library, to sunos_create_dynamic_sections.
- (sunos_scan_ext_relocs): Don't warn about a reloc in the .text
- section.
- (sunos_check_dynamic_reloc): Remove .text section assertion.
-
-Thu Sep 28 18:48:47 1995 Stan Shebs <shebs@andros.cygnus.com>
-
- * config.bfd: Add powerpc-*-macos*, powerpc-*-mpw*.
- * configure, configure.in: Add pmac_xcoff_vec case.
- * Makefile.in (BFD32_BACKENDS): Add coff-pmac.o.
- * coff-pmac.c: New file, PowerMac XCOFF support.
- * coffcode.h (coff_set_arch_mach_hook): Add PowerMac case.
- * targets.c (pmac_xcoff_vec): Declare.
-
- * mpw-config.in: Various changes to be compatible with the
- autoconf-based configury.
- * mpw-make.sed: New file, sed commands to translate Unix
- makefile into MPW syntax.
- * mpw-make.in: Remove.
- * hosts/mpw.h: Remove.
- * bfd-in.h, bfd-in2.h: If MPW, include the file that defines
- true and false as enums, then define TRUE_FALSE_ALREADY_DEFINED.
-
-Thu Sep 28 17:06:23 1995 steve chamberlain <sac@slash.cygnus.com>
-
- * binary.c (binary_get_symtab): Return an empty string on error.
- * opncls.c (bfd_fdpenr): Change WIN32 restriction to WINGDB.
-
-Thu Sep 28 15:30:44 1995 Kim Knuttila <krk@nellie>
-
- * coff-ppc.c: Reformatted according to gnu conventions
- Removed irrelevant "if 0" code
-
-Thu Sep 28 11:19:53 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * hp300hpux.c (convert_sym_type): Treat secondary symbols as weak
- symbols rather than as indirect symbols.
- (MY(slurp_symbol_table)): Don't do anything special about
- secondary symbols.
-
- * coffcode.h (coff_new_section_hook): Make sure that the alignment
- of .ctors and .dtors sections is no larger than 2.
-
- * sunos.c (sunos_add_one_symbol): Don't change
- bfd_link_hash_common to bfd_link_hash_new, since it may be on the
- undef list.
- (bfd_sunos_record_link_assignment): Don't put __DYNAMIC in the
- dynamic symbols when creating a shared library.
- (sunos_scan_ext_relocs): Handle relocs correctly when creating a
- shared library.
- (sunos_scan_dynamic_symbol): Don't mark the __DYNAMIC symbol as
- written even if it is not defined in a regular object.
- (sunos_write_dynamic_symbol): Use plt_offset for the address of
- the jump table reloc. Add an assertion. Use RELOC_JMP_SLOT
- rather than the constant 22.
- (sunos_check_dynamic_reloc): Handle creating a shared library.
- (sunos_finish_dynamic_link): Set the first entry in the GOT to
- zero when creating a shared library.
- * aoutx.h (NAME(aout,final_link)): If there is a symbol __DYNAMIC,
- write it out at the start of the symbol table.
-
- * Makefile.in (BFD32_BACKENDS): Add coff-arm.o.
-
-Thu Sep 28 00:58:05 1995 Doug Evans <dje@deneb.cygnus.com>
-
- * config.bfd: Add arm-*-coff.
- * configure.in, configure: Add armcoff_{little,big}_vec.
- * targets.c (armcoff_{little,big}_vec): Declare.
- (bfd_target_vector): Add armcoff_{little,big}_vec.
- * coff-arm.c (armcoff_{little,big}_vec): Always define.
-
-Wed Sep 27 10:37:14 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * targets.c (bfd_find_target): Remove debugging code.
-
-Wed Sep 27 07:23:39 1995 Kim Knuttila <krk@nellie>
-
- * coff-ppc.c, pe-ppc.c, pei-ppc.c: Initial bfd for coff/PE
- support on powerpc.
- * Makefile.in: added *-ppc files
- * coffcode.h: ppc MAGIC, and use peicode.h rather than coffswap.h to
- allow pe based .o's to be shared with other tools on ppc/NT
- * config.bfd: added powerpc[le]-[pe|winnt] config support
- * configure, configure.in: added bfd_powerpc[le]_pe[i]_vec
- * peicode.h: Added more section flags for PE on ppc
- Added coff_swap_filehdr_out to allow peicode.h to be
- used for non-image PE files on ppc.
- Check for image, or not, before copying pe_opthdr
- * targets.c: Added new bfd's
- * targets.c: Removed two inactive bfds that shouldn't have made it this
- far.
-
-Tue Sep 26 14:06:41 1995 Michael Meissner <meissner@tiktok.cygnus.com>
-
- * elf32-ppc.c (ppc_reloc_type): Rename from reloc_type, and use
- explicit values to initialize all relocs. Change all users.
- (ppc_elf_brtaken_inner): New function to handle branch predicition
- relocs.
- (ppc_elf_brtaken_reloc): Ditto.
- (ppc_elf_howto_raw): Use new functions. Make sure all unsupported
- relocs use ppc_elf_unsupported_reloc.
- (ppc_elf_merge_private_bfd_data): Keep track of whether an error
- needs to be reported.
- (ppc_elf_relocate_section): Support branch prediction relocs.
-
-Tue Sep 26 12:48:05 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * bfd.c (bfd_assert): Remove \n from string passed to
- _bfd_error_handler.
-
- * coff-i386.c: (TWO_DATA_SECS): Don't define.
- * coffcode.h (bfd_coff_backend_data): Remove _bfd_make_section_hook.
- (bfd_coff_make_section_hook): Don't define.
- (coff_make_section_hook): Remove.
- (sec_to_styp_flags): Remove TWO_DATA_SECS case.
- (styp_to_sec_flags): Likewise.
- (coff_write_object_contents): Likewise.
- (bfd_coff_std_swap_table): Don't initialize make_section_hook
- field.
- * libcoff.h: Rebuild.
- * coffgen.c (make_a_section_from_file): Just call
- bfd_make_section_anyway, not bfd_make_section or
- bfd_coff_make_section_hook.
- * ecoff.c (_bfd_ecoff_make_section_hook): Remove.
- * libecoff.h (_bfd_ecoff_make_section_hook): Don't declare.
- * coff-alpha.c (alpha_ecoff_backend_data): Don't initialize
- make_section_hook field.
- * coff-mips.c (mips_ecoff_backend_data): Likewise.
+ * elf.c (_bfd_elf_close_and_cleanup): New function; free the shstrtab.
+ * elf-bfd.h (_bfd_elf_close_and_cleanup): Declare it.
+ * elfxx-target.h (bfd_elfNN_close_and_cleanup): Arrange for it
+ to be called.
- * aoutx.h (translate_from_native_sym_flags): Don't try to stuff
- pointers into value field for warning and indirect symbols; just
- leave the value field alone.
- * linker.c (generic_link_add_symbol_list): Use next symbol for
- warning and indirect symbols, rather than looking in symbol value.
- * ecoff.c (ecoff_set_symbol_info): Remove indirect_ptr_ptr
- parameter. Change all callers. Remove support for indirect
- symbols; it didn't work anyhow.
- (_bfd_ecoff_slurp_symbol_table): Remove indirect_ptr variable.
- * syms.c: Change comments about BSF_WARNING and BSF_INDIRECT.
- * bfd-in2.h: Rebuild.
+Tue Jan 27 21:45:15 1998 Jeffrey A Law (law@cygnus.com)
-Mon Sep 25 16:04:09 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+ * archures.c (bfd_mach_mips*): Add definitions for various MIPS
+ processors.
+ * cpu-mips.c (arch_info_struct): Add mips variants.
+ * bfd-in2.h: Rebuilt.
- * elf32-ppc.c (ppc_elf_howto_raw): For all 14-bit branch relocs,
- go back to telling the tools this reloc operates on 32 bits.
+Tue Jan 27 15:06:04 1998 Nick Clifton <nickc@cygnus.com>
-Mon Sep 25 11:48:02 1995 Ian Lance Taylor <ian@cygnus.com>
+ * coff-arm.c (coff_arm_relocate_section): Preserve the contents of
+ t2a3_b_insn.
- * aout-adobe.c (aout_adobe_callback): Use _bfd_error_handler
- rather than a direct fprintf.
- * archive.c (_bfd_write_archive_contents): Likewise.
- * coffcode.h (coff_slurp_symbol_table): Likewise.
- * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Likewise.
- (ppc_elf_unsupported_reloc): Likewise.
- (ppc_elf_relocate_section): Likewise.
- * i386linux.c (linux_tally_symbols): Likewise.
- (linux_finish_dynamic_link): Likewise.
- * osf-core.c (osf_core_core_file_p): Likewise.
- * rs6000-core.c (rs6000coff_get_section_contents): Likewise.
- * som.c (som_sizeof_headers): Likewise.
- * srec.c (srec_bad_byte): Likewise.
- * bfd.c (bfd_assert): Likewise. Also change file to be const.
- * libbfd-in.h (bfd_assert): Declare first parameter const.
- * libbfd.h: Rebuild.
- * coff-a29k.c (a29k_reloc): Don't bother to fprintf; returning
- bfd_reloc_overflow is enough.
- * coff-h8300.c (rtype2howto): Don't bother to fprintf; just abort.
- * coff-h8500.c (rtype2howto): Likewise.
- * coff-z8k.c (rtype2howto): Likewise.
- * coffcode.h (dummy_reloc16_extra_cases): Likewise.
- * elf.c (_bfd_elf_get_lineno): Likewise.
- (_bfd_elf_no_info_to_howto): Likewise.
- (_bfd_elf_no_info_to_howto_rel): Likewise.
- * hp300hpux.c (convert_sym_type): Likewise.
- (MY(swap_std_reloc_in)): Likewise.
- * elf.c (bfd_section_from_shdr): Remove #if 0 sections.
-
- * libaout.h (struct aoutdata): Add line_buf field.
- * aoutx.h (NAME(aout,find_nearest_line)): Remove statics buffer
- and filename_buffer. Instead, use a malloc buffer stored in the
- new line_buf field. Remove length restrictions.
-
- * coffgen.c (string_size): Remove static variable.
- (debug_string_size, debug_string_section): Likewise.
- (coff_fix_symbol_name): Add string_size_p, debug_string_section_p,
- and debug_string_size_p parameters. Use them instead of the
- global variables. Change all callers.
- (coff_write_symbol): Likewise.
- (coff_write_alien_symbol, coff_write_native_symbol): Likewise.
- (coff_write_symbols): Add local variables to replace removed
- global variables.
-
- * libcoff-in.h (struct coff_section_tdata): Add offset, i,
- function, and line_base fields.
- * libcoff.h: Rebuild.
- * coffgen.c (coff_find_nearest_line): Use section tdata to cache
- information, rather than using static variables.
+Tue Jan 27 12:47:27 1998 Robert Lipe <robertl@dgii.com>
- * sunos.c (sunos_read_dynamic_info): Adjust offsets in an NMAGIC
- file. From Peter DeWolf <pld@amt.tay1.dec.com>.
+ * config.bfd (i[3456]86-sco3.2v5*): ELF now the default.
+ (i[3456]86sco3.2v5*coff): New target.
- * init.c (initialized): Remove static variable.
- (bfd_init): Don't bother setting initialized.
- (bfd_check_init): Remove.
- * opncls.c (_bfd_new_bfd): Don't call bfd_check_init.
- * libbfd.h: Rebuild.
+Mon Jan 26 15:41:30 1998 Ian Lance Taylor <ian@cygnus.com>
-Sat Sep 23 01:22:23 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
-
- * rs6000-core.c (rs6000coff_core_p): Don't check the core file
- size for full core dumps. Copy core file header to private data.
- (rs6000coff_core_file_failing_command,
- rs6000coff_core_file_failing_signal): New functions to extract
- the file name and terminating signal from the core file.
- * coff-rs6000.c: Use them.
-
-Fri Sep 22 17:44:47 1995 Ian Lance Taylor <ian@cygnus.com>
-
- Change arch info to be const, initialized at compile time.
- * archures.c: Reindent many functions. Change CONST to const.
- (bfd_arch_info_type): Make arch_name const. Remove disassemble;
- nothing set it anyhow. Make next const.
- (bfd_arch_info_list): Remove.
- (bfd_archures_list): Rename from archures_init_table. Change from
- a table of function pointers to a table of bfd_arch_info_type
- structure addresses.
- (bfd_scan_arch): Rewrite accordingly. Return a const pointer.
- (bfd_lookup_arch): Likewise.
- (bfd_set_arch_info): Rewrite accordingly. Change argument to be a
- const pointer.
- (bfd_default_arch_struct): Make const.
- (bfd_arch_init, bfd_arch_linkin): Remove.
- (bfd_get_arch_info): Return a const pointer.
- * init.c (bfd_init): Don't call bfd_arch_init.
- * bfd.c (struct _bfd): Make arch_info const.
- * bfd-in2.h: Rebuild.
- * libbfd.h: Rebuild.
- * configure.in: Put & before everything in $selarchs.
- * configure: Rebuild.
- * cpu-*.c: Change bfd_*_arch from a function which calls
- bfd_arch_linkin to a const structure.
- * ieee.c (ieee_object_p): Make arch const.
+ * bfd-in2.h: Rebuild with changes to chew--tab expansion.
-Fri Sep 22 16:23:18 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+Thu Jan 22 21:26:48 1998 Richard Henderson <rth@cygnus.com>
- * reloc.c (bfd_reloc_code_type): Add relocations to support all of
- PowerPC V.4.
+ * bfd.c (bfd_get_error_handler): Add orthogonal function.
* bfd-in2.h: Regenerate.
- * libbfd.h: Regenerate.
-
- * elf32-ppc.c (reloc_type): Update names to match current draft.
- (ppc_elf_howto_raw): Mark 14 bit relocs as short sized and PC
- relative. Update names to current V.4 draft.
- (ppc_elf_reloc_type_lookup): Add support for more relocations.
- (ppc_elf_relocate_section): Rename relocations to match draft.
-
-Thu Sep 21 21:53:18 1995 Michael Meissner <meissner@cygnus.com>
-
- * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Allow modules
- compiled with -mrelocatable-lib to be linked with either normal
- modules or -mrelocatable modules.
-
-Wed Sep 20 12:03:26 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * coffcode.h (coff_write_object_contents): Clear the vstamp field
- in the a.out header.
-
- * aoutx.h (NAME(aout,swap_ext_reloc_out)): Don't set r_extern for
- a reloc against a local symbol, even if it's not a section.
-
-Tue Sep 19 17:02:26 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * targets.c (bfd_target): Remove unused align_power_min field.
- * bfd-in2.h: Rebuild.
- * All backends: Remove initialization of align_power_min.
-
-Tue Sep 19 14:02:21 1995 steve chamberlain <sac@slash.cygnus.com>
-
- * peicode.h (coff_swap_scnhdr_out): Get sizes for BSS right.
-
-Mon Sep 18 14:35:01 1995 Arne H. Juul <arnej@pvv.unit.no>
- * config.bfd (mips-dec-netbsd*): New target.
- * configure.host (mips-dec-netbsd*): New host.
- * configure.in (mips-dec-netbsd*): New native.
- * configure: Rebuild.
-
-Fri Sep 15 10:24:36 1995 Ian Lance Taylor <ian@cygnus.com>
-
- Make the COFF backend linker merge common types:
- * cofflink.c (struct coff_debug_merge_element): Define.
- (struct coff_debug_merge_type): Define.
- (struct coff_debug_merge_hash_entry): Define.
- (struct coff_debug_merge_hash_table): Define.
- (coff_debug_merge_hash_table_init): Define.
- (coff_debug_merge_hash_table_free): Define.
- (coff_debug_merge_hash_lookup): Define.
- (struct coff_final_link_info): Add debug_merge field.
- (coff_debug_merge_hash_newfunc): New static function.
- (_bfd_coff_final_link): Allocate and free debug_merge table.
- (coff_link_input_bfd): Merge identical enum, struct and union
- types.
-
-Thu Sep 14 14:53:58 1995 Ian Lance Taylor <ian@cygnus.com>
-
- Convert i960 COFF to use COFF backend linker.
- * coff-i960.c (coff_i960_relocate): Use a coff_section_data
- structure to store the symbol being used.
- (coff_i960_start_final_link): New static function.
- (coff_i960_relocate_section): New static function.
- (coff_i960_adjust_symndx): New static function.
- (coff_start_final_link): Define.
- (coff_relocate_section): Define.
- (coff_adjust_symndx): Define.
- * coffcode.h (bfd_coff_backend_data): Add new callback function
- _bfd_coff_start_final_link.
- (bfd_coff_start_final_link): Define.
- (coff_start_final_link): Define if not defined.
- (bfd_coff_std_swap_table): Add coff_start_final_link.
- * cofflink.c (_bfd_coff_internal_syment_name): Make globally
- visible.
- (_bfd_coff_final_link): Call bfd_coff_start_final_link if the
- function callback is not NULL.
- * libcoff-in.h (struct coff_section_tdata): Add tdata field.
- (_bfd_coff_internal_syment_name): Declare.
- * libcoff.h: Rebuild.
- * configure.in (icoff_big_vec): Add cofflink.o.
- (icoff_little_vec): Likewise.
- * configure: Rebuild.
-
-Wed Sep 13 17:38:23 1995 Fred Fish <fnf@rtl.cygnus.com>
-
- * Makefile.in (clean-info): Remove extraneous tab from line
- following action.
-
-Wed Sep 13 13:27:53 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * cofflink.c (coff_link_input_bfd): Fail if a section with no
- contents has relocs.
-
-Thu Sep 12 12:45:34 1995 steve chamberlain <sac@slash.cygnus.com>
-
- * coffcode.h (coff_compute_section_file_positions): Keep the
- raw size safe.
- (coff_write_object_contents): Remember if it's a relocatable
- file.
- * libcoff-in.h (pe_data_type): New member 'has_reloc_section'
- * peicode.h (coff_swap_filehdr_out): Clear not-reloc flag
- if relocatable file. Swap out saved raw size.
-
-Tue Sep 12 12:14:33 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * Makefile.in (do_maintainer_clean): Rename from do_realclean.
- (maintainer-clean): Rename from realclean, passing
- maintainer-clean down to subdirectories, but leave realclean as a
- synonym.
-
- * linker.c (_bfd_generic_link_add_one_symbol): Pass symbol name to
- warning callback.
-
- * dep-in.sed: Remove config.h from generated dependencies.
-
- * sunos.c (sunos_slurp_dynamic_symtab): New static function,
- broken out of sunos_canonicalize_dynamic_symtab.
- (sunos_canonicalize_dynamic_symtab): Call new function
- sunos_slurp_dynamic_symtab.
- (sunos_add_dynamic_symbols): Add three new parameters. Return the
- dynamic symbol table to the caller.
- * aoutx.h (aout_link_add_symbols): Permit add_dynamic_symbols
- callback to override the symbols being read.
- * libaout.h (struct aout_backend_data): Add three new parameters
- to add_dynamic_symbols callback.
-
- Extensive minor changes to avoid various gcc warnings. Also:
- * Makefile.in (BFD32_BACKENDS): Remove coff-arm.o.
- * archures.c (bfd_arch_info_type): Change mach field from long to
- unsigned long.
- (bfd_lookup_arch): Change machine parameter from long to unsigned
- long.
-
-Mon Sep 11 10:55:47 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * sunos.c (sunos_scan_std_relocs): Fix BFD_ASSERT: it's OK to find
- a symbol with a non-zero plt_offset.
-
-Fri Sep 8 11:47:24 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * elfcode.h (align_file_position): Remove; not used.
-
- * configure.in: Only check for <sys/procfs.h> on a native system,
- and make sure it defines prstatus_t.
- * configure: Rebuild.
-
-Thu Sep 7 12:48:01 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * sunos.c (sunos_write_dynamic_symbol): Correct m68k abort test.
-
- * config.in: Rename from config.h.in.
- * configure.in: Call AC_CONFIG_HEADER with config.h:config.in.
- Check for config.h:config.in when creating stamp-h.
- * configure: Rebuild.
- * Makefile.in (stamp-h): Depend upon config.in rather than
- config.h.in. Set CONFIG_HEADERS to config.h:config.in when
- calling config.status.
-
- * Makefile.in (do_distclean): Remove config.h and stamp-h.
- (Makefile): Just rebuild Makefile.
- (config.h, stamp-h): New targets.
- * configure.in: Create stamp-h when rebuilding config.h.
- * configure: Rebuild.
-
-Wed Sep 6 15:00:33 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Call AC_CONFIG_HEADER. Substitute
- 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.
-
- * aclocal.m4 (BFD_BINARY_FOPEN): Define.
- (BFD_CC_FOR_BUILD): Define.
- * configure.in: Use BFD_CC_FOR_BUILD.
- * configure: Rebuild.
-
-Tue Sep 5 19:35:28 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * aclocal.m4: Don't try to grep ../Makefile if it doesn't exist.
- * configure: Rebuild.
-
- * coff-sparc.c (CALC_ADDEND): Don't set the addend to the value of
- a global symbol.
-
-Tue Sep 5 12:48:26 1995 Jason Molenda (crash@phydeaux.cygnus.com)
-
- * config.bfd: i386pe_ve -> i386pe_vec.
-
-Mon Sep 4 14:02:43 1995 Ian Lance Taylor <ian@cygnus.com>
+Thu Jan 22 21:13:39 1998 Richard Henderson <rth@cygnus.com>
- * configure.host: Incorporate host Makefile fragments by setting
- 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.
-
- * config.bfd: Rewrite to incorporate the contents of the Makefile
- fragments by setting shell variables, rather than merely returning
- the name of a Makefile fragment.
- * configure.in: Use shell variables set by config.bfd rather than
- looking at the target Makefile fragment files. Don't substitute
- target_makefile_frag. Do substitute TDEFINES.
- * configure: Rebuild.
- * Makefile.in (@target_makefile_frag@): Remove.
- (ALL_CFLAGS): Change $(TDEFINES) to @TDEFINES@.
- * config/*.mt: Remove.
+ * tekhex.c (tekhex_write_object_contents): Check for no symbols.
-Mon Sep 4 03:13:28 1995 Ken Raeburn <raeburn@cygnus.com>
+Wed Jan 21 21:19:03 1998 Ian Lance Taylor <ian@cygnus.com>
- * configure.in: Put changequote lines around "i[345]86" patterns
- section of core file support.
+ * coff-i386.c (coff_i386_rtype_to_howto): If COFF_WITH_PE, don't
+ adjust addend for an output common symbol (from Jimmy Blair
+ <jimmyb@wrs.com>). If COFF_WITH_PE, adjust addend for PC relative
+ defined symbol to counteract adjustment made in generic relocation
+ code.
-Sun Sep 3 11:31:58 1995 Jeff Law (law@snake.cs.utah.edu)
+ * dwarf2.c: Include sysdep.h, not stdio.h and stdlib.h.
- * som.c (som_bfd_print_private_bfd_data): Define to use the
- generic version.
+Wed Jan 21 21:16:06 1998 Manfred Hollstein <manfred@s-direktnet.de>
-Fri Sep 1 17:08:40 1995 steve chamberlain <sac@slash.cygnus.com>
+ * coff-m88k.c (GET_SCNDHR_NRELOC): Fix typo in macro name.
+ (GET_SCNDHR_NLNNO): Likewise.
- * peicode.h (coff_swap_aouthdr_in): Add ImageBase to
- entry, text_start and data_start.
+Mon Jan 19 12:49:52 1998 Ian Lance Taylor <ian@cygnus.com>
-Fri Sep 1 18:06:28 1995 Ian Lance Taylor <ian@cygnus.com>
+ * cpu-sh.c (arch_info_struct): Correct next field of sh3e.
- * Makefile.in (OFILES): Remove $(TDEPFILES).
- * config/apollo.mt (TDEPFILES): Remove.
- * config/README: Update.
+Wed Jan 14 17:23:27 1998 Nick Clifton <nickc@cygnus.com>
- * configure.in: For a native configuration, set COREFILE and
- COREFLAG based on the canonical host name.
- * configure: Rebuild.
- * Makefile.in: Rebuild dependencies.
- (ALL_CFLAGS): Add @COREFLAG@.
- (OFILES): Replace $(HDEPFILES) with @COREFILE@.
- * coff-rs6000.c: Check AIX_CORE rather than HOST_AIX for core file
- support routines. Check LYNX_CORE rather than HOST_LYNX.
- * lynx-core.c: Check LYNX_CORE rather than HOST_LYNX.
- * i386lynx.c: Likewise.
- * m68klynx.c: Likewise.
- * sparclynx.c: Likewise.
- * rs6000-core.c: Check AIX_CORE rather than HOST_AIX.
- * *-core.c: Comment changes.
- * config/decstation.mh (HDEPFILES): Remove.
- (HDEFINES): Remove -DTRAD_CORE.
- * config/irix3.mh (RANLIB): Remove.
- * config/irix4.mh (HDEPFILES, RANLIB): Remove.
- (HDEFINES): Remove -DIRIX_CORE.
- * config/riscos.mh (RANLIB, HDEPFILES): Remove.
- (HDEFINES): Remove -DTRAD_CORE.
- * config/ncr3000.mh (AR_FLAGS, RANLIB): Remove.
- * config/ultra3.mh (RANLIB): Remove.
- * config/aix4.mh, config/alphaosf.mh, config/amix.mh: Remove.
- * config/apollo.mh, config/delta68.mh, config/delta88.mh: Remove.
- * config/dpx2.mh, config/esix.mh, config/harris.mh: Remove.
- * config/hp300.mh, config/hp300bsd.mh, config/hppabsd.mh: Remove.
- * config/hppahpux.mh, config/hppaosf.mh: Remove.
- * config/i386aix.mh, config/i386bsd.mh: Remove.
- * config/i386linux.mh, config/i386mach3.mh: Remove.
- * config/i386sco.mh, config/i386v.mh, config/i386v4.mh: Remove.
- * config/irix5.mh, config/m88kmach3.mh, config/mipsbsd.mh: Remove.
- * config/mipsmach3.mh, config/news-mips.mh: Remove.
- * config/news.mh, config/pc532mach.mh, config/riscix.mh: Remove.
- * config/rs600.mh, config/rs6000lynx.mh: Remove.
- * config/solaris2.mh, config/stratus.mh: Remove.
- * config/symmetry.mh, config/sysv4.mh, config/tahoe.mh: Remove.
- * config/vaxbsd.mh, config/vaxult.mh, config/vaxult2.mh: Remove.
-
-Fri Sep 1 15:18:50 1995 Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>
-
- * elflink.h (elf_bfd_final_link): Don't change a DT_INIT or
- DT_FINI entry if the appropriate symbol is not in the hash table.
-
- * libelf.h (struct elf_backend_data): Add create_program_headers
- and want_hdr_in_seg fields.
- * elfxx-target.h (elf_backend_want_hdr_in_seg): Define if not
- defined.
- (elf_backend_create_program_headers): Likewise.
- (elfNN_bed): Initialize create_program_headers and
- want_hdr_in_seg.
- * elf.c (get_program_header_size): Call create_program_headers
- backend routine.
- (map_program_segments): Check want_hdr_in_seg backend field. Call
- create_program_headers backend routine.
-
- * elf.c (assign_file_positions_except_relocs): Align non allocated
- sections when creating an executable.
-
- * elfcode.h (elf_swap_phdr_in): Make non static.
- (elf_swap_phdr_out): Make non static.
- * libelf.h (bfd_elf32_swap_phdr_in): Declare.
- (bfd_elf32_swap_phdr_out): Declare.
- (bfd_elf64_swap_phdr_in): Declare.
- (bfd_elf64_swap_phdr_out): Declare.
-
- * ecofflink.c (ecoff_collect_shuffle): New static function.
- (_bfd_ecoff_get_accumulated_pdr): New function.
- (_bfd_ecoff_get_accumulated_sym): New function.
- (_bfd_ecoff_get_accumulated_ss): New function.
- * libbfd-in.h (_bfd_ecoff_get_accumulated_pdr): Declare.
- (_bfd_ecoff_get_accumulated_sym): Declare.
- (_bfd_ecoff_get_accumulated_ss): Declare.
- * libbfd.h: Rebuild.
+ * elf32-m32r.c: Add macros to handle NOP insertion.
-Fri Sep 1 13:20:25 1995 Ian Lance Taylor <ian@cygnus.com>
-
- * libecoff.h (_bfd_ecoff_bfd_print_private_bfd_data): Fix typo.
-
- * elflink.h (elf_link_add_object_symbols): Handle indirect and
- warning symbols. If any section is named .gnu.warning.XXX, treat
- the contents as a warning to be issued if the symbol XXX is
- referenced.
- (elf_link_output_extsym): For an indirect or warning symbol, just
- output the symbol it points to.
-
- * linker.c (_bfd_link_hash_newfunc): Don't bother to set bfd_error
- if bfd_hash_allocate fails, since it will already be set.
- (generic_link_hash_newfunc): Likewise.
- (archive_hash_newfunc): Likewise.
- (hash_entry_bfd): New static function.
- (_bfd_generic_link_add_one_symbol): Pass new arguments to warning
- callback. Allocate a new warning using the hash table newfunc.
- Use bfd_hash_replace to update the entry in the hash table, rather
- than assuming we can copy the fields with structure assignment.
-
- * hash.c (bfd_hash_replace): New function.
- * bfd-in.h (bfd_hash_replace): Declare.
- * bfd-in2.h: Rebuild.
+Wed Jan 14 16:15:22 1998 Richard Henderson <rth@cygnus.com>
-Fri Sep 1 08:12:50 1995 James G. Smith <jsmith@beauty.cygnus.com>
+ * xcofflink.c (xcoff_mark_symbol): Don't mark the absolute section.
+ (xcoff_mark): Likewise.
+ (xcoff_build_ldsyms): Mark absolute symbols.
- * config.bfd: Add mips*vr4300-*-elf* target.
- * config/mipsbvr4300.mt: Added.
+Wed Jan 14 16:03:11 1998 Richard Henderson <rth@cygnus.com>
-See file ChangeLog.2
+ * bout.c (b_out_write_object_contents): Sort symbols before output
+ to keep {CALL,BAL}NAME symbols adjacent.
+ (b_out_symbol_cmp): New function.
+For older changes see ChangeLog-9697
Local Variables:
mode: change-log
diff --git a/contrib/binutils/bfd/ChangeLog-9193 b/contrib/binutils/bfd/ChangeLog-9193
new file mode 100644
index 000000000000..15af93195967
--- /dev/null
+++ b/contrib/binutils/bfd/ChangeLog-9193
@@ -0,0 +1,7851 @@
+Fri Dec 31 16:23:43 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ Minor cleanups suggested by CodeCenter.
+ * aoutx.h, coffgen.c, ecoff.c, ecofflink.c, elf.c, libbfd.c,
+ linker.c, reloc.c, section.c, srec.c: Added /*ARGSUSED*/ as
+ appropriate.
+ * aoutx.h (struct external_exec): Removed unnecessary declaration.
+ (NAME(aout,some_aout_object_p)): Set some tdata pointers to NULL.
+ (adjust_z_magic): Removed useless variable data_vma.
+ (stringtab_init): Initialize hash_zero.
+ (add_to_stringtab): Removed unused fourth argument.
+ (NAME(aout,swap_std_reloc_out)): Removed useless variable
+ r_addend.
+ (aout_link_input_section): Added some casts.
+ * archive.c (get_extended_arelt_filename, do_slurp_coff_armap,
+ bfd_ar_hdr_from_filesystem, bsd_write_armap, coff_write_armap):
+ Minor code rewriting to make it more C like.
+ (do_slurp_bsd_armap): Added some casts.
+ * ecoff.c (ecoff_write_object_contents): Removed useless variable
+ scn_base.
+ (ecoff_write_armap): Added some casts. Use "" rather than "\0".
+ * ecofflink.c (bfd_ecoff_write_debug): Added a cast.
+ * libaout.h (struct internal_exec): Removed unnecessary
+ declaration.
+ * linker.c (_bfd_generic_indirect_link_order): Added a cast.
+ * opncls.c (new_bfd): Removed a cast.
+ * reloc.c (bfd_generic_get_relocated_section_contents): Added
+ some casts.
+ * srec.c (internal_srec_write_object_contents): Removed useless
+ variable bytes_written.
+
+Fri Dec 31 11:46:13 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * i386mach3.c (N_TXTADDR): Don't define after all.
+ (TEXT_START_ADDR): Don't include exec header size in value.
+
+Thu Dec 30 15:47:54 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * i386mach3.c (N_TXTADDR): Define.
+
+Thu Dec 30 13:37:24 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ Extensive changes to move the bulk of the linker into BFD so that
+ 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.
+
+Thu Dec 30 07:41:36 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * section.c (bfd_get_section_contents): Return zero filled buffer
+ if section has no contents.
+
+Tue Dec 28 12:43:54 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elf.c (bfd_elf_generic_reloc): If this is not an inplace reloc,
+ then skip bfd_perform_relocation even if the addend is non-zero.
+
+Tue Dec 21 09:22:19 1993 Ken Raeburn (raeburn@rtl.cygnus.com)
+
+ * coffcode.h (coff_write_relocs) [SWAP_OUT_RELOC_OFFSET]: Copy
+ addend to r_offset field.
+
+ * Makefile.in (CFILES): Added coff-sparc.c. Rebuild dependencies.
+
+ * coff-sparc.c (SWAP_IN_RELOC_OFFSET, SWAP_OUT_RELOC_OFFSET,
+ CALC_ADDEND): Define.
+
+ * aix386-core.c (aix386_core_file_p): Use cd_regs[0] for computing
+ the offsetof because AIX /bin/cc does not like to take the address
+ of an array. (From Minh Tran-Le.)
+
+Thu Dec 16 13:06:32 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * Thu Dec 16 15:41:06 1993 Peter Hoogenboom (hoogen@cs.utah.edu)
+
+ * elf32-hppa.c (hppa_elf_build_arg_reloc_stub): Make sure to copy
+ the return pointer into %r2 if no jump-in-call-delay-slot
+ optimization was done.
+
+ * hosts/hp300bsd.h: Correctly identify 4.3BSD vs 4.4BSD.
+
+Wed Dec 15 08:04:16 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * hosts/std-host.h: (time): Don't declare; conflicts on Mach3.
+
+ * hosts/i386mach3.h (HOST_PAGE_SIZE): Set to 1 to avoid padding.
+ (HOST_SEGMENT_SIZE): Set to 0 for same reason.
+
+ * i386mach3.c (PAGE_SIZE, SEGMENT_SIZE): Same changes as above.
+ (TEXT_START_ADDR): Correct.
+ (MY_backend_data): Define.
+
+ * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic):
+ New functions; code moved from aout_<size>_adjust_sizes_and_vmas.
+
+Tue Dec 14 21:48:33 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (som_begin_writing): Fix thinkos in auxiliary header
+ support.
+ (bfd_som_attach_aux_hdr): Likewise.
+
+Mon Dec 13 23:34:48 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * elf32-hppa.c (hppa_elf_gen_reloc_type): Handle 'T' field
+ selectors for PIC code.
+
+ * som.c (hppa_som_gen_reloc_type): Handle 'T' field selectors.
+ (som_write_fixups): Handle R_DLT_REL, R_FSEL, R_RSEL, R_LSEL
+ relocations needed by PIC.
+
+Tue Dec 7 15:47:51 1993 Stu Grossman (grossman at cygnus.com)
+
+ * nlmcode.h: Fixes to avoid compiler warnings...
+
+Tue Dec 7 15:10:54 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * libnlm.h (nlm_backend_data): Removed macro definition.
+ (nlm_alpha_backend_data): Adjusted accordingly.
+
+Sun Dec 5 19:32:08 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (som_begin_writing): Flesh out code for handling simple
+ auxiliary headers.
+ (bfd_som_attach_aux_hdr): New function.
+
+ * som.h (struct somdata): Add fields for attaching version and
+ copyright headers. Add accessor macros.
+
+ * som.c (R_DLT_REL, R_AUX_UNWIND, R_SEC_STMT): Add protected
+ definitions for old versions of HPUX which fail to define them.
+ (som_hppa_howto_talbe): Add R_DLT_REL, R_AUX_UNWIND, and R_SEC_STMT
+ now that they're safe. Delete bogus R_STATEMENT relocations.
+
+ * som.c (som_hppa_howto_table): Add missing R_END_TRY. Delete
+ extra R_DATA_OVERRIDE.
+ (hppa_som_gen_reloc_type): Generate a relocation for the rounding
+ mode selector if needed.
+ (som_write_fixups): Handle requests for a change in the default
+ rounding mode. Rounding modes do not consume input bytes, but
+ are just markers much like R_ENTRY and R_EXIT.
+
+Sat Dec 4 19:40:32 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ Fri Dec 3 09:55:17 1993 Pete Hoogenboom (hoogen@cs.utah.edu)
+
+ * elf32-hppa.c: (hppa_elf_reloc): Do not do code reordering when
+ the branch instruction as originally been nullified.
+ hppa_elf_reloc): Avoid useless call to bfd_put_32 () in the
+ case of no code reordering due to an LDO instruction in the
+ delay slot of the branch. Make sure to relocate the correct
+ instruction. Do not perform instruction reordering for millicode
+ calls.
+ (hppa_elf_build_arg_reloc_stub): Change the relocation type
+ to R_HPPA_STUB_CALL_17 when special processing might be needed.
+ (hppa_elf_build_long_branch_stub): Prevent code reordering on
+ a call from a linker stub to another linker stub and for millicode
+ calls. Do not trash the return register for calls from one linker
+ stub to a second linker stub.
+
+ * elf32-hppa.c: (elf_hppa_howto_table): PLABEL and DLT
+ relocations are not pc-relative.
+
+ * hppa_stubs.h: (BLE_N_XXX_0_31): New instruction used in
+ linker stub code.
+ (COPY_2_31): Likewise.
+
+Fri Dec 3 18:40:58 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * config/solaris2.mh (HDEFINES): Remove -Dconst=
+ * hosts/solaris.h: If not __GNUC__, define const as empty.
+
+Thu Dec 2 15:43:32 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * ecoff.c: Added various casts for 32/64 bit cross targeting.
+ (ecoff_mkobject_hook): Set SEC_SHARED_LIBRARY for the .reginfo
+ section so that the linker ignores it.
+ * ecofflink.c: Added various casts for 32/64 bit cross targeting.
+ (ecoff_add_bytes): Changed need argument to size_t.
+ (bfd_ecoff_debug_link_other): Check return value of
+ ecoff_add_string.
+
+ * libbfd-in.h (new_bfd): Use void rather than an empty parameter
+ list.
+ * libbfd.h: Rebuilt.
+
+ * libnlm.h (struct nlm_obj_tdata): New field backend_data.
+ (nlm_backend_data, nlm_alpha_backend_data): New accessor macros.
+ (struct nlm_backend_data): New field no_uninitialized_data.
+ (nlm_no_uninitialized_data): New accessor macro.
+ * nlmcode.h (nlm_compute_section_file_positions): Handle
+ no_uninitialized_data.
+ (nlm_external_reloc_compare): Sort relocs by address for a
+ particular symbol, to make the sort more stable.
+ (nlm_write_object_contents): Cast the arguments to qsort. Get the
+ value of a debugging symbol the same way we get the value of a
+ normal symbol.
+ * nlm32-alpha.c: Various changes. Write out GP and .lita relocs.
+ Set no_uninitialized_data to true.
+ * nlm32-i386.c (nlm32_i386_backend), nlm32-sparc.c
+ (nlm32_sparc_backend): Set no_uninitialized_data field false.
+ * nlmswap.h (nlm_swap_fixed_header_out): Zero out destination
+ before filling it in.
+
+Wed Dec 1 21:47:58 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (som_section_type, som_decode_symcalss): New functions.
+ (som_get_symbol_info): Use them.
+ (som_slurp_symbol_table): Set the section of common and undefined
+ symbols correctly.
+
+Wed Dec 1 14:15:10 1993 Ken Raeburn (raeburn@cygnus.com)
+
+ * elfcode.h (write_relocs): Initialize local var LAST_SYM_IDX, to
+ make gcc happy.
+
+ * mipsbsd.c: Changes from Ralph Campbell:
+ (mips_howto_table_ext): MIPS_RELOC_LO16 should use
+ complain_overflow_dont.
+ (aout_mips_*_vec): Make name use "a.out" instead of "aout", to
+ make gdb happy.
+
+ * bfd.c (bfd_errmsgs): Reword invalid-target message.
+
+ * config.bfd: For sparc*-*-coff, use sparc-coff.
+ * configure.in: Handle sparccoff_vec.
+ * targets.c (sparccoff_vec): Declare.
+
+ * reloc.c (bfd_get_reloc_size): New function.
+ (struct reloc_howto_type): Update documentation of size field.
+
+Wed Dec 1 14:39:05 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * nlm32-alpha.c: New file; preliminary Alpha NetWare support.
+ * config.bfd (alpha-*-netware*): New target; use alpha-nlm.
+ * config/alpha-nlm.mt: New file.
+ * configure.in (nlm32_alpha_vec): New vector; use nlm32-alpha.o,
+ nlm32.o, and nlm.o.
+ * Makefile.in (BFD32_BACKENDS): Added nlm32-alpha.o.
+ (CFILES): Added nlm32-alpha.c.
+ Rebuilt dependencies.
+ * targets.c (nlm32_alpha_vec): Declare.
+
+ * libnlm.h (struct nlm_backend_data): New fields
+ optional_prefix_size, nlm_backend_object_p, nlm_write_prefix,
+ nlm_set_public_section, nlm_get_public_offset. Removed unused
+ nlm_write_reloc field. Changed nlm_write_import to remove
+ unnecessary symbol argument. Renamed nlm_write_externals to
+ nlm_write_external, and changed cound argument from bfd_vma to
+ bfd_size_type.
+ (nlm_optional_prefix_size, nlm_backend_object_p_func,
+ nlm_write_prefix_func, nlm_set_public_section_func,
+ nlm_get_public_offset_func): New accessor macros.
+ (nlm_write_reloc_func): Removed.
+ (nlm_write_external_func): Adjusted for field renaming.
+ * nlm32-i386.c (nlm_i386_write_import): Renamed from
+ nlm_i386_write_reloc. Removed old nlm_i386_write_import which
+ just called old nlm_i386_write_reloc.
+ (nlm_i386_write_external): Renamed from nlm_i386_write_externals.
+ Declared. Changed second argument from bfd_vma to bfd_size_type.
+ (nlm32_i386_backend): Adjusted for changes to fields and names.
+ * nlm32-sparc.c (nlm_sparc_mangle_relocs): Removed unused,
+ ifdeffed out code.
+ (nlm_sparc_write_import): Removed second argument.
+ (nlm_sparc_write_external): Renamed from
+ nlm_sparc_write_externals. Changed second argument from bfd_vma
+ to bfd_size_type.
+ (nlm32_sparc_backend): Adjusted for changes to fields and names.
+ * nlmcode.h: Removed some unused code.
+ (nlm_object_p): Don't destroy tdata pointer. Call
+ backend_object_p function if it exists.
+ (nlm_slurp_symbol_table): Removed unused variable rcount. Call
+ set_public_section_func if it exists instead of checking
+ NLM_HIBIT.
+ (nlm_compute_section_file_positions): Account for
+ optional_prefix_size.
+ (nlm_write_object_contents): Account for optional_prefix_size.
+ Removed useless variable write_reloc_func. Changed declaration
+ and call of write_import_func. Call write_prefix_func if it
+ exists. Removed unused variables len and temp. Call
+ get_public_offset_func if it exists rather than setting NLM_HIBIT.
+ * nlmswap.h: Declare functions.
+
+ * bfd-in.h (uint64_typeLOW, uint64_typeHIGH): Fully parenthesize
+ for clarity.
+ (fprintf_vma, sprintf_vma): Use %lx, not %x.
+ * bfd-in2.h: Rebuilt.
+ * hosts/alphaosf.h (uint64_typeLOW, uint64_typeHIGH): Cast results
+ to unsigned long.
+
+ * config.bfd: Don't set target64 here, as the setting is ignored.
+ * configure.in (ecoffalpha_little_vec): Set target64.
+
+ * config/alphaosf.mt (TDEFINES): Removed; setting host parameters
+ in TDEFINES is wrong.
+
+ * coff-alpha.c (alpha_ecoff_get_relocated_section_contents):
+ Remove unused variable output_section.
+
+Tue Nov 30 16:45:23 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * irix-core.c: New file for Irix 4 and Irix 5 core support.
+ 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.
+
+Wed Nov 24 02:02:41 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elfcode.h (map_program_segments): Restore check of file_size !=
+ mem_size, but only if SHT_PROGBITS.
+
+ * ecofflink.c: New file to hold ECOFF debug information linking
+ routines.
+ * ecoff.c (ecoff_clear_output_flags, ecoff_rel, ecoff_dump_seclet,
+ ecoff_add_string, ecoff_get_debug): Removed. Functionality now in
+ ecofflink.c.
+ (ecoff_get_extr, ecoff_set_index): New functions.
+ (ecoff_slurp_symbolic_info): Don't save raw_size.
+ (ecoff_bfd_seclet_link): Rewrote to use ecofflink.c functions.
+ (ecoff_compute_section_file_positions): Don't set EXEC_P just
+ because there is a start address.
+ (ecoff_write_object_contents): Handle external symbols here. Use
+ ecofflink.c functions to write out debugging information.
+ * elf32-mips.c (mips_elf_read_ecoff_info, mips_elf_get_extr,
+ mips_elf_set_index): New functions.
+ (mips_elf_seclet_link): Discard empty sections, the .options
+ section and .gptab sections. Handle linking .mdebug section.
+ * libecoff.h (ecoff_data_type): Removed raw_size and ifdbase.
+ * libelf.h (elf_symbol_type): Added mips_extr to tc_data union.
+ * bfd-in.h: Added prototypes for routines in ecofflink.c (some are
+ called by gas, so they are public).
+ * bfd-in2.h: Rebuilt.
+ * Makefile.in (BFD_LIBS): Added ecofflink.o.
+ (CFILES): Added ecofflink.c.
+ (ecofflink.o): New target. Rebuilt dependencies.
+
+Mon Nov 22 22:26:42 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (hppa_object_p): Also recognize SHARED_MAGIC_CNX as
+ a valid magic number if it's been defined.
+
+Mon Nov 22 14:17:36 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * ecoff.c (ecoff_mkobject): Don't create .scommon section; linker
+ no longer requires it.
+ (ecoff_bfd_seclet_link, ecoff_sizeof_headers,
+ ecoff_write_object_contents): Don't treat .scommon section
+ specially.
+
+Mon Nov 22 10:54:27 1993 Fred Fish (fnf@cygnus.com)
+
+ Merged changes from kev@spuds.geg.mot.com (Kevin A. Buettner):
+ * bfd/config/delta88.mh (HDEFINES): Define this to be -DPTRACE_CORE.
+ * bfd/config/delta88.mh (HDEPFILES): Defined to be ptrace-core.o.
+ * bfd/ptrace-core.c: New file for dealing with core files with
+ start with the ptrace_user structure found on BCS compliant systems.
+ * bfd/targets.c (ptrace_core_vec): New vector.
+
+Mon Nov 22 02:33:12 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * Minimal support for reading SOM fixup streams. Allows
+ objdump -r to do something reasonable.
+ * som.c (som_get_reloc_upper_bound): Implement.
+ (som_canonicalize_reloc): Implement.
+ (som_set_reloc_info, som_slurp_reloc_table): New functions.
+
+Sun Nov 21 13:46:55 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * hosts/lynx.h (FPRINTF_ALREADY_DECLARED): Define.
+ * hosts/sparclynx.h: Include lynx.h instead of duplicating it.
+
+Fri Nov 19 14:34:04 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * coff-a29k.c (a29k_reloc): For R_IREL, don't left shift
+ signed_value before sign extending it. Don't subtract out
+ reloc_entry->address. This makes it compatible with what gas is
+ generating.
+
+ * elfcode.h (elf_fake_sections): Accept .sbss as the name for a
+ SHT_NOBITS sections.
+ (map_program_segments): Don't leave the loop after the first
+ SHT_NOBITS section.
+ (assign_file_positions_except_relocs): Only force sh_offset and
+ sh_addr to match modulo maxpagesize for a section which is not
+ SHT_NOBITS. Changed the method used to force page alignment after
+ a SHT_NOBITS section to only do it for the last such consecutive
+ section, and to really force page alignment.
+
+Fri Nov 19 04:02:01 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * coffcode.h (coff_slurp_symbol_table): Print more verbose message
+ in the case of an unknown (or unhandled) storage class.
+
+ * config/i386-lynx.mt (TDEFINES): FPRINTF_ALREADY_DECLARED should
+ not be defined here, since it is a host attribute, not a target
+ one.
+ * config/m68k-lynx.mt, config/sparc-lynx.mt: Ditto.
+
+ * coffcode.h (coff_bfd_reloc_type_lookup): Don't define if already
+ defined.
+
+ * coff-sparc.c: Define some relocations, based on ELF relocations.
+ (enum reloc_type, bfd_coff_generic_reloc, coff_sparc_howto_table,
+ struct coff_reloc_map, sparc_reloc_map,
+ coff_sparc_reloc_type_lookup): Borrowed from elf32-sparc.c and
+ elf.c, renamed.
+ (coff_bfd_reloc_type_lookup): Define to be coff_sparc_reloc_....
+ (rtype2howto): Index into coff_sparc_howto_table using
+ dst->r_type.
+
+Thu Nov 18 11:45:39 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * config.bfd (mips*-*-irix5*): New target; use mipsbelf.
+ * configure.host (mips-sgi-irix5*) New host; use irix5 (no
+ hosts/irix5.h created; just use std-host.h).
+ * config/irix5.mh: New file; like irix4.mh, but don't use -G or
+ -lmalloc.
+ * Makefile.in: Rebuilt dependencies.
+
+ * ecoffswap.h: Changed type of internal pointers for swap out
+ functions to const *.
+
+ * elf32-mips.c (mips_elf_got16_reloc): New function. Handle GOT16
+ correctly for assembler, but linker support not implemented.
+ (elf_mips_howto_table): Use mips_elf_got16_reloc for GOT16.
+ (mips_elf_sym_is_global): New function; at least on Irix 5, all
+ non section symbols are considered global.
+ (elf_backend_sym_is_global): Define.
+ (mips_elf_final_write_processing): New function. Set the MIPS
+ architecture level correctly.
+ (elf_backend_final_write_processing): Define.
+ (mips_elf_section_from_shdr): Handle SHT_MIPS_OPTIONS.
+ (mips_elf_fake_sections): Set entsize of .mdebug or .reginfo
+ section to 1. Handle .options section.
+ (mips_elf_acom_section, mips_elf_acom_symbol,
+ mips_elf_acom_symbol_ptr): New static variables, used to build a
+ generic .acommon section to hold SHN_MIPS_ACOMMON symbols.
+ (mips_elf_symbol_processing): Handle SHN_MIPS_ACOMMON symbols by
+ putting them all in a global .acommon section.
+
+ * elfcode.h (bfd_section_from_shdr): Don't dump core if target
+ section has no ELF section data.
+ (elf_make_sections): Set addralign of reloc section to 4.
+ (elf_fake_sections): Likewise.
+ (map_program_segments): Don't consider section 0.
+ (assign_file_positions_except_relocs): Don't consider section 0.
+ In the main loop, skip the symtab and strtab sections, since their
+ positions are set elsewhere.
+ (swap_out_syms): Set addralign of symtab section to 4. Set
+ addralign of strtab sections to 1.
+ (assign_file_positions_for_relocs): Don't consider section 0.
+ (write_object_contents): Don't write out section 0.
+
+ * libelf.h (struct elf_backend_data): Added fields
+ elf_backend_sym_is_global and elf_backend_final_write_processing.
+ * elf32-target.h (elf32_bed): Added corresponding initializers.
+ * elf64-target.h (elf64_bed): Likewise.
+ * elfcode.h (sym_is_global): Take abfd argument. Call
+ elf_backend_sym_is_global if it is not NULL.
+ (elf_map_symbols): Pass abfd to sym_is_global.
+ (write_object_contents): Call elf_backend_final_write_processing
+ if it is defined.
+
+Wed Nov 17 18:43:28 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * libecoff.h: Include coff/ecoff.h.
+ (struct ecoff_backend_data): Move external debugging information
+ fields into a single field pointing to an ecoff_debug_swap
+ structure.
+ (ecoff_data_type): Move debugging information fields into a single
+ field pointing to an ecoff_debug_info structure.
+ * coff-alpha.c, coff-mips.c, ecoff.c: Corresponding changes.
+
+Wed Nov 17 17:38:58 1993 Sean Eric Fagan (sef@cygnus.com)
+
+ * nlmswap.h: New file to swap fixed header. Included by NLM
+ backends.
+ * libnlm.h (struct reloc_and_sec): Define.
+ (struct nlm_backend_data): Add fields fixed_header_size,
+ nlm_read_import, nlm_write_import, nlm_swap_fhdr_in,
+ nlm_swap_fhdr_out.
+ (nlm_fixed_header_size, nlm_read_import_func,
+ nlm_write_import_func, nlm_swap_fixed_header_in_func,
+ nlm_swap_fixed_header_out_func, nlm_write_external_func): New
+ accessor macros.
+ * nlmcode.h: Use new functions.
+ * nlm32-i386.c: Provide new functions.
+ * nlm32-sparc.c: New file; SPARC NLM backend.
+
+Wed Nov 17 13:56:10 1993 Stan Shebs (shebs@rtl.cygnus.com)
+
+ * i386lynx.c (swap_std_reloc_in, swap_ext_reloc_in): Ignore
+ garbage bits appearing in the upper end of symbolnums.
+
+ * config/sparc-lynx.mt (TDEFINES): Add -DFPRINTF_ALREADY_DECLARED.
+
+Tue Nov 16 17:03:41 1993 Stu Grossman (grossman at cygnus.com)
+
+ * lynx-core.c (lynx_core_file_p): Change bfd_zalloc to bfd_alloc.
+ * m68klynx.c: Define core file macros.
+ * hosts/i386lynx.h, hosts/m68klynx.h, hosts/lynx.h: Move all
+ non-architecture specific stuff into lynx.h.
+
+Tue Nov 16 15:45:54 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * i386linux.c: Define new macro ZMAGIC_DISK_BLOCK_SIZE to 1024, and
+ change PAGE_SIZE to 4096.
+
+Mon Nov 15 11:48:08 1993 Ken Raeburn (raeburn@rtl.cygnus.com)
+
+ * Makefile.in (diststuff): New target.
+
+ * VERSION: Updated.
+
+Sun Nov 14 23:33:01 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (som_object_setup): Do not create dummy ".text", ".data",
+ and ".bss" sections.
+ (setup_sections): Do not set SEC_HAS_CONTENTS if a section's size
+ is zero. Recognize BSS type sections and turn off SEC_LOAD and
+ SEC_DATA (so binutils/size works). Set the correct value for
+ a section's _raw_size.
+ (som_slurp_symbol_table): Program entry points, and millicode are
+ also functions. Mark them as such. Also mark L$* symbols as
+ debugging symbols.
+
+ * bfd-in2.h: Rebuilt.
+
+Sat Nov 13 15:27:15 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (som_bfd_reloc_type_lookup): Add missing prototype. Returns
+ a pointer to constant data. Delete bogus #define which made the
+ function useless.
+
+ * som.c (som_prep_for_fixups): New function.
+ (som_write_fixups): New function.
+ (som_write_space_strings): New function.
+ (som_write_symbol_strings): New function.
+ (som_begin_writing): New function.
+
+Fri Nov 12 15:29:36 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (som_write_object_contents): Do not abort. Flesh out.
+ (som_set_section_contents): Do not abort. Flesh out.
+
+ * som.c (som_write_headers): New function.
+ (som_prep_headers): New function.
+ (som_build_and_write_symbol_table): New function.
+
+ * som.c (som_sizeof_headers): Add missing prototype.
+ (som_set_arch_mach): Do not abort.
+
+ * som.c (som_count_spaces): New function.
+ (som_count_subspaces): New function.
+ (compare_syms): New function.
+ (som_compute_checksum): New function.
+
+ * som.c (hppa_som_gen_reloc_type): New function.
+ (som_bfd_reloc_type_lookup): New function.
+
+ * som.c (try_prev_fixup): New function.
+ (som_reloc_skip): New function.
+ (som_reloc_addend): New function.
+ (som_reloc_call): New function.
+
+ * som.c (som_initialize_reloc_queue): New function.
+ (som_reloc_queue_insert): Likewise.
+ (som_reloc_queue_fix): Likewise.
+ (som_reloc_queue_find): Likewise.
+
+ * som.c (som_hppa_howto_table): SOM howto relocation table.
+ (hppa_som_reloc): New function.
+
+ * som.c (struct reloc_queue): New structure to keep track of
+ the last four multibyte relocations emitted.
+ (enum pa_symbol_type): Type to fully describe the symbol types
+ associated with .import/.export assembler directives.
+
+ * som.c: Include libhppa.h
+
+ * som.c (bfd_som_set_section_attributes): New function.
+ (bfd_som_set_subsection_attributes): Likewise.
+ (bfd_som_set_symboL_type): Likewise.
+ (bfd_som_attach_unwind_info): Likewise.
+ * som.h: Declare new exported functions.
+
+ * som.h (struct som_symbol): Add new fields to hold additional
+ information needed to build/write symbol tables and fixup streams.
+ (struct som_section_data_struct): Add new fields to hold additional
+ information needed to build/write space and subspace headers.
+ (som_symbol_data): New accessor macro for SOM symbol information.
+ (R_HPPA_*): Basic relocation types to be used by the assembler.
+
+Fri Nov 12 11:00:28 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * trad-core.c (trad_unix_core_file_p): If new hook
+ TRAD_CORE_ALLOW_ANY_EXTRA_SIZE defined, then skip the check for the
+ corefile being too big.
+ * hosts/i386sco.h: Define it.
+
+Thu Nov 11 15:16:28 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * bfd.c (struct _bfd): Add hppabsd_core_data.
+ * targets.c (target_vector): Add hppabsd_core_vec.
+ * hpux-core.c (hpux_core_core_file_p): Fail if an unknown core
+ section is encountered during core section scanning.
+ * hppabsd-core.c: New file.
+ * config/hppabsd.mh: Enable HPPA BSD core files.
+
+ * elf32-hppa.c (hppa_elf_reloc): Remove DEFUN crud. Remove code
+ which is either commented out or ifdef'd out. Add, update and
+ clean comments. Fix various indention and spacing problems. Handle
+ problems related to using "ble" to jump to a stub rather than "bl"
+ (%r31 is trashed by "ble", but not by "bl").
+ (NEW_INSTRUCTION): Put inside curly braces.
+ (CURRENT_STUB_OFFSET): Fix indention problems.
+ (hppa_elf_build_arg_reloc_stub): Fix indention and spacing problems.
+ Add, update and clean comments. Handle "ble" %r31 lossage problems.
+ (hppa_elf_build_long_branch_stub): Likewise.
+ (hppa_look_for_stubs_in_section): Likewise.
+ (hppa_elf_stub_check): Remove obsolete function.
+
+ * hppa_stubs.h: Add new instructions to deal with %r31 lossage
+ problems. Delete unused instructions.
+
+Tue Nov 9 11:40:27 1993 Stan Shebs (shebs@rtl.cygnus.com)
+
+ * m68klynx.c (TARGET_IS_BIG_ENDIAN_P): Define.
+
+Tue Nov 9 11:26:05 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elfcode.h (elf_object_p): Rather than looking through an array
+ of architectures, get the ELF EM_xxx code from the backend
+ information. Let the generic ELF target match any EM_xxx code not
+ matched by another ELF target. Call elf_backend_object_p to let
+ the backend do more checks and set global information.
+ * libelf.h (struct elf_backend_data): Added elf_machine_code and
+ elf_backend_object_p fields.
+ (struct bfd_elf_arch_map): Removed.
+ (bfd_elf_arch_map, bfd_elf_arch_map_size): Don't declare.
+ * elf32-target.h, elf64-target.h: Initialize elf_machine_code
+ field with ELF_MACHINE_CODE. Initialize elf_backend_object_p
+ field with elf_backend_object_p (if it is defined).
+ * elf32-gen.c, elf32-hppa.c, elf32-i386.c, elf32-i860.c,
+ elf32-m68k.c, elf32-m88k.c, elf32-mips.c, elf32-sparc.c,
+ elf64-gen.c (ELF_MACHINE_CODE): Defined.
+ * elf32-mips.c: Include ecoffswap.h to get ECOFF swapping
+ routines.
+ (mips_elf_object_p): Set the right machine number.
+ (mips_elf_ecoff_debug_swap): Defined.
+ (elf_backend_object_p): Defined to be mips_elf_object_p.
+ (elf_backend_ecoff_debug_swap): Defined to be
+ mips_elf_ecoff_debug_swap.
+ * elf.c (bfd_elf_arch_map, bfd_elf_arch_map_size): Removed.
+
+ * libbfd-in.h (target_vector, default_vector): Declare.
+ * libbfd.h: Rebuilt.
+ * format.c (target_vector, default_vector): Don't declare.
+
+ * elf32-mips.c (elf_mips_howto_table): Don't complain on overflow
+ for R_MIPS_26. Correct overflow detection requires matching the
+ upper four bits of the destination against the PC. From Ted Lemon
+ <mellon@pepper.ncd.com>.
+
+ * bout.c (b_out_reloc_type_lookup): Return type should point to
+ const data.
+ * coff-i960.c (coff_i960_reloc_type_lookup): Likewise.
+ * elf32-hppa.c (elf_hppa_reloc_type_lookup): Likewise.
+ * mipsbsd.c (MY(reloc_howto_type_lookup)): Likewise.
+ * coff-i386.c (coff_i386_reloc): Made howto const.
+ * oasys.c (oasys_write_data): Made how const.
+
+ * libelf.h: Added some comments.
+ (struct elf_backend_data): Added elf_backend_ecoff_debug_swap
+ field. Removed unused write_relocs field.
+ * elf32-target.h: Adjusted elf_backend_data initialization
+ accordingly.
+ * elf64-target.h: Corrected elf_backend_data initialization to
+ fill in all fields and to set elf_64_p to 1.
+
+Mon Nov 8 18:13:14 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elfcode.h (bfd_section_from_shdr): Remove duplicate assignment
+ to filepos in SHT_STRTAB case.
+ (assign_file_position_for_section): Set BFD section filepos as
+ well as ELF section sh_offset.
+
+ * reloc.c: Use const instead of CONST.
+ (bfd_perform_relocation): Make variable howto a const pointer.
+ * bfd-in2.h, libbfd.h: Rebuilt.
+
+Mon Nov 8 12:19:15 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (realclean): Don't remove generated headers. Reverts
+ change of 2 Jul 1993.
+
+Mon Nov 8 06:08:31 1993 D. V. Henkel-Wallace (gumby@cirdan.cygnus.com)
+
+ * configure.bfd: make unixware equivalent to sysv4.
+
+ * config/i386-nlm.mt: bring in elf config; make it the default.
+
+Sun Nov 7 20:21:38 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * libbfd.c (bfd_put_8): Add parens around reference to "val"
+ argument.
+
+Fri Nov 5 21:45:09 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * hosts/i386mach3.h (HOST_SEGMENT_SIZE),
+ i386mach3.c (SEGMENT_SIZE, TEXT_START_ADDR): Correct values (?).
+
+Fri Nov 5 15:17:57 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * coffcode.h (coff_write_object_contents): Zero out internal_a.
+
+Fri Nov 5 10:41:07 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * aoutx.h, archive.c, archures.c, bfd.c, cache.c, coffcode.h,
+ core.c, ctor.c, format.c, init.c, libbfd.c, opncls.c, reloc.c,
+ section.c, syms.c, targets.c:
+ Doc cleanup (spelling, punctuation, grammar, formatting).
+ * bfd-in2.h, libbfd.h: Rebuild.
+
+Thu Nov 4 14:46:14 1993 John Gilmore (gnu@rtl.cygnus.com)
+
+ * bfd-in.h (bfd_get_cacheable, bfd_set_cacheable): New accessors.
+ * bfd.c, opncls.c: Improve comments on file descriptor cacheing.
+
+Thu Nov 4 08:54:30 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * From Pete Hoogenboom (hoogen@cs.utah.edu)
+ * elf32-hppa.c (hppa_elf_get_section_contents): Fix logic error
+ in last change. Always rebuild symbol extension section the first
+ time though if output sections exist (fixes ld -r problems).
+
+Thu Nov 04 08:08:46 1993 Jeffrey Wheat (cassidy@cygnus.com)
+
+ * Makefile.in: Add .PHONY for check and installcheck rules.
+
+Tue Nov 2 14:42:27 1993 Bill Cox (bill@tarkas.cygnus.com)
+
+ * libbfd-in.h (artdata): Use long, not time_t for portability, at
+ least to HPUX. File below is a derived file.
+
+Tue Nov 2 14:42:27 1993 Bill Cox (bill@tarkas.cygnus.com)
+
+ * libbfd.h (artdata): Use long, not time_t for portability, at
+ least to HPUX.
+
+Tue Nov 2 09:32:25 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config.bfd: Use bigmips for mips*-*-bsd*.
+
+Mon Nov 1 14:30:09 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elfcode.h (elf_slurp_reloca_table, elf_slurp_reloc_table):
+ Handle symbol number of zero.
+
+ * reloc.c (enum bfd_reloc_code_real): Added
+ BFD_RELOC_MIPS_LITERAL, BFD_RELOC_MIPS_GOT16,
+ BFD_RELOC_MIPS_CALL16, BFD_RELOC_MIPS_GPREL32.
+ * bfd-in2.h: Rebuilt.
+ * coff-mips.c (mips_bfd_reloc_type_lookup): Handle
+ BFD_RELOC_MIPS_LITERAL.
+ * elf32-mips.c (mips_reloc_map): Handle new relocs.
+ (mips_elf_hi16_reloc, mips_elf_lo16_reloc): Rearrange _gp_disp
+ checks slightly.
+
+ * aout-target.h (MY_bfd_debug_info_start, MY_bfd_debug_info_end,
+ MY_bfd_debug_info_accumulat [sic]): Remove unused definitions.
+ (MY_bfd_get_relocated_section_contents, MY_bfd_relax_section,
+ MY_bfd_seclet_link): Define.
+ (MY_bfd_reloc_type_lookup): Rename from
+ MY_reloc_howto_type_lookup.
+ (MY_bfd_make_debug_symbol): Rename from MY_make_debug_symbol.
+ (MY(vec)): Use JUMP_TABLE rather than listing functions.
+ * hp300hpux.c (MY_get_symtab, MY_get_symtab_upper_bound,
+ MY_canonicalize_reloc, MY_write_object_contents): Don't define in
+ terms of MY, because that causes a recusive invocation of CAT when
+ expanded within JUMP_TABLE, and ANSI compilers don't expand
+ recursive macros.
+ * mipsbsd.c (MY_bfd_reloc_type_lookup): Rename from
+ MY_reloc_howto_type_lookup, and don't define in terms of MY.
+ (MY_canonicalize_reloc): Don't define in terms of MY.
+ (aout_mips_little_vec, aout_mips_big_vec): Use JUMP_TABLE rather
+ than listing functions.
+
+Mon Nov 1 09:12:25 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config.bfd: Use m68k-elf for m68*-*-sysv4*.
+
+Sun Oct 31 09:35:49 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * targets.c: Move enum target_flavour outside of struct and change
+ the name to enum bfd_flavour. This means bfd clients can use it.
+ * bfd-in.h: Add macro bfd_get_flavour.
+ * bfd-in2.h: Rebuilt.
+
+ * som.c: Add comment about how abort() on corrupt executable is evil.
+
+Sat Oct 30 12:27:09 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * aoutx.h (aout,slurp_reloc_table): Avoid a goto.
+
+Fri Oct 29 16:04:33 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * gen-aout.c, libbfd.c: exit(1) instead of exit(-1).
+
+Fri Oct 29 13:17:21 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * bfd-in.h: Added commands for object file flag values.
+ * bfd-in2.h: Rebuilt.
+ * elfcode.h (elf_object_p): If type is ET_DYN, set DYNAMIC flag,
+ not EXEC_P.
+ * bout.c, coff-h8300.c, coff-sh.c: Add BFD_IS_RELAXABLE to
+ object_flags field for target vector.
+ * aix386-core.c, aout-adobe.c, aout-target.h, bout.c, coff-a29k.c,
+ coff-alpha.c, coff-apollo.c, coff-h8300.c, coff-h8500.c,
+ coff-i386.c, coff-i960.c, coff-m68k.c, coff-m88k.c, coff-mips.c,
+ coff-rs6000.c, coff-sh.c, coff-we32k.c, coff-z8k.c, hpux-core.c,
+ ieee.c, mipsbsd.c, nlm-target.h, oasys.c, osf-core.c, som.c,
+ srec.c, tekhex.c, trad-core.c: Remove DYNAMIC from object_flags
+ field for target vector.
+
+Thu Oct 28 20:02:31 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * hosts/std-host.h: Don't declare time; causes error on mach3.
+ * configure.in (i386mach3_vec): Require aout32.o stab-syms.o.
+
+Thu Oct 28 16:33:26 1993 Stan Shebs (shebs@rtl.cygnus.com)
+
+ LynxOS and Sparc LynxOS changes:
+ * config.bfd: Recognize sparc-*-lynxos*.
+ * configure.host: Recognize sparc-*-lynxos*.
+ * configure.in: Recognize Sparc Lynx vectors.
+ * targets.c (sparclynx_aout_vec): Declare.
+ (sparclynx_coff_vec): Declare.
+ (target_vector): Add them.
+ * cf-i386lynx.c: New file, renamed from i386lynx-cf.c.
+ * cf-m68klynx.c: New file, renamed from m68klynx-cf.c.
+ * cf-sparclynx.c: New file, support for coff in Sparc LynxOS.
+ * coff-sparc.c: New file, basic Sparc coff support.
+ * sparclynx.c: New file, support for a.out in Sparc LynxOS.
+ * Makefile.in: Change filenames appropriately, add Sparc rules.
+ * coffcode.h (coff_set_arch_mach_hook): Recognize Sparc magic
+ number.
+ (coff_set_flags): Use LynxOS magic number for i386, m68k, and
+ Sparc LynxOS, set Sparc magic number for Sparcs.
+ * config/m68k-lynx.mt (SELECT_VECS): Remove redundant vector.
+ * config/sparc-lynx.mt: New file.
+ * hosts/i386lynx.h: Cosmetic improvements.
+ * hosts/m68klynx.h: Add ifdefs, #define of cfree.
+ * hosts/sparclynx.h: New file.
+
+Thu Oct 28 16:23:40 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ gcc -Wall lint:
+ * coff-h8300.c (h8300_reloc16_estimate): Declare return type.
+ Remove useless statement probably left by code copy.
+ * cpu-i960.c (compatible): Fully bracket matrix initializer.
+ * elf32-hppa.c (hppa_elf_build_arg_reloc_stub): Use bfd_xmalloc
+ rather than xmalloc. Use realloc and check the return value
+ rather than xrealloc.
+ (hppa_elf_get_section_contents): Add some casts.
+ * elf32-i386.c (elf_i386_reloc_type_lookup): Remove unused
+ variable. Add default case to switch.
+ * hp300hpux.c: Declare aout_32_write_syms.
+ * i386bsd.c, i386linux.c, netbsd386.c (N_SHARED_LIB): Define as 0
+ (definition from aout/aout64.h is always 0 anyhow).
+ * i386lynx.c (swap_std_reloc_in): Remove unused variable.
+ * ieee.c (ieee_write_id): length can never be negative.
+ (read_id): Likewise.
+ (ieee_archive_p): Remove unused variable.
+ * libcoff-in.h (bfd_perform_slip): Declare.
+ * libcoff.h: Rebuilt.
+ * oasys.c (oasys_write_sections): Remove zero initialization of
+ static structure.
+ * reloc16.c: Indentation change.
+
+Wed Oct 27 16:51:29 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * configure.in, config/i386-mach3.mt: Update for new configuration
+ (--with-targets and so on).
+ * hosts/i386mach3.h: Declare errno.
+ * targets.c: Declare i386mach3_vec.
+
+Wed Oct 27 12:18:07 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * nlmcode.h (nlm_swap_auxiliary_headers_in,
+ nlm_swap_auxiliary_headers_out): Handle sharedDebugRecordOffset
+ and sharedDebugRecordCount fields.
+
+Tue Oct 26 16:21:12 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * targets.c (target_vector): Remove SCO_CORE. On Sep 11 1993,
+ we started using trad-core.c for SCO instead.
+
+ * targets.c (target_vector): Re-enable generic ELF and NLM targets.
+
+Tue Oct 26 16:53:12 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elfcode.h (assign_file_position_for_section): Align sh_offset to
+ sh_addralign (this is what UnixWare does, and it shouldn't hurt).
+
+Tue Oct 26 10:16:54 1993 Ken Raeburn (raeburn@cygnus.com)
+
+ From Jeff Law and Pete Hoogenboom at Utah:
+
+ * 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.
+
+Tue Oct 26 02:40:46 1993 Stu Grossman (grossman at cygnus.com)
+
+ * som.c (hppa_object_setup): Set SEC_CODE for .text section so
+ that GDB can figure out text_start and text_end.
+
+Mon Oct 25 16:05:23 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ Fix up warnings from gcc -Wall:
+ * coffgen.c (coff_print_symbol): Use %lx and cast n_value to
+ unsigned long. Use %ld for tagndx. Use %lx for offset + vma and
+ cast it to unsigned long.
+ * ecoff.c (ecoff_emit_aggregate): Use %ld.
+ (ecoff_print_symbol): Use %ld, and cast indx and sym_base to long.
+ * coffcode.h (dummy_reloc16_estimate): Specify return type.
+
+ * libbfd.c (bfd_write): If not everything is written out, set
+ bfd_error to system_call_error. If the return value is
+ non-negative, set errno to ENOSPC (if ENOSPC is defined).
+ (bfd_seek): If the seek fails, set bfd_error to system_call_error.
+ (bfd_generic_set_section_contents): For a bad offset + count, set
+ bfd_error to bad_value.
+ * seclet.c (rel): Don't abort. Instead, return false.
+
+Mon Oct 25 09:59:37 1993 Ken Raeburn (raeburn@cygnus.com)
+
+ * aoutx.h (reloc_type_lookup): Handle BFD_RELOC_SPARC_WDISP22.
+
+Fri Oct 22 20:35:54 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * config.bfd: handle mips*-* instead of mips-*, use mips*el
+ instead of mips-*-*l
+
+Fri Oct 22 14:03:33 1993 Mark Eichin (eichin@cygnus.com)
+
+ * m68k-lynx.mt, i386-lynx.mt (TDEFINES): set
+ FPRINTF_ALREADY_DECLARED because the objdump.c declaration of
+ fprintf collides with the native one.
+
+Fri Oct 22 11:50:25 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * targets.c (target_vector): Enable MIPS ELF vectors.
+
+Fri Oct 22 07:51:51 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config.bfd: Use bigmips for mips-sony-bsd*.
+
+ * configure.host, config.bfd: Add * to end of all OS names.
+
+Thu Oct 21 12:16:26 1993 Ken Raeburn (raeburn@cygnus.com)
+
+ * elfcode.h (FILE_ALIGN): Renamed from EALIGN, to avoid conflict
+ with Ultrix header files.
+
+ * som.h (struct som_section_data_struct): Renamed from
+ som_section_data to avoid conflict with macro by that name.
+
+ Changes from Jeff Law and Peter Hoogenboom at Utah:
+
+ * elf32-hppa.c (hppa_elf_reloc): Target register for a 'jump
+ in delay slot' optimization in combination with a long call
+ stub should always be r31.
+
+ * elf32-hppa.c: (hppa_elf_relocate_insn): To be consistent
+ across all relocation types, retrieve instruction addends from
+ the relocation entry rather than from the instruction itself.
+
+ * elf32-hppa.c: (hppa_elf_relocate_insn): Fix a relocation
+ error that only occurred when the addend of an 'addil' or
+ 'ldil' was larger than 21 bits and very close to a 2K byte
+ boundary.
+
+ * elf32-hppa.c: (hppa_elf_reloc): Handle the optimization in
+ which a jump is placed in the delay slot of a function call.
+ The jump was being accomplished via an adjustment to the
+ return pointer. This optimization would break the long call
+ stub code, if there was any.
+
+ * elf32-hppa.c: (hppa_elf_build_long_branch_stub): Corrections
+ to long branch stubs to avoid use of general register 2.
+
+ * hppa_stubs.h: New stub instructions.
+
+ * elfcode.h: Declare bfd_elf_find_section.
+
+ * som.h (som_section_data): Add new "subspace_index" field.
+
+ * som.c (setup_sections): Save the original SOM subspace index
+ in the BFD section associated with that subspace.
+ (som_get_symtab_upper_bound): Implement.
+ (som_get_symtab): Implement.
+ (som_print_symbol): Implement.
+ (som_slurp_string_table): New function to read a string table
+ from a SOM object file.
+ (som_section_from_subspace_index): New function to return the
+ section which corresponds to a SOM subspace index.
+ (som_slurp_symbol_table): New function to read the symbol
+ table from a SOM object file.
+ (som_make_empty_symbol): Check for errors from bfd_zalloc.
+ (som_new_section_hook): Initialize subspace_index field to
+ -1 instead of 0.
+
+ * som.c (som_object_setup): Fix polarity of test to set HAS_RELOC.
+ Set EXEC_P for executables.
+ (setup_sections): Correctly identify when a section has
+ relocations.
+ (log2): New function.
+ (setup_sections): Correctly convert between SOM alignments and BFD
+ alignments.
+
+ * som.c (setup_sections): Do not set SEC_ALLOC or SEC_LOAD
+ for sections which correspond to SOM spaces, doing so confuses
+ many utilities. Set assorted SEC_* flags for SOM subspaces
+ which correspond to BFD sections.
+
+ * elf32-hppa.c: (elf32_hppa_backend_fake_sections): The stab
+ string table should have sh_type == SHT_STRTAB. Add
+ processing to make it so.
+
+ * elfcode.h: (bfd_section_from_shdr): String tables (other
+ than .strtab) were not getting the file offsets recorded, so
+ they could not be read from disk.
+
+ * elfcode.h: (elf_make_sections): Leave the sh_addr field of
+ the section header and the vma field of a section at 0 if the
+ section is not part of the program execution image. (e.g.,
+ .stab)
+
+ * som.[hc]: Change target vector prefix from "hppa" to "som".
+ Consistently use obj_som prefix to access fields in backend data
+ structures. Fix all callers/references.
+
+ * som.h: Do not include files only needed for core file reading here.
+ Include a.out for both HOST_HPPAHPUX and HOST_HPPABSD. Delete
+ forward structure declarations, they are unnecessary.
+ (struct somdata): Delete aux_hdr, and hp_symbol_entry_size fields.
+ Change "symbols" to "symtab". Add "stringtab" and "reloc_filepos"
+ fields for future use. Change obj_som_* macros as appropriate.
+ (som_section_data): New structure to keep SOM specific information
+ about BFD sections (for future use).
+
+ * som.c: Provide PARAMS declarations for all functions currently
+ in this file.
+ (struct container): Delete unwanted structure definition.
+ (som_object_setup): Add comments. Use som_mkobject to allocate
+ SOM specific information in the BFD; use information from the
+ file and (possibly empty) auxiliary headers to initialize this
+ information. Delete redundant bfd_get_symcount (abfd) "calls".
+ (setup_sections): Return type is now boolean, fix return statements.
+ "Fix" handling of BSS like subspaces in the computation of the
+ containing space's size. If the subspace has relocations, set the
+ appropriate BFD section flags and record the index into and the
+ size of the fixup stream. Always return a value.
+ (som_object_p): Set bfd_error appropriately if errors are detected
+ from bfd_{read,seek} functions. Handle EXECLIBMAGIC type files.
+ Do not try to read a non-existant auxiliary header.
+ (som_mkobject): Flesh out.
+ (som_section_hook): Allocate space to hold SOM specific information
+ about sections.
+
+Thu Oct 21 12:41:34 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ gcc -Wall lint:
+ * coff-h8300.c, coffcode.h: Change shrink parameter
+ in *_reloc16_estimate to unsigned to match prototype.
+ * archive.c: Avoid "/*" in comment.
+
+Thu Oct 21 13:05:16 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * dep-in.sed: Create our own line breaks for a more aesthetic
+ Makefile.
+ * Makefile.in: Rebuilt dependencies.
+
+ * elf32-mips.c: Include "seclet.h".
+ (mips_elf_fake_sections): Force size of .reginfo section to sizeof
+ Elf32_External_RegInfo.
+ (mips_elf_seclet_link): New function. Link the .reginfo section
+ specially, and pass everything else to the generic routine.
+ (bfd_elf32_bfd_seclet_link): Define macro.
+ * elf32-target.h: If bfd_elf32_bfd_seclet_link is already defined,
+ don't override it.
+
+Wed Oct 20 12:22:37 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * libnlm.h (nlm_backend_data): Added signature field.
+ (nlm_signature): New macro.
+ * nlmcode.h (nlm_object_p, nlm_write_object_contents): Use the NLM
+ signature from the backend rather than the constant NLM_SIGNATURE.
+ * nlm32-i386.c (nlm32_i386_backend): Initialize signature field.
+
+ * aoutf1.h (MACHTYPE_OK): Accept M_UNKNOWN.
+ (NAME(sunos,set_arch_mach)): Treat M_UNKNOWN as 68000, not 68020.
+
+Wed Oct 20 10:28:27 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * hosts/i386bsd.h [__bsdi__]: Define HOST_DATA_START_ADDR.
+
+Wed Oct 20 10:10:07 1993 Ken Raeburn (raeburn@cygnus.com)
+
+ * Makefile.in (HFILES): New variable, for use in "make dep".
+ (.dep): Depend on $(CFILES) and $(HFILES). Delete .dep1 and
+ remake it, so that "$?" is complete.
+ (.dep1): Don't need to remove .dep1 first.
+ (dep.sed): Depend on config.status, not Makefile.
+ (CFILES): Add nlm.c.
+
+Tue Oct 19 15:26:26 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * coff-alpha.c: Implemented reloc handling for the linker, made
+ various other related changes.
+ * libecoff.h (ecoff_backend_data): Added rdata_in_text field.
+ Renamed finish_reloc to adjust_reloc_in. Added adjust_reloc_out
+ field.
+ (ecoff_bfd_get_relocated_section_contents): Don't define.
+ * ecoff.c (ecoff_sec_to_styp_flags, ecoff_styp_to_sec_flags):
+ Handle .lita section.
+ (ecoff_slurp_reloc_table): Handle RELOC_SECTION_FINI.
+ finish_reloc backend field renamed to adjust_reloc_in.
+ (ecoff_bfd_seclet_link): Adjust number of aux entries to
+ debug_align boundary.
+ (ecoff_compute_section_file_positions): If rdata_in_text put
+ .rdata section in text segment, not data segment. Put .pdata
+ section in text segment.
+ (ecoff_write_object_contents): Likewise. Also, call
+ adjust_reloc_out, and handle .lita, .xdata, .pdata, .fini and
+ absolute sections when writing out relocs.
+ * coffswap.h (coff_swap_aouthdr_out): For ALPHAECOFF, output 2 for
+ bldrev field, as on Alpha OSF/1. Padding field is now 2 bytes.
+ * coff-mips.c (mips_ecoff_swap_reloc_out): Added assertion.
+ (mips_adjust_reloc_in): Renamed from mips_finish_reloc.
+ (mips_adjust_reloc_out): New function (does nothing).
+ (mips_ecoff_backend_data): Initialize new fields.
+ (ecoff_bfd_get_relocation_section_contents): Define to be
+ bfd_generic_get_relocated_section_contents.
+
+ * reloc.c (bfd_perform_relocation): Added casts to avoid Alpha
+ OSF/1 cc bug.
+
+Thu Oct 14 01:10:35 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * reloc.c (bfd_perform_relocation): Add comments attempting to
+ explain PC relative relocations.
+
+ * coffcode.h (styp_to_sec_flags): Don't set SEC_DEBUGGING until it
+ is made to work.
+ (coff_compute_section_file_positions): Remove check for
+ USE_DISCARDED_SECTIONS_COUNT.
+ * coff-i386.c: Don't define USE_DISCARDED_SECTIONS_COUNT. Basing
+ it on host defines is wrong.
+
+ * ecoff.c (ecoff_bfd_seclet_link): Don't link a .reginfo section.
+ (ecoff_write_object_contents): Don't require the .reginfo section
+ to be a particular size.
+
+Wed Oct 13 18:39:03 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * Makefile.in (dep-in): New rule, for editing dependencies into
+ Makefile.in in $(srcdir). Use move-if-change.
+ (.dep1, dep): Use move-if-change.
+ (CFILES): Add coff-apollo.c.
+
+ Sun Oct 10 18:02:56 1993 Troy Rollo (troy@cbme.unsw.EDU.AU)
+
+ * Makefile.in: Recognise new file, coff-apollo.o
+
+ * coff-apollo.c: New file
+
+ * coffcode.h: Recognise apollo magic numbers and writable text
+
+ * coffswap.h: Swap Apollo optional header entries
+
+ * config.bfd: Add line for Apollo
+
+ * configure.host: Replace apollo68b and apollo68v with Apollo
+
+ * configure.in: Recognise apollocoff_vec
+
+ * targets.c: Likewise
+
+ * config/apollo.mh, config/apollo.mt: New files
+
+ * hosts/apollo68.h: Remove inclusion of strings.h
+
+Wed Oct 13 14:28:17 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * coff-i386.c (i3coff_object_p): Now static.
+
+ * Makefile.in: Updated dependencies.
+ (.dep, .dep1, dep.sed): New targets, to make "make dep" work
+ better.
+ * dep-in.sed: New file.
+
+ * m68klynx-cf.c (ONLY_DECLARE_RELOCS): Define, to avoid name
+ conflicts when "--with-targets=all".
+ * coff-m68k.c (m68kcoff_howto_table, m68k_rtype2howto,
+ m68k_howto2rtype): Rename via macros to keep namespace clean.
+ * configure.in: For m68klynx_coff_vec, include coff-m68k.o for
+ now.
+
+Tue Oct 12 17:03:27 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elf32-mips.c: Extensive additions to do relocations and to
+ handle MIPS specific sections.
+ * libelf.h (elf_backend_data): Pass fourth argument to
+ elf_backend_section_from_bfd_section to permit it to control the
+ section index to use.
+ (elf_obj_tdata): Add gp and gp_size fields.
+ (elf_gp, elf_gp_size): New accessor macros.
+ * elfcode.h: Removed a number of unused local variables.
+ (elf_fake_sections): Clear section header before calling
+ elf_backend_fake_sections, not after.
+ (prep_headers): Return true at end.
+ (elf_section_from_bfd_section): Pass retval argument to
+ elf_backend_section_from_bfd_section.
+ * elf32-hppa.c (elf32_hppa_backend_section_from_bfd_section):
+ Accept and ignore new retval argument.
+ * bfd.c: Include libelf.h.
+ (bfd_set_gp_size): Handle ELF targets.
+ * Makefile.in (bfd.o): Depends upon libelf.h.
+ (elf32-mips.o): Depends upon $(INCDIR)/elf/mips.h.
+
+Mon Oct 11 17:25:18 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * ecoff.c (ecoff_mkobject): Check bfd_make_section return value.
+ (ecoff_mkobject_hook): New function.
+ (ecoff_new_section_hook, ecoff_sizeof_headers,
+ ecoff_compute_section_file_positions, ecoff_set_section_contents,
+ ecoff_write_object_contents): Handle dummy REGINFO section.
+ (ecoff_get_section_contents): New function to handle reading
+ REGINFO section.
+ * libecoff.h (ecoff_get_section_contents): Change from macro
+ definition to function prototype.
+ (ecoff_mkobject_hook): New prototype.
+ * coff-alpha.c (alpha_ecoff_mkobject_hook): Removed.
+ (alpha_ecoff_backend_data): Use ecoff_mkobject_hook.
+ * coff-mips.c (mips_ecoff_mkobject_hook): Removed.
+ (mips_ecoff_backend_data): Use ecoff_mkobject_hook.
+
+Fri Oct 8 15:25:33 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * libbfd.c (bfd_get*32, bfd_get*64): Prevent ANSI sign extension
+ by casting the most significant byte to bfd_vma.
+
+Fri Oct 8 02:34:21 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * configure.in: Do not define SELECT_VECS, SELECT_ARCHITECTURES
+ if configuring --with-targets=all.
+
+Thu Oct 7 17:34:07 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * aoutx.h (howto_table_std): Correct the "size" field in some
+ entries.
+
+ * reloc.c (reloc_howto_type): Change documentation to dispel any
+ notion that the "size" field is a power-of-two indicator.
+
+Thu Oct 7 10:50:38 1993 Steve Chamberlain (sac@phydeaux.cygnus.com)
+
+ * coffswap.h: (bfd_swap_reloc_in): a symndx is signed.
+
+ Make support for relaxing more generic.
+ * reloc16.c: Add new target entry - bfd_coff_reloc16_estimate,
+ fix bit rot.
+ * libcoff.h, libcoff-in.h: declarations. Prototypes
+ * coffcode.h (bfd_coff_std_swap_table): Add calls to
+ coff_reloc_16_extra_cases and coff_reloc16_estimate.
+ (dummy_reloc16_estimate): New function.
+ * coff-h8300.c (h8300_reloc16_estimate): New function
+
+Thu Oct 7 14:24:13 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * elfcode.h (EALIGN): Define, dependent on ARCH_SIZE.
+ (align_file_position): New function.
+ (elf_locate_sh): Disabled function deleted.
+ (assign_file_positions_for_symtab_and_strtabs): Align position,
+ then place symtab, then do other sections.
+ (map_program_segments): Align program header.
+ (assign_file_positions_except_relocs): Align section headers.
+ (assign_file_positions_for_relocs): Align relocation sections.
+
+Tue Oct 5 10:44:32 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * configure.host: Recognize hppa*-*-hiux* (currently synonym for hpux).
+ Change other hppa entries to use -*- not -hp-.
+ * config.bfd: Recognize hppa*-*-hiux* (currently synonym for hpux).
+
+ * coff-rs6000.c, cpu-rs6000.c, rs6000-core.c: Change non-ASCII
+ characters in comment to octal escapes.
+
+Sun Oct 3 12:35:15 1993 Stan Shebs (shebs@rtl.cygnus.com)
+
+ * coff-i386lynx.c: Removed, name too long.
+ * i386lynx-cf.c: New file, was coff-i386lynx.c.
+ * configure.in: Reflect file name changes.
+ * Makefile.in: Mention Lynx-related files.
+
+ * i386lynx.c (lynx_32_swap_ext_reloc_in): get reloc bits in i386
+ Lynx-specific way.
+
+ * m68klynx-cf.c: New file, defines coff format for M68K LynxOS.
+ * m68klynx.c: Remove coff vector definition, now in m68klynx-cf.c.
+
+ * coffcode.h (sec_to_styp_flags): Set section flag to STYP_INFO
+ for .stab, .stabstr and .debug sections, and set SEC_DEBUGGING for
+ sections of type STYP_INFO. (from Minh Tran-Le)
+ (coff_compute_section_file_positions): Add discarded_sections_count
+ to abfd->section_count, which helps `strip' keep the size
+ of the executable header constant.
+ * coff-i386.c (discarded_sections_count): New variable, initialized
+ to zero. For use by `strip'. Currently being used only in aix386
+ coff, but may be useful for other coff systems. (from Minh Tran-Le)
+
+ * coffswap.h (coff_swap_filehdr_out): Added a missing cast.
+
+ * archive.c: Cosmetic improvements.
+ * opncls.c: Cosmetic improvements.
+ (new_bfd): Removed redundant structure slot init.
+
+Sat Oct 2 18:48:17 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/news-mips.mh, hosts/news-mips.h: New files.
+ * configure.host: Use news-mips for mips-sony-bsd*.
+
+Fri Oct 1 13:14:17 1993 Stan Shebs (shebs@rtl.cygnus.com)
+
+ * configure.in: i386lynx_coff_vec requires coff-i386lynx.o.
+ * coff-i386lynx.c: New file, defines Lynx target vector and name,
+ includes coff-i386.c.
+ * coff-i386.c (i386coff_vec): Allow redefinition of target vector
+ symbol and name, if TARGET_SYM and/or TARGET_NAME are defined.
+ * i386lynx.c: Remove coff vector definition entirely.
+ (lynx_32_swap_ext_reloc_in): Define.
+ (lynx_32_swap_std_reloc_in): Define, get reloc bits in i386
+ Lynx-specific way.
+ (lynx_32_swap_ext_reloc_out): Define.
+ (lynx_32_swap_std_reloc_out): Define.
+ (lynx_32_slurp_reloc_table): Define, call Lynx swapping fns.
+ (lynx_32_squirt_out_relocs): Define, call Lynx swapping fns.
+ (lynx_32_canonicalize_reloc): Define, call Lynx swapping fns.
+ (WRITE_HEADERS): Define, call Lynx swapping fns.
+
+ * config/i386-lynx.mt (SELECT_VECS): Remove redundant vector.
+
+Thu Sep 30 17:50:52 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * reloc.c (bfd_reloc_code_type): Add linkage-table relative
+ relocations of size 8, 16, 32. Sort generic relocs by type rather
+ than size. Added a little documentation too.
+
+ * aoutx.h (howto_table_std): Add BASE16 and BASE32 relocs.
+ (TABLE_SIZE): New macro.
+ (reloc_type_lookup): Handle BFD_RELOC_{16,32}_BASEREL for std
+ relocs.
+ (swap_std_reloc_out): Write baserel relocs correctly.
+ (swap_std_reloc_in): Handle r_baserel field. Assert that
+ r_jmptable and r_relative fields are clear, and that the computed
+ index does refer to a defined entry of the howto table.
+
+Tue Sep 28 14:47:46 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * section.c (bfd_make_section_anyway): New function.
+ * section.c: Change comments to say several sections can have
+ the same name.
+ * bfd-in2.h: Re-generate to reflect above change.
+ * coffgen.c (make_a_section_from_file): Call bfd_make_section_anyway
+ if still no section after the bfd_coff_make_section_hook.
+ * coffcode.h: Add comment about TWO_DATA_SECS.
+
+Tue Sep 28 03:22:24 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * ecoff.c (ecoff_slurp_symbolic_info): Always determine raw_size
+ explicitly.
+ * ecoff.c (ecoff_sec_to_styp_flags, ecoff_styp_to_sec_flags): Handle
+ .fini section.
+
+Mon Sep 27 18:29:18 1993 Stan Shebs (shebs@rtl.cygnus.com)
+
+ * config.bfd configure.host: Match on *-lynxos* for LynxOS,
+ add m68*-*-lynxos*.
+ * configure.in : Replaced i386lynx_vec with i386lynx_aout_vec
+ and i386lynx_coff_vec.
+ Added m68klynx_aout_vec and m68klynx_coff_vec.
+ * targets.c (target_vector): Removed i386lynx_vec, added
+ {i386,m68k}lynx_{aout,coff}_vec.
+ * i386lynx.c: Added copy of i386coff.c, renamed bfd target to
+ i386lynx_coff_vec.
+ * m68klynx.c: New file.
+ * config/i386-lynx.mt: Replaced i386lynx_vec with i386lynx_aout_vec
+ and i386lynx_coff_vec.
+ * config/m68k-lynx.mt: New file.
+ * hosts/i386lynx.h: Added definition of cfree as free (from Eichin).
+ * hosts/m68klynx.h: New file.
+
+Mon Sep 27 18:00:41 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * archive.c: Define offsetof here.
+ * hosts/*.h: Don't define it here.
+
+Mon Sep 27 19:09:27 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elfcode.h (bfd_section_from_shdr): Set filepos for SHT_STRTAB
+ section.
+
+Fri Sep 24 15:47:40 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * hpux-core.c: Add comment about hpux version 7.
+
+Fri Sep 24 16:50:26 1993 Stu Grossman (grossman at cygnus.com)
+
+ * lynx-core.c (lynx_core_file_p): Change per-thread register
+ section names from .regXXX to .reg/XXX to avoid parsing ambiguity
+ in gdb/corelow.c. Create alias .reg section for the currently
+ running thread.
+
+Fri Sep 24 13:22:32 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * libecoff.h (ecoff_backend_data): Removed big_magic and
+ little_magic fields.
+ * coff-alpha.c (alpha_ecoff_backend_data): Removed initialization
+ of big_magic and little_magic.
+ * coff-mips.c (mips_ecoff_bad_format_hook): Make sure magic number
+ matches endianess of bfd.
+ (mips_ecoff_backend_data): Removed initialization of big_magic and
+ little_magic.
+ * ecoff.c (ecoff_set_arch_mach_hook): Set MIPS machine number
+ based on magic number. Support r4000 magic numbers.
+ (ecoff_get_magic): New function.
+ (ecoff_write_object_contents): Use ecoff_get_magic, not fields in
+ the backend structure.
+ * cpu-mips.c (arch_info_struct): Added case for r6000.
+
+ For MIPS configurations put both big and little endian versions in
+ the list of targets; the code is getting compiled in anyhow.
+ * bigmips.mt (SELECT_VECS): Define to be ecoff_little_vec.
+ * decstation.mt (SELECT_VECS): Define to be ecoff_big_vec.
+ * mipsbelf.mt (SELECT_VECS): Define to be bfd_elf32_littlemips_vec.
+ * mipslelf.mt (SELECT_VECS): Define to be bfd_elf32_bitmips_vec.
+ * riscos.mt (SELECT_VECS): Define to be ecoff_little_vec.
+
+Fri Sep 24 00:42:23 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * osf-core.c: New file for OSF/1 core file support.
+ * config/alphaosf.mh (HDEFINES): Add -DOSF_CORE.
+ (HDEPFILES): Set to osf-core.o.
+ * bfd-in2.h (union tdata): Add osf_core_data member.
+ * targets.c: If OSF_CORE is defined, add osf_core_vec to target list.
+ * Makefile.in (OPTIONAL_BACKENDS): Add osf-core.o.
+ (osf-core.o): New dependency.
+
+Thu Sep 23 21:04:53 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * TODO: Remove note about making --with-bfd-targets use canonical
+ target configuration name (already done); reword item about
+ separating reading and writing stuff to not refer to a
+ non-existent item.
+
+ * ecoff.h (ecoff_set_arch_mach_hook): Accept MIPS_MAGIC_LITTLE2
+ and MIPS_MAGIC_BIG2.
+
+Thu Sep 23 11:06:34 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * gen-aout.c (main): Output newline after end of comment, not
+ before. (Reported by Jonathan Stone,
+ jonathan@oscar.stanford.edu).
+
+Thu Sep 23 10:48:27 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * archive.c (compute_and_write_armap): Put weak symbols in the
+ armap.
+
+ * elfcode.h (fix_up_strtabs): Set sh_entsize for the .stab
+ section, not the .stabstr section. Set the type of the .stabstr
+ section to SHT_STRTAB.
+ (elf_section_from_bfd_section): Handle SHT_STRTAB sections.
+
+ * section.c (SEC_DEBUGGING): New section flag.
+ * elfcode.h (bfd_section_from_shdr): If section is SHT_PROGBITS,
+ and the name starts with .debug, .line or .stab, set
+ SEC_DEBUGGING. If SHT_STRTAB, check for .debug and .stab.
+ * elf32-target.h (TARGET_BIG_SYM, TARGET_LITTLE_SYM): Added
+ SEC_DEBUGGING to section_flags.
+ * elf64-target.h (TARGET_BIG_SYM, TARGET_LITTLE_SYM): Added
+ SEC_DEBUGGING and SEC_CODE to section_flags.
+ * bfd-in2.h: Updated.
+
+Wed Sep 22 16:34:14 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * bfd.c (tdata): Add lynx_core_data.
+
+ * ecoff.c (ecoff_compute_section_file_positions): Set filepos for
+ sections with SEC_LOAD set, even if SEC_HAS_CONTENTS is clear.
+ (ecoff_write_object_contents): Don't set scnptr to zero just
+ because size of section is zero. Needed for Irix 4.0.5F.
+
+Wed Sep 22 09:49:32 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config.bfd: Use i960-bout, not i960-coff for i960-*-nindy*.
+
+Wed Sep 22 07:34:09 1993 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in (OPTIONAL_BACKENDS): Add lynx-core.o.
+ * bfd-in2.h (tdata): Add lynx_core_data;
+ * config.bfd configure.host: Get rid of superfluous netbsd and
+ lynxos entries.
+ * configure.in: Add lynx-core.o to Lynx config.
+ * i386lynx.c: Add defs for core file support.
+ * lynx-core.c: New file with Lynx core file support.
+ * hosts/i386lynx.h: Move lots of host specific includes to here.
+ Add def of HOST_LYNX. Remove unnecessary defs.
+
+Mon Sep 20 19:18:10 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elfcode.h (bfd_section_from_shdr): Only set SEC_DATA for a
+ SHF_PROGBITS or SHT_STRTAB section if SEC_ALLOC is set. Never set
+ SEC_DATA for a SHF_NOBITS section.
+
+ * nlm32-i386.c (nlm_i386_mangle_relocs): Check SEC_LOAD rather
+ than SEC_CODE | SEC_DATA. Add some casts to avoid warnings.
+ * nlmcode.h: Add some casts to avoid warnings.
+ (nlm_write_object_contents): Ignore relocs for sections that are
+ neither code nor data. Just use the symbol value for debugging
+ symbols; don't offset by the section vma.
+
+Fri Sep 17 18:08:55 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * reloc.c (bfd_perform_relocation): Don't return an error when
+ performing a reloc against an undefined weak symbol.
+ * syms.c (bfd_print_symbol_vandf): Show value of BSF_WEAK rather
+ than obsolete BSF_EXPORT.
+
+Fri Sep 17 02:04:31 1993 John Gilmore (gnu@cygnus.com)
+
+ * hosts/{alphaosf.h, amix.h, apollo68.h, apollov68.h,
+ decstation.h, delta88.h, dgux.h, dose.h, go32.h, harris.h,
+ hp300.h, hp300bsd.h, hppabsd.h, hppahpux.h, i386aix.h, i386bsd.h,
+ i386linux.h, i386lynx.h, i386v.h, i386v4.h, irix3.h, irix4.h,
+ mipsbsd.h, ncr3000.h, rs6000.h, rtbsd.h, solaris2.h, sparc-ll.h,
+ std-host.h, stratus.h, sun3.h, sysv4.h, tahoe.h, ultra3.h,
+ vaxult.h, vaxult2.h, we32k.h}: Make sure that "offsetof" is
+ defined on all hosts, now that archive.c uses it.
+
+Thu Sep 16 18:20:30 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elfcode.h (elf_map_symbols): Create section symbols for all
+ sections, not just allocated sections; debugging sections can have
+ relocs.
+ (elf_symbol_from_bfd_symbol): If there is an output section, use
+ the section index from that rather than the input section.
+
+Thu Sep 16 12:20:50 1993 Ken Raeburn (raeburn@cygnus.com)
+
+ * libbfd-in.h (bfd_flush, bfd_stat): Reflect John's changes to
+ libbfd.h, which is regenerated from this file.
+
+ * bfd-in.h (symtype): Deleted typedef.
+
+Wed Sep 15 11:48:37 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * libbfd.c (COERCExx): Cast x to bfd_signed_vma before doing the
+ xor and subtract. Otherwise it will not sign extend if the type
+ of bfd_vma is larger than int.
+
+ * ecoffswap.h (ecoff_swap_pdr_in): Get regoffset, iopt, fregoffset
+ and frameoffset as signed numbers. From Peter Schauer.
+
+Tue Sep 14 18:20:36 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elf32-i386.c (elf_howto_table): Add bfd_elf_generic_reloc
+ special function for all reloc entries.
+ * elf32-target.h (TARGET_LITTLE_SYM): Add SEC_CODE to
+ section_flags.
+ * libelf.h (elf_symbol_type): Remove desc, type and other fields.
+ * Makefile.in (elf32-*.o): These depend upon elf32-target.h.
+
+Tue Sep 14 14:34:45 1993 Steve Chamberlain (sac@phydeaux.cygnus.com)
+
+ * libbfd-in.h (struct artdata): Add armap_timestamp and
+ armap_datepos here too.
+
+Mon Sep 13 21:03:18 1993 John Gilmore (gnu@cacophony.cygnus.com)
+
+ Improve timestamp support in BSD archive files to avoid linker
+ warnings.
+
+ * libbfd.h (struct artdata): Add armap_timestamp and armap_datepos.
+ (bfd_flush, bfd_stat): Add prototypes.
+ * libbfd.c (bfd_flush): Add, does fflush on a BFD.
+ (bfd_stat): Add, does fstat on a BFD.
+
+ * archive.c (_bfd_write_archive_contents): At end of file writing,
+ verify and possibly update the timestamp in the armap, if a BSD
+ archive. FIXME! Kludge recognizes BSD archive, rather than
+ vectoring properly. Should add to xvec.
+ (compute_and_write_armap): Move prototype to top, avoid PROTO.
+ (bsd_write_armap): Save timestamp and file location thereof, when
+ writing the armap in a BSD file.
+ (bsd_update_armap_timestamp): New function to check and
+ rewrite the timestamp.
+
+ * hosts/std-host.h (offsetof): Define, if not already, for archive.c.
+
+Sat Sep 11 18:13:42 1993 Jim Kingdon (kingdon@poseidon.cygnus.com)
+
+ * hosts/i386sco.h: Define a bunch of stuff for core files.
+ * sco-core.c: Remove, replace by trad-core.c.
+ * trad-core.c: If HOST_STACK_START_ADDR is defined, use it.
+ * config/i386sco.mh: Use trad-core not sco-core.
+ * hosts/i386isc.h, config/i386isc.mh: Remove.
+ * configure.host: Use i386sco for isc.
+ * config/i386-sco.mt: Remove, identical to i386-coff.mt.
+ * config.bfd: Use i386-coff not i386-sco.
+
+ * config.bfd: Recognize i[34]86-*-solaris2* specifically rather
+ than using *-*-solaris2* (i486-unknown-solaris2 is i386-elf, not
+ i486-elf which doesn't exist).
+
+Fri Sep 10 12:56:36 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * coffswap.h (coff_swap_aouthdr_out): For ALPHAECOFF, force
+ padding field to zero.
+
+ * config.bfd (i[34]86-*-netbsd*): New target; use i386-netbsd.
+ * configure.in: Remove bogus netbsd386 handling.
+
+ * coff-mips.c: Don't warn about overflow for MIPS_R_JMPADDR reloc.
+ Correct overflow detection requires matching the upper four bits
+ of the destination against the PC.
+
+Thu Sep 9 16:57:46 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * configure.in: Make 64-bit stuff work with "--with-targets=all".
+
+Tue Sep 7 14:17:02 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * libbfd-in.h: Removed swapping routines declarations.
+ * bfd-in.h: Added swapping routine declarations, and renamed them
+ from _do_* to bfd_*.
+ * libbfd.c: Renamed swapping routines from _do_* to _bfd_*.
+ * Changed all callers.
+ * libbfd.h, bfd-in2.h: Rebuilt.
+
+Mon Sep 6 15:28:07 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elf32-i386.c (elf_howto_table): Set pcrel_offset to true for
+ R_386_PC32.
+
+Fri Sep 3 13:06:12 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * configure.in: Reorganized setting of makefile variables so
+ 64-bit stuff works again.
+
+ * libbfd-in.h (_do_get*, _do_put*): Renamed via macros to clean up
+ namespace.
+
+ * libelf.h (elf32_symbol_type, elf64_symbol_type): Deleted
+ "native_elf_sym" field, merged to make new type "elf_symbol_type".
+ (struct elf_obj_tdata): Field symbols is now elf_symbol_type*.
+ Deleted field raw_syms.
+ (obj_symbols): Remove cast.
+ (obj_raw_syms): Deleted.
+ * elfcode.h (elf_slurp_symbol_table): Don't set raw_syms or
+ native_elf_sym fields.
+ * elf32-hppa.c: Changed uses of elf32_symbol_type to
+ elf_symbol_type.
+
+ From Pete Hoogenboom and Jeff Law:
+
+ * elf32-hppa.c (ELF_MAXPAGESIZE): Define.
+
+ * elf32-hppa.c (elf_hppa_tc_symbol): If the argument relocation
+ bits are zero (e.g., they specify no relocations), then do not
+ even bother adding their entries to the symextn section.
+
+ * elf32-hppa.c (elf_hppa_tc_symbol): Any function, regardless
+ of scope can have an argument relocation stub.
+
+ * elf32-hppa.c: (Elf32_hppa_Stub_description): Rename this
+ structure and type to elf32_hppa_stub_description. This makes
+ it consistent with the GNU coding conventions.
+ (elf32_hppa_stub_description): Added a 'next' field to allow
+ linking of stub description structures.
+ (elf32_hppa_stub_description): Added a 'stub_listP' field to
+ keep track of individual stubs.
+ (Elf32_hppa_Stub_list, Elf32_hppa_Stub_list_struct): Removed.
+ Combined with the elf32_hppa_stub_description structure.
+ (elf32_hppa_stub_name_list): New type to keep track of
+ individual stubs.
+ (add_stub): Removed.
+ (add_stub_by_name): New function.
+ (find_stub_by_name): New function.
+ (hppa_elf_build_arg_reloc_stub): Allow reusing stubs that
+ already exist.
+ (hppa_elf_build_long_branch_stub): Allow reusing stubs that
+ already exist.
+
+ * elf32-hppa.c: (retval_mismatches): The direction of argument
+ relocation was reversed.
+ (hppa_elf_build_arg_reloc_stub): Return address was not being
+ restored.
+ (hppa_elf_arg_reloc_needed_p): Add argument containing caller
+ argument relocation bits so this function can be used in the check
+ for plabel stubs.
+ (hppa_elf_stub_check): Pass caller argument relocation bits into
+ hppa_elf_arg_reloc_needed_p().
+ (hppa_look_for_stubs_in_section): Add check for plabel stubs and
+ pass caller argument relocation bits into
+ hppa_elf_arg_reloc_needed_p().
+
+Thu Sep 2 00:59:55 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * libhppa.h (hppa_field_adjust): Remove unused `init_value' variable.
+
+ * hosts/delta88v4.h: New for SVR4.
+ * configure.hosts: Use it.
+
+Wed Sep 1 14:23:32 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * libaout.h, netbsd386.c: Change M_I386 to M_386_NETBSD. M_I386
+ is an SCO pre-define.
+
+Tue Aug 31 12:50:19 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * nlmcode.h (nlm_object_p): Set HAS_SYMS if there are external
+ references.
+ (nlm_swap_auxiliary_headers_{in,out}): The copyright length is
+ only one byte.
+ (nlm_get_symtab_upper_bound): Include debugging symbols in symbol
+ count.
+ (nlm_slurp_symbol_table): Make symlength unsigned. Read debugging
+ symbols as BFD local symbols.
+ (nlm_write_object_contents): Don't bother writing out exported
+ symbols more than once; they now appear in the symbol table more
+ than once (with and without a prefix) if necessary. Set offset
+ values to be non-zero as NLMLINK does.
+
+Tue Aug 31 12:07:43 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * libhppa.h: Restore #undefs of e_fsel and other e_* symbols.
+
+Fri Aug 27 16:43:35 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * section.c (struct sec): Move position of user_set_vma, and
+ document it.
+ (SEC_BALIGN): Disable for now. I don't think it's currently used.
+
+ * elf32-hppa.c (elf_hppa_howto_table): Now static.
+ (symext_rootP, symext_lastP, global_value, GOT_value,
+ global_symbol, global_sym_defined, symextn_contents,
+ symextn_contents_real_size, elf_hppa_stub_rootP,
+ elf32_hppa_symextn_map, elf32_hppa_symextn_map_size): Rely on
+ default initialization.
+ (hppa_elf_gen_reloc_type): Macro "UNDEFINED" doesn't need a
+ trailing semicolon.
+ (hppa_look_for_stubs_in_section): Introduce temporaries to make
+ code more readable in 80 columns.
+
+ * libhppa.h (all functions): Now inline under GNU C.
+
+ More patches from Jeff Law:
+
+ * elf32-hppa.c (AR_WARN): Give argument which caused the
+ invalid argument relocation.
+ (AR_UNIMP): Delete unused macro.
+ (hppa_elf_set_section_contents): Always return a value.
+ (elf32_hppa_backend_table_processing): Likewise.
+ (elf32_hppa_backend_section_processing: Likewise.
+
+ * som.c: New file containing SOM specific code extracted
+ from hppa.c
+
+ * som.h: New file containing SOM specific code extracted
+ from libhppa.h
+
+ * hppa.c: Deleted.
+
+ * libhppa.h: Delete SOM specific code. Add generic PA
+ code which can be shared by both SOM and ELF backends.
+
+ * Makefile.in: Replace hppa.c with som.c. elf32-hppa.o
+ depends on libhppa.h now.
+
+ * configure.in (hppa_vec): Needs som.o module instead of
+ hppa.o.
+
+ * elf32-hppa.c: Include libhppa.h. Do not define
+ BYTES_IN_WORD.
+
+ * elf32-hppa.h (hppa_reloc_field_selector_type): Delete
+ now lives in libhppa.h.
+ (hppa_reloc_field_selector_type_alt): Likewise.
+
+ * hosts/hppabsd.h: Include <stdlib.h> and <unistd.h>. Do not
+ define malloc or free.
+
+ * config/hppa-elf.mt (SELECT_ARCHITECTURES): Don't define
+ SELECT_VECS.
+
+ * elf32-hppa.c (hppa_elf_relocate_unwind_table): Delete unused
+ variables.
+ (elf_hppa_reloc_type_lookup): Likewise.
+ (elf_hppa_tc_make_sections): Likewise.
+ (hppa_elf_arg_reloc_needed_p): Likewise.
+ (hppa_elf_build_long_branch_stub): Likewise.
+ (elf_reloc_map): Delete, no longer used.
+ (elf_hppa_reloc_map): Likewise.
+ (elf32_hppa_symextn_map_max_size): Likewise.
+ (elf32_hppa_get_sym_extn): Abort if type is bogus.
+
+ * elf32-hppa.c (elf32_hppa_backend_fake_sections): Add processing
+ of the .hppa_unwind section.
+
+Wed Aug 25 16:13:49 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * config.bfd: recognize m88110.
+
+Tue Aug 24 16:32:35 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ Merged changes from Jeff Law and Pete Hoogenboom at Utah:
+
+ * elfcode.h (elf_section_from_bfd_section): Add detection of
+ SHT_NOTE sections.
+
+ * elf32-hppa.c:
+ (hppa_elf_build_long_branch_stub,hppa_elf_long_branch_needed_p):
+ New functions for support of long branch stubs.
+ (hppa_elf_stub_check,hppa_look_for_stubs_in_section): Add
+ check for long branch stubs.
+ (hppa_look_for_stubs): Unused function. Removed.
+ (hppa_elf_set_section_contents): Implement a PA/ELF-specific
+ version of bfd_set_section_contents.
+ (hppa_elf_long_branch_needed_p): Only output debugging diagnostics
+ when BFD is configured for debugging.
+
+ * elf32-hppa.c: (elf32_hppa_get_symextn_chain): New function
+ to return a list of symbols that have non-zero argument
+ relocation bits.
+ (hppa_elf_stub_finish): Make sure stub generation is done only
+ once.
+
+ * elf32-hppa.c: (hppa_elf_stub_reloc): New function for
+ generation relocation entries within a stub.
+ (hppa_elf_build_arg_reloc_stub): Corrections to argument
+ relocation stubs.
+
+ * elf32-hppa.c: New #define's for argument relocation types.
+ (mismatches, retval_mismatches): Updated to reflect new
+ argument relocation types.
+ (CURRENT_STUB_OFFSET): New macro.
+
+ * elfcode.h (map_program_segments): Set the PF_X bit for data
+ segments.
+
+ * elf32-hppa.c: (elf_hppa_howto_table): Add
+ R_HPPA_STUB_CALL_17 for support of linker stub generation.
+ (hppa_elf_reloc): Add support of R_HPPA_STUB_CALL_17
+ relocation type.
+
+ * elf32-hppa.h: (elf32_hppa_reloc_type): Add
+ R_HPPA_STUB_CALL_17 for support of linker stub generation.
+
+ * hppa_stubs.h: Add new instructions that are used in linker
+ stub generation.
+
+ * elf32-hppa.c (hppa_elf_relocate_unwind_table): The offsets in an
+ unwind descriptor were incorrect.
+
+ * libelf.h (bfd_elf_find_section): Declare.
+
+ * elf32-hppa.c: (elf32_hppa_backend_symbol_processing): New
+ function in place of global_sym field in elf_backend_data
+ structure.
+ (elf32_hppa_backend_symbol_table_processing,
+ elf32_hppa_backend_section_processing,
+ elf32_hppa_backend_fake_sections,
+ elf32_hppa_backend_section_from_shdr,
+ elf32_hppa_backend_section_from_bfd_section): New functions to
+ provide support of symbol extension sections and argument
+ relocation stubs.
+ (elf_info_to_howto): Remove call to abort().
+
+ * elf32-target.h: Support for special processing by the backend.
+ (struct elf_backend_data): Added elf_backend_symbol_processing,
+ elf_backend_symbol_table_processing,
+ elf_backend_section_processing, elf_backend_section_from_shdr,
+ elf_backend_fake_sections, and
+ elf_backend_section_from_bfd_section fields.
+ * elfcode.h: (bfd_section_from_shdr): Add a check for
+ processor-specific section types.
+ (elf_fake_sections): Add a check for processor-specific
+ section types.
+ (bfd_elf32_write_object_contents): Add a check to see if
+ there is any final section processing to be done by the
+ backend.
+ (elf_section_from_bfd_section): Add a check for
+ processor-specific section types.
+ (elf_slurp_symbol_table): Remove reference to global_sym in the
+ elf_backend_data structure. Replace it with a call to
+ elf_backend_symbol_processing.
+ * libelf.h: Remove global_sym field in the elf_backend_data
+ structure. Replace it with a series of backend-specific
+ functions.
+
+ * elf32-hppa.c (hppa_elf_stub_branch_reloc): The formal argument
+ stub_sym should be called target_sym.
+ (hppa_elf_build_arg_reloc_stub): Refer to the stub bfd (abfd)
+ rather than the output bfd (output_bfd).
+ (hppa_elf_reloc): Get rid of references to the global_sym field in
+ the elf_backend_data structure.
+
+ * elfcode.h (elf_fake_sections): Check the correct condition for
+ .bss. Also, detect the existence of a .note section.
+
+ * elf32-hppa.c (hppa_elf_relocate_insn): r_format argument should
+ have been r_field.
+
+ * hosts/hppabsd.h (HOST_MACHINE_ARCH): Reference to bfd_arch_m68k
+ should be a reference to bfd_arch_hppa.
+
+ * hppa.c (hppa_vec): Replace bfd_false with _bfd_dummy_target in
+ the bfd_check_format structure to avoid a type mismatch.
+
+Mon Aug 23 1993 Sean Fagan (sef@cygnus.com)
+ and Jim Kingdon (kingdon@cygnus.com)
+
+ Add NetBSD support:
+ * netbsd386.c: New file.
+ * aoutx.h: Make sym_is_debugger_info true for N_FN.
+ * Makefile.in, aout-target.h, config.bfd, configure.host, configure.in,
+ libaout.h, targets.c: Other changes.
+
+Fri Aug 20 17:04:59 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/m88k-elf.mt: New file.
+ * config.bfd: Use it for m88*-*-sysv4*.
+
+Fri Aug 20 15:16:58 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * elfcode.h (elf_build_phdrs): Unused function deleted.
+ (bfd_shdr_from_section): Ditto.
+ (write_relocs): Don't change section contents for addend.
+ (elf_locate_sh): Return type is now always elf_internal_shdr,
+ since the other types were really aliases for this type anyways.
+ Don't compile this function, since it is static and doesn't appear
+ to be used in this file.
+ (sym_is_global): Return non-zero for weak symbols. Abort if
+ section pointer is null.
+ (swap_out_syms): Reorder tests so function symbols can be weak.
+ (elf_slurp_symbol_table): Don't use BSF_EXPORT.
+ (elf_slurp_reloca_table): Make RELOC_PROCESSING section smaller by
+ extracting out some common code. Abort if BFD section symbol has
+ null name.
+ (elf_slurp_reloc_table): Translate ELF section symbols into BFD
+ section symbols. Don't read section contents to fill in addend
+ field.
+
+ * elf32-i386.c (elf_howto_table): All partial_inplace fields
+ should be "true".
+
+ * Merged from OSF:
+
+ Tue Jun 15 14:38:32 1993 Michael Meissner (meissner@osf.org)
+
+ * libelf.h (struct Elf_Sym_Extra): New structure to contain ELF
+ specific information for a symbol. Put in elf_sym_num, which
+ gives the external symbol number in the elf object file, since
+ local symbols must come before global symbols.
+ (elf_sym_extra): New macro.
+ (elf_symtab_map): Delete, in favor of using Elf_Sym_Extra.
+ * elfcode.h (elf_map_symbols): Use Elf_Sym_Extra to map internal
+ symbol number to external number. Store the address of the
+ Elf_Sym_Extra field for the symbol in the udata field.
+ (elf_write_object_contents): Use Elf_Sym_Extra to map out symbols.
+
+ Sun Jun 20 16:30:11 1993 Michael Meissner (meissner@osf.org)
+
+ * elfcode.h (elf_obj_tdata): Add field to count the size of the
+ array of pointers to section symbols.
+ (elf_map_symbols): Bump the max index of the section symbols so
+ that we don't overwrite memory. Store the max index into the
+ elf_obj_tdata field.
+
+ Sat Jun 19 10:12:27 1993 Michael Meissner (meissner@osf.org)
+
+ * elfcode.h (elf_obj_tdata): Add pointer to an array of pointers
+ to the section symbols we created. Remove unused field
+ internal_syms.
+ (elf_map_symbols): Fill in array of pointers to section symbols.
+ Only create section symbols for sections that have SEC_ALLOC set,
+ and have non-zero size.
+ (elf_symbol_from_bfd_symbol): If udata is NULL, and this is a
+ section symbol, look up the section in the list of section
+ symbols, and set the udata pointer appropriately. Otherwise, if
+ udata is still NULL, fail an assertion, and use 0, instead of
+ dropping core.
+
+Fri Aug 20 12:18:05 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * config.bfd (mips-*-elfl*, mips-*-elf*): New targets, using
+ mipslelf and mipsbelf respectively.
+ * config/mipslelf.mt, config/mipsbelf.mt: New files.
+ * elf32-mips.c: Added some reloc information.
+ * configure.in: Fixed error message.
+
+ * ecoff.c (ECOFF_LONG_SIZE): Removed. Just use constants.
+
+Thu Aug 19 09:45:51 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * Makefile.in (BFD_LIBS, ALL_MACHINES, BFD32_BACKENDS, BFD64_BACKENDS,
+ OPTIONAL_BACKENDS): Alphabetize entries and add a few missing ones.
+ * archures.c: Alphabetize decls.
+
+ * configure.in, targets.c: Add missing vectors to the tables.
+ * targets.c (target_vector) [!SELECT_VECS]: Add DEFAULT_VECTOR.
+ Remove hp300bsd_vec due to clash with sunos_big_vec.
+
+Tue Aug 17 18:12:32 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * hosts/i386{mach3,osf1mk}.h: New files, for Mach hosting.
+ * hosts/i386mach.h: removed, replaced by i386osf1mk.h.
+ * config/i386mach3.mt, i386mach3.c: New files, for Mach a.out format.
+ * Makefile.in, configure.host, config.bfd: Corresponding changes.
+ * hosts/decstation.h: Include <sys/param.h> not <machine/param.h>.
+
+Tue Aug 17 15:19:41 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * coffgen.c (coff_section_symbol): If section's output_section is
+ not yet set, point to itself. This is needed because this is
+ called on the output file, not the input file.
+
+ * coff-rs6000.c (dummy_reloc, RTYPE2HOWTO): Set howto field to a
+ dummy value, rather than leaving it NULL.
+
+ * archures.c (bfd_default_set_arch_mach): Set bfd_error on
+ failure.
+ * aoutx.h (NAME(aout,set_arch_mach)): Check return value of
+ bfd_default_set_arch_mach.
+
+Tue Aug 17 09:42:16 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * config.bfd (cpu): Extract from canonical name with sed.
+ * configure.in: Don't pass it.
+
+Sun Aug 15 20:45:45 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * bfd-in.h: Remove {BYTE,WORD,LONG}_SIZE; they are pointless and
+ BYTE_SIZE conflicts with a Mach header.
+ * ecoff.c: Change LONG_SIZE to ECOFF_LONG_SIZE and define it.
+
+ * configure.host: Make sure all OS fields end in *.
+
+Fri Aug 13 16:33:33 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * ecoff.c (ecoff_slurp_reloc_table): Use bfd_abs_section for
+ RELOC_SECTION_NONE and RELOC_SECTION_ABS. If a reloc section
+ doesn't exist, don't try to create it.
+
+ * nlmcode.h (nlm_write_object_contents): procedure offsets are
+ from start of code segment, not start of file.
+ * config/i386-nlm.mt (DEFAULT_VECTOR): It's nlm32_i386_vec, not
+ bfd_nlm32_i386_vec.
+ * configure.in (SELECT_VECS switch): Likewise.
+
+Thu Aug 12 10:32:47 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * format.c (bfd_check_format): If the target matches the default
+ target, set match_count to 1, to ignore any previous matches.
+
+ * Makefile.in (BFD32_BACKENDS): Remove srec.o, add reloc16.o.
+
+ * configure.in: Add reloc16.o when we add
+ coff-h8300.o, coff-h8500.o, coff-sh.o, coff-z8k.o.
+ Makefile.in (BFD_LIBS): Remove reloc16.o.
+
+ * 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.
+
+Thu Aug 12 08:30:05 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coff-alpha.c (alpha_howto_table, alpha_finish_reloc,
+ alpha_ecoff_swap_reloc_{in,out}, alpha_bfd_reloc_type_lookup):
+ Read and write Alpha relocs. Can't process them yet.
+ * ecoff.c (ecoff_slurp_reloc_table): Recognize new reloc sections.
+ If the section does not already exist, create it.
+
+ * ecoffswap.h (ecoff_swap_pdr_{in,out}): Handle new fields defined
+ on the Alpha.
+
+ * libecoff.h (ecoff_backend_data): Added constructor_reloc and
+ finish_reloc fields.
+ * ecoff.c: Move MIPS reloc support from here...
+ * coff-mips.c: to here.
+ * ecoff.c (ecoff_set_symbol_info): Get constructor reloc howto
+ from backend.
+ (ecoff_slurp_reloc_table): Removed MIPS specific stuff. Call
+ finish_reloc backend function.
+ (ecoff_write_object_contents): Removed MIPS specific assertions.
+ * coff-mips.c (mips_finish_reloc): New function.
+ (mips_ecoff_backend_data): Fill in new fields.
+ * coff-alpha.c (alpha_ecoff_backend_data): Use NULL for new
+ fields.
+ * targets.c: Added extern for ecoffalpha_little_vec.
+
+ * bfd.c (_bfd_host_big_endian): Removed.
+ * bfd-in.h (HOST_BYTE_ORDER_BIG_P, bfd_header_twiddle_required):
+ Removed.
+ * bfd-in2.h: Regenerated.
+
+Wed Aug 11 12:11:23 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * 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.
+
+ * archures.c (archures_init_table): Add bfd_sh_arch.
+
+ * configure.in: Include coff-m68k.o for m68kcoffun_vec.
+ Include nlm32.o and nlm.o for bfd_nlm32_i386_vec.
+ Fix error in error message.
+
+ * oasys.c: Make bfd_error_vector extern.
+
+ * configure.in: Include stab-syms.o for a.out/b.out targets
+ and hp300{bsd,hpux}.
+
+Wed Aug 11 06:40:51 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * nlmcode.h (nlm_compute_section_file_positions): Add the .bss
+ section before setting output_has_begun.
+ (nlm_set_section_contents): Remove argument names from
+ mangle_relocs_func prototype.
+ (nlm_write_object_contents): Remove shadowing local variable.
+ Don't write out debugging symbols if debugInfoOffset is -1. Add
+ the codeImageOffset to the start, exit, and check procedure
+ offsets.
+ * nlm32-i386.c (nlm_i386_write_reloc, nlm_i386_mangle_relocs):
+ Don't check partial_inplace field; its value is irrelevant.
+
+ * Base use of sco-core on host, not target.
+ * configure.host (i[34]86-*-sco*): Use i386sco rather than i386v.
+ * config/i386-sco.mt (TDEFINES): Removed.
+ * config/i386sco.mh: New file to use sco-core.
+ * hosts/i386sco.h: New file; just includes hosts/i386v.h.
+
+ * ecoffswap.h (ecoff_swap_{hdr,ext}_{in,out}): Use signed
+ conversions for some fields.
+
+Tue Aug 10 13:32:23 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * ecoff.c (ecoff_gprel_reloc): If _gp is not defined, give an
+ error rather than aborting.
+
+ * libnlm.h (struct nlm_backend_data): Added mach field.
+ (nlm_machine): New accessor macro.
+ * nlm.c (nlm_mkobject): Set architecture and machine from backend
+ information.
+ * nlm32-i386.c (nlm32_i386_backend): Initialize new mach field.
+
+Tue Aug 10 09:31:18 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * configure.in: Replace calls to sort with shell code
+ to uniq the lists.
+
+Tue Aug 10 06:23:16 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * configure.in: Include aout32.o for any a.out/b.out formats.
+
+Mon Aug 9 09:37:18 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * config/i386-linux.mt (SELECT_VECS): Support bfd_elf32_i386_vec.
+ * config/m68k-elf.mt (SELECT_VECS): Support m68kcoff_vec.
+ * config/i386-elf.mt (SELECT_VECS): Support i386coff_vec.
+ * config/hppa-elf.mt (SELECT_VECS): Support hppa_vec.
+ * config/sparc-elf.mt (SELECT_VECS): Support sunos_big_vec.
+ * config/i386-sco.mt (SELECT_VECS): Don't define; Ian says it was
+ just a hack.
+
+Mon Aug 9 13:15:00 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * config/m88k-coff.mt (DEFAULT_VEC -> DEFAULT_VECTOR): renamed.
+
+Mon Aug 9 14:26:45 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * syms.c (BSF_EXPORT): Now same as BSF_GLOBAL.
+
+ * bfd.c (bfd_scan_vma): New function.
+
+Mon Aug 9 11:29:53 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * bfd-in.h (bfd_get_architecture, bfd_get_machine): Removed
+ obsolete macros.
+ * bfd-in2.h: Updated.
+
+ * ecoff.c (ecoff_slurp_armap): Correct bug in initialization of
+ stringbase.
+
+Sun Aug 8 12:21:13 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * configure.in: Remove unneeded test.
+
+Sun Aug 8 12:41:22 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in ({dist,real}clean): Use $(MAKE), not make.
+
+Sat Aug 7 09:14:21 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * config/st2000.mt (TDEFINES): Don't define MRI; not used.
+
+ * PORTING, TODO, config/README: Update to reflect below changes.
+
+ * configure.in: Replace MINIMIZE and --with-minimal-bfd with
+ --with-bfd-targets="target1,target2,..." and the special target
+ "all" to get the previous default behavior.
+ Figure out which architecture and backend .o files are needed from
+ DEFAULT_VECTOR, SELECT_VECS, and SELECT_ARCHITECTURES as set in
+ the .mt files. Define TDEFAULTS based on them, also.
+
+ * Makefile.in: Remove references to MINIMIZE.
+ * archures.c, targets.c: Ditto.
+
+ * config/*.mt: Define DEFAULT_VECTOR, SELECT_VECS, and
+ SELECT_ARCHITECTURES as variables rather than as -D arguments to
+ TDEFAULTS.
+
+ * config/a29k-coff.mt,alphaosf.mt, i386-sco.mt, i960-bout.mt,
+ i960-coff.mt (TDEFAULTS): Don't put the default vector in
+ SELECT_VECS manually; it's automatic now.
+
+ * config/i386-sco.mt (TDEFAULTS): Don't put &sco_core_vec in
+ SELECT_VECS manually; -DSCO_CORE does it automatically now.
+
+ * config/h8300-coff.mt,h8500-coff.mt,sh-coff.mt,st2000.mt,z8k-coff.mt
+ (TDEFAULTS): Don't define BFD; not used.
+
+ * config/hppaosf.mh (HDEFINES): Don't define SELECT_ARCHITECTURES;
+ this is a host, not a target.
+
+Sat Aug 7 05:28:03 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * elfcode.h (elf_object_p): Add comment about what this function
+ does and to watch out for side effects. Add FIXME for memory leaks.
+ Fix comment about checking for matching byte order. Preserve
+ pointer to old tdata (if any), and restore it if we don't match
+ file with target vector. If we are going to use goto's, use them
+ consistently and maintainably.
+ * nlmcode.h (nlm_object_p): Expand comments about leaked memory
+ to note that the problem is even more serious than just leaked
+ memory. Replace goto with more traditional return.
+
+Fri Aug 6 12:00:03 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ Fix incorrect or useless makefile variable definitions:
+ * config/news.mt, config/u68k-coff.mt (TDEFAULTS): Use this to
+ define DEFAULT_VECTOR, instead of TDEFINES.
+ * config/i386aix.mh (MINIMIZE): Don't define.
+ * config/hppaosf.mh (MINIMIZE): Don't conditionalize.
+ * config/rs6000.mh (ALLOCA),
+ * config/i386v.mh (ALLOCA),
+ * config/i386linux.mh (ALLOCA),
+ * config/i386isc.mh (ALLOCA),
+ * config/go32.mh (EXTRALIBS): Don't define; not used.
+ * config/solaris2.mh (HDEFINES): Renamed from H_DEFINES.
+ * config/alphaosf.mt (TDEFINES): Set it, not HDEFINES.
+ * config/z8k-coff.mt (CC): Don't define. It's a target, not a host.
+
+ * config/README: New file, explaining the variables.
+
+ * targets.c (target_vector): Add hp300_bsd_vec.
+ * Makefile.in (BFD32_BACKENDS, CFILES): Add hp300bsd.
+ (hp300bsd.o): New rule.
+
+Fri Aug 6 15:13:22 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * libelf.h (NAME): Provide a default definition, that's neither
+ for 32 bits nor for 64.
+
+ Tue Jun 15 14:38:32 1993 Michael Meissner (meissner@osf.org)
+
+ * libelf.h (elf_hash): Change declaration to bfd_elf_hash, since
+ that is what is in elf.c.
+
+Fri Aug 6 12:28:38 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * ecoff.c (ecoff_set_symbol_info): Removed special handling for
+ scBss and scSBss symbols, since it was wrong.
+
+ * Makefile.in (coff-mips.o, coff-alpha.o): Don't depend on
+ coffcode.h.
+
+ * coffcode.h (sec_to_styp_flags): Inspired by mb@tti.COM (Michael
+ Bloom): Only set STYP_BSS for SEC_ALLOC sections.
+
+ * ecoff.c (ecoff_slurp_armap): From Arne Henrik Juul
+ <arnej@kari.fm.unit.no>: Handle a COFF style armap.
+
+Fri Aug 6 09:59:45 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * hpux-core.c: Cast return value from bfd_zalloc.
+
+Thu Aug 5 13:22:44 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * aoutx.h (log2): Delete i387-specific code.
+
+ * Makefile.in (BFD_LIBS): Always include elf.o.
+ (BFD32_BACKENDS): Don't include elf.o here.
+ (ofiles): Delete references to ofiles2 and ofiles3.
+ (do_clean): Delete ofiles.
+ (BFDIN_H): Changed references to $(srcdir)/bfd-in2.h.
+ (stmp-bfd.h): Use bfd.h-new as temporary name, not bfd.h2.
+ (headers): Use bfd-in2.h-new as temporary name, not bfd.h-new.
+
+ * bfd-in.h: Reworded comment to make it clear that bfd-in2.h is a
+ generated file.
+
+ * reloc.c (enum bfd_reloc_code_real): Added i386-elf reloc types
+ (from Meissner's additions to bfd-in2.h).
+
+ * elf32-i386.c (ELF_MAXPAGESIZE): Define.
+
+ Merged:
+
+ Wed Jun 23 06:05:58 1993 Michael Meissner (meissner@osf.org)
+
+ * elfcode.h (elf_write_object_contents): Don't drop core if
+ elf_symbol_from returns a NULL pointer when processing a non-elf
+ symbol, use a 0 size instead.
+
+ Tue Jun 15 14:38:32 1993 Michael Meissner (meissner@osf.org)
+
+ * elfcode.h (elf_hash): Delete macro mapping elf_hash to
+ bfd_elf32_hash, since the hash table is independent of the 32/64
+ bit system.
+
+ * libelf.h (elf_hash): Change declaration to bfd_elf_hash, since
+ that is what is in elf.c.
+
+ Sat Jun 19 10:12:27 1993 Michael Meissner (meissner@osf.org)
+
+ * elf32-i386.h (reloc_type): Reformat spacing.
+ (elf_howto_table): Add the rest of the 386/ELF relocations.
+ (elf_i386_reloc_type_lookup): Ditto.
+ (elf_i386_info_to_howto): Ditto.
+ (elf_i386_info_to_howto_rel): Ditto.
+
+Thu Aug 5 10:07:43 1993 Fred Fish (fnf@cygnus.com)
+
+ * nlmcode.h (nlm_get_reloc_upper_bound): Test return value
+ of nlm_slurp_symbol_table as boolean, not pointer.
+ * nlmcode.h (nlm_canonicalize_reloc): Test return value
+ of nlm_slurp_reloc_fixups as boolean, not pointer.
+
+Wed Aug 4 16:22:55 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * config/go32.mh: remove HDEFINES; since __MSDOS__ and __GO32__
+ are now predefined by GCC
+
+Wed Aug 4 16:06:29 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * coffgen.c (coff_print_symbol): Add the section offset to the
+ line number address, so it's printed the same way as the function
+ address. Only showed up for line numbers that aren't in the first
+ section (.text).
+
+Wed Aug 4 08:33:55 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * libnlm.h (nlm_backend_data): Added nlm_mangle_relocs.
+ (nlm_mangle_relocs_func): New macro.
+ * nlm32-i386.c (nlm_i386_write_reloc): Rewrote correctly.
+ (nlm_i386_mangle_relocs): New function.
+ * nlmcode.h (nlm_compute_section_file_positions): Move all common
+ symbols into the .bss section.
+ (nlm_set_section_contents): Call the mangle_relocs function.
+ (nlm_write_object_contents): Treat a reloc against any defined
+ symbol as an internal reloc. Fix bug in external reloc counting.
+ Get the offset and debugging type right for .bss symbols. Only
+ output debugging symbols for defined symbols.
+
+ * coff-h8500.c (rtype2howto): Do an fprintf to stderr rather than
+ using printf.
+ * coff-z8k.c (rtype2howto): Likewise.
+ * coffcode.h (dummy_reloc16_extra_cases): Likewise.
+ * elf32-i386.c (TRACE): Likewise.
+ * hp300hpux.c (convert_sym_type, swap_std_reloc_in): Likewise.
+ * rs6000-core.c (rs6000coff_get_section_contents): Likewise.
+ * coffgen.c (coff_print_symbol): Do an fprintf to the file
+ argument rather than using printf.
+
+Tue Aug 3 18:17:25 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coffswap.h: Added macros used when accessing several fields;
+ default is the same as before.
+ (coff_swap_aouthdr_{in,out}): Handle the Alpha ECOFF fields.
+ * coff-alpha.c: Defined macros to use the right sizes in
+ coffswap.h.
+ * libecoff.h: Backend information is now in target vector, not
+ BFD. Start of backend information is COFF backend information.
+ * coff-alpha.c, coff-mips.c: Changed accordingly.
+ * ecoff.c (ecoff_mkobject): New function.
+ (ARMAP_START): Changed into backend information, since Alpha uses
+ a different name.
+ (ecoff_slurp_armap): Don't overlay archive header.
+ * bfd.c: Include libcoff.h.
+
+Tue Aug 3 16:33:11 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * Makefile.in (install): Fix sh syntax error.
+
+ * aoutf1.h: Make bfd_error_trap extern; it's defined in bfd.c.
+
+Tue Aug 3 15:19:09 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * nlm_slurp_symbol_table: Don't use '&' on arrays.
+
+Tue Aug 3 11:06:28 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * ecoff.c: New file for generic ECOFF functions.
+ * ecoffswap.h: New file for ECOFF swapping functions which differ
+ only slightly for different targets.
+ * libecoff.h: Added prototypes for ecoff.c functions.
+ (ecoff_backend_data): New structure.
+ (ecoff_tdata): Added backend_data field. Changed external data
+ pointers to be PTR rather than to a particular struct.
+ (ecoff_symbol_struct): Moved in from coff-mips.c.
+ * coff-alpha.c, coff-mips.c: Moved common functions into ecoff.c.
+ Added ECOFF backend structures. Include ecoffswap.h.
+ * coff-msym.c: Removed; superseded by ecoffswap.h.
+ * bfd.c: Include coff/internal.h.
+ * Makefile.in (BFD_LIBS): Removed coff-mips.o and coff-msym.o.
+ Added ecoff.o.
+ (BFD64_BACKENDS): Added coff-alpha.o.
+ (CFILES): Removed coff-msym.c. Added ecoff.c.
+ (bfd.o): Added dependency on $(INCDIR)/coff/sym.h.
+ (coff-mips.o): Added dependency on ecoffswap.h and coff/ecoff.h.
+ (ecoff.o, coff-alpha.o): New targets.
+ (coff-msym.o): Removed target.
+
+Mon Aug 2 23:33:38 1993 John Gilmore (gnu@cygnus.com)
+
+ * elf32-hppa.h, hosts/*: Remove (one more time) all occurrances
+ of EXFUN in the BFD sources. Heave ho!
+
+Mon Aug 2 16:45:57 1993 Stu Grossman (grossman at cygnus.com)
+
+ * coffcode.h (coff_set_arch_mach_hook): Add check for I386LYNXMAGIC.
+
+Mon Aug 2 12:18:03 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * hosts/sun3.h: remove some more conflicting decls
+
+Mon Aug 2 11:48:23 1993 Stu Grossman (grossman at cygnus.com)
+
+ * i386lynx.c: Remove unnecessary def of N_HEADER_IN_TEXT,
+ redefine TEXT_START_ADDR to be 0.
+
+Sun Aug 1 22:54:08 1993 Stu Grossman (grossman at cygnus.com)
+
+ * configure.host, configure.in, hosts/i386lynx.h: Lynx/386
+ host and target info.
+
+Fri Jul 30 18:08:27 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * nlm32-i386.c: New file. First cut at i386 NLM code.
+ * libnlm.h: Added some more prototypes.
+ (struct nlm_relent): New structure.
+ (nlmNAME(symbol_type)): Added rcnt and relocs fields.
+ (struct nlm_obj_tdata): Added new fields: nlm_symbols,
+ nlm_text_low, nlm_data_low, nlm_reloc_fixups,
+ nlm_reloc_fixup_secs.
+ (struct nlm_backend_data): New structure, with accessor macros.
+ * nlmcode.h: Use NLM_HIBIT rather than MSB.
+ (nlm_object_p): Set SEC_RELOC for .text and .data. Don't set
+ SEC_DATA for .bss. Set HAS_RELOC and HAS_SYMS for abfd. Set the
+ architecture.
+ (nlm_swap_fixed_header_out, nlm_swap_variable_header_out,
+ find_nonzero, nlm_swap_auxiliary_headers_out): New outbound
+ swapping functions.
+ (nlm_get_symtab_upper_bound, nlm_slurp_symbol_table): Include
+ external references in symbol table as undefined symbols.
+ (nlm_get_symtab, nlm_slurp_symbol_table): Fill in alocation
+ argument in get_symtab rather than in slurp_symbol_table.
+ (nlm_slurp_symbol_table): Save symbol information in tdata.
+ (nlm_print_symbol): New function.
+ (nlm_slurp_reloc_fixups, nlm_get_reloc_upper_bound,
+ nlm_canonicalize_reloc): New functions to read relocs.
+ (nlm_compute_section_file_positions, nlm_set_section_contents,
+ nlm_external_reloc_compare, nlm_write_object_contents): New
+ functions to create NLM files.
+ * nlm-target.h: Define all the nlm functions here either as
+ default values or in terms of nlmNAME. Use JUMP_TABLE(nlm). Set
+ the backend_data field to TARGET_BACKEND_DATA.
+ * nlm32-gen.c, nlm64-gen.c: Don't define function macros here;
+ they are now in nlm-target.h.
+ (TARGET_BACKEND_DATA): Define as NULL.
+ * nlm.c (nlm_mkobject): Do allocate the tdata field.
+ (nlm_set_arch_mach): New function.
+ * targets.c: Added nlm32_i386_vec.
+ * Makefile.in (BFD32_BACKENDS): Added nlm32-i386.o.
+ (CFILES): Added nlm32-i386.c.
+ (nlm32-gen.o, nlm64-gen.o): Depend on nlm-target.h.
+ (nlm32-i386.o): New target.
+
+Thu Jul 29 20:20:39 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * hosts/sun3.h: remove some function decls that conflict w/ ANSI
+ C, and aren't needed anyway (return int)
+
+Wed Jul 28 15:46:38 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * elfcode.h: Use casts with bfd_alloc and alloca.
+
+Tue Jul 27 12:51:43 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * nlm{32,64}-gen.c (JUMP_TABLE_PREFIX): Delete.
+ * nlm{32,64}-gen.c (JUMP_TABLE_INIT): New macro that works with
+ older cpp's, that don't do additional replacement on the JUMP_TABLE
+ macro's argument.
+ * nlm-target.h (JUMP_TABLE_INIT): Use new macro in place of
+ JUMP_TABLE macro.
+
+Mon Jul 26 17:39:01 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ Yet another trad-core variant:
+ * config/esix.mh, hosts/esix.h: New files.
+ * configure.hosts: Use them.
+
+Mon Jul 26 13:22:15 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * reloc.c (bfd_perform_relocation): Handle the case of
+ complain_overflow_bitfield, rightshift > bitpos, and a negative
+ number.
+
+Mon Jul 26 14:40:10 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * elfcode.h: Reimplement segment writing.
+ (elf_write_phdrs): Use precomputed e_phoff rather than making
+ assumptions.
+ (elf_build_phdrs): Disabled, for now.
+ (assign_file_position_for_section): Don't change file offset for
+ SHT_NOBITS.
+ (assign_file_positions_for_symtab_and_strtabs): New function.
+ (struct seg_info): New type.
+ (map_program_segments): New function.
+ (assign_file_positions_except_relocs): For executables, leave
+ section headers &c for last, and properly align all sections with
+ flag SHF_ALLOC set.
+ (prep_headers): No longer abort when EXEC_P is set.
+ (write_shdrs_and_ehdr): Deleted all code relating to program
+ segments.
+
+ * elfcode.h (various): Deleted some unused code, and debugging
+ "malloc(0)" calls.
+ (write_relocs): Cache value of last symbol looked up, to save
+ time if the symbol is referred to repeatedly.
+ (elf_fake_sections): Check only SEC_RELOC flag, not number of
+ relocs.
+ (assign_section_numbers): Likewise.
+
+ * Makefile.in (ofiles): Stars in wildcards belong outside quotes.
+
+ * libelf.h (struct elf_backend_data): New field, maxpagesize.
+ (struct elf_obj_tdata): New field, phdr.
+ * elf32-target.h (elf32_bed): Initialize maxpagesize from
+ ELF_MAXPAGESIZE.
+ (ELF_MAXPAGESIZE): Default to 1.
+ * elf64-target.h (elf64_bed, ELF_MAXPAGESIZE): Likewise.
+ * elf32-sparc.c (ELF_MAXPAGESIZE): Define.
+ (elf_sparc_howto_table): All relocs should have pcrel_offset=true.
+ Most should have length field of `2'.
+
+ * reloc.c (bfd_perform_relocation): Handle 64-bit relocs.
+
+ * config/sparc-aout.mt (TARGET_BACKENDS): Define.
+
+Mon Jul 26 08:56:16 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * configure.in: Don't look in ${srcdir} for ${target_makefile_frag};
+ the top level script has already adjusted for it.
+
+Mon Jul 26 08:09:19 1993 Steve Chamberlain (sac@phydeaux.cygnus.com)
+
+ * srec.c (srec_write_symbols): Get CR LF in the right order.
+
+Mon Jul 26 02:08:41 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * hosts/vaxbsd.h: Include std-host.h. Don't include <machine/param.h>.
+
+Sat Jul 24 16:13:01 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * reloc.c (bfd_perform_relocation): Handle case of rightshift !=
+ bitpos when overflow checking.
+
+Fri Jul 23 10:20:27 1993 Doug Evans (dje@canuck.cygnus.com)
+
+ * bfd.c (bfd_nonrepresentable_section, bfd_undefined_symbol,
+ bfd_reloc_value_truncated, bfd_reloc_is_dangerous, bfd_assert):
+ Send error messages to stderr.
+
+Thu Jul 22 15:57:29 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * nlm{32,64}-target.h: Remove.
+ * nlm-target.h: New file, merged from nlm{32,64}-target.h
+ * libnlm.h (NLM_ARCH_SIZE): Define to ARCH_SIZE.
+ * nlm.c (ARCH_SIZE): Remove define to zero.
+ * nlm32-gen.c (ARCH_SIZE): Define to 32.
+ * nlm32-gen.c (JUMP_TABLE_PREFIX): Define to nlm32.
+ * nlm{32,64}-gen.c (nlm-target.h): Include.
+ * targets.c, libnlm.h, nlm.c, nlm{32,64}-gen.c, nlm{32,64}.c,
+ nlmcode.h: Convert prefixes from bfd_nlm<size> to just
+ nlm<size>, and use macros select size.
+
+Thu Jul 22 15:40:14 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+
+ * Makefile.in (Makefile): add configure.in, drop redundant
+ $(srcdir), drop redundant ./
+
+Thu Jul 22 13:34:57 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * hpux-core.c: New file; backend for HP/UX style core files.
+ * 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.
+
+ * reloc.c (enum complain_overflow): New enumeration with the
+ various flavours of overflow checking.
+ (srtuct reloc_howto_struct): Changed complain_on_overflow field
+ from boolean to emum complain_overflow. Removed obsolete absolute
+ field.
+ (HOWTO): Removed absolute argument.
+ (bfd_perform_relocation): Do overflow checking on all types of
+ fields.
+ * bfd-in2.h: Updated accordingly.
+ * all targets: Updated initialization of reloc howto tables.
+
+Wed Jul 21 20:34:34 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * opncls.c (bfd_create): Don't use C++ keyword "template" as a C
+ variable name.
+
+Tue Jul 20 15:02:23 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * coff-m68k.c (m68k_howto2rtype): Make arg CONST to match callers.
+
+ * elfcode.h: Fix several illegal pointer combination warnings for
+ usages of bfd_alloc and alloca.
+
+ * libnlm.h (nlm_obj_tdata): Rename hidden struct members to avoid
+ apparent Sun C preprocessor recursion. Fix access macros.
+ * nlmcode.h: Remove spurious '&' before several array references.
+
+Tue Jul 20 14:36:27 1993 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * Rename for DOS uniqueness: coff-m68k-un.c -> coff-u68k.c
+ config/m68k-coffun.mt -> u68k-coff.mt.
+ * Makefile.in, configure.in: Corresponding changes.
+
+Tue Jul 20 16:21:52 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * elf32-sparc.c (elf_sparc_howto_table): Don't use "&" before
+ function name; it's valid without, and some compilers give
+ warnings with it there.
+
+Tue Jul 20 08:21:15 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * bfd-in.h: Apply some of the changes that were made to bfd-in2.h.
+ * bfd.c (union tdata): Add nlm_obj_data;
+ * targets.c (enum target_flavour): Add bfd_target_nlm_flavour.
+
+Mon Jul 19 20:46:18 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * configure.in (*-*-netware, i[34]86-*-netware): New configs.
+ * 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.
+
+Mon Jul 19 15:09:01 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
+
+ * configure.{hosts,in}: add i[34]86-*-lynxos* support
+
+Mon Jul 19 14:53:30 1993 Ken Raeburn (raeburn@rtl.cygnus.com)
+
+ * elf.c, elfcode.h, libelf.h: Serious reorganization.
+ Deleted `thunk' structure, merged into tdata, duplicate data
+ eliminated.
+ Rearranged functions, grouping by functionality.
+ Broke up many functions in elfcode.h, re-ordered many parts of
+ file writing to handle unpredictable state of section relocation
+ table as provided by various applications.
+ Still needs cleanup: Merge functions back together, split out
+ data structure with only data that is used only when writing out
+ object file.
+
+ * elf.c (bfd_elf_generic_reloc): New function, taken from
+ coff-mips.c.
+ * elf32-sparc.c (elf_sparc_howto_table): Use it, to work around
+ bfd_perform_relocation lossage.
+
+ * Makefile.in (BFD_LIBS): Include coff-mips.o and coff-msym.o, so
+ that gdb will link.
+ (ofiles): Don't use sort or uniq; do it with sh constructs.
+
+Sun Jul 18 19:42:14 1993 Jim Kingdon (kingdon@rtl.cygnus.com)
+
+ * coffcode.h: Recognize I386PTXMAGIC.
+ * aoutf1.h, libaout.h: Add M_386_DYNIX.
+ * trad-core.c (TRAD_CORE_USER_OFFSET, TRAD_CORE_STACK_FILEPOS):
+ New macros; use it if defined.
+ * config/symmetry.mh, hosts/symmetry.h: New files.
+
+Fri Jul 16 14:56:31 1993 Jim Kingdon (kingdon@rtl.cygnus.com)
+
+ * Rename elf{32,64}-generic.c to *-gen.c for 14 char filenames.
+ * Makefile.in: Change accordingly.
+ (CFILES): Add elf64-gen.c.
+
+Fri Jul 16 09:53:23 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coff-mips.c: Use MIPS_AOUT_{OZ}MAGIC rather than {OZ}MAGIC.
+
+Thu Jul 15 16:02:07 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * coff-m88k.c (howto_table): Corrected bitsize for R_PCR26L from
+ 16 to 26.
+
+Wed Jul 14 15:29:56 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * hppa.c [HOST_HPPABSD]: Use hpux-style core files.
+ * libhppa.h [HOST_HPPABSD]: Include hpux version of core.h
+
+Wed Jul 14 09:30:48 1993 Doug Evans (dje@canuck.cygnus.com)
+
+ * configure.in: Recognize h8300h-*-*.
+
+Tue Jul 13 12:03:00 1993 Steve Chamberlain (sac@phydeaux.cygnus.com)
+
+ * coff-h8500.c (reloc_processing, rtype2howto): New relocation
+ type R_H8500_HIGH_16.
+ * coff-sh.c (r_imm32): Get the width of the reloc right.
+
+Tue Jul 13 16:48:56 1993 Frederic Pierresteguy (F.Pierresteguy@frcl.bull.fr)
+
+ * configure.in: Add new target m68k-coffun to the dpx/2.
+ * config/m68k-coffun.mt: New file, renamed from config/dpx2.mt.
+
+Mon Jul 12 10:42:49 1993 Ken Raeburn (raeburn@deneb.cygnus.com)
+
+ * reloc.c (enum bfd_reloc_code_real): Move SPARC_BASE13 reloc into
+ sparc-aout-specific list.
+
+ * libelf.h (struct elf_obj_tdata): Add field `thunk'.
+
+ * config/sparc-elf.mt (TARGET_BACKENDS): New make variable.
+
+Thu Jul 1 14:52:47 1993 Frederic Pierresteguy (F.Pierresteguy@frcl.bull.fr)
+ and Jim Kingdon (kingdon@cygnus.com)
+
+ * elfcode.h: Use memset not bzero.
+ * 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.
+
+Fri Jul 9 00:43:06 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * aoutf1.h: Add definition of MACHTYPE_OK.
+
+Thu Jul 8 14:37:44 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * reloc.c (bfd_perform_relocation): Don't subtract the addend
+ again for coff.
+
+ * syms.c, bfd-in2.h: Doc fix.
+
+ * coffcode.h (CALC_ADDEND): Check for common section using the
+ section flag as well as the symbol flag.
+
+Thu Jul 8 13:43:52 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * hosts/i386bsd.h: Conditionalize HOST_STACK_END_ADDR on __bsdi__.
+ i386bsd.c: Remove defines of N_TXT*; the versions in aout64.h should
+ be sufficient. Define TEXT_START_ADDR.
+
+Wed Jul 7 10:56:21 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * aoutx.h (translate_from_native_sym_flags): Removed statep
+ 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.
+
+Tue Jul 6 13:24:55 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * reloc.c (enum bfd_reloc_code_real): Put simple power-of-two
+ relocs together, and add 64-bit versions.
+ (bfd_generic_get_relocated_section_contents): Argument to alloca
+ is size_t.
+
+ * libbfd.c (bfd_xmalloc_by_size_t): New function.
+ * opncls.c (bfd_cache_init, bfd_open_file): Add prototypes to
+ declarations.
+ (obstack_chunk_alloc): Use bfd_xmalloc_by_size_t.
+ (new_bfd): Prototype-style definition, using DEFUN.
+ (bfd_alloc_grow, bfd_alloc, bfd_zalloc, bfd_realloc): Size
+ argument is type size_t, not bfd_size_type.
+ * ieee.c (obstack_chunk_alloc): Use bfd_xmalloc_by_size_t.
+ * bfd.c (bfd_default_error_trap, bfd_error_trap,
+ bfd_error_nonrepresentabltrap): Prototypes.
+ * libbfd-in.h (bfd_alloc, bfd_zalloc, bfd_realloc,
+ bfd_alloc_grow): Adjusted prototypes for arg type change.
+ * archive.c (get_elt_at_filepos, do_slurp_bsd_armap, normalize,
+ do_slurp_coff_armap, bfd_construct_extended_name_table):
+ Prototypes.
+ * elfcode.h (elf_string_from_elf_strtab): Prototypes.
+ * libelf.h (elf_string_from_elf_section, elf_get_str_section):
+ Prototypes.
+
+ * Makefile.in (ALL_MACHINES): Renamed from BFD_MACHINES.
+ (ofiles): New target. Build a list of unique file names, in case
+ any got duplicated.
+ (TARGETLIB): Use list of files from ofiles.
+ * configure.in: Set BFD_MACHINES and BFD_BACKENDS depending on
+ minimal-bfd flag and target makefile frag contents.
+
+ * elfcode.h (elf_read): Delete static declaration, since function
+ has moved.
+ (elf_map_symbols): Write out section symbols for all sections, for
+ now.
+ (elf_symbol_from_bfd_symbol): Allow match if both symbols are
+ section symbols for the same section.
+ (elf_find_nearest_line): Don't print message, just return false.
+
+ * libelf.h (bfd_elf_locate_sh): Declaration deleted.
+
+Mon Jul 5 16:48:11 1993 Doug Evans (dje@canuck.cygnus.com)
+
+ * cpu-h8300.c (h8300_scan): Fix parsing of architecture string.
+
+Fri Jul 2 18:27:00 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (clean): Remove bfd.h and stmp-bfd.h.
+ (realclean): Remove generated headers.
+
+Fri Jul 2 14:51:51 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * section.c (bfd_set_section_content): Deny if file is not opened with
+ the proper mode, set output_has_begun if file is openened for update.
+ * aoutx.h (aout_*_set_section_content): Remove checks that are now
+ done in bfd_set_section_content.
+
+Fri Jul 2 09:25:20 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * hosts/std-host.h: Removed declarations of printf, fprintf,
+ fcntl, fread and fwrite. They are all error prone for one reason
+ or another. Changed declaration of memchr from char * to PTR.
+
+ * configure.in (mips-*-riscos*): New target; use riscos.
+ * configure.host (mips-*-riscos*): New host; use riscos.
+ * config/riscos.mh (HDEFINES): Add -G 4.
+
+ * libaout.h (GET_SWORD): Use the bfd_h_get_signed entry points
+ rather than casting the result of bfd_h_get.
+
+Fri Jul 2 10:13:48 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * configure.in, hosts/delta68.h, config/delta68.mh: Add stuff for
+ Motorola Delta 68.
+
+Wed Jun 30 06:02:43 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * targets.c (bfd_elf64_{big,little}_generic_vec): Declare, and
+ include in search list if BFD64 is defined.
+
+ * libelf.h (CAT4): Added a version for Saber-C, ANSI mode.
+ (bfd_elf64_*): Declarations for 64-bit versions of many routines.
+
+Tue Jun 29 22:50:59 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * elf64-target.h, elf64-generic.c: New files.
+ * Makefile.in (BFD64_BACKENDS): Include elf64-generic.o.
+ (elf64-generic.o): List dependencies.
+
+ * Makefile.in: List target `all' explicitly before host/target
+ makefile fragments are included, in case they define any new
+ targets.
+
+ * elfcode.h (ELF_R_INFO, ELF_R_SYM): Define as 32- or 64-bit
+ versions as appropriate. Uses updated.
+ (elf_debug_section): Declare before use.
+ (elf_debug_file): New function.
+ (bfd_section_from_shdr, bfd_shdr_from_section, elf_fake_sections):
+ Alignment value in section header is n_bytes, not log2.
+ (new_section_hook): Do nothing for now.
+ (bfd_section_from_shdr): Use Elf_External_Rel[a], not 32-bit
+ version explicitly.
+ (elf_core_file_p): Simplify check for correct class (word size).
+ (elf_make_sections, elf_fake_sections, elf_write_object_contents):
+ Initialize all fields when creating data structures.
+ (elf_locate_sh): Renamed from bfd_elfXX_locate_sh, made static.
+ (elf_compute_section_file_positions): Set correct class in output
+ file.
+ (elf_write_object_contents): Section symbols have empty names in
+ output file.
+
+ * libbfd.c (bfd_xmalloc, zalloc): Be sure to cast malloc, memset
+ args to size_t before call.
+ (bfd_add_to_string_table): Cast zalloc arg to bfd_size_type.
+
+Tue Jun 29 10:49:42 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coff-mips.c (ecoff_find_nearest_line): If procedure has no line
+ number information, return 0 for line number.
+
+Mon Jun 28 10:45:02 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * aoutx.h (some_aout_object_p): If *oldrawptr is non-NULL, copy it
+ into *rawptr.
+
+Sun Jun 27 09:05:19 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * hosts/riscos.h: Define NBPG and UPAGES.
+
+Sun Jun 27 16:28:26 1993 Ken Raeburn (raeburn@cygnus.com)
+
+ * elfcode.h (elf_slurp_symbol_table): Don't use obj_raw_syms as
+ lvalue; it contains a cast.
+
+Fri Jun 25 17:09:55 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * aoutx.h (hash, compare, struct stringtab_entry, add_to_stringtab):
+ Use unsigned hash values for better hashing.
+ (hash): Hash in the string length for long strings.
+
+Thu Jun 24 15:47:51 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * aoutx.h (compare): Replace 3 if's with a subtraction.
+ (translate_to_native_sym_flags, add_to_stringtab): Reorder tests
+ in decreasing order of success, as an optimization.
+ (hash): Take a length arg; ignore chars after #25, for speed.
+ (add_to_stringtab): Pass length to hash.
+
+Thu Jun 24 17:25:51 1993 Ken Raeburn (raeburn@poseidon.cygnus.com)
+
+ * elf32-sparc.c (sparc_reloc_map): Add SPARC_WDISP22 reloc.
+
+ * elfcode.h (elf_new_section_hook): Do nothing for now.
+ (elf_write_object_contents): Output common symbols the way ELF
+ wants them.
+
+Wed Jun 23 16:20:07 1993 Ken Raeburn (raeburn@poseidon.cygnus.com)
+
+ * libelf.h (struct elf_obj_tdata and associated macros): Moved
+ here from elfcode.h. A couple of size-specific structure pointers
+ were changed to PTR; uses fixed appropriately.
+ (elf32_symbol_type, elf64_symbol_type): Separated definitions.
+ (bfd_elf_mkobject): Renamed from bfd_elf32_mkobject.
+ (bfd_elf32_mkobject, bfd_elf64_mkobject, elf_mkobject): New
+ temporary macros to ease name change.
+ * elf.c (elf_read, elf_mkobject, elf_get_str_section,
+ elf_string_from_elf_section, bfd_elf_find_section): Moved here
+ from elfcode.h.
+ * doc/Makefile.in (libbfd.h): Process elf.c too.
+ * Makefile.in (elf.o): Note new dependencies.
+
+ * elfcode.h: Lots of stuff moved elsewhere. Deleted some unused
+ code, tweaked some debug hooks.
+ (elf_slurp_reloca_table): Translate ELF section symbols into BFD
+ section symbols.
+
+Wed Jun 23 11:34:21 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * hosts/riscos.h: New file.
+
+Tue Jun 22 14:35:20 1993 Ken Raeburn (raeburn@poseidon.cygnus.com)
+
+ * elfcode.h (bfd_section_from_shdr, case SHT_PROGBITS): Even if
+ section already exists, use its pointer to fill in rawdata slot.
+
+Tue Jun 22 16:36:51 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * hosts/std-host.h: Return value of puts and fputs is int not void.
+
+Tue Jun 22 14:25:58 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * aoutx.h (howto_table_ext): Comment the field names.
+ * reloc.c (bfd_perform_relocation): Fix max and min values.
+
+Mon Jun 21 18:19:14 1993 Ken Raeburn (raeburn@poseidon.cygnus.com)
+
+ * elf32-target.h, elf32-hppa.c, elfcode.h: Use new
+ size-independent elf internal data structures.
+ * elfcode.h (put_word, get_word): Define as appropriate for
+ architecture word size. Structure swapping functions changed to
+ use them as appropriate.
+
+ * configure.in: If compiling 64-bit back ends, do them before
+ 32-bit ones.
+
+ * libelf.h: Use new size-independent versions of elf internal data
+ structures.
+ (symbol_type): Reordered to put any fields dependent on target
+ size at the end.
+ (elf_backend_data): Renamed from elf##_backend_data and made
+ size-independent.
+ (elf_sect_thunk): Now size-independent.
+
+ * libbfd.c (bfd_log2): Now returns unsigned int.
+
+Mon Jun 21 12:30:47 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * Rename config/m88k-aout.mt to config/noop.mt.
+ configure.in: Use it for mips-*-bsd*.
+
+Sun Jun 20 20:32:19 1993 Ken Raeburn (raeburn@poseidon.cygnus.com)
+
+ * cpu-m68k.c (arch_info_struct): Eliminate "partially bracketed
+ initializer" warning from gcc.
+ * cpu-h8500.c (arch_info_struct): Likewise.
+ * cpu-sh.c (arch_info_struct): Likewise.
+
+ * cpu-h8300.c (local_bfd_reloc_type_lookup, howto*_callback,
+ howto_*): Unused functions and variables commented out.
+ * cpu-z8k.c (local_bfd_reloc_type_lookup, howto*_callback,
+ howto_*): Likewise.
+ * cpu-h8500.c (compatible): Likewise.
+ * cpu-sh.c (compatible): Likewise.
+
+ * hp300hpux.c (swap_std_reloc_in): Delete unused variables.
+ Always set a valid length value, even for invalid input.
+
+ * srec.c (srec_write_symbols): Use sprintf_vma.
+
+ * bfd-in.h (uint64_typeLOW, uint64_typeHIGH, int64_type,
+ uint64_type): Provide default definitions.
+ * hosts/std-host.h (int64 stuff): Remove them from here.
+
+ * bfd-in.h (sprintf_vma): Define parallel to fprintf_vma.
+
+ * elf32-i386.c (elf_i386_reloc_type_lookup): Delete unused
+ variable. Added default case to switch.
+
+ * aoutx.h (translate_from_native_sym_flags): Before casting
+ pointers to integers, make sure the integer type is wide enough.
+ * coff-mips.c (ecoff_set_symbol_info): Ditto.
+
+ * section.c (bfd_get_section_contents): Since `count' is unsigned,
+ don't bother comparing for less-than-zero.
+ (bfd_set_section_contents): Ditto.
+
+ * elfcode.h (bfd_add_to_strtab): Now static.
+ (sym_is_global): New function.
+ (elf_map_symbols): Call it. Now returns void. Removed unused
+ local variable.
+ (bfd_section_from_shdr): Mark string tables other than for section
+ and symbol names as normal sections having contents.
+ (fix_up_strtabs): New function; fixes up ELF header fields for
+ stab sections with string tables associated.
+ (elf_write_object_contents): Map fix_up_strtabs over all BFD
+ sections. Reordered condition tests for symbol flags; default to
+ local-object value instead of global-object.
+ (elf_symbol_from_bfd_symbol): Hid conditionally-used variable
+ inside condition test.
+ (elf_print_symbol): Use fprintf_vma.
+ (elf_idx_of_sym, bfd_shdr_from_section): Unused functions
+ commented out.
+
+ * bfd-in.h (int64_type, uint64_type): Define these if we fall
+ back to "long long" for HOST_64_BIT.
+
+ * libelf.h (elfNAME, ElfNAME): New versions to get desired results
+ without using invalid ANSI C preprocessing tokens.
+
+ * elf32-target.h (bfd_elf32_new_section_hook): Delete macro.
+ * libelf.h (bfd_elf32_new_section_hook): Declare.
+ * elfcode.h (new_section_hook): Define here.
+
+ * hosts/sparc.h, hosts/std-host.h, hosts/i386bsd.h: Protect
+ against multiple inclusions.
+
+ * hosts/news.h: Include hosts/std-host.h, not plain std-host.h.
+
+ * Makefile.in (bfd.h): Generate into current directory by grabbing
+ 64-bit definition (if any) from sysdep.h.
+ * bfd-in.h: Put in marker for sysdep.h inclusion.
+
+Fri Jun 18 19:57:23 1993 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * reloc.c (bfd_perform_relocation): Check for overflow on
+ pc-relative relocations if the howto asked for it.
+
+Fri Jun 18 16:00:20 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * Makefile.in (stmp-bfd.h): Ignore nonzero exit status from grep.
+
+Fri Jun 18 16:54:29 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/riscos.m{h,t}: New files.
+ * configure.{host,in}: Use them.
+
+Fri Jun 18 12:55:10 1993 K. Richard Pixley (rich@cygnus.com)
+
+ * elf32-mips.c: comment change. This is a mips file, not 88k.
+
+Mon Jun 14 14:02:41 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * cache.c (bfd_cache_init): Increment open_files and call close_one
+ if necessary.
+ (bfd_open_file): Don't increment open_files here.
+
+Fri Jun 18 10:00:14 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/delta88.mh: Don't set CC.
+
+ * Makefile.in: Add elf32-{mips,m88k,generic}.
+ elf32-{mips,m88k,generic}.c: New files.
+ targets.c (target_vector): Include bfd_elf32_{mips,m88k,generic}_vec.
+ elfcode.h (elf_object_p): Match elf32-generic for all machines which
+ don't match a different target.
+
+Fri Jun 18 03:12:12 1993 John Gilmore (gnu@cygnus.com)
+
+ Eliminate "int8_type", "int16_type", "int32_type", and their
+ variants from the BFD universe. Leave the 64-bit types for now,
+ since they are in flux.
+
+ * aoutx.h, hp300hpux.c: Eliminate needless (int32_type) casts.
+ * libaout.h (GET_SWORD): Convert (int32_type) to (int).
+ * ieee.c: Convert uint8e_type => unsigned char.
+ * oasys.c: Extensive changes to eliminate obsolete types.
+ These depend on changes in ../include/oasys.h as well.
+ * hosts/*.h: Remove declarations of all these types.
+
+Mon Jun 14 14:02:41 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * hosts/delta88.h: #if 0 out some declarations which conflict with
+ system headers.
+
+Mon Jun 14 17:08:18 1993 david d `zoo' zuhn (zoo at rtl.cygnus.com)
+
+ * Makefile.in (install): remove parentdir cruft
+
+Mon Jun 14 19:04:09 1993 Stu Grossman (grossman@cygnus.com)
+
+ * hppa.c (hppa_get_symbol_info): Remove redundant copy.
+ * Expurgate random DEFUNs that have crept in.
+
+Mon Jun 14 10:23:53 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coff-mips.c (ecoff_set_symbol_info): Constructor sections should
+ only be aligned to a 4 byte boundary.
+
+Sat Jun 12 16:13:17 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * hosts/std-host.h (struct int64e_struct): Remove needless typedef
+ keyword.
+
+Fri Jun 11 14:25:34 1993 Steve Chamberlain (sac@phydeaux.cygnus.com)
+
+ * aoutf1.h (sunos4_write_object_contents): set flags to 1, breaking
+ 1927 but fixing some other important things.
+
+Thu Jun 10 20:36:22 1993 Doug Evans (dje@canuck.cygnus.com)
+
+ * hosts/std-host.h (int64e_type): Fix definition.
+
+Thu Jun 10 11:48:28 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coff-mips.c (ecoff_sec_to_styp_flags): Use STYP_MIPS_INIT for
+ section named _INIT. Don't set STYP_TEXT unless SEC_CODE is set.
+ (ecoff_styp_to_sec_flags): Treat a STYP_MIPS_INIT section like
+ a STYP_TEXT section.
+
+Wed Jun 9 16:48:13 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in (install, headers): don't put comments after a tab
+ in the actions section of a rule
+
+Wed Jun 9 15:00:01 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coff-mips.c (ecoff_mkobject_hook): Mark ZMAGIC files as D_PAGED.
+ (ecoff_write_object_contents): If not D_PAGED, don't add the
+ section headers to text_size. If not D_PAGED, set the magic
+ number to OMAGIC rather than ZMAGIC. If creating a D_PAGED
+ executable, the executable must fully occupy an even number of
+ pages.
+ (ecoff_set_symbol_info, make_bfd_asection, ecoff_little_vec,
+ ecoff_big_vec): Consistently set section alignment power to 4,
+ since ECOFF sections should be multiples of 16 bytes.
+ (ecoff_little_vec, ecoff_big_vec): Added D_PAGED to object_flags.
+ Made ar_pad_char and ar_max_namelen agree for both.
+
+Tue Jun 8 20:28:02 1993 Mark Eichin (eichin at tweedledumber)
+
+ * elfcode.h (elf_slurp_symbol_table): subtract section vma from
+ symbol value, since bfd symbols are section relative, but ELF
+ symbols aren't.
+
+Tue Jun 8 12:08:27 1993 Steve Chamberlain (sac@phydeaux.cygnus.com)
+
+ * cpu-i960.c, cpu-h8300.c (compatible): Make static.
+
+Tue Jun 8 14:27:56 1993 Jim Kingdon (kingdon@rtl.cygnus.com)
+
+ * hosts/news.h, config/news.mh: New files.
+
+Tue Jun 8 12:08:27 1993 Steve Chamberlain (sac@phydeaux.cygnus.com)
+
+ * bfd-in2.h, archures.c (bfd_mach_h8300[h]): new defines.
+ * coff-h8300.c: More addressing modes.
+ * coffcode.h (coff_set_arch_mach_hook): Cope with H8300 magic
+ number.
+ * cpu-h8300.c: Removed disassemble stuff. (h8300_scan): Recognise
+ H8/300H name. (compatible): New function.
+ * reloc16.c (bfd_coff_reloc16_get_relocated_sec): Cope with more
+ addressing modes.
+
+Tue Jun 8 10:30:13 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coff-mips.c (ecoff_compute_section_file_positions,
+ ecoff_write_object_contents): Only round to page boundaries if
+ D_PAGED flag is set for the output BFD.
+
+Fri Jun 4 15:47:52 1993 Steve Chamberlain (sac@phydeaux.cygnus.com)
+
+ * coffcode.h (get_index, coff_slurp_symbol_table): Fix pointer
+ casts to work on machine where sizeof(long) != sizeof(int) !=
+ sizeof(char *).
+ * coffgen.c (coff_get_normalized_symtab): Ditto.
+ * cpu-h8300.c coff-h8300.c: Support for H8/300-H.
+
+Fri Jun 4 15:24:27 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * coffgen.c (coff_write_symbols): For empty string table, write
+ out 4 in correct byte order. (from minyard@bnr.ca)
+
+ * elf32-hppa.c: Don't include libhppa.h for now; define
+ BYTES_IN_WORD instead, until Utah sends a better fix.
+ (hppa_elf_build_arg_reloc_stub): Use xmalloc and xrealloc instead
+ of malloc and realloc.
+
+Fri Jun 4 07:49:01 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * configure.in (mips-*-ecoffl*): New target; use decstation.
+ (mips-*-ecoff*): Added trailing '*'.
+
+ * coff-mips.c (ecoff_get_debug): Get the offset from the first PDR
+ for the FDR, not from the first PDR in the file.
+
+Thu Jun 3 16:41:10 1993 Stu Grossman (grossman@cygnus.com)
+
+ * hppa.c (hppa_get_symbol_info): New func needed for JUMP_TABLE.
+
+Thu Jun 3 15:33:57 1993 David J. Mackenzie (djm@rtl.cygnus.com)
+
+ * hppa.c (hppa_get_symbol_info): New function.
+
+Thu Jun 3 13:07:42 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * elfcode.h (elf_map_symbols): Don't crash if no symbols have been
+ allocated yet.
+
+ From Peter Hoogenboom (hoogen@schafer.cs.utah.edu):
+ * libhppa.h (MAXCOMLEN): Define unconditionally.
+ (_PA_RISC_ID): Only define if not already defined.
+ * elf32-hppa.c: Include libhppa.h.
+
+ From Ralph Campbell:
+ * hosts/mipsbsd.h (HOST_DATA_START_ADDR): Delete definition.
+
+ * elf32-hppa.h (symext_rootP, symext_lastP): Delete decls.
+
+Thu Jun 3 00:23:53 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * config/go32.mh: define EXTRALIBES to -lm (for binutils), also
+ remove defines of __MSDOS__ and __GO32__ (these are in the
+ compiler now).
+
+Wed Jun 2 17:57:13 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ From Utah:
+ * hosts/hppabsd.h: Eliminate use of obsolete EXFUN.
+ * config/hppabsd.mh: Don't use ranlib.
+
+Tue Jun 1 04:15:57 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com)
+
+ * elf.c: New file, for word-size independent code.
+ * elfcode.h (elf_hash): Moved to there, renamed bfd_elf_hash.
+ * Makefile.in: Include elf.o in standard objects.
+
+ * bfd-in.h (CAT3): Define here.
+ * libaout.h, libelf.h: Not here.
+
+ * libelf.h (struct strtab): Define here.
+ (bfd_elf_locate_sh): Declare here.
+ * elfcode.h (struct strtab): Definition deleted.
+
+ * reloc.c (enum bfd_reloc_code_real): Added HPPA_PCREL_CALL_12.
+
+ * Makefile.in: Make "all", not "bfd.h", be the default target.
+ (stmp-bfd.h): New target; prevents rebuilding world if bfd.h
+ hasn't really changed.
+
+ Tue May 25 12:15:15 1993 Michael Meissner (meissner@osf.org)
+
+ * elfcode.h (elf_hash): Provide elf standard hash function.
+ (various): Key off of the machines use_rela_p field to determine
+ whether to use REL or RELA relocations.
+ (elf_swap_reloc_out, elf_swap_reloc_in): New functions.
+ (elf_make_sections): Allocate a pointer to hold all data for a
+ given section, and copy each fragment into the data region.
+ Update the section's pointer with the REL implicit addends if the
+ machine uses REL relocation.
+
+ * elf32-i386.c (elf_bfd_reloc_type_lookup): Rename to
+ elf_i386_bfd_reloc_type_lookup, and use cpp to map the name back
+ into was elf32-target.h expects.
+ (elf_info_to_howto): Rename to elf_i386_info_to_howto.
+ (elf_i386_bfd_reloc_type_lookup): Add relocation support.
+ (elf_i386_info_to_howto): Add minimal relocation support.
+
+ * libelf.h (elf_backend_data): Add use_rela_p, elf_64_p,
+ elf_info_to_howto_rel fields.
+
+ * elf32-target.h (elf_bed): Add support for new fields in
+ elf_backend_data.
+
+ Sun May 30 16:38:24 1993 Peter Hoogenboom (hoogen@fast.cs.utah.edu)
+
+ * elf32-hppa.c: Add symbol extension section support, fix
+ relocation howto table, add stub generation support.
+
+ * elf32-hppa.h: Add symbol extension section support, fix
+ relocation howto table, add stub generation support.
+
+ * elfcode.h (bfd_elf_locate_sh): New function to locate ELF
+ section header.
+
+ * elfcode.h (bfd_add_to_strtab): Made non-static due to a call
+ from elf32-hppa.c.
+
+ * elfcode.h (elf_idx_of_sym): Return STN_UNDEF instead of 0 when
+ the symbol is not found.
+
+ * elfcode.h (elf_compute_section_file_positions): Not all section
+ file positions were computed.
+
+ * elfcode.h (elf_get_sect_thunk): New function.
+
+ * hppa.c (sign_ext): Reimplement.
+
+ * hppa.c (round_down,round,round_up,L,R,LS,RS,LD,RD,LR,RR): Make
+ these functions static.
+
+Tue Jun 1 14:40:41 1993 Per Bothner (bothner@rtl.cygnus.com)
+
+ * Makefile.in (bfd.h): Move closer to headers - and after 'all'!
+
+ * aoutx.h (translate_from_native_sym_flags): Don't set
+ BSF_DEBUGGING for constructor symbols, only BSF_CONSTRUCTOR.
+ * aoutx.h (translate_to_native_sym_flags): Translate
+ constructor symbols properly.
+
+Thu May 27 16:09:04 1993 Steve Chamberlain (sac@phydeaux.cygnus.com)
+
+ * archures.c (bfd_default_arch_struct): use 4 byte alignment as a
+ minimum.
+ * aout-target.h (minimum_alignment): 8 byte alignment is right.
+ (fix ld/2680)
+
+Thu May 27 13:38:47 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * configure.in, Makefile.in: Build bfd-in2.h in source directory,
+ from bfd-in.h and .c files. Build bfd.h in build directory,
+ substituting in requested target word size. Insert word size into
+ makefile, and maybe enable 64-bit targets.
+
+ * bfd-in.h, libbfd.c, demo64.c, targets.c: Define BFD64 if 64 bits
+ are available. Conditionalize on this. Assume HOST_64_BIT
+ will be defined if needed, so 64-bit targets are conditionalized
+ only in the Makefile.
+
+Tue May 25 14:03:56 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * libbfd.c (COERCE64): Rewrite to avoid out-of-range values.
+
+ * coff-sh.c (rtype2howto): Put error message on stderr.
+ (extra_case): Delete unused variable.
+
+ * coff-mips.c (ecoff_print_symbol): Cast bfd_vma values to long
+ before calling printf.
+
+ * elfcode.h: New file, almost completely derived from old elf32.c.
+ * elf32.c: Now just define ARCH_SIZE and include elfcode.h.
+ * Makefile.in (elf64.o): List dependencies, don't build by
+ default.
+ (elf64.c): Add to list of sources.
+ (elf32.o): Update dependencies.
+ * elf32-*.c: Updated type/macro/structure names. Cleaned up
+ namespace pollution; rename vectors.
+ * targets.c, config/*-elf.mt: Updated.
+ * All uses of 32-bit versions of structures, routines, and macros
+ renamed.
+
+ * Makefile.in (archures.o, targets.o): Depend on Makefile.
+
+Mon May 24 15:53:13 1993 Ken Raeburn (raeburn@cygnus.com)
+
+ * elf32-i386.c (enum reloc_type): No comma after last enumerator.
+
+ * elf32.c (elf_string_from_elf_section): Handle index of zero
+ specially.
+ (bfd_section_from_shdr, elf_slurp_symbol_table): Don't need to do
+ so here.
+ (elf_write_object_contents): Deleted one unused variable and
+ initialized another to avoid gcc warnings.
+ (elf_set_section_contents): Delete unused variable.
+
+Fri May 21 19:04:21 1993 Stu Grossman (grossman@cygnus.com)
+
+ * i386lynx.c: New module for Lynx variant of a.out.
+ * Makefile.in (BFD_BACKENDS CFILES depends): Add i386lynx.c.
+ * gen-aout.c: Get rid of defunct endian stuff, print out true
+ pagesize.
+ * targets.c (target_vector): Add i386lynx_vec.
+
+Fri May 21 17:02:22 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * configure.in: Use i386-sco.mt for i[36]86-*-isc*.
+
+Fri May 21 13:44:18 1993 David J. Mackenzie (djm@rtl.cygnus.com)
+
+ * aix386-core.c, aout-target.h, aoutx.h, coff-alpha.c,
+ coff-mips.c, coffgen.c, elf32.c, ieee.c, libaout.h, libcoff-in.h,
+ libelf.h, mipsbsd.c, oasys.c, sco-core.c, srec.c, tekhex.c,
+ trad-core.c: Define a TARGET_get_symbol_info function or macro.
+ Remove the bfd_print_symbol_nm case from TARGET_print_symbol.
+
+ * bfd-in.h: Don't define bfd_print_symbol_nm.
+ Define symbol_info type.
+ (JUMP_TABLE): Set _get_symbol_info element.
+
+ * syms.c (coff_section_type, bfd_symbol_info): New functions.
+ (bfd_decode_symclass): Use coff_section_type.
+
+ * targets.c: Add bfd_get_symbol_info call.
+
+Wed May 19 15:30:52 1993 Stu Grossman (grossman@cygnus.com)
+
+ * coff-i386.c (coff_i386_reloc): Use unsigned char to avoid
+ complaints from ancient gcc's.
+
+Wed May 19 15:51:19 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * trad-core.c: Check macro TRAD_CORE_EXTRA_SIZE_ALLOWED.
+ hosts/i386linux.h: Define it.
+
+Mon May 17 15:00:33 1993 Ken Raeburn (raeburn@deneb.cygnus.com)
+
+ * VERSION, bfd-in.h: Bump version number to 2.2.
+
+ * hppa.c (assemble_3, dis_assemble_3, assemble_12,
+ dis_assemble_12, assemble_17, dis_assemble_17, assemble_21,
+ dis_assemble_21, sign_ext, ones, sign_unext, low_sign_ext,
+ low_sign_unext, round_down, round, round_up, L, R, LS, RS, LD, RD,
+ LR, RR, hppa_field_adjust): New functions.
+
+Mon May 17 10:04:16 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coff-mips.c (ecoff_set_symbol_info): Added support for indirect
+ stabs symbols, including new indirect_ptr_ptr argument.
+ (ecoff_slurp_symbol_table): Pass new argument in calls to
+ ecoff_set_symbol_info.
+
+Fri May 14 00:05:06 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * configure.in: For m68k sysv systems, use m68k-coff.
+
+ * config/hppa-elf.mt (TDEFINES): Don't define DEFAULT_VECTOR here.
+ (TDEFAULTS): Define it here. Use the new name.
+
+ * elf32-hppa.c (elf_hppa_backend_data): Delete; rely on default
+ values instead.
+
+ * reloc.c (bfd_reloc_code_real_type): Add some HPPA reloc types.
+
+ * aix386-core.c (NO_GETS): Fix PROTO invocation to have correct
+ number of arguments.
+ (aix386_core_file_p): Initialize core_size to correct value.
+
+Wed May 12 14:39:59 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in (CC_FOR_BUILD): New variable, set to $(CC).
+ (FLAGS_TO_PASS): Pass down CC_FOR_BUILD.
+
+ * bout.c (aout32_slurp_extended_name_table): Define to be
+ _bfd_slurp_extended_name_table rather than bfd_true.
+
+ * coff-mips.c: Include libaout.h and aout/aout64.h to get
+ definitions for N_SET[ATDB].
+ (ecoff_howto_table): Moved near top of file.
+ (ecoff_set_symbol_info): If a STABS symbol of type N_SET[ATDB] is
+ seen, cook up a constructor section of the same name and put in a
+ reloc pointing to the symbol. This lets the GNU linker build
+ global constructors and destructors without using collect.
+
+Tue May 11 00:33:31 1993 John Gilmore (gnu@cygnus.com)
+
+ * coff-m88k.c (m88kbcs_vec): Symbols have underbars.
+
+Mon May 10 05:55:45 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com)
+
+ * hosts/miniframe.h: New file.
+ * configure.host: Use it.
+
+Sun May 9 16:36:59 1993 Fred Fish (fnf@cygnus.com)
+
+ * configure.in (hppa*-*-bsd): Change to hppa*-*-bsd*
+ * configure.in (hppa*-*-hpux): Change to hppa*-*-hpux*
+ * configure.in (m68*-hp-bsd): Change to m68*-hp-bsd*
+ * configure.in (m68*-*-hpux): Change to m68*-*-hpux*
+ * configure.in (*-*-bsd): Change to *-*-bsd*
+
+Wed May 5 16:08:32 1993 Per Bothner (bothner@cygnus.com)
+
+ * elf32-hppa.c (elf_hppa_reloc_type_lookup): Cast enums to
+ int, for the sake of the old Portable C Compiler.
+
+Mon May 3 14:37:01 1993 Stu Grossman (grossman@cygnus.com)
+
+ * Makefile.in (CFILES): Add cpu-sh.c and coff-sh.c.
+
+Mon May 3 14:03:21 1993 Ken Raeburn (raeburn@deneb.cygnus.com)
+
+ * configure.in: Get target name right for m68*-*-hpux.
+
+Sun May 2 11:39:44 1993 Fred Fish (fnf@cygnus.com)
+
+ * trad-core.c (NO_SIGNED_GET): New macro.
+ * trad-core.c (trad_core_vec): Use new NO_SIGNED_GET instead of
+ signed NO_GET, where appropriate.
+
+ * configure.in (i[34]86-*-linux*): Add; bfd_target = i386-linux.
+ * configure.in (*-*-linux*): Remove until linux port for a
+ non-i386/i486 system is actually available.
+
+Fri Apr 30 20:04:10 1993 Stu Grossman (grossman@cygnus.com)
+
+ * libhppa.h: #undef e_* symbols which come from <machine/som.h>
+ when compiling under HPUX.
+
+Fri Apr 30 17:25:23 1993 Stu Grossman (grossman@cygnus.com)
+
+ * The following patches are from Jeffrey Law <law@cs.utah.edu>.
+ * hppa.c (hppa_core_file_p): Provide a temporary dummy routine
+ for HOST_HPPABSD.
+ * bfd/hosts/hppabsd.h: Fix declarations of malloc and free.
+ * bfd/libhppa.h: Include sysdep here. Conditionalize
+ includes based on HOST_HPPAHPUX or HOST_HPPABSD.
+ Provide definitions for MAXCOMLEN and _PA_RISC_ID suitable
+ for BSD.
+
+Fri Apr 30 17:34:11 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * elf32-hppa.c: Don't include a.out.h. Apparently not even the
+ GNU version is needed.
+
+Fri Apr 30 09:38:59 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * coffcode.h: use dummy_reloc16_extra_cases rather than casting abort.
+
+Thu Apr 29 11:30:32 1993 Ken Raeburn (raeburn@deneb.cygnus.com)
+
+ * Makefile.in: Build elf32-hppa.o.
+
+ * syms.c (BSF_FUNCTION): New symbol flag.
+
+ * elf32-hppa.c: Fixed to work with elf32-target.h.
+
+ * hp300hpux.c (NAME, NAME_swap_exec_header_in): Fix for
+ traditional C.
+ * libaout.h (NAME): Don't define if already defined.
+
+ * libelf.h: Protect against multiple inclusions.
+ (elf_symbol_type): Moved here, added new fields.
+ (struct elf_backend_data): New field `global_sym'; I suspect this
+ may be misplaced.
+ * elf32.c (elf_symbol_type): Deleted from here.
+ (struct elf_obj_tdata): New fields raw_syms and internal_syms, to
+ point to backend versions of symbols.
+ (obj_symbols, obj_raw_syms, obj_internal_syms): New macros.
+ (elf_swap_phdr_out, elf_build_phdrs, elf_write_phdrs): New
+ functions.
+ (elf_write_object_contents): Write program headers if appropriate.
+ (bfd_section_from_shdr): Unnamed sections get empty string for
+ name, not "unnamed". Handle SHT_NOBITS separately from
+ SHT_PROGBITS, and set some different flags.
+ (elf_file_p): New routine.
+ (elf_object_p, elf_core_file_p): Call it.
+ (elf_object_p): Handle EM_HPPA.
+ (elf_symbol_from, elf_idx_of_sym): New functions.
+ (elf_make_sections): Get symbol number right for relocations. Set
+ SHF_ALLOC, SHF_WRITE, SHF_EXECINSTR when appropriate.
+ (elf_fake_sections): BSS section should be SHT_NOBITS, not
+ SHT_PROGBITS. Always generate symtab and strtab, not only if
+ relocations are needed. Set SHF_* flags as appropriate.
+ (elf_compute_section_file_positions): Handle bfd_arch_hppa.
+ (elf_write_object_contents): Fix off-by-one error in symbol count.
+ Store a correct value for the symbol; write the size field
+ properly; make some guesses about the type field. Set section
+ type correctly for string tables.
+ (section_from_elf_index): Check for absolute and common sections
+ first.
+ (elf_section_from_bfd_section): Ditto.
+ (elf_slurp_symbol_table): Use elf_symbol_type instead of asymbol.
+ Use empty string instead of "unnamed" for nameless symbols.
+ Handle STTY_FUNC type, and weirdness with "$global$" symbol for
+ HPPA (only?). Don't free raw symbols; keep the pointer around for
+ later.
+ (elf_set_arch_mach): Handle bfd_arch_hppa.
+ (elf_find_nearest_line): Just return false.
+ (elf_write_object_contents, elf_set_section_contents): Set
+ output_has_begun field after computing file positions.
+ (elf_set_section_contents): Write section contents immediately,
+ rather than caching the whole file and writing it at close time.
+
+ * libhppa.h (enum hppa_reloc_field_selector_type, enum
+ hppa_reloc_field_selector_typ_alt, enum hppa_reloc_expr_type, enum
+ hppa_reloc_expr_type_alt): New enumerator types.
+
+ * config/hppa-elf.mt,. config/hppaosf.mh: HP PA/OSF support.
+ * configure.in, configure.host: Use them.
+
+Wed Apr 28 23:21:01 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * elf32-target.h: Allow overrides of armap defaults.
+
+ * elf32-hppa.c, elf32-hppa.h: New files.
+
+ * config/hp300hpux.mt: New file.
+
+Tue Apr 27 05:39:40 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com)
+
+ * aix386-core.c (NO_GETS): New macro; NO_GET for signed values.
+ (aix386_core_vec): Update for new fields.
+
+ * archive.c (bfd_generic_archive_p): Call target-specific
+ slurp_armap code, instead of bfd_slurp_armap.
+ (bfd_slurp_bsd_armap_f2): New function.
+ * libbfd-in.h (bfd_slurp_bsd_armap_f2): Declare it.
+ * aout-target.h (AR_PAD_CHAR): Define it if not already defined.
+ (vec): Use it.
+ * libaout.h (struct aoutdata): New field for subformat, for
+ differentiating between highly similar a.out formats.
+ * aoutx.h (NAME_swap_exec_header_in): New macro, defaults to local
+ version of function.
+ (swap_exec_header_in): Don't define if NAME_swap_exec_header_in is
+ already defined.
+ * hp300hpux.c: New file.
+ * Makefile.in: Include it.
+
+Mon Apr 26 13:24:43 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * Makefile.in, archures.c, coffcode.h, targets.c: Support for
+ Hitachi SH.
+
+Mon Apr 26 13:55:42 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * trad-core.c (trad_unix_core_file_p): Check the file size.
+
+Mon Apr 26 13:24:43 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * coff-alpha.c: Remove duplicate function and add warnings.
+
+Mon Apr 26 11:25:58 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * sco-core.c (sco_core_vec): Add initializers for new target
+ fields.
+
+Sat Apr 24 21:33:45 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * coffcode.h [_LIT]: Recognize .lit section.
+
+Fri Apr 23 19:00:36 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * coff-alpha.c, cpu-alpha.c, config/alphaosf.mt,
+ config/alphaosf.mt, hosts/alphaosf.h: New files.
+
+Fri Apr 23 16:48:46 1993 Stu Grossman (grossman@cygnus.com)
+
+ * Merge in HPPA/BSD changes from Utah.
+ * hppa.c: Use this for both HPUX & BSD.
+ * targets.c: Enable hppa_vec for both HPUX & BSD.
+ * config/hppabsd.mt: TDEFINES => TDEFAULTS.
+ * hosts/hppabsd.h: #define HOST_HPPABSD.
+
+Wed Apr 21 01:50:10 1993 John Gilmore (gnu@cygnus.com)
+
+ * libbfd.c: Whitespace changes around byteswap macros.
+ * libbfd-in.h: Whitespace changes around byteswap declarations.
+
+Tue Apr 20 15:59:07 1993 Stu Grossman (grossman@cygnus.com)
+
+ * aoutf1.h (sunos4_core_file_p): Don't default bfd_error to
+ system_error anymore. It confuses bfd_check_format().
+
+Mon Apr 19 23:03:08 1993 Stu Grossman (grossman@cygnus.com)
+
+ * bfd.c: Add sgi_core_data to tdata union.
+ * coff-mips.c: Add Irix 4.x core file support.
+ * hosts/irix4.h: #define HOST_IRIX4.
+
+Mon Apr 19 18:52:52 1993 Ken Raeburn (raeburn@deneb.cygnus.com)
+
+ * aoutx.h (translate_from_native_sym_flags): Check that the
+ symbol's section does get set.
+ (slurp_symbol_table): Zero index means null-string name.
+
+ * aoutx.h (struct stringtab_entry, struct stringtab_data): New
+ data structures.
+ (hash, stringtab_init, add_to_stringtab, emit_strtab, compare):
+ New functions.
+ (write_syms): Use them, to reduce string table size.
+
+Mon Apr 19 16:45:12 1993 Fred Fish (fnf@cygnus.com)
+
+ * trad-core.c (trad_core_vec): Add 6 new initializers to match
+ new signed get/put fields. Minor reformatting to label
+ some fields.
+
+Mon Apr 19 06:09:41 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * bfd-in.h: Insert comment about SVR3 compiler warnings.
+
+ * hosts/{hp300,i386isc,i386v}.h: Remove unused #defines of {r,}index
+ (bfd uses strchr and the broken SVR3.2 cpp loses with the defines).
+
+ * libbfd.c: bfd_put*: Remove casts to bfd_vma.
+
+Fri Apr 16 17:49:27 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * aoutf1.h (internal_sunos_core): Make c_stacktop a bfd_vma.
+ (swapcore_sparc): Make sp a bfd_vma.
+
+Thu Apr 15 09:09:18 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * libbfd.c: Add signed versions of bfd_{h_,}{get,put}_signed_<size>.
+ libbfd.c, libbfd-in.h: Add _do*signed*.
+ targets.c, all targets: Add bfd*signed*.
+ bfd-in.h: Add bfd_signed_vma. Add comments.
+
+ * bfd-in.h (bfd_error), bfd.c (bfd_errmsgs): Add file_truncated.
+
+ * format.c (bfd_check_error): Check error return from
+ _bfd_check_format routines.
+
+Wed Apr 14 23:48:25 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * rs6000-core.c (rs6000coff_core_p): Improve error checking and
+ recognize .data section if present.
+
+Thu Apr 15 01:00:29 1993 John Gilmore (gnu@cygnus.com)
+
+ * aoutx.h (aout_*_adjust_sizes_and_vmas): Avoid `sanity'
+ check for the case where the user sets the address of the BSS
+ section (and the file header can't specify this). Let the user
+ set it wherever they want, regardless of what goes in the header.
+
+ * ieee.c (ieee_slurp_sections): Pass all ieee section names
+ straight through into BFD sections. Add comments.
+
+Wed Apr 14 20:34:54 1993 John Gilmore (gnu@cygnus.com)
+
+ Cleanup in preparation for better 64-bit host support.
+
+ * bfd-in.h (bfd_64_type): Remove.
+ * libbfd.c (_do_getb64, _do_putb64): Use bfd_vma, not bfd_64_type.
+
+ * bfd-in.h (bfd_size): Remove.
+
+ * bfd-in.h (bfd_offset): Remove, after fixing ld/ldlang.[ch].
+
+ * bfd-in.h (bfd_word): Remove.
+ * reloc.c (reloc_howto_type): Replace bfd_word with bfd_vma.
+
+ * bfd-in.h (rawdata_offset): Remove.
+ * reloc.c (arelent): Replace rawdata_offset with bfd_size_type.
+ (bfd_perform_relocation): Lint.
+ (enum bfd_reloc_status): Comment cleanup.
+
+ * aout-adobe.c, cpu-h8300.c, mipsbsd.c, srec.c: lint -Wall.
+
+Tue Apr 13 11:19:52 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * aoutf1.h (swapcore_sparc): Guess the right value of USRSTACK.
+
+Mon Apr 12 14:18:00 1993 John Gilmore (gnu@cygnus.com)
+
+ * elf32.c: Clean up old comments.
+
+Fri Apr 9 10:43:20 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * config/sun3.h: String argument to fprintf is const.
+
+ * coff-mips.c: Renamed PAGE_SIZE to ROUND_SIZE, to avoid confusion
+ on systems which define PAGE_SIZE in <limits.h>.
+
+Thu Apr 8 10:28:00 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * trad-core.c (trad_unix_core_file_failing_signal): Use new macro
+ TRAD_UNIX_CORE_FILE_FAILING_SIGNAL to allow host files to specify
+ the core file failing signal.
+ * hosts/decstation.h (TRAD_UNIX_CORE_FILE_FAILING_SIGNAL): Define
+ to supply the core file failing signal.
+
+Thu Apr 8 09:17:35 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coffcode.h (styp_to_sec_flags): Only set SEC_SHARED_LIBRARY for
+ a STYP_NOLOAD | STYP_BSS section if BSS_NOLOAD_IS_SHARED_LIBRARY
+ is defined. On many COFF targets STYP_BSS is always STYP_NOLOAD.
+ * coff-i386.h (BSS_NOLOAD_IS_SHARED_LIBRARY): Define.
+
+Wed Apr 7 11:33:06 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coff-mips.c (PAGESIZE): Correct value.
+
+Tue Apr 6 12:05:44 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coff-mips.c (ecoff_find_nearest_line): Address of first PDR is
+ an offset (patch from Jean-Daniel Fekete <jdf@lri.lri.fr>).
+
+Mon Apr 5 12:07:12 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coffcode.h (styp_to_sec_flags): Set SEC_SHARED_LIBRARY for a
+ STYP_NOLOAD | STYP_BSS section. Don't set SEC_NEVER_LOAD for a
+ STYP_INFO section.
+ (coff_compute_section_file_positions): Force vma and lma of _LIB
+ section to be zero.
+ (coff_set_section_contents): Count number of entries in new lma
+ field, not in vma.
+ * coffgen.c (make_a_section_from_file): Force lineno_count of
+ SEC_SHARED_LIBRARY section to be zero, since it is non-zero on the
+ SCO 3.2v4 shared library.
+ * seclet.c (rel): Copy over any section with contents, not just
+ loadable sections.
+
+ * coff-mips.c (ecoff_make_empty_symbol): Zero out newly allocated
+ symbol.
+
+ * coff-i386.c (coff_i386_reloc): New function, to generate
+ relocateable output correctly.
+ (howto_table): Use coff_i386_reloc for all reloc types.
+ (CALC_ADDEND): Use a more efficient hack to get the correct addend
+ for a common symbol.
+ (i386comm_value): Removed; no longer needed.
+
+Sun Apr 4 15:08:48 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * coffcode.h (coff_set_section_contents): Don't write out
+ sections without a filepos.
+
+Fri Apr 2 14:35:05 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * seclet.c (seclet_dump_seclet): Correct SEC_HAS_CONTENTS test.
+
+Wed Mar 31 17:41:05 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * reloc.c (bfd_reloc_code_real_type): Added BFD_RELOC_MIPS_GPREL.
+ * libecoff.h (ecoff_data_type): Added gp_size field.
+ * coff-mips.c (ecoff_mkobject_hook): Initialize gp_size to 8.
+ (ecoff_set_symbol_info): Compare against gp_size, not hardcoded 8.
+ Set flags to 0 for large common symbols.
+ (ecoff_gprel_reloc): Handle non-zero addend for external symbols,
+ which can occur for gas-generated relocs.
+ (ecoff_bfd_reloc_type_lookup): Added BFD_RELOC_MIPS_GPREL case.
+ * bfd.c (bfd_get_gp_size, bfd_set_gp_size): New functions.
+ * Makefile.in (bfd.o): Now depends on coff/sym.h and libecoff.h.
+
+Tue Mar 30 09:33:16 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * srec.c (srec_set_section_contents): Use lma field for load
+ address.
+ * section.c: Add declaration of lma field to section structure.
+ * coffcode.h (coff_write_object_contents): Use lma field for load
+ address.
+ * bfd-in.h (bfd_set_section_vma): Set lma along with vma.
+
+ * aoutx.h (translate_from_native_sym_flags): Now handles indirect
+ symbols in a better way. (translate_to_native_sym_flag): Set the
+ N_INDR bit when necessary. (aout<>slurp_symbol_table): Maintain
+ indirect state.
+ * section.c: Added BFD_IND_SECTION_NAME and bfd_ind_section.
+ (bfd_make_section): Cope with new builtin section.
+ * syms.c (bfd_decode_symclass): Can now print indirect section
+ info.
+
+Wed Mar 24 13:36:33 1993 Per Bothner (bothner@rtl.cygnus.com)
+
+ * aout-target.h (MY(object_p)): Fail if MACHTYPE_OK is
+ defined, and yields false.
+ * aout-mipsbsd.c, i386bsd.c: Define MACHTYPE_OK appropriately.
+
+ * archive.c (snarf_ar_hdr): Add support for reading (only,
+ so far) BSD-4.4-style extended headers.
+ * archive.c: Some more comments.
+
+Wed Mar 24 02:05:10 1993 david d `zoo' zuhn (zoo at poseidon.cygnus.com)
+
+ * Makefile.in: fix rule for dvi and info, so that the recursive
+ makes does the right thing, instead of always info
+
+Wed Mar 24 02:56:44 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * libbfd.c (bfd_seek): Disable optimized handling for archives and
+ archive members; they need more special reatment. For now, verify
+ that computed and actual file positions correspond.
+
+Tue Mar 23 08:45:33 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * mipsbsd.c: Renamed from aout-mipsbsd.c.
+ (set_arch_mach): Delete non-MIPS code.
+ (reloc_howto_type_lookup): Ditto.
+ * Makefile.in: Adjusted.
+
+ * libbfd.c (bfd_tell): Update `where' field.
+ (bfd_seek): Don't do anything if we're not changing the file
+ position. If FILE_OFFSET_IS_CHAR_INDEX is defined, check `where'
+ field against a SEEK_SET request. Call bfd_tell to re-update
+ `where' field when done.
+ (bfd_read, bfd_write) [FILE_OFFSET_IS_CHAR_INDEX]: Maintain
+ `where' field.
+ * hosts/sparc.h: Define FILE_OFFSET_IS_CHAR_INDEX.
+
+Mon Mar 22 23:18:10 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in: added installcheck target
+
+Mon Mar 22 14:57:18 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coff-mips.c (ecoff_set_symbol_info): Relocate encapsulated stabs
+ if the type is not stNil.
+
+Tue Mar 16 10:35:27 1993 Ken Raeburn (raeburn@cygnus.com)
+
+ * elf32.c (elf_little_vec, elf_big_vec): Delete now-invalid
+ forward declarations.
+
+ * elf32-sparc.c (elf_sparc_howto_table): Don't use CONST here,
+ it's implied by the type.
+
+Fri Mar 12 18:58:08 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.host: recognize sparc-sun-solaris2* instead of sparc-sun-solaris*
+
+Tue Mar 9 09:23:12 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * rs6000-core.c: Add .ldinfo section.
+
+Fri Mar 12 11:57:52 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in (MAKEOVERRIDES): Define to be empty.
+
+Fri Mar 12 08:32:11 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * section.c (bfd_set_section_contents): whitespace
+ * seclet.c (seclet_dump_seclet): Don't try and fill sections with
+ no contents.
+
+Thu Mar 11 19:26:15 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * hosts/go32.h: don't define POSIX_UTIME
+
+Tue Mar 9 10:52:01 1993 Fred Fish (fnf@cygnus.com)
+
+ * elf32.c (elf_object_p): Use ELF_ARCH stored in xvec to match
+ against machine architecture stored in the ELF header, to resolve
+ ambiguities.
+ * elf32.c (bfd_section_from_shdr): Bfd_make_section can return
+ NULL, so only use results when non-NULL.
+ * targets.c (elf32_m68k_vec, elf32_i860_vec): Add extern decls
+ and add to vector of targets.
+
+Mon Mar 8 15:13:44 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coff-mips.c (ecoff_set_symbol_info): Encapsulated STABS symbols
+ are always just debugging symbols.
+
+ * coff-mips.c (ecoff_[gs]et_sym_index): Moved macros from here...
+ libecoff.h (ecoff_[gs]et_sym_index): ...to here.
+
+Mon Mar 8 14:55:13 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * hppa.c (_PA_RISC_ID): Defined if not already defined (e.g., for
+ hpux 7). Patch from friedman@gnu.ai.mit.edu.
+ (hppa_object_p): Only check for DL_MAGIC and SHL_MAGIC if they're
+ defined, which they aren't in hpux 7.0.
+
+ * aix386-core.c: Include uinfo.h and coredump.h. Patch from Minh
+ Tran-Le, tranle@intellicorp.com.
+
+Fri Mar 5 14:54:21 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coff-mips.c (ecoff_generic_reloc): If the addend is non-zero, go
+ ahead and do the relocation.
+ (ecoff_refhi_reloc): Don't to the relocation here, just remember
+ what needs to be done.
+ (ecoff_reflo_reloc): Do the REFHI relocation here.
+
+Thu Mar 4 14:44:01 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coff-mips.c (ecoff_bfd_reloc_type_lookup): New function.
+ (ecoff_write_object_contents): Added BFD_ASSERT calls to ensure
+ relocs are reasonable.
+ * coff-msym.c: Eliminated uses of DEFUN.
+ (ecoff_swap_tir_out): New function.
+
+Tue Mar 2 17:52:58 1993 Fred Fish (fnf@cygnus.com)
+
+ (Ultrix 2.2 support from Michael Rendell <michael@mercury.cs.mun.ca>)
+ * configure.host (vax-*-ultrix2*): Add triplet.
+ * hosts/vaxult2.h: New file.
+ * config/vaxult2.mh: New file.
+
+ * aoutx.h (string.h): Include for strchr and friends.
+ * archive.c (string.h): Include for memchr and friends.
+ * elf32.c (string.h): Include for strrchr and friends.
+
+Sat Feb 27 00:44:24 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * aoutf1.c (sunos4_reloc_type_lookup): Unused; deleted.
+ (MY_set_sizes): Use sunos4_set_sizes.
+
+ * elf32.c: Renamed from elf.c. Several CPU-specific functions
+ deleted, as well as elf-big and elf-little targets.
+ * libelf.h: New file.
+ * elf32-sparc.c, elf32-i386.c, elf32-i860.c, elf32-m68k.c: New
+ files, new targets.
+ * Makefile.in, config/*-elf.mt, targets.c: Adjusted.
+
+ * i386linux.c (TARGETNAME): Use hyphens instead of parentheses.
+
+ * coffcode.h (coff_compute_section_file_positions): Don't need
+ variable "old_sofar" if compiling for i960.
+
+ * reloc.c (bfd_default_reloc_type_lookup): First argument is now a
+ bfd pointer.
+ * libbfd.h: Updated.
+
+ * ieee.c (exten, envi): "static" belongs first in declaration.
+
+Fri Feb 26 17:37:34 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * srec.c: add support for symbolsrec, srecords with symbols in
+ them.
+
+Thu Feb 25 11:43:30 1993 John Gilmore (gnu@cacophony.cygnus.com)
+
+ * ieee.c: cast all arguments of ieee_write_byte to bfd_byte
+ to avoid lint complaints.
+
+Thu Feb 25 02:15:52 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * elf.c (elf_write_object_contents): Section ".shstrtab" should be
+ type SHT_STRTAB. Don't alter file offset for section 0.
+ (reloc_type_names): Now an array instead of a macro. Still inside
+ "#if 0", since it's used only in debugging code also in "#if 0".
+ (struct elf_reloc_map_elt, struct elf_reloc_map): New types.
+ (sort_reloc_map): New function.
+ (sparc_reloc_map): New variable.
+ (elf_bfd_reloc_type_lookup): New function.
+
+Tue Feb 23 12:17:16 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * bfd-in.h (JUMP_TABLE): Added bfd_reloc_type_lookup and
+ 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.
+
+ * Minor cleanups provoked by gcc warnings:
+ * aoutx.h (NAME(aout, reloc_type_lookup)),
+ cpu-h8300.c (local_bfd_reloc_type_lookup),
+ cpu-z8k.c (local_bfd_reloc_type_lookup): Added default case to
+ switches.
+ * archive.c (do_slurp_bsd_armap, do_slurp_coff_armap),
+ ieee.c (ieee_slurp_section_data),
+ elf.c (elf_make_sections, elf_fake_sections,
+ elf_compute_section_file_positions, elf_write_object_contents):
+ Removed unused variables.
+ * archures.c: Removed /* from within comment.
+ * bout.c (b_out_squirt_out_relocs): Initialize r_extern.
+ * oasys.c (oasys_write_data): Initialize i.
+
+Mon Feb 22 18:40:06 1993 Per Bothner (bothner@rtl.cygnus.com)
+
+ * libcoff.h (obj_raw_syment_coun): New macro.
+ * coffgen.c (coff_get_normalized_symtab): Initialize
+ raw_syment_count.
+ * coffgen.c (coff_find_nearest_line): Numerous little fixes.
+
+Mon Feb 22 15:03:07 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coff-mips.c (ecoff_set_symbol_info): stBlock symbols are always
+ debugging symbols.
+ (ecoff_get_debug): Offset the fdr adr by the adr of the first pdr,
+ for compatibility with tools from MIPS.
+
+ * config/bigmips.mt: New file; default vector is ecoff_big_vec.
+ * config/irix3.mt, config/irix4.mt: Removed.
+ * configure.in (mips-*-ecoff): New target; uses bigmips.mt.
+ (mips-sgi-*, mips-big-*): Use bigmips rather than irix3.
+
+Wed Feb 17 23:40:41 1993 John Gilmore (gnu@cygnus.com)
+
+ * hosts/hp300bsd.h: Add gross hack to determine whether we
+ are running on BSD 4.3 or BSD 4.4, and use appropriate include
+ files (and set other parameters) to match.
+
+Wed Feb 17 12:28:13 1993 K. Richard Pixley (rich@cygnus.com)
+
+ * trad-core.c (trad_unix_make_empty_symbol): wrap PARAMS around an
+ ansi definition which otherwise confuses non-ansi compilers.
+
+ * aout-adobe.c (aout_adobe_object_p): eliminate a warning from vax
+ ultrix cc by forward declaring getenv as is done in
+ bfd_find_target.
+
+Tue Feb 16 17:56:58 1993 K. Richard Pixley (rich@cygnus.com)
+
+ * elf.c (elf_info_to_howto): cast an enum into unsigned char
+ avoiding a fatal error in vax ultrix 4.2 cc.
+
+Tue Feb 16 00:44:54 1993 John Gilmore (gnu@cygnus.com)
+
+ * bfd-in.h, VERSION: Roll to version 2.1.
+
+Mon Feb 15 20:43:51 1993 John Gilmore (gnu@cygnus.com)
+
+ * oasys.c (oasys_write_object_contents): Lint.
+ * srec.c: Whitespace cleanup.
+
+Fri Feb 12 14:23:07 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coffgen.c (coff_print_symbol): Print correct tagndx value;
+ cleaned up output formatting a bit.
+
+Fri Feb 12 08:28:56 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * coffcode.h (coff_set_arch_mach_hook): *FIXME* the H8/300 is always
+ relaxable. Should be moved somewhere else.
+
+Thu Feb 11 14:09:42 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * aout-mipsbsd.c: Eliminated uses of DEFUN.
+ (aout_mips_*_vec): Added seclet_link element.
+
+ * Makefile.in (BFD_BACKENDS, CFILES, aout-mipsbsd.o): Added
+ support for aout-mipsbsd target.
+
+ * bout.c (get_value): Don't truncate 32-bit addend to 16 bits.
+
+Fri Feb 5 08:08:43 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * cpu-h8500.c (scan_mach): return false if it's not an H8/500
+
+Thu Feb 4 12:52:40 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ Add support for the H8/500
+
+ * coff-h8500.c, cpu-h8500.c, archures.c, coffcode.h, targets.c
+
+Thu Feb 4 12:35:02 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * libecoff.h: New file. Defines ECOFF backend data for gdb.
+ * coff-mips.c: Now includes libecoff.h.
+ (ecoff_data_type): Moved to libecoff.h.
+ (ecoff_slurp_symbolic_info): Made globally visible so that gdb can
+ call it. If there is ever another ECOFF target, this and the
+ swapping functions should be accessed via an ECOFF specific target
+ vector.
+ * Makefile.in (coff-mips.o): Depends on libecoff.h.
+
+Wed Feb 3 09:14:36 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coffcode.h: Removed MIPS specific information, since coff-mips.c
+ no longer includes this file.
+
+ * coff-msym.c (ecoff_swap_fdr_in, ecoff_swap_ext_in): Set reserved
+ bits to 0 to make comparison test useful.
+
+ * config/irix3.mh, config/irix4.mh (HDEFINES): Set to -G 4 to
+ avoid overflowing GP accessible sections in binutils/objdump.
+
+Tue Feb 2 15:36:55 1993 Per Bothner (bothner@cygnus.com)
+
+ * aoutx.h (NAME(aout,slurp_symbol_table)): Made symbol
+ reading more robust: Fail if string index is out of string
+ table range.
+
+Tue Feb 2 11:43:25 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * bout.c (b_out_get_relocated_section_contents, cases PCREL24 and
+ PCREL13): Don't take dst_address into account; the input file has
+ already taken care of that.
+
+Tue Feb 2 11:41:06 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coff-mips.c: Completed support for linker and binutils.
+
+Mon Feb 1 14:45:38 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * bout.c (b_out_get_relocated_section_contents, case ABS32): Keep
+ original addend from section contents.
+
+Thu Jan 28 21:01:37 1993 John Gilmore (gnu@cygnus.com)
+
+ Fix minor bugs reported by Carl Greco, <cgreco@parrot.creighton.edu>:
+ * hosts/delta88.h (strtol): Fix prototype.
+ * config/m88k-coff.mt (SELECT_ARCHITECTURES): Fix name.
+
+Wed Jan 27 17:16:51 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * elf.c: Get rid of "#ifdef sparc".
+ (RELOC_TYPE_NAMES): Never used (currently), so don't include it.
+ (elf_sparc_howto_table): Renamed from elf_howto_table, and always
+ used.
+ (elf_info_to_howto): Use runtime conditionals on CPU type, not
+ compile type conditionals on host CPU.
+ (elf_little_vec, elf_big_vec): Use bfd_default_reloc_type_lookup,
+ not null pointer.
+ (reloc_type, RELOC_TYPE_NAMES): Include i386 values.
+
+Tue Jan 26 11:43:14 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * 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.
+
+Mon Jan 25 15:27:36 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * coffcode.h (_bfd_coff_mkobject_hook): Pass aouthdr argument.
+ (coff_mkobject_hook): Accept aouthdr argument.
+ * coffgen.c (coff_real_object_p): Pass aouthdr to mkobject_hook.
+ Handle NULL aouthdr argument.
+ (coff_object_p): If there is no aouthdr, pass it as NULL to
+ coff_real_object_p.
+ * libcoff.h: Rebuilt for mkobject_hook changes.
+
+ * coffswap.h (coff_swap_aouthdr_in, coff_swap_aouthdr_in): Swap
+ additional MIPS ECOFF fields.
+
+Sat Jan 23 18:36:20 PST 1993 Ralph Campbell (ralphc@pyramid.com)
+
+ * configure.host: added mips-dec-bsd*
+ * configure.in: added mips-dec-bsd*
+ * aout-mipsbsd.c: new file for mips-dec-bsd*
+ * aout-target.h: don't define '' if 'MY_BFD_TARGET' is defined.
+ * aoutx.h: added mips support.
+ * archures.c: added mips support to bfd_default_scan().
+ * cpu-mips.c: added support for R4000 (untested).
+ * libaout.h: added MIPS1 & MIPS2 magic numbers.
+ * reloc.c: fix typo's in comments. Added BFD_RELOC entries which I
+ hope will make it into include/bfd.h.
+ * targets.c: added aout_mips_*_vec.
+
+Wed Jan 20 17:15:52 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * config/decstation.mt: Set DEFAULT_VECTOR to ecoff_little_vec.
+
+Tue Jan 19 09:06:14 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * bfd-in.h (bfd_asymbol_value): Add needed parentheses.
+
+ * libcoff-in.h: Update prototype for coff_count_linenumbers.
+
+Fri Jan 15 18:13:17 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * coff-msym.c (ecoff_swap_hdr_out, ecoff_swap_fdr_out,
+ ecoff_swap_pdr_out, ecoff_swap_sym_out, ecoff_swap_ext_out,
+ ecoff_swap_rndx_out, ecoff_swap_rfd_out, ecoff_swap_opt_in,
+ ecoff_swap_opt_out, ecoff_swap_dnr_in, ecoff_swap_dnr_out): New
+ functions.
+ * coffswap.h: If NO_COFF_RELOCS is defined, don't define
+ bfd_swap_reloc_in or coff_swap_reloc_out.
+ * coff-mips.c: Added code to link and write out symbolic debugging
+ information, and to swap relocs in and out.
+
+Thu Jan 14 15:51:58 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * libcoff.h, coffgen.c (coff_count_linenumbers), coffcode.h
+ (coff_write_object_contents): coff_count_linenumbers returns the
+ number of line number records it found.
+
+ * coffgen.c (coff_write_linenumbers): only write out line numbers
+ in the section they belong to.
+
+Mon Jan 11 18:32:22 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * 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.
+
+Sat Jan 9 21:29:32 1993 Stu Grossman (grossman at cygnus.com)
+
+ * coffgen.c: #include seclet.h.
+
+Sat Jan 9 19:48:14 1993 Stu Grossman (grossman at cygnus.com)
+
+ * hppa.c (hppa_object_setup): Get rid of all knowledge of stabs
+ debug info. Setup info about linker symbols only, and use
+ standard bfd fields to hold the info.
+ * (hppa_object_p): Remove unneeded decls.
+ * (hppa_new_section_hook): Get rid of most of this.
+ * libhppa.h (struct hppadata): Remove ten pounds of useless ugly
+ fat. Remove all knowledge of stabs, remove redundant knowledge of
+ linker symbols.
+ * Remove macros for accessing fields which are now gone.
+
+Fri Jan 8 15:20:00 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * coffcode.h (sec_to_styp_flags): allow SEC_NEVER_LOAD to turn on
+ STYP_NOLOAD bit.
+ * coff-z8k.c: delete unused reloc functions
+
+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.
+
+ * coffcode.h: Moved many generic functions into coffgen.c. Moved
+ swapping functions into coffswap.h for ECOFF use. Moved
+ relocation functions, only used by h8300 and z8k, into reloc16.c.
+ Added hooks for coffgen.c functions to backend data structure, and
+ added hook functions. Still more could be done.
+ * coffswap.h: New file to hold COFF swapping routines.
+ * coffgen.c: New file to hold generic COFF functions.
+ * reloc16.c: New file to hold h8300 and z8k specific relocation
+ functions.
+ * libcoff-in.h: Added declarations for functions in coffgen.c.
+ * libcoff.h: Rebuilt to incorporate changes.
+ * coff-h8300.c: Function name changes.
+ * coff-z8k.c: Function name changes. Use coff_reloc16_extra_cases
+ hook rather than defining EXTRA_CASES.
+ * Makefile.in: Build new files coffgen and reloc16. Added
+ dependencies of coff-*.o on coffswap.h and seclet.h.
+
+Thu Jan 7 16:16:26 1993 Per Bothner (bothner@cygnus.com)
+
+ * ieee.c (ieee_slurp_sections): Add cast to avoid warning
+ about discarding const.
+
+Wed Jan 6 00:16:49 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * archive.c, seclet.c, elf.c use bfd_xmalloc instead of malloc
+
+Tue Jan 5 09:35:57 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * configure.in (post-target): If --with-minimal-bfd is specified,
+ set MINIMIZE=1.
+
+Mon Jan 4 07:20:01 1993 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * srec.c (srec_write_records): one of my boards wants a CR between
+ records.
+
+Wed Dec 30 12:46:30 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * archive.c (do_slurp_coff_armap): set symdef_count correctly
+ (it broke a couple of weeks ago).
+
+Tue Dec 29 21:41:05 1992 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * elf.c (bfd_elf_find_section): Switch back to "struct ..." for
+ return type, so libbfd.h doesn't reference undefined typedefnames.
+
+Tue Dec 29 13:54:35 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * coffcode.h (coff_real_object_p): use name I386AIXMAGIC rather
+ than I386SVMAGIC.
+ (coff_pointerize_aux): don't pointerize a negative tagndx
+ (sometimes generated by SCO 3.2v4 cc).
+
+ * bout.c (calljx_callback, callj_callback,
+ b_out_get_relocated_section_contents): warn if relocating against
+ an undefined symbol.
+
+Mon Dec 28 14:30:55 1992 Stu Grossman (grossman at cygnus.com)
+
+ * hppa.c: Get rid of DEFUN, use more conventional prolog stuff.
+ Make a bunch more routines be static.
+ * hppa.c (fill_spaces): Get rid of this, replace with much better
+ written setup_sections().
+ * (setup_sections): New routine to create BFD sections for each
+ space and subspace in SOM files.
+ * (hppa_object_setup): Use BFD sections created by
+ setup_sections() to locate GDB symbol table info.
+ * (make_unique_section): New routine to create a BFD section. It
+ ensures that the given name is unique, and will generate a unique
+ one if necessary.
+ * (hppa_object_p): Become much more paranoid about file header.
+ * (make_bfd_asection): Call bfd_make_section to do the dirty
+ work. Simplify code somewhat.
+ * (hppa_core_file_p): Use proper name for stack section.
+ * libhppa.h: Remove millicode_start, millicode_end decls.
+
+Mon Dec 28 11:03:22 1992 Ken Raeburn (raeburn@cygnus.com)
+
+ * Makefile.in (coff-we32k.o, coff-z8k.o): Note dependencies.
+
+ * reloc.c (bfd_perform_relocation): For normal 2- or 4-byte
+ relocs, don't bother doing the adjustment if the value to add is
+ zero.
+
+Sun Dec 27 17:45:05 1992 Fred Fish (fnf@cygnus.com)
+
+ * bfd.c (bfd_get_size): New function that gets an upper bound
+ on the possible size of any object in a bfd.
+ * elf.c (bfd_elf_find_section, elf_get_str_section,
+ elf_get_symtab_upper_bound): Rewrite to avoid NULL pointer
+ dereferences.
+ * elf.c (elf_big_vec, elf_little_vec): Document last three
+ members initialized to NULL.
+
+Thu Dec 24 17:49:09 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * hppa.c: change a 'const' to 'CONST', or else HP C compiler dies
+
+Mon Dec 21 16:33:34 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * hosts/std-host.h: New file. Attempt at a generic/default
+ set of definitions, to discourage porting to new hosts by copying.
+ * hosts/news.h: Removed.
+ * hosts/sparc.h: Use std-host.h.
+ * bfd-in.h: New macros bfd_asymbol_bfd and bfd_asymbol_flavour;
+ perhaps we can later remove the the_bfd field from each symbol.
+ * syms.c (struct symbol_cache_entry): Remove unused field
+ app_data. Add comment noting that the_bfd is almost redundant,
+ but not quite.
+ * aoutx.h, coff-a29k.c, coff-i386.c, coff-i960.c, coffcode.h:
+ Use new macros bfd_asymbol_bfd and bfd_asymbol_flavour.
+ * hppa.c (fill_spaces): Make slightly more rebust.
+ * configure.in: Allow std-host as the "default" host.
+
+Mon Dec 21 17:24:13 1992 Stu Grossman (grossman at cygnus.com)
+
+ * bfd.c: Add struct hppa_core_data to tdata union.
+ * hppa.c: Conditionalize on HOST_HPPAHPUX instead of hp9000s800.
+ Get rid of HPPA/BSD specific code. That will go somewhere else
+ someday.
+ * (fill_spaces): Don't spin forever and die if you don't find
+ $MILLICODE$ subspace.
+ * (hppa_object_p): Make sure that we have a real honest-to-cthulu
+ exec file!
+ * (hppa_core_file_failing_signal, hppa_core_file_failing_command):
+ Make these work for HPUX.
+ * (make_bfd_asection): New routine to make section creation a
+ little easier.
+ * (hppa_core_file_p): Completely rewrite, leave out bugs.
+ * libhppa.h: #include the right system files. Redefine all of
+ the structs/macros for hacking core files to use more sensible
+ HPUX core file structures.
+ * targets.c (target_vector): Conditionalize hppa_vec on
+ HOST_HPPAHPUX, not hp9000s800.
+ * hosts/hppahpux.h: #include stdlib.h to get correct decls for
+ malloc and realloc. #define HOST_HPPAHPUX.
+
+Mon Dec 21 12:40:10 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * 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.
+
+Fri Dec 18 10:20:27 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * aoutf1.h (sunos4_write_object_contents): set flags to 0, fixing
+ 1927.
+
+Thu Dec 17 19:35:32 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in: added dvi target
+
+Thu Dec 17 00:36:24 1992 John Gilmore (gnu@cygnus.com)
+
+ * bfd.c: Use right name for tekhex tdata struct.
+ * tekhex.c: Insert leading_char (0) into bfd_target struct. Style.
+ * libcoff.h: Updated to get spacing change from coffcode.h.
+ * trad-core.c: leading_char is 0 (no symbols!), not '_'.
+
+Tue Dec 15 15:40:30 1992 Per Bothner (bothner@cygnus.com)
+
+ * archive.c (do_slurp_bsd_armap, do_slurp_coff_armap): New
+ functions, with the "guts" of the old bfd_slurp_bsd_armap
+ and bfd_slurp_coff_armap, but assuming we've already checked
+ if the armap is present or not.
+ Also, rewrite a bit to avoid keeping around obstack data
+ that we don't need.
+ * archive.c (snarf_ar_header, _bfd_slurp_extended_name_table):
+ Various fixes to correctly handle COFF_style archives names.
+ (Note that because these have a trailing '/', the names can
+ have embedded spaces.)
+ * archive.c (bfd_slurp_armap): New function, replaces old
+ bfd_slurp_bsd_armap and bfd_slurp_coff_armap. Recognizes
+ _either_ format, and calls do_slurp_bsd_armap or
+ do_slurp_coff_armap if either form of map is seen.
+ * libbfd-in.h: Changed bfd_slurp_bsd_armap and
+ bfd_slurp_coff_armap into macro synonyms for bfd_slurp_armap.
+ * elf.c (elf_slurp_armap, elf_write_armap): Fix.
+ * Makefile.in (AR_FLAGS): Use rc instead of non-standard qc.
+
+Mon Dec 14 17:08:08 1992 Stu Grossman (grossman at cygnus.com)
+
+ * hppa.c: #include "sysdep.h", not <sysdep.h>.
+ * libhppa.h: Make millicode_start and millicode_end be unsigned
+ int to be same type as CORE_ADDR in GDB. Why are these here?
+
+Sat Dec 12 15:54:36 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * coff-i386.c (CALC_ADDEND): if reloc is PC relative, add the
+ vaddr of the section to the addend.
+ * targets.c: if MINIMIZE is 1, and SCO_CORE is defined, add
+ SCO_CORE to SELECT_VECS.
+ (target_vector): add sco_core_vec.
+ * sco-core.c (sco_core_vec): add leading underscore initializer.
+ * configure.in (i[34]86-*-sco*): use target i386-sco.
+ * config/i386-sco.mt: new file; define SCO_CORE.
+
+Thu Dec 10 02:13:15 1992 John Gilmore (gnu@cygnus.com)
+
+ * aout-adobe.c (aout_adobe_object_p): Fix !strcmp thinko.
+
+Fri Dec 4 14:02:49 1992 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * coffcode.h (bfd_coff_std_swap_table): Now static and const.
+
+Thu Dec 3 16:54:58 1992 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * hosts/i386linux.h: Include unistd.h.
+
+ * aoutx.h (print_symbol): aout_stab_name returns a constant
+ string.
+ * libaout.h (aout_stab_name): Fix prototype.
+ * stab-syms.c (aout_stab_names): Array is now const.
+ (aout_stab_name): Return value is now pointer to const.
+
+ * aoutx.h, archive.c, archures.c, coffcode.h, ctor.c, reloc.c,
+ syms.c: Doc fixes.
+
+ * syms.c (asymbol): Added new field "app_data", for data
+ particular to the application. Some of the linker flags ought to
+ get moved to this field someday.
+
+ * archures.c (bfd_default_scan): Recognize a few more numbers:
+ 80486, 80960, and 960.
+
+ * bfd-in.h (COFF_SWAP_TABLE): New is just address of
+ bfd_coff_std_swap_table, cast to PTR.
+ * bfd.c (bfd_coff_swap_*): Deleted macros.
+ * targets.c (struct bfd_target): Deleted COFF-specific swapping
+ routine pointers.
+ * coffcode.h (type bfd_coff_backend_data): New structure type,
+ contains pointers to the COFF-specific swapping routines.
+ (bfd_coff_std_swap_table): New data structure, to be used when
+ NO_COFF_SYMBOLS and NO_COFF_LINENOS are not defined.
+ (bfd_coff_swap_*): New macros.
+ * coff-mips.c (mips_coff_swap_table): New data structure.
+ (ecoff_big_vec): Use it.
+ * All COFF targets: Moved COFF_SWAP_TABLE to target-specific data.
+ * All other targets: Deleted coff-specific vector entries.
+
+ * trad-core.c: Fixed some `PARAMS' uses that were missing
+ parentheses.
+
+Sun Nov 29 08:37:13 1992 Fred Fish (fnf@cygnus.com)
+
+ * aoutx.h (some_aout_object_p): Protect arg prototype in
+ callback_to_real_object_p with PARAMS macro for non-ANSI compilers.
+
+Sat Nov 28 04:01:21 1992 John Gilmore (gnu@cygnus.com)
+
+ * aout-target.h, aoutf1.h, trad-core.c, coffcode.h, libaout.h,
+ libbfd-in.h, bfd-in.h: Eliminate all PROTO calls, replace with
+ PARAMS for readability.
+
+ * aoutx.h: Add type to callback parameter.
+ * coff-mips.c: Don't call trad-core.h, not needed.
+ * trad-core.c: Incorporate trad-core.h declarations. Fix comments.
+ * trad-core.h: Eliminate, unused.
+
+Wed Nov 18 13:16:17 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * format.c (bfd_check_format): if default target isn't found
+ then look through the entire list rather than return early.
+
+Mon Nov 16 14:33:03 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * config/i960-coff.mt: reorder vec to match bfd_check_format (from Per)
+
+Thu Nov 12 17:01:41 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in: pass down prefix and exec_prefix in FLAGS_TO_PASS
+
+Thu Nov 12 09:46:47 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * coff-z8k.c: checkpoint, more addressing modes handled
+ * coffcode.h (get_value): don't truncate reloc->addend field, it's
+ a long now.
+
+Wed Nov 11 23:57:55 1992 Brendan Kehoe (brendan@cygnus.com)
+
+ * we32k.mt (TDEFAULTS): Use we32kcoff_vec, not i386coff_vec.
+
+Tue Nov 10 14:04:38 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * Makefile.in: minor tweaks to make $(CC) command lines more consistent
+
+Mon Nov 9 23:58:17 1992 John Gilmore (gnu@cygnus.com)
+
+ * opncls.c (bfd_fdopenr, bfd_close): Add doc about cacheing
+ and about when file descriptors are closed.
+
+Sat Nov 7 00:42:20 1992 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * bout.c (b_out_squirt_out_relocs): Make sure alignment relocs get
+ written out correctly.
+
+Thu Nov 5 15:34:19 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * section.c: New section bit SEC_SHARED_LIBRARY.
+ coffcode.h (styp_to_sec_flags): if STYP_NOLOAD && (STYP_TEXT ||
+ STYP_DATA), set SEC_SHARED_LIBRARY. This seems to be correct for
+ i386-sysv.
+
+Thu Nov 5 04:43:09 1992 John Gilmore (gnu@cygnus.com)
+
+ * target.c (struct bfd_target): Eliminate the SDEF and SDEF_FMT
+ macros; use PARAMS to declare the function pointers involved.
+
+ * bfd-in.h, bfd.c, libbfd.h, reloc.c, seclet.h, section.c,
+ targets.c: Rename struct bfd_seclet_struct to struct bfd_seclet.
+
+Thu Nov 5 02:59:09 1992 John Gilmore (gnu@cygnus.com)
+
+ Cleanup: Replace all uses of EXFUN in the BFD sources, with PARAMS.
+
+ * archures.c, reloc.c, section.c, tekhex.c: Use PARAMS in
+ declaring pointers to functions.
+ * cache.c, elf.c: Move static function decls to top, use PARAMS.
+ * seclet.h: Declare external function with PARAMS.
+
+ * doc/chew.c (exfunstuff): Eliminate.
+ (paramstuff): Replace exfunstuff with function to generate PARAMS.
+ * doc/proto.str: Use paramstuff rather than exfunstuff.
+
+ * libbfd.h: Update, based on changes in source code and chew.
+
+Wed Nov 4 22:47:29 1992 John Gilmore (gnu@cygnus.com)
+
+ * libieee.h: Add FIXME about removing limit on number of sections.
+ * bfd-in.h: Improve comments to make it clear that bfd.h is
+ the wrong place to edit this file.
+ * Makefile.in (install): Install ansidecl.h and obstack.h in the
+ same places where we install bfd.h.
+
+Wed Nov 4 13:40:23 1992 Sean Eric Fagan (sef@cygnus.com)
+
+ * coffcode.h (coff_swap_aux_out, coff_swap_aux_in): check for
+ symbol type before blindly modifying the auxent. Specifically,
+ only modify the endndx fields for types that need it, and don't
+ set the array information for non-arrays.
+
+Wed Nov 4 09:30:50 1992 Ken Raeburn (raeburn@cygnus.com)
+
+ * aoutx.h (some_aout_object_p): Section list should be set up
+ correctly anyways; don't have to set up "next" pointers manually.
+
+Mon Nov 2 12:36:14 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * config/delta88.mh, config/hp300.mh, config/hppahpux.mh,
+ config/i386v.mh: removed -DUSG from HDEFINES.
+ hosts/delta88.h, hosts/hp300.h, hosts/hppahpux.h, hosts/i386v.h:
+ defined USE_UTIME.
+ hosts/i386v.h: don't define POSIX_UTIME.
+
+Fri Oct 30 16:13:52 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * ieee.c (ieee_slurp_sections): make a private copy of the
+ section's name before truncating it.
+
+Thu Oct 29 08:30:50 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * hppa.c: add symbol_leading_char entry in transfer vec
+
+,Wed Oct 28 16:11:57 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * ieee.c (get_symbol): can now cope when two symbols of a
+ different class, but the same index number occur consecutively.
+ (get_section_entry): nicer name for sections being forward
+ referenced. (ieee_archive_p): don't free the filename string,
+ since it was never malloced.
+
+Wed Oct 28 13:42:09 1992 John Gilmore (gnu@cygnus.com)
+
+ * coffcode.h (coff_write_object_contents): Zero timestamp field.
+
+Tue Oct 27 12:24:34 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * coffcode.h (coff_swap_aux_out): set the fcnary info before
+ optionally setting the dimen info, since they are in the same
+ memory locations. Also zero out external auxent.
+ (coff_write_symbol): don't zero external auxent; now done in
+ coff_swap_aux_out.
+
+Fri Oct 23 13:55:35 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * Check fclose return value for errors.
+ libbfd.h: bfd_cache_close now returns a boolean.
+ cache.c (bfd_cache_delete): return fclose success value.
+ (bfd_cache_close): return bfd_cache_delete return value.
+ opncls.c (bfd_close, bfd_close_all_done): return result of
+ bfd_cache_close.
+
+Fri Oct 23 10:32:36 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * seclet.c (rel): don't load sections without the SEC_LOAD bit.
+
+Thu Oct 15 10:16:35 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * coff-m68k.c (m68k_howto2type, SELECT_RELOC): new function to
+ work out a coff relocation type from a howto's attributes rather
+ than using the input r_type field. This fixes PR1677 and allows
+ conversion of a.out relocs to coff relocs.
+
+ * coffcode.h (coff_write_relocs): if supplied a relocation
+ relative to an absolute symbol, use the right symbol index.
+
+ * reloc.c (bfd_perform_relocation): do a partial link for coff
+ relocs right.
+
+Fri Oct 23 08:15:56 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * changes to support i386-sysv with shared libraries:
+ * coffcode.h (sec_to_styp_flags): if TWO_DATA_SECS is defined,
+ check for .data2; if _LIB is defined, check for it; map
+ SEC_NEVER_LOAD to STYP_NOLOAD.
+ (styp_to_sec_flags): map STYP_NOLOAD to SEC_NEVER_LOAD.
+ (make_a_section_from_file): if TWO_DATA_SECS, accept .data2.
+ (coff_write_object_contents): force vaddr of .lib to 0; set scnptr
+ if section has contents, not just if it is loadable; if
+ TWO_DATA_SECS, check for .data2
+ (coff_set_section_contents): set vma of .lib section to number of
+ .lib sections.
+ * coff-i386.c: define TWO_DATA_SECS; use a special CALC_ADDEND;
+ don't define coff_write_armap to bsd_write_armap.
+ * hosts/i386v.h: don't include <utime.h>, since it is not provided
+ by SVR3.2.
+
+Thu Oct 22 22:40:20 1992 Brendan Kehoe (brendan@lisa.cygnus.com)
+
+ * solaris2.h: Get the definition of alloca from alloca.h if we
+ aren't using gcc.
+
+Thu Oct 22 03:07:28 1992 John Gilmore (gnu@cygnus.com)
+
+ * configure.in (i960-*-{aout,bout}): Support these.
+
+Wed Oct 21 03:46:34 1992 John Gilmore (gnu@cygnus.com)
+
+ * config/a29k-aout.mt (DEFAULT_TARGET): Set to one that exists.
+
+Thu Oct 15 15:05:39 1992 Per Bothner (bothner@cygnus.com)
+
+ * apollo68.h, apollov68.h, hp300.h, i386v.h, irix3.h: Remove
+ no-longer-used definitions of L_SET and L_INCR.
+ * i386linux.h: Tweaks to smooth Linux build.
+
+Thu Oct 15 01:32:22 1992 John Gilmore (gnu@cygnus.com)
+
+ * seclet.h: Add enum tag to bfd_seclet_enum_type.
+
+ * bfd-in.h (file_ptr): Update comments, make FIXME re off_t.
+
+ * aout-adobe.c, aoutf1.h, archive.c, bout.c, coff-rs6000.c,
+ 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.
+
+ * aout-adobe.c, aoutf1.h, aoutx.h, bout.c coff-m68k.c, coff-z8k.c,
+ coffcode.h, elf.c, libaout.h, libbfd-in.h, srec.c: Lint.
+
+Fri Oct 9 03:46:37 1992 John Gilmore (gnu@cygnus.com)
+
+ * configure.host: New file, contains mapping of host configs
+ to host support file names for bfd, binutils, opcodes.
+ * configure.in: Use it.
+ * i386aout.c: Cleanup, dump TARGET_IS_LITTLE_ENDIAN_P.
+ * i386bsd.c: Cleanup, reformat.
+ * config/i386-bsd.mt: Comment changes.
+ * config/i386bsd.mh: New file for core file support.
+ * hosts/i386bsd.h: Merge changes from Peter Schauer.
+ * bout.c (ALIGN): Rename to ALIGNER, since system header files
+ on BSD 4.4 define ALIGN (sigh!).
+
+Thu Oct 8 22:18:10 1992 Mark Eichin (eichin at tweedledumber.cygnus.com)
+
+ * libaout.h (aout_backend_data): added exec_header_not_counted
+ field. For ZMAGIC files only, when text_includes_header is set, by
+ default the length of the exec header is counted in the text
+ section size. For go32, exec header is mapped in but does *not*
+ contribute to the size of section.
+ * aoutx.h (aout_adjust_sizes_and_vmas): if exec_header_not_counted
+ is not set, but ztih is, add the size of the exec header to the
+ recorded size of the text section.
+ * aoutf1.h (sunos4_aout_backend): clear exec_header_not_counted.
+ * i386aout.c (i386aout_backend_data): set exec_header_not_counted.
+ Also set text_includes_header.
+ * aout-target.h (*_backend_data): cleare exec_header_not_counted
+ by default in MY(backend_data).
+
+Thu Oct 8 18:12:49 1992 Ken Raeburn (raeburn@cygnus.com)
+
+ * aout-target.h (callback): Don't define this function if it won't be
+ used.
+
+ * aoutx.h (some_aout_object_p): Restore old aout_data value if this
+ type doesn't match. Don't lose if file sections have already been
+ created.
+ (set_arch_mach): Set reloc_entry_size.
+ (slurp_symbol_table): Use bfd_h_get_{16,8} for reaeding symbol data.
+
+ * hosts/i386bsd.h: New file.
+ * configure.in: Recognize i[34]86-*-bsd host.
+
+ * aout-target.h (callback, write_object_contents): Delete unused
+ variables.
+
+ * aoutx.h (reloc_type_lookup): New function.
+ * aout-target.h (MY_reloc_howto_type_lookup): Use it as default.
+ * aoutf1.h (sunos4_reloc_type_lookup): Deleted.
+ (MY_reloc_howto_type_lookup): Don't define it.
+
+ * aoutx.h (adjust_sizes_and_vmas): Don't bother with padding for
+ OMAGIC files.
+ (slurp_symbol_table): Use header byte order, not target byte
+ order, for reading symbol data.
+
+Thu Oct 8 17:33:39 1992 John Gilmore (gnu@cygnus.com)
+
+ * configure.in: Undo some brain damage in the host section.
+ * configure.in: Reformat the target section, test many configs.
+ * Makefile.in (make): Remove obsolete `make make'.
+ * aoutx.h (some_aout_object_p): Make defines line up.
+
+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.
+
+ * 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.
+
+Mon Oct 5 14:32:55 1992 Per Bothner (bothner@cygnus.com)
+
+ * archive.c: Make errno global.
+ * archive.c (_bfd_write_archive_contents): If read fails (and
+ errno!=0) set bfd_error to malformed_archive (since this probably
+ indicates a truncated archive), rather than system_call_error.
+
+Mon Oct 5 03:33:39 1992 Mark Eichin (eichin at tweedledumber.cygnus.com)
+
+ * Makefile.in: added rules for i386bsd.c
+ * i386bsd.c: new file, supporting 386bsd.
+ * configure.in: recognize i386-*-bsd target.
+ * config/i386-bsd.mt: new file - 386bsd target configuration.
+
+Thu Oct 1 17:51:07 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: re-arrange host section to use *-*-* notation,
+ clean up some of the target section as well
+
+ * seclet.c: cast result of bfd_get_relocated_section_contents to
+ avoid compiler warnings
+
+Tue Sep 29 13:24:09 1992 Ken Raeburn (raeburn@cygnus.com)
+
+ * coffcode.h (coff_section_symbol): Create section if it doesn't
+ already exist.
+
+ * bout.c: Removed some unused variables.
+
+Tue Sep 29 08:30:21 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * Portability fixes from p3:
+ coffcode.h (coff_write_relocs): removed sanity check until it
+ works on all targets (per advice from sac).
+ config/hp9000.mh: new file to define USG.
+ hppa.c: #undef hppa before the JUMP_TABLE.
+ hosts/hppahpux.h: #define NATIVE_HPPAHPUX_COMPILER if not
+ __STDC__.
+ targets.c (bfd_target_list): if NATIVE_HPPAHPUX_COMPILER, make
+ local variable target volatile to avoid mysterious bug in
+ HP9000/700 cc.
+
+Sat Sep 26 03:58:49 1992 John Gilmore (gnu@cygnus.com)
+
+ * config/hppabsd.mh, config.hppahpux.mh: Remove various bogosity.
+ * hosts/hppahpux.h: Remove bcopy and index circumventions.
+
+Fri Sep 25 22:36:52 1992 John Gilmore (gnu@cygnus.com)
+
+ * coff-z8k.c (func_da, func_jr): Lint.
+ * coffcode.h: Use memset rather than bzero.
+ * elf.c: Use memcpy rather than bcopy.
+ * tekhex.c: Use memset rather than bzero.
+
+Fri Sep 25 19:14:48 1992 John Gilmore (gnu@cygnus.com)
+
+ Add Adobe a.out support.
+
+ * 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'.
+
+Fri Sep 25 15:03:22 1992 Brendan Kehoe (brendan@rtl.cygnus.com)
+
+ * elf.c (section_from_elf_index): Return bfd_abs_section, not 0,
+ since we should never have a NULL section.
+ (elf_slurp_symbol_table): If st_shndx doesn't match any of our
+ tests, set the section to bfd_abs_section.
+
+Fri Sep 25 11:11:57 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * coff-z8k.c: getting closer
+ * coffcode.h (coff_get_relocated_section_contents): allow
+ EXTRA_CASES hooks for different arches to provide different reloc
+ types.
+ * seclet.h: #ifndef around it to allow multiple inclusion
+ * srec.c: minor doc fix
+
+Mon Sep 21 14:33:58 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * hosts/hp9000.h, hosts/irix3.h: changes from WRS.
+
+Sun Sep 20 08:48:25 1992 Fred Fish (fnf@cygnus.com)
+
+ * configure.in: Use i386-elf for all i386/i486 sysv4 hosts, not
+ just ncr.
+
+Thu Sep 17 06:40:46 1992 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * bout.c (b_out_slurp_reloc_table): Clear howto field before
+ filling in reloc, in case immediately following code doesn't set
+ it.
+
+Fri Sep 11 15:37:06 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * coffcode.h (coff_renumber_symbols): set the last renumbered
+ symbol pointer to NULL, as expected by coff_write_linenumbers.
+ (coff_write_relocs): apparently a non-zero addend is OK for reloc
+ type R_IHCONST used on the 29k.
+
+Thu Sep 10 13:28:24 1992 John Gilmore (gnu@cygnus.com)
+
+ * opncls.c (bfd_fdopenr): Determine whether to fdopen for
+ update, based on how the underlying file was opened. Obsoletes
+ FASCIST_FDOPEN.
+ * hosts/rs6000.h, hosts/tahoe.h, hosts/vaxbsd.h: Remove
+ all FASCIST_FDOPEN config defines.
+
+Tue Sep 8 21:37:58 1992 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * sparc-opc.c: Moved to opcodes library, now that we have one.
+ * Makefile: Don't compile it.
+
+Tue Sep 8 10:10:34 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * aoutx.h: adjust_sizes_and_vmas did not return anything.
+
+Thu Sep 3 19:29:04 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * section.c (bfd_set_section_flags): Remove a sanity check.
+ It is unfortunately broken, and prevents strip from working.
+
+Thu Sep 3 16:14:40 1992 Jim Wilson (wilson@sphagnum.cygnus.com)
+
+ * sparc-opc.c (condr): Remove extraneous, but harmless, backlash
+ created by last change.
+
+Thu Sep 3 13:52:38 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * reloc.c (reloc_howto_struct): Make size field be unsigned.
+ * bfd-in.h: Bump to version 2.0.
+
+Thu Sep 3 09:05:37 1992 Stu Grossman (grossman at cygnus.com)
+
+ * bout.c, cpu-z8k.c: Use enums when initializing structs to keep
+ braindamaged HP/Apollo compiler happy.
+
+Wed Sep 2 02:53:29 1992 John Gilmore (gnu@cygnus.com)
+
+ * format.c: Fix description of search for matching target.
+ * aoutx.h (some_aout_object_p): Set SEC_CODE and SEC_DATA.
+ * targets.c: Update description of search for matching target.
+ * Makefile.in (do_clean, clean): Fix infant mortality typo.
+ (docdir): Set to ./doc, not ${srcdir}/doc, which has no makefile.
+ (z8k and we32k files): `*.o: *.c': avoid Sun Make bug.
+
+Wed Sep 2 00:26:32 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * Makefile.in: Added mostlyclean/clean/distclean rules.
+
+Tue Sep 1 13:38:40 1992 Per Bothner (bothner@cygnus.com)
+
+ * targets.c (target_vector): Take out oasys (unless that is
+ the default): Because there is no magic number in archives,
+ there can be annoying target mis-matches.
+
+Mon Aug 31 10:11:37 1992 Jim Wilson (wilson@sphagnum.cygnus.com)
+
+ * sparc-opc.c: Rigorously updated to match architecture manual.
+
+Mon Aug 31 08:07:58 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * aoutx.h (aout<n>swap_ext_reloc_out), bout.c
+ (b_out_squirt_out_relocs): fix bug 1506 where abs symbols attached
+ to the built-in abs_section were not written out correctly.
+
+Fri Aug 28 16:29:15 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * archive.c (bfd_slurp_bsd_armap): if the symdef_count is too
+ large, assume we're using a swapped byte order and fail with
+ wrong_format rather than dumping core.
+
+Fri Aug 28 15:38:03 1992 Ken Raeburn (raeburn@cygnus.com)
+
+ * Renamed opc-sparc.c to sparc-opc.c for systems with short
+ filename constraints.
+ * Makefile.in: Updated to reflect change.
+
+Thu Aug 27 13:05:28 1992 Brendan Kehoe (brendan@cygnus.com)
+
+ Add preliminary support for the we32k:
+
+ * Makefile.in, archures.c, coffocode.h, configure.in, targets.c:
+ Minor edits.
+ * coff-we32k.c, cpu-we32k.c, config/we32k.mt, hosts/we32k.h: New files.
+
+Wed Aug 26 14:20:16 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * bout.c: added support for relaxable alignment relocs.
+
+ * seclet.c (rel, seclet_dump_seclet, seclet_dump): get the app to
+ pass down pointer to play area rather than use alloca
+
+ * cpu-z8k.c (compatible): made static to reduce name space
+ polution.
+
+Tue Aug 25 08:39:10 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ Add basic support for the z8k:
+
+ * Makefile.in, archures.c, coffcode.h, configure.in, reloc.c,
+ section.c, targets.c,
+
+ * syms.c: move mis-inserted patch.
+
+Fri Aug 14 15:39:29 PDT 1992 Howard Chu (hyc@hanauma.jpl.nasa.gov)
+
+ Documentation fixes:
+ * ctors.c, format.c, section.c, reloc.c: append " -" to item tags.
+ * reloc.c, section.c, syms.c, targets.c: add DOCDD before @node
+ comments.
+ * reloc.c: break out addend item from surrounding text.
+
+ * doc.str (DOCDD): Defined. Adds text to output.
+ (bodytext): Put bulletize before kill_bogus_lines.
+ * chew.c (bulletize): End itemization after a blank line, to
+ prevent following text from being swallowed up in an item.
+
+Mon Aug 24 20:50:22 1992 Stu Grossman (grossman at cygnus.com)
+
+ * configure.in: Add sparclite as a target.
+
+Mon Aug 24 12:06:31 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * ieee.c (ieee_get_symtab): always null terminate the symbol list,
+ lint.
+
+ * coffcode.h (coff_add_missing_symbols): if symbols don't come
+ from a coff file (csym is null), dont deref them
+
+ * ieee.c (parse_expression): get the answer right when adding an
+ abs+(sec+off), (ieee_generic_stat_arch_elt): call ieee_object_p
+ on elts so that filename is filled in.
+
+Thu Aug 20 19:05:48 1992 Ken Raeburn (raeburn@cygnus.com)
+
+ * bout.c (howto_align_table): New set of relocs, with enough
+ data for "objdump -r" to work.
+ (b_out_reloc_type_lookup): Recognize alignment relocs.
+
+Tue Aug 18 12:57:45 1992 Ian Lance Taylor (ian@cygnus.com)
+
+ * Makefile.in: added FLAGS_TO_PASS, and used it for all recursive
+ invocations of make. Also, always create installation
+ directories.
+
+ * config/apollov68.mh: removed -g from CC definition.
+
+Mon Aug 17 13:40:08 1992 Ken Raeburn (raeburn@cygnus.com)
+
+ * config/decstation.mh (HDEFINES): Specify "-G 4" to avoid
+ overflowing gp-offset range.
+
+Mon Aug 17 11:44:28 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * srec.c (srec_set_section_contents): don't write out sections
+ without the LOAD and ALLOC attributes
+
+Mon Aug 17 11:55:07 1992 Ken Raeburn (raeburn@cambridge.cygnus.com)
+
+ * archures.c, cpu-m68k.c, cpu-sparc.c: Undo 16 June changes.
+ * libaout.h (struct aout_backend_data): New callback "set_sizes".
+ * aout-target.h (callback): Don't set page/seg sizes.
+ (mkobject): Ditto.
+ (set_sizes): New routine.
+ (backend_data): Point to it.
+ * aoutf1.h (sunos4_set_sizes): Heed architecture when setting sizes.
+ (sunos4_aout_backend): Point to it.
+ * aoutx.h (set_arch_mach): Call set_sizes callback.
+
+Fri Aug 14 19:22:18 1992 Per Bothner (bothner@cygnus.com)
+
+ * aout-target.h: Make _bfd_slurp_extended_name_table be
+ the default. Given that we *write* the suckers (for long
+ archive member names), we really ought to be able to read them!
+ * trad-core.c: Don't include <machine/reg.h>. It doesn't
+ seem to be needed, and many machines don't have it.
+
+Thu Aug 13 09:53:39 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * coff-m68k.c (vector): read and write archives in coff format.
+
+Tue Aug 11 12:19:42 1992 Ken Raeburn (raeburn@cygnus.com)
+
+ * opc-sparc.c: New file.
+
+Sat Aug 8 23:15:35 1992 Fred Fish (fnf@cygnus.com)
+
+ * bout.c (bfd_reloc_status_type, callj_callback): Cast void*
+ 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.
+
+Mon Aug 3 00:35:29 1992 Fred Fish (fnf@cygnus.com)
+
+ * configure.in: Recognize i486 host cpu, and use i386-elf
+ for i486-ncr-sysv4.
+
+Sat Aug 1 13:49:59 1992 Fred Fish (fnf@cygnus.com)
+
+ * config/stratus.mt (CC): Remove definition.
+ * elf.c (bfd_section_from_shdr): Test for the possibility that
+ section_from_elf_index returns NULL and don't dereference it.
+
+Mon Jul 20 02:46:09 1992 D. V. Henkel-Wallace (gumby@cygnus.com)
+
+ * add hppa_data to bfd tdata (indirectly via sef).
+
+ * config/hppahpux.mh: hpux is -DUSG (patch by sef)
+
+Sat Jul 18 15:50:11 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: error messages to stderr, not stdout
+
+Fri Jul 17 18:32:46 1992 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * bfd.c, cache.c, coff-a29k.c, coff-i386.c, coff-i960.c,
+ coff-m68k.c, coff-m88k.c, demo64.c, libaout.h, libbfd.c,
+ oasys.c, opncls.c, sunos.c, targets.c: removed rcsid's.
+
+Fri Jul 17 17:06:56 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: recognize hppa* instead of hppa
+
+Thu Jul 16 16:39:25 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * coff-m68k.c: added R_RELLONG_NEG reloc type, and changed
+ RTYPE2HOWTO to cope with same.
+ * reloc.c (bfd_perform_relocation): added support for size of -2
+ (subtract a word reloc type). Updated doc.
+
+Thu Jul 16 16:28:09 1992 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * Makefile.in: merged changes from progressive, removed rcsid.
+
+ * archures.c, archive.c, Makefile.dos: removed rcsid.
+
+Thu Jul 16 08:08:25 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * bfd-in.h : add BFD_IS_RELAXABLE flag
+ * bout.c (bout_swap_exec_header_[in_out]): new field in exec
+ header e_relaxable, major hackery in callbacks
+ * libaout.h : add space for a_relaxable.
+ * seclet.c (rel): don't relax empty sections
+
+
+Wed Jul 15 07:57:46 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * section.c (STD_SECTION): add some casts to the initializers for
+ dumb compilers
+
+Tue Jul 14 14:06:28 1992 Stu Grossman (grossman at cygnus.com)
+
+ * rs6000-core.c (rs6000coff_core_p): Greatly simplify expression,
+ and add appropriate casts to keep (picayune) aix-cc happy.
+
+Mon Jul 13 05:06:51 1992 John Gilmore (gnu at cygnus.com)
+
+ * elf.c (elf_slurp_symbol_table): Now 2nd arg is where to write
+ symbol pointers. Punt expensive & useless bfd_realloc. Use
+ malloc for raw symbols, and free it before returning.
+ (bfd_section_from_shdr): Do not slurp symbol table until politely
+ asked. Do not even slurp string tables.
+ (elf_get_symtab_upper_bound): Count 'em without reading them.
+ (elf_get_symtab): This is how to politely ask. Schlurp!
+ This should probably just *become* elf_slurp_symbol_table, FIXME.
+
+Wed Jul 8 16:24:33 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * archive.c (bsd_write_armap): write the timestamp of the
+ archive header to be just a little bit later than the timestamp of
+ the file, otherwise the linker will complain that the index is
+ out of date.
+
+Tue Jul 7 00:23:23 1992 Fred Fish (fnf@cygnus.com)
+
+ * configure.in: Add m68k-ericsson-*.
+
+Sat Jul 4 03:29:41 1992 John Gilmore (gnu at cygnus.com)
+
+ * syms.h: Define BSF_FILE, update BSF_SECTION_SYM desc.
+ * elf.c: Remove unconditional debug printf's.
+ (elf_write_object_contents, elf_slurp_symbol_table): Handle
+ BSF_SECTION_SYM <=> STT_SECTION, BSF_FILE <=> STT_FILE.
+ (elf_slurp_symbol_table): Hand out symbols in forward, not
+ reverse order. Simplify duplicate code.
+
+Fri Jul 3 20:23:34 1992 Fred Fish (fnf@cygnus.com)
+
+ * elf.c: Remove "(void)" casts from function calls where the
+ return value is ignored, in accordance with GNU coding standards.
+
+Tue Jun 30 16:49:12 1992 Fred Fish (fnf@cygnus.com)
+
+ * hppa.c: Apply John's standard fix to avoid "empty translation
+ unit" warnings from some ANSI-C compilers.
+
+Thu Jun 25 04:39:25 1992 John Gilmore (gnu at cygnus.com)
+
+ * hosts/solaris2.h: Configure same as sysv4.
+
+Tue Jun 23 21:54:44 1992 Fred Fish (fnf@cygnus.com)
+
+ * libbfd.h, libbfd-in.h (bfd_seek): Make prototype match definition.
+ * reloc.c (bfd_default_reloc_type_lookup): Make cast on return
+ type match actual return type.
+ * elf_print_symbol (section_name): Make CONST.
+
+Mon Jun 22 17:35:24 1992 Per Bothner (bothner@cygnus.com)
+
+ * i386linux.c, hosts/i386linux.h, config/i386-linux.mt:
+ New files, for Linux (a free Unix clone for 386 machines).
+ * Makefile.in, configure.in, targets.c: Update accordingly.
+
+Fri Jun 19 20:23:21 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+ Lints for bfd_reloc_code_type->bfd_reloc_code_real_type, and
+ correct calling of howto special functions and fixes from Raeburn
+ for gas<>bfdness
+ * archures.c: nuke bfd_reloc_code_type
+ * bout.c, cpu-h8300.c, coff-i960.c, coff-m88k.c: special function lint
+ * coffcode.h (styp_to_sec_flags): STYP_INFO is marked as
+ SEC_NEVER_LOAD, various other bfdgas newness
+ * reloc.c->libbfd.h: change protype of bfd_default_reloc_type_lookup
+ * targets.c: change jump table vector to above
+
+
+Fri Jun 19 19:00:45 1992 John Gilmore (gnu at cygnus.com)
+
+ * elf.c (bfd_elf_find_section): Mark as INTERNAL_FUNCTION so
+ its prototype will be included in libbfd.h. Change result type
+ to struct * (rather than equivalent typedef) so it can be used in
+ the prototype, where they typedef won't be known.
+ * libbfd.h: Updated version.
+
+Fri Jun 19 15:21:56 1992 Stu Grossman (grossman at cygnus.com)
+
+ * Makefile.in, archures.c, configure.in, cpu-hppa.c, hppa.c, libhppa.h,
+ targets.c: HPPA merge.
+
+Fri Jun 19 12:21:38 1992 John Gilmore (gnu at cygnus.com)
+
+ * configure.in: Separate Solaris2 from SYSV4 on SPARC.
+ * config/solaris2.mh: Kludge around Sun compiler bug.
+
+Wed Jun 17 14:02:46 1992 Stu Grossman (grossman at cygnus.com)
+
+ * libaout.h (aout_backend_data): Change defs of two bitfields to
+ be unsigned chars instead to get around rs6000 compiler problem.
+
+Wed Jun 17 13:55:31 1992 Fred Fish (fnf@cygnus.com)
+
+ * elf.c (bfd_section_from_shdr, elf_slurp_symbol_table):
+ Correct misconception that there can be only one symbol table.
+ Only call elf_slurp_symbol_table on the full symbol table, not
+ the dynamic one which is only a subset of the full one.
+
+Wed Jun 17 15:54:57 1992 Ken Raeburn (Raeburn@Cygnus.COM)
+
+ * coffcode.h (coff_compute_section_file_positions): For I960,
+ don't align sections in file.
+
+Tue Jun 16 06:28:21 1992 Ken Raeburn (Raeburn@Cygnus.COM)
+
+ * targets.c (struct bfd_target): Added field for target-specific
+ (but not file-specific) data, for distinguishing minor
+ characteristics between (e.g.) a.out formats.
+
+ * section.c (struct sec): New field user_set_vma indicates vma
+ field should be heeded, not assumed to be unset.
+ (STD_SECTION): Initialize that field of standard sections to zero.
+ * bfd-in.h (bfd_set_section_vma): Set user_set_vma to true.
+
+ * coffcode.h (coff_write_relocs): Write out swapped reloc, not
+ pre-swapped version.
+
+ * archures.c (struct bfd_arch_info): Fixed order of comment and
+ field decl. New fields indicate size of page and segment for
+ architecture.
+ * cpu-m68k.c (N): Fill in values.
+ * cpu-sparc.c (arch_info_struct): Ditto.
+
+ * libaout.h (struct aout_backend_data): Various bits of data (not
+ all used currently) with characteristics of a.out implementation.
+ Important field for now is text_includes_header, indicating that
+ the text section starts immediately after the file header, which
+ gets mapped in with it.
+ (struct aout_data): New fields indicate whether vma has been
+ adjusted yet (not yet used), and what magic number will be used in
+ the output file (should go away in favor of vma_adjusted).
+ (WRITE_HEADERS): Code for dealing with section sizes and related
+ header fields replaced with call to adjust_sizes_and_vmas.
+ * aoutx.h (some_aout_object_p): Fill in magic number field.
+ Set WP_TEXT flag for ZMAGIC as well as NMAGIC files.
+ (set_arch_mach): Set page size and segment size once CPU
+ type is known.
+ (adjust_sizes_and_vmas): New function; has much code moved
+ from set_section_contents and WRITE_HEADERS. Sets or adjusts vma
+ and size parameters, as well as many header fields, after deciding
+ on magic number for output file. Checks to ensure that this
+ adjustment has only been done once.
+ (set_section_contents): Call adjust_sizes_and_vmas instead of
+ doing much of the work here.
+
+ * aout-target.h (MY_make_debug_symbol, MY_backend_data): Provide
+ default (null) values of these fields.
+ * aoutf1.h (sunos4_write_object_contents): Don't override a_text
+ value in exec header.
+ (sunos4_aout_backend, MY_backend_data): Define backend data
+ indicating file header is included in text section.
+
+ * aoutf1.h (MY_reloc_howto_type_lookup): Fix typo.
+
+ * hosts/sparc.h (abort, exit): Hide these names if compiling with
+ gcc version 2, to avoid warnings.
+
+Mon Jun 15 12:26:56 1992 Fred Fish (fnf@cygnus.com)
+
+ * config/ncr3000.mh (INSTALL, RANLIB): Don't use /usr/ucb/install,
+ it's broken on ncr 3000's. Use simple "true" for RANLIB.
+
+Sat Jun 13 09:16:43 1992 Michael Tiemann (tiemann@rtl.cygnus.com)
+
+ * configure.in (m680[01234]0-wrs-*): Fix typo in match pattern.
+
+Fri Jun 12 19:48:34 1992 John Gilmore (gnu at cygnus.com)
+
+ * section.c (STD_SECTION): Remove extra semicolon in declarations.
+ * configure.in: Rewrite target parsing to use simple format.
+ Handle sparc-sun-solaris2 configuration.
+ * aout64.h: Avoid ANSI C brain death warning.
+ * elf.c: Avoid trigraph (???) or /* in comments.
+
+Fri Jun 12 14:51:14 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * config/sysv4.mh: new file, RANLIB=echo
+
+ * configure.in: handle Solaris2 as -sysv4 or -solaris2
+
+Thu Jun 11 00:52:03 1992 John Gilmore (gnu at cygnus.com)
+
+ * elf.c (elf_obj_tdata): Merge elf_obj_tdata_struct and
+ elf_core_tdata_struct into a single common struct. Core files
+ wouldn't have worked at all without this.
+ (bfd_elf_find_section): New function for GDB's undercover use
+ to find string sections that BFD hides from it.
+ (elf_get_str_section): Avoid multiple alloc&reads for same data;
+ lint.
+ (elf_object_p, elf_core_file_p): Allocate internal file header
+ storage dynamically.
+ * bfd.c (union {...} tdata): Remove elf_core_tdata_struct.
+ * demo64.c: Prevent "empty translation unit" warnings from idiots.
+
+Tue Jun 9 17:15:26 1992 Fred Fish (fnf at cygnus.com)
+
+ * config/{i386v4.mh, ncr3000.mh}: Update RANLIB, add INSTALL.
+
+Sat Jun 6 17:02:51 1992 John Gilmore (gnu at cygnus.com)
+
+ * configure.in: Handle Solaris2 as *-sun-sysv4 or as *-sun-sunos5.
+
+Sun May 31 05:45:00 1992 david d `zoo' zuhn (zoo@cygnus.com)
+
+ * configure.in: handle m680[01234]0 as aliases for m68k
+
+Tue May 26 16:50:59 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * coff-a29k.c: do byte relocs correctly
+ * coffcode.h (styp_to_sec_flags): never load INFO sections
+ * seclet.c (rel): don't relocate INFO sections
+
+Wed May 20 08:18:18 1992 Ken Raeburn (Raeburn@Cygnus.COM)
+
+ * section.c (bfd_*_symbol, bfd_*_section): Initialize statically.
+ Make the symbols unmodifiable.
+ (bfd_section_init): Deleted.
+ * init.c (bfd_init): Don't call bfd_section_init.
+
+ * section.c (bfd_set_section_contents): Ensure that range to be
+ written is within section boundaries.
+ (bfd_get_section_contents): Likewise. Don't bother dispatching if
+ size is zero.
+
+ * libbfd.c (bfd_xmalloc): Text of error message should be const.
+
+ * coff-i960.c (howto_table): Deleted.
+ (howto_rellong, howto_iprmed, howto_optcall): New vars;
+ interesting entries from old howto_table.
+ (RTYPE2HOWTO): Adjusted to use switch.
+ (coff_i960_reloc_type_lookup): New function.
+
+ * coffcode.h (coff_new_section_hook): Allocate storage for aux
+ records for section symbol.
+ (make_abs_section): Unused; deleted.
+ (renumber_symbols): Re-order symbols so undefined symbols come
+ last, as COFF format desires.
+ (coff_write_symbol): Put C_FILE symbols in debug section always.
+ (coff_section_symbol): New function; creates a symbol with the
+ same name as a section, and sets up aux records for it.
+ (coff_add_missing_symbols): New function; adds section symbols to
+ symbol table if they aren't there already. Should someday also
+ add a dummy C_FILE symbol if none is present.
+ (coff_write_object_contents): Add missing symbols before preparing
+ symbol table to be written.
+ (coff_slurp_reloc_table): Verify that symbol indices read in are
+ in a reasonable range.
+ * libcoff-in.h (struct coff_tdata): New field conv_table_size.
+ (obj_conv_table_size): Accessor macro.
+
+ * bout.c (b_out_reloc_type_lookup): New function. Handles three
+ reloc types on i960.
+
+ * bfd-in.h (bfd_get_section_name): New macro. Like
+ bfd_section_name, but returns rvalue, not lvalue.
+ (bfd_get_section_vma, bfd_get_section_alignment): Similar.
+ (bfd_get_section_flags): Now returns rvalue.
+
+ * reloc.c (enum bfd_reloc_code_real): Add several new values, some
+ general, some specific to sparc or i960.
+
+ * aoutx.h (set_section_contents): Set VMA for each section based
+ on previous section. If text section VMA doesn't appear to have
+ been set, make a best guess from the type of file.
+
+ * aout-target.h (MY_reloc_howto_type_lookup): Define as zero if
+ not defined.
+ (MY(vec)): Initialize reloc_type_lookup field.
+
+ * aoutx.h (howto_table_*): Export as aout_#_*_howto_table.
+ (bfd_error_trap, bfd_error_vector): Extern, not common.
+
+ * aoutf1.h (sunos4_reloc_type_lookup): New function. Handles a
+ few types of relocs for sparc; will need enhancement.
+
+ * bout.c (callj_callback): Use DEFUN macro in definition.
+ * coff-i960.c (optcall_callback): Likewise.
+
+ * targets.c (bfd_target): Added fields reloc_type_lookup and
+ _bfd_make_debug_symbol. Also minor comment changes.
+ * syms.c (bfd_make_debug_symbol): New dispatching macro.
+ * reloc.c (bfd_reloc_type_lookup): Take a BFD ptr as arg rather
+ than arch info, and dispatch with BFD_SEND. Callers changed.
+ * archures.c (struct bfd_arch_info): Deleted field
+ reloc_type_lookup.
+ * cpu-*.c: Don't initialize that field.
+
+ * bfd-in.h (enum bfd_error): Add new value "bad_value".
+ * bfd.c (bfd_errmsgs): Now const; added entry for bad_value.
+ (bfd_errmsg): Now returns ptr to const.
+ * bfd-in.h (bfd_errmsg): Fix prototype.
+
+ * cache.c (BFD_CACHE_MAX_OPEN): Fix typo in doc.
+ * reloc.c (bfd_generic_relax_section): Ditto.
+
+ * section.c (Section Output doc): Improve description of use of
+ output_section and output_offset.
+
+Tue May 19 23:42:10 1992 D. V. Henkel-Wallace (gumby@cygnus.com)
+
+ * sco-core.c: new file from net.
+ * aoutx.h (translate_to_native_sym_flags): bugfix from net:
+ Now we have the hairy linker, it's possible to move symbols from
+ one section into another. Actually make that work!
+
+Sat May 16 17:57:59 1992 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * hosts/sun3.h: fix declaration of free.
+
+Tue May 12 14:08:59 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * coff-a29k.c (perform_reloc): fix bug in jmp/call evaluation
+ * coff-h8300.c (reloc_processing): all relocs are relative to
+ section start.
+ * opncls.c: don't use fdopen on DOS systems
+
+ short patches from Glenn Kasten (glenn@ready.com)
+ * target.c: enabled oasys support
+ * oasys.c: Insert . when UNDERSCORE_HACK is enabled,
+ fix problem where a relocation which crossed a modification byte
+ boundary did not work. Fix problem where a relocation near the end
+ of a data record did not work.
+
+
+Tue May 5 18:11:25 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * archive.c (bfd_slurp_coff_armap): old versions of BFD wrote
+ archvie header string counts the endian way, this heuristic sees
+ how big an archive string to read by trying it one way and if the
+ string table is unreasonably big, trying it the other. *FIXME*.
+ * opncls.c (bfd_fdopenr): can't do fdopens on VMS
+
+Tue May 5 14:18:24 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * bfd-in.h: Increase version number to 1.97, for consistency
+ with ../binutils.
+ * Makefile.in: docdir is ./doc, not ${srcdir}/doc.
+
+Mon May 4 11:49:15 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * bfd-in.h: bump version to 1.96
+ Major change; changed calling convention for
+ bfd_get_relocated_section_contents so that caller allocates
+ memory for section data.
+ * coffcode.h (bfd_coff_get_relocated_section_contents), reloc.c,
+ seclet.c, targets.c, bfd.c: reflect new convention.
+ * coffcode.h (styp_to_sec_flags): if styp_flags is not a special
+ case, then use reasonable default values for SEC_* flags.
+
+Fri May 1 12:58:34 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * coffcode.h (coff_write_object_contents): use RELSZ to work out
+ size of output reloc struct.
+ * targets.c, Makefile.in: comment out tekhex for the moment.
+ * 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
+ * coff-a29k.c: various changes to the way relocations work to cope
+ with the "new order" and latent bugs.
+ * coffcode.h: lint
+
+Wed Apr 29 12:37:07 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * aoutx.h (aout_swap_ext_reloc_out, aout_swap_std_reloc_out)
+ 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.
+
+Fri Apr 24 07:35:26 1992 Stu Grossman (grossman at cygnus.com)
+
+ * configure.in: Add a29k-amd-udi.
+
+Thu Apr 23 18:37:55 1992 Fred Fish (fnf@cygnus.com)
+
+ * aoutx.h (aout_<bits>_swap_exec_header_in): Zero out the
+ internal_exec structure before initializing the fields that
+ are used, so that the unused fields are in a known state.
+
+Wed Apr 22 09:36:08 1992 Fred Fish (fnf@cygnus.com)
+
+ * tekhex.c (struct data_struct): Convert from typedef that
+ typedefs nothing to a normal structure declaration.
+ * tekhex.c (pass_over): Prototype args for function that
+ second arg points to.
+
+Mon Apr 20 22:22:51 1992 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * Makefile.in: remove old style staging. Do not print recursion
+ lines.
+
+ * Makefile.in: rework CFLAGS so that CFLAGS can be passed from the
+ Makefile command line. Remove MINUS_G. Default CFLAGS to -g.
+ Pass CFLAGS.
+
+Fri Apr 17 09:15:31 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * bfd.c, Makefile.in: added tekhex
+ * aoutx.h (set_section_contents): pages should be padded to the
+ size of a page, not the size of a segment.
+ * configure.in: added go32 host and i386-aout target.
+ * i386aout.c, libaout.h: now works for go32 target
+ * ieee.c: fix bit rot.
+ * seclet.c: support for padding seclet type.
+
+Wed Apr 15 18:11:58 1992 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * Makefile.in: added .NOEXPORT:
+
+Tue Apr 14 14:34:42 1992 Fred Fish (fnf@cygnus.com)
+
+ * elf.c (bfd_add_strtab, bfd_add_2_to_strtab): CONST spreads
+ like ooze.
+ * elf.c (elf_compute_section_file_positions,
+ elf_write_object_contents): Return boolean, not NULL (which
+ can be void *).
+ * elf.c (bfd_section_from_shdr): Ifdef-out debugging code.
+ Also ifdef-out code that aborts on unhandled section types.
+
+Fri Apr 10 22:29:18 1992 Fred Fish (fnf@cygnus.com)
+
+ * configure.in: Recognize ncr3000 config
+ * Makefile.in (MINUS_G): Pass on to recursive makes.
+ * hosts/ncr3000.h, config/ncr3000.mh: Add host config files.
+
+Thu Apr 2 17:42:45 1992 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in: Now that we have sym.h and symconst.h, compile
+ coff-msym.c on all systems.
+ * config/{decstation.mh, irix3.mh, irix4.mh}: Remove coff-msym.o dep.
+ * coff-msym.c: Update include files and comments; add weakext bit.
+
+Wed Apr 1 23:16:38 1992 John Gilmore (gnu at cygnus.com)
+
+ * archive.c, bfd.c, bout.c, coffcode.h, init.c, reloc.c,
+ section.c, srec.c, syms.c, coff-h8300.c: Lint.
+
+Sun Mar 29 09:37:59 1992 John Gilmore (gnu at cygnus.com)
+
+ * bout.c, coff-a29k.c, coff-i960.c: Lint.
+ * configure.in: Add new host and target configs.
+ * elf.c (bfd_prstatus, bfd_fpregset): Avoid typename of register
+ structs, which vary; just use member name.
+ (elf_object_p, elf_core_file_p): Lint, fix comments.
+ * config/sparc-elf.mt, hosts/sysv4.h: New config files.
+
+Sat Mar 28 13:07:02 1992 Fred Fish (fnf@cygnus.com)
+
+ * elf.c (elf_object_p, elf_core_file_p): Fix to use only a single
+ local, disposable, copy of the external form of section header
+ table and program header table entries.
+
+Thu Mar 26 16:59:58 1992 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in: Set MINIMIZE back to 0 for a real release.
+
+Tue Mar 24 15:57:03 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * configure.in: config/irix4.m[ht], hosts/irix4.h: add support for
+ irix4.
+
+Mon Mar 23 22:37:34 1992 Stu Grossman (grossman at cygnus.com)
+
+ * coff-msym.c (ecoff_swap_rfd_in): remove & for array ref.
+
+Tue Mar 17 14:12:25 1992 Per Bothner (bothner@rtl.cygnus.com)
+
+ * bout.c (b_out_slurp_reloc_table): Use BFD_ASSERT macro,
+ not internal bfd_assert function (twice).
+
+Tue Mar 17 10:45:12 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * aout-target.h: change ar_max_namelen to 15 (the right value)
+ * coff-a29k, coffcode.h: more hangovers from the bfd_abs_section
+ change
+
+Mon Mar 16 14:57:22 1992 Steve Chamberlain (sac@rtl.cygnus.com)
+
+ * archive.c (bfd_generic_archive_p): check for bout archives too.
+ * bout.c: make it work again.
+
+Sat Mar 14 17:30:40 1992 Fred Fish (fnf@cygnus.com)
+
+ * elf.c (elf_corefile_note): Call bfd_xmalloc() instead of bare
+ malloc().
+ * reloc.c (bfd_generic_get_relocated_section_contents): Call
+ bfd_xmalloc() instead of bare malloc().
+
+Fri Mar 13 15:44:37 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in: pass down MAKEINFO on info.
+
+Fri Mar 13 07:41:13 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * config/mt-<foo> now <foo>.mt, config/mh-<foo> now <foo>.mh.
+ host/h-<foo> now just <foo>.
+ * configure.in: reflect changes
+
+Thu Mar 12 11:15:02 1992 Per Bothner (bothner@cygnus.com)
+
+ * libbfd-in.h (set_tdata): Make change of Feb 27 in the
+ actual source file, not just the generated libbfd.h.
+
+Sat Mar 7 10:33:41 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * coff-i960.c (icoff_little_vec): add COFF_SWAP_TABLE so we can run
+ gdb on little-endian 960 code.
+ * archive.c (compute_and_write_armap): indirect symbols should go
+ into the archive header too.
+
+Fri Mar 6 21:55:16 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in: added check target.
+
+Thu Mar 5 23:51:42 1992 John Gilmore (gnu at cygnus.com)
+
+ * coff-msym.c: Move this file from gdb/ecoff.c. It
+ handles byte-swapping for ECOFF (MIPS symbol) files.
+ * config/mh-decstation, config/mh-irix3: Add coff-msym.o
+ to the files built on MIPS-based hosts.
+ * Makefile.in: Add rule for coff-msym.
+
+Thu Mar 5 21:36:05 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in: added clean-info target. MINIMIZE=1.
+
+Sun Mar 1 22:32:58 1992 Per Bothner (bothner@cygnus.com)
+
+ * coff-rs6000.c: Move core file functions into separate
+ new file rs6000-core.c. This is needed because reading
+ core files depends on native include files that conflict
+ with ../include/coff/rs6000.h.
+ * config/mh-rs6000: Add rs6000-core.o to HDEPFILES.
+
+Thu Feb 27 22:19:55 1992 Per Bothner (bothner@cygnus.com)
+
+ * aoutx.h (NAME(aout,print_symbol)): Don't print
+ symbol addresss for undefined symbols.
+ * coff-rs6000.c: Various updates (due to target-
+ independent changes).
+ * libbfd.h: Ditto (tdata field is now a union).
+ * hosts/h-sparc.h: Removed prototype for bogus function
+ 'emset' (presumably should have been 'memset' - which is there).
+
+Thu Feb 27 11:46:33 1992 John Gilmore (gnu at cygnus.com)
+
+ * configure.in (mips-big-* target): Same is Iris.
+
+Thu Feb 27 09:24:56 1992 Steve Chamberlain (sac at thepub.cygnus.com)
+
+ * aoutx.h (translate_from_native_sym_flags): when creating an
+ alias symbol, fill in the section as undefined, rather than
+ leaving it blank. If an output section can't be found for a
+ symbol, then don't core dump.
+
+Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com)
+
+ * Makefile.in, configure.in: removed traces of namesubdir,
+ -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced
+ copyrights to '92, changed some from Cygnus to FSF.
+
+Wed Feb 26 19:40:59 1992 Steve Chamberlain (sac at thepub.cygnus.com)
+
+ * bfd.c: lint
+ * coff-h8300.c: fix stupid reloc subtraction bug
+ * coffcode.h (coff_swap_aux_out): only swap a tvndx by 2 bytes,
+ since that's how wide it is. (coff_slurp_symbol_table): always zero out
+ the symbol.flags and done_lineno fields.
+
+Tue Feb 25 14:29:24 1992 Steve Chamberlain (sac at rtl.cygnus.com)
+
+ * coffcode.h (coff_write_symbol): write out the correct number of
+ auxents.
+ * cpu-h8300.c: fix disassembly bug
+
+Fri Feb 21 21:39:56 1992 John Gilmore (gnu at cygnus.com)
+
+ * bfd-in.h (bfd_errmsg), coffcode.h (coff_swap_aux_in,
+ section_from_bfd_index), cpu-h8300.c (howto*_callback),
+ reloc.c, section.c (bfd_map_over_sections), targets.c
+ (bfd_target_list): Protolint.
+ * libbfd.h: Update to match a libbfd-in.h from a month ago.
+
+Fri Feb 21 10:57:54 1992 Steve Chamberlain (sac at rtl.cygnus.com)
+
+ * coffcode.h (coff_swap_aux_in): lint, (coff_print_symbol): prints
+ out tagndx too.
+ * aoutx.h (swap_std_reloc_out, swap_ext_reloc_out): use the output
+ section of a symbol rather than the section of a reffed symbol to
+ determine the r_index of an emmitted reloc.
+
+Thu Feb 20 18:10:34 1992 Per Bothner (bothner at cygnus.com)
+
+ * PORTING: New (preliminary) porting guide.
+
+Wed Feb 19 21:39:37 1992 John Gilmore (gnu at cygnus.com)
+
+ * bout.c (callj_callback), coff-a29k.c (a29k_reloc), coff-m88k.c
+ (howto_hvrt16): lint.
+
+Mon Feb 17 12:02:17 1992 Per Bothner (bothner at cygnus.com)
+
+ * hp300bsd.c (new), config/mt-hp300bsd: Make hp300bsd
+ a full configuration (with possible cross-development),
+ instead of using host-aout.c.
+
+Sun Feb 16 13:01:49 1992 Per Bothner (bothner at cygnus.com)
+
+ * aout-target.h (MY(write_object_contents):
+ Set obj_reloc_entry_size (abfd).
+ * gen-aout.c: Change to emit a .c files, not a .h file.
+
+Thu Feb 13 20:11:47 1992 Fred Fish (fnf at cygnus.com)
+
+ * elf.c (elf_slurp_symbol_table): Remove obsolete use of
+ BSF_ABSOLUTE and replace with bfd_abs_section reference.
+
+Thu Feb 13 17:22:44 1992 Steve Chamberlain (sac at rtl.cygnus.com)
+
+ * coffcode.h (get_normalized_symtab): fixed bug where symbols
+ with more than one auxent can cause nasty core dumps.
+
+ * coffcode.h, libcoff.c: added new fielded to coff_symbol_struct
+ "done_lineno" so that a symbol which appears twice in the symbol
+ table only gets it's linenumbers relocated once. Modifed
+ (coff_write_native_symbol) and (coff_make_empty_symbol) to make
+ use of it.
+
+Tue Feb 4 15:39:55 1992 Steve Chamberlain (sac at rtl.cygnus.com)
+
+ * aoutx.h: (translate_from_native_sym_flags): fix constructor
+ stuff to use the New Order.
+
+Fri Jan 31 01:34:45 1992 Stu Grossman (grossman at cygnus.com)
+
+ * ieee.c: Change type of envi[] to unsigned char.
+
+ * configure.in: fix vax ultrix configuration.
+
+ * elf.c (bfd_section_from_shdr): Deal with null return from
+ bfd_make_section(). (elf_object_p): Select endianess properly.
+
+Fri Jan 31 01:19:55 1992 John Gilmore (gnu at cygnus.com)
+
+ * hosts/h-tahoe.h, h-vaxbsd.h: Fix stack in core files.
+
+Thu Jan 30 23:51:07 1992 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in: host-aout.c doesn't depend on aout-params.h.
+ * aout-target.h: Use TARGET_BIG_ENDIAN_P to set up vector.
+ * host-aout.c: Don't use aout-params.h; configure these systems
+ in their xm files, not in a randomly generated file.
+ * hosts/h-hp300bsd.h, h-tahoe.h, h-vaxbsd.h, h-vaxult.h:
+ Specify byte order.
+ * hosts/h-vaxbsd.h: Define the form of exec and core files.
+
+Thu Jan 30 13:02:41 1992 Per Bothner (bothner at cygnus.com)
+
+ * config/mt-tahoe, config/mt-vax: Change DEFAULT_VECTOR to
+ host_aout_vec here as well.
+
+Thu Jan 30 11:41:45 1992 Stu Grossman (grossman at cygnus.com)
+
+ * host-aout.c: Change TARGETNAME to "a.out" to be compatible with
+ gdb. config/mt-hp300bsd: Change DEFAULT_VECTOR to host_aout_vec
+ to prevent undefined symbol.
+
+Thu Jan 30 07:26:53 1992 Steve Chamberlain (sac at rtl.cygnus.com)
+
+ Various lints found on PersSony
+ * aoutx.h: cast an enum
+ * coff-a29k.c: many ints in reloc structure turned to enum
+ * coffcode.h: more enums
+ * cpu-h8300.c: more enums
+ * opncls.c: more enums
+
+Thu Jan 30 01:19:56 1992 John Gilmore (gnu at cygnus.com)
+
+ * configure.in: Make Tahoe configuration work again.
+ * bfd-in.h: Remove trailing comma from enum declaration.
+ * ieee.c: Can't put byte values >0x7F into a signed char.
+
+Tue Jan 28 21:10:51 1992 Fred Fish (fnf at cygnus.com)
+
+ * Makefile.in: Add dependencies for various coff-*.o files.
+
+ * elf.c: Remove extraneous paren from core_prpsinfo and
+ core_prpstatus macros, rename core_prpstatus to core_prstatus.
+ Replace references to old section "size" member with new
+ "_raw_size" member. Implement elf_make_empty_symbol, which
+ is now used.
+
+Tue Jan 28 14:51:40 1992 Stu Grossman (grossman at cygnus.com)
+
+ * trad-core.c, bfd.c, ../include/bfd.h: Various fixes for PMAX
+ core reading.
+
+Tue Jan 28 10:46:32 1992 Steve Chamberlain (sac at rtl.cygnus.com)
+
+ * coffcode.h (bfd_coff_relax_section): now static.
+ (bfd_coff_get_relocated_section_contents): various type lints.
+
+Mon Jan 27 19:44:08 1992 Steve Chamberlain (sac at rtl.cygnus.com)
+
+ New entry point in the transfer vector - bfd_relax_section.
+
+ * aout-target.h: add to vector, call generic_relax
+ * bfd-in.h: add to vector
+ * bfd.c: add #define for vector
+ * bout.c: add to vector, call generic_relax
+ * coffcode.h: add to vector, also now has coff specific relax code
+ for the relaxable H8/300 relocs. Also clean up abs section cruft.
+ * elf.c: call generic_relax
+ * ieee.c: call new vector, clean up some bugs due to the creation
+ of bfd_abs_section
+ * libbfd.h: add bfd_generic_relax_section EXFUN
+ * oasys.c: call generic_relax
+ * reloc.c: implement generic_relax
+ * seclet.c: moved much of this into coffcode.h
+ * srec.c: call generic_relax
+ * targets.c: define new transfer vector
+
+Fri Jan 24 14:40:17 1992 Steve Chamberlain (sac at rtl.cygnus.com)
+
+ * everything: now modified to use smaller reloc type. Self hosts
+ on sun3 & sun4.
+
+Sat Jan 18 17:00:16 1992 Fred Fish (fnf at cygnus.com)
+
+ * config/mh-stratus, config/mt-i860-elf, hosts/h-stratus:
+ New files for stratus.
+
+ * configure.in: Add configuration fragments for stratus.
+
+Wed Jan 15 10:02:43 1992 Fred Fish (fnf at cygnus.com)
+
+ * aoutx.h (NAME(aout,find_nearest_line)): Declare various filename
+ variables as CONST since they are set to point to a const char
+ string. Fixes compiler complaints.
+
+Fri Jan 10 17:44:53 1992 Fred Fish (fnf at cygnus.com)
+
+ * hosts/h-amix.h hosts/h-i386v4.h: Change abort() to a function
+ returning void.
+
+Fri Jan 10 14:33:32 1992 Per Bothner (bothner at cygnus.com)
+
+ * aoutx.h (NAME(aout,find_nearest_line)): Recognize N_SOL
+ symbols, so that we can emit the correct file name even
+ if it's an include file.
+
+Thu Jan 2 16:43:34 1992 John Gilmore (gnu at cygnus.com)
+
+ * coff-i960.c: Add COFF_SWAP_TABLE to little_vec as well as big_vec.
+ (Reported by john@labtam.labtam.oz.au (John Carey)).
+
+Wed Jan 1 04:23:06 1992 Fred Fish (fnf at cygnus.com)
+
+ * elf.c: Change all '#if HAVE_PROCFS' to '#ifdef HAVE_PROCFS'.
+
+ * config/mh-amix, config/mh-i386v4: Remove HDEFINES that was
+ being used to -DHAVE_PROCFS.
+
+ * hosts/h-amix, hosts/h-i386v4: Add '#define HAVE_PROCFS'. Move
+ '#include "fopen-same.h"' to end of file to match other h-* files.
+
+Fri Dec 20 12:06:17 1991 Fred Fish (fnf at cygnus.com)
+
+ * configure.in: Change svr4 references to sysv4. Add case
+ "unknown" for target vendor and infer some targets based
+ on the specified operating system.
+
+Wed Dec 18 17:17:59 1991 Stu Grossman (grossman at cygnus.com)
+
+ * bfd-in.h, libaout.h: ANSIfy enums.
+
+Wed Dec 18 16:12:25 1991 Steve Chamberlain (sac at rtl.cygnus.com)
+
+ * archive.c (normalize): created version for VMS which removes the
+ VMS directory crap from the front and end of a filename, eg turn
+ [-.foo]bar.obj;123 into bar.obj
+ (bfd_construct_extended_name_table): now writes index into an
+ extended name table in decimal - the same base used to read an
+ extended name table.
+
+Wed Dec 18 14:40:39 1991 Per Bothner (bothner at cygnus.com)
+
+ * aout-encap.c: Fix to use aout-target.h.
+ * aoutf1.h: Use standard MY_object_p and MY_callback
+ in aout-target.h. Remove target-specific versions.
+ * host-aout.c: Re-write to use aout-target.h.
+ * gen-aout.c: New files use with host-aout.c to generate
+ host-specific a.out-related parameters.
+ * Makefile.in: host-aout.o depends on aout-params.h, which is
+ generated by gen-aout.
+ * aout-target.h: Make a little more flexible.
+ * libaout.h, aout-target.h: Removed WORK_OUT_FILE_POSTIONS
+ macro. Instead, inline it in aout-target.h.
+ * newsos3.c: Define N_SHARED_LIB(x) as 0 to avoid
+ a gcc -Wall warning.
+ * archive.c: Add missing commas in DEFUN macro (2 places).
+ * elf.c, coffcode.h, aoutf1.h: Use ANSI functions instead of
+ Berkeley ones, now that libiberty has them:
+ bcopy->memcpy, bzero->memset, bcmp->memcmp.
+ * aoutx.h: Various touch-ups: Re-formatting, fix a cast,
+ remove unused variable.
+
+Tue Dec 17 19:48:59 1991 Fred Fish (fnf at cygnus.com)
+
+ * elf.c (elf_core_file_matches_executable_p): Enclose corename
+ and execname inside HAVE_PROCFS ifdef since they are unused
+ when it is not defined.
+
+Mon Dec 16 12:00:10 1991 Fred Fish (fnf at cygnus.com)
+
+ * elf.c: Flag all sections as either code or data. We can't
+ be sure what they are anyway, since ELF doesn't fit the
+ traditional model of text+data+bss very well. Add new local
+ function elf_read() to simplify code. Record entry point in
+ the bfd structure.
+
+Thu Dec 12 21:01:22 1991 John Gilmore (gnu at cygnus.com)
+
+ * hosts/h-*.h: Configure fopen using ../include/fopen-*.h
+ rather than N copies of the same lines.
+
+Wed Dec 11 16:39:45 1991 Steve Chamberlain (sac at rtl.cygnus.com)
+
+ * cpu-h8300.c: disassemble branch displacements correctly
+ * coff-h8300.c: put reloc offsets out in 32bits
+
+ * makefile.dos, configdj.bat: New files from DJ
+ * cache.c: fopen with new macros is needed for DOS.
+ * ieee.c: environ renamed to envi to stop an include file
+ conflict.
+ * opncls.c, coff-rs6000.c: more fopens with macros.
+
+Tue Dec 10 04:07:24 1991 K. Richard Pixley (rich at rtl.cygnus.com)
+
+ * Makefile.in: infodir belongs in datadir.
+
+Sat Dec 7 16:39:23 1991 Steve Chamberlain (sac at rtl.cygnus.com)
+
+ * Makefile.in: fix where docdir lives
+
+ * aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c,
+ 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.
+
+
+Sat Dec 7 07:22:09 1991 John Gilmore (gnu at cygnus.com)
+
+ * coffcode.h, srec.c: Lint.
+
+Fri Dec 6 22:58:48 1991 K. Richard Pixley (rich at rtl.cygnus.com)
+
+ * Makefile.in: install using INSTALL_DATA, added standards.text
+ support.
+
+ * configure.in: mark directory as target dependent. configure
+ nows works in objdir always so make file existence checks
+ against ${srcdir}.
+
+Thu Dec 5 22:46:19 1991 K. Richard Pixley (rich at rtl.cygnus.com)
+
+ * Makefile.in: idestdir and ddestdir go away. Added copyrights
+ and shift gpl to v2. Added ChangeLog if it didn't exist. docdir
+ and mandir now keyed off datadir by default.
+
+Wed Dec 4 10:14:17 1991 Steve Chamberlain (sac at rtl.cygnus.com)
+
+ * aoutf1.h (sunos_<size>_object_p, sunos4_callback): moved the
+ computation of arch and machine type so it's worked out before
+ some_aout_object_p is called.
+ * aoutx.h: (some_aout_object_p): don't set arch and mach to
+ unknown.
+ * archures.c: add extra field 'section_align_power' to hold
+ default section alignment in object files.
+ * cpu-a29k.c, cpu-h8300.c, cpu-i386.c, cpu-i960.c, cpu-m68k.c,
+ cpu-m88k.c, cpu-mips.c, cpu-rs6000.c, cpu-sparc.c, cpu-vax.c:
+ initialize the new field.
+ * bout.c (b_out_callback): replace the text size, since aout
+ fries them.
+ * aoutx.h: Documentation in the new style
+
+Wed Dec 4 02:00:30 1991 John Gilmore (gnu at cygnus.com)
+
+ * bfd.c (bfd_get_mtime): Don't cache mtime any more; only
+ use the saved value if mtime_set is already set (intended
+ for archive files, though apparently not used yet).
+
+Tue Dec 3 22:54:50 1991 John Gilmore (gnu at cygnus.com)
+
+ * targets.c: Revise comments about how to configure the target
+ vector, to match reality. Remove mention of obsolete methods.
+ Remove long lists of capitalized macros that turn into the same
+ thing in lowercase. Normal vector simply lists all known
+ lowercase xvec names; all other cases are handled by SELECT_VECS.
+
+ * config/mt-i386-coff: Set DEFAULT_VECTOR to real identifier,
+ not macro name.
+
+ * config/mt-i960-{coff,bout}: Use SELECT_VECS to make a short
+ list of supported targets.
+
+Tue Dec 3 14:06:15 1991 Per Bothner (bothner at cygnus.com)
+
+ * archive.c (bsd_write_armap): The pad byte sometimes added to
+ the string table in a __.SYMDEF member is now
+ counted as part of the size of the string table.
+ This is compatible with the old ranlib, as well as Sun's.
+
+Tue Dec 3 10:53:30 1991 Steve Chamberlain (sac at rtl.cygnus.com)
+
+ * srec.c: Rewrote to fix many bugs; now gets the record type
+ right, doesn't choke on input, sets the start address in an S9 and
+ fills in the filename on an S0.
+
+Sat Nov 30 21:19:15 1991 Steve Chamberlain (sac at rtl.cygnus.com)
+
+ * cpu-h8300.c: Add support for MEMIND addressing mode
+
+ * coff-a29k.c: defined RELOC_PROCESSING to take the #ifdef out of
+ coffcode.h
+ * coffcode.h: use the new macro if available
+
+ * elf.c (elf_corefile_note): cast malloc to avoid warning.
+ * Makefile.in: Fixed dependencies due to file rename
+
+ * aout-encap.c, aoutf1.h, aoutx.h, archive.c, bout.c, coff-a29k.c,
+ 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.
+
+Fri Nov 29 20:04:49 1991 Fred Fish (fnf at cygnus.com)
+
+ * config/mh-i386v4, config/mh-i386-elf, hosts/h-i386v4.h: New files.
+
+ * configure.in: Add vendor "ncr" as supported per-target vendor.
+ Add svr4 case for i386 per-host case.
+
+ * elf.c (elf_object_p, elf_core_file_p): Add missing "break" to
+ ELFDATA2LSB cases.
+
+Fri Nov 29 12:16:51 1991 Per Bothner (bothner at cygnus.com)
+
+ * syms.c (bfd_decode_symclass): Return 'A'
+ for symbols that are both absolute and global.
+ * archive.c (bfd_special_undocumented_glue): Return NULL
+ if bfd_ar_hdr_from_filesystem returns NULL.
+
+Tue Nov 26 09:10:55 1991 Steve Chamberlain (sac at cygnus.com)
+
+ * Makefile.in: added coff-h8300
+ * 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
+
+Fri Nov 22 08:11:42 1991 John Gilmore (gnu at cygnus.com)
+
+ * aoutx.h (some_aout_object_p): Set the `executable' bit
+ if the entry point is contained in the text segment, even if the
+ text segment is at location 0.
+
+ * coff-mips.c, coffcode.h: Peter Schauer's patch to kludge in
+ nonstandard MIPS sections (.rdata, .sdata, etc).
+
+ * aoutx.h, bfd.c, coffcode.h, ieee.c, oasys.c, targets.c: CONST lint.
+ * libbfd-in.h, libbfd.h, aoutx.h, coffcode.h, elf.c, libaout.h:
+ Rename ALIGN to BFD_ALIGN to avoid conflict with BSD <sys/param.h>.
+ * libbfd.c: Lint.
+ * host-aout.c, trad-core.c: Fix write_armap prototypes. Lint.
+
+Thu Nov 21 19:56:40 1991 Per Bothner (bothner at cygnus.com)
+
+ * stab-syms.c, syms.c: Moved bfd_stab_name() and bfd_stab_names[]
+ from syms.c to new file stab-syms.c. Also, since GNU extended
+ type codes such as N_SETT are no longer in ../include/stab.def,
+ include them manually.
+ * stab-syms.c, aoutx.h: Renamed bfd_stab_name() and
+ bfd_stab_names[] to aout_stab_name() and aout_stab_names[].
+ * libaout.h: Added prototype for aout_stab_name().
+ * Makefile.in: Update Makefile for new stab-syms.[co].
+
+Thu Nov 21 11:50:49 1991 John Gilmore (gnu at cygnus.com)
+
+ * libaout.h (WORK_OUT_FILE_POSITIONS): One more try at this
+ rather complicated seeming problem. Eliminate LOGICAL_ versions,
+ just make N_XXX work by excluding the header from the text segment.
+ * aoutx.h: Fix comments to match.
+
+Tue Nov 19 18:49:01 1991 Per Bothner (bothner at cygnus.com)
+
+ * libaout.h (WORK_OUT_FILE_POSITIONS): Use new LOGICAL_TXTADDR,
+ LOGICAL_TXTOFF, LOGICAL_TXTSIZE macros to figure out numbers
+ for the "logical" text segment (i.e. never consider the exec
+ header to be part of the text segment). This change is
+ needed for consistency with various other parts of bfd and ld.
+ * aoutx.h (NAME(aout,soe_aout_object_p)): Fix comment,
+ and move calculation of obj_textsec(abfd)->size to libaout.h.
+ * bfd-in.h: Removed bogus ';'.
+
+ * Makefile.in: Add MINIMIZE flag to select lean
+ or bloated target_vector.
+ * targets.c: Use new MINIMIZE macro, and add trad_core if needed.
+ * newsos3.c: Fixes to ../include/aout64.h remove need
+ for special N_TXTOFF macro, but require N_HEADER_IN_TEXT.
+
+Mon Nov 18 12:00:59 1991 Per Bothner (bothner at cygnus.com)
+
+ * aout-target.h, aoutf1.h, newsos3.c: Make aout-target.h
+ handle both little and big-endian targets, with little
+ the default unless TARGET_IS_BIG_ENDIAN_P is defined.
+ * host-aout.c: Add FIXME note.
+
+Sun Nov 17 13:29:39 1991 Per Bothner (bothner at cygnus.com)
+
+ * targets.c: Make the default target_vector contain
+ just &DEFAULT_VECTOR. This makes executables a lot smaller.
+ Old behavior can be gotten by defining ALL_TARGETS.
+ * aoutf1.h, demo64.c, i386aout.c, newsos3.c, sunos.c:
+ Factored out common code into new file aout-target.h.
+ Saves a lot of duplicate code for a.out variants.
+
+Fri Nov 15 13:00:43 1991 Per Bothner (bothner at cygnus.com)
+
+ Get 'make headers' to work when configured with +subdirs.
+ * Makefile.in: Add $(subdir) to docdir path.
+ * doc/Makefile.in (protos): Add $(srcdir) prefix
+ to name of sed scripts.
+
+Thu Nov 14 19:49:10 1991 Per Bothner (bothner at cygnus.com)
+
+ * aoutx.h (NAME(aout,print_symbol)): Fix thinko.
+ * syms.c (bfd_stab_names): Turn on new GNU_EXTRA_STABS macro
+ to include names of N_SETT etc.
+
+Thu Nov 14 19:11:13 1991 Fred Fish (fnf at cygnus.com)
+
+ * elf.c: Add minimal support for ELF symbol tables. Generates
+ canonical bfd symbol tables from ELF symbol tables. Change the
+ name of some functions from bfd_<name> to elf_<name>.
+
+ * syms.c: Trivial fix to comment to remove a redundant "to".
+
+Wed Nov 13 17:02:01 1991 John Gilmore (gnu at cygnus.com)
+
+ * coff-{i386,m68k,m88k}.c: Change name of file format to standard
+ form that GDB recognizes as COFF.
+
+Wed Nov 13 09:09:41 1991 Steve Chamberlain (sac at cygnus.com)
+
+ * ieee.c (ieee_object_p): cast NULL correctly.
+ * configure.in: added harris host
+
+ * coff-a29k.c: Lots of changes, most from David Wood.
+
+Tue Nov 12 07:21:41 1991 John Gilmore (gnu at cygnus.com)
+
+ * coff-m88k.c (coff_write_armap): Just #undef it.
+
+Mon Nov 11 20:30:18 1991 Steve Chamberlain (sac at cygnus.com)
+
+ * Makefile.in: standardize on MINUS_G to disable debugging
+ * coff-m88k.c: create coff armaps instead of bsd ones.
+ * opncls.c (bfd_close_all_done), (bfd_close): Mask out random bits
+ when calling chmod.
+
+Mon Nov 11 19:07:32 1991 Fred Fish (fnf at cygnus.com)
+
+ * elf.c: Additions to support ELF format core files.
+ * config/mh-amix: Add -DHAVE_PROCFS to HDEFINES, since host
+ has support for /proc (all the include files in particular).
+
+Mon Nov 11 18:36:47 1991 Per Bothner (bothner at cygnus.com)
+
+ * aoutx.h (NAME(aout,find_nearest_line)): Handle the case
+ of two N_SO stabs, one for directory, and one for filename.
+
+ * bfd-in.h (print_vma): Factor out duplicate definition.
+
+ Exit a little more gracefully when malloc returns NULL.
+ * libbfd.c: New function bfd_xmalloc (malloc wrapper).
+ * opncls.c, syms.c, bout.c, aoutx.h: Replace malloc by bfd_xmalloc.
+ * libbfd.h: Rre-generated due to libbfd.c update.
+
+Sat Nov 9 13:45:01 1991 Fred Fish (fnf at cygnus.com)
+
+ * config/mt-m68k-elf: Define DEFAULT_VECTOR as elf_big_vec.
+
+ * elf.c (elf_object_p): Don't try to create a bfd section for
+ the first ELF section header. It is just a placeholder.
+
+Sat Nov 9 03:04:26 1991 John Gilmore (gnu at cygnus.com)
+
+ * coff-rs6000.c, config/mh-rs6000: Make it work on archive and
+ core files, when compiling native.
+ * hosts/h-rs6000.h: Define FASCIST_FDOPEN for bfd_fdopenr.
+
+ FIXME: The aoutf1.h change below needs to be reversed back
+ to the way it was.
+
+Thu Nov 7 11:03:55 1991 Steve Chamberlain (sac at rtl.cygnus.com)
+
+ * coffcode.h: Defined new macros [PUT|GET]LINENO_LNNO for
+ manipulation of lnno fields in lineno structs in a coff-<f>.h
+ independent way. Override it in coff-<f>.h to your favourite
+ number if you don't have a 16bit lnno field. (coff_swap_lineno_in)
+ (coff_swap_lineno_out): modified to use the new macros.
+
+Mon Nov 4 11:38:33 1991 Steve Chamberlain (sac at cygnus.com)
+
+ * aoutf1.h (sunos4_callback): Now defaults to 68020 rather than
+ unknown arch when the magic number doesn't specify the
+ architecture, since some OSs (eg old sun3s) don't set the number, and
+ 020 is probably the right answer anyway.
+
+Sun Nov 3 12:07:08 1991 Per Bothner (bothner at cygnus.com)
+
+ * hosts/h-news.h, hosts/h-rtbsd.h:
+ Get rid of MISSING_VFPRINTF, since libiberty provides one.
+ * bfd-in.h (bfd_print_symbol_type_hopw enum): Add new option
+ bfd_print_symbol_nm, for use by nm.
+ * aoutx.h (NAME(aout,print_symbol)): Add code for new
+ bfd_print_symbol_nm option, to print in nm format.
+ * coffcode.h (coff_print_symbol), ieee.c (ieee_print_symbol)
+ oasys.c (oasys_print_symbol): Provide stub implementations
+ for bfd_print_symbol_nm.
+ * syms.c: New function bfd_decode_symclass, used by nm printer.
+ New function bfd_stab_name to look up string name of stab code.
+
+Sat Nov 2 14:26:03 1991 Steve Chamberlain (steve at cygnus.com)
+
+ * Makefile.in: Added ctor.c
+ * archures.c (bfd_default_arch_struct) added
+ bfd_default_reloc_type_lookup.
+ * coffcode.h: removed a load of #if 0ed code.
+ (coff_compute_file_section_positions): now works out the section
+ alignment and size correctly in all cases.
+ (coff_get_symtab): looks for constructor symbols and calls the
+ right function when they're found. (coff_canonicalize_reloc):
+ knows when a section is full of constructors and does the right
+ thing.
+ * cpu-m88k.c: Added default_reloc_type lookup to the architecture
+ description.
+ * libbfd-in.h: (bfd_default_reloc_type_lookup) defun added.
+ * libcoff.h: removed #if 0ed code
+ * reloc.c: (bfd_reloc_code_real_type) added BFD_RELOC_CTOR for
+ arch independent constructor relocation type.
+ (bfd_reloc_type_lookup): removed the comment "this will go away"
+ since it won't. (bfd_howto_32): stolen from 88k, this is a 32bit
+ reloc which is used when BFD_RELOC_CTOR falls through to give a
+ default 32bit reloc for constructors.
+ (bfd_default_reloc_type_lookup): added.
+ * aoutf1.h: fixed SEGMENT_SIZE typo.
+
+Thu Oct 31 18:23:06 1991 John Gilmore (gnu at cygnus.com)
+
+ * coff-rs6000.c: Change name to "aixcoff-rs6000", to avoid
+ matching prefix "coff".
+ * coffcode.h (coff_swap_aux_in, coff_swap_aux_out): Handle
+ rs/6000 csect records.
+
+Sun Oct 27 16:56:58 1991 Steve Chamberlain (steve at cygnus.com)
+
+ * coff-m88k.c, targets.c: change name of m88k_bcs to m88kbcs
+ * configure.in: add motorola delta88 cases
+ * libbfd.h, libbfd-in.h, archive.c, ieee.c, elf.c, srec.c: fix
+ write_armap prototype
+ * libbfd.c: add doc on bfd_write_bigendian_4byte_int
+
+Fri Oct 25 02:48:19 1991 John Gilmore (gnu at cygnus.com)
+
+ * Rename COFF-related files in `coff-ARCH.c' form.
+ coff-a29k.c, coff-i386.c, coff-i960.c, coff-m68k.c, coff-m88k.c,
+ coff-mips.c, coff-rs6000.c to be exact.
+
+ * Makefile.in: Only supply TARGET_DEFAULTS to targets.c, reducing
+ make output clutter.
+ * config/mt-*: Ditto.
+
+Thu Oct 24 22:40:07 1991 John Gilmore (gnu at cygnus.com)
+
+ RS/6000 support, by Metin G. Ozisik, Mimi Phûông-Thåo Võ, and
+ John Gilmore. Archive support from Damon A. Permezel.
+
+ * Makefile.in: Add cpu-rs6000.c and rs6000coff.c.
+ * configure.in: Add rs6000 case.
+ * targets.c: Add rs6000 vector.
+ * archures.c: Add rs6000, fix comment on romp.
+ * bfd-in.h (enum bfd_error): Add no_debug_section error.
+ * libcoff-in.h (struct coff_tdata): Remove unused string_table.
+ * bfd.c (bfd_errmsgs): Add no_debug_section error message.
+ * section.c (bfd_make_section): Return NULL on attempt to create
+ a section twice.
+ * coffcode.h (bfd_swap_reloc_in): Handle r_type and r_size.
+ (bfd_swap_aouthdr_in): Handle lots more members.
+ (make_a_section_from_file): If section has already been seen,
+ just return false rather than overwriting it.
+ (coff_real_object_p): Understand incoming magic numbers.
+ (coff_set_flags): Understand outgoing magic numbers.
+ (coff_compute_section_file_positions): outgoing aouthdr magic #.
+ (build_debug_section): Add fn for reading debug string section.
+ (get_normalized_symtab): Handle symbol names in debug string section.
+ Remove unused obj_string_table.
+ (coff_slurp_symbol_table): Handle rs6000-specific storage classes.
+ * aoutx.h (translate_from_native_sym_flags, N_SET*): Check for
+ existing section before making one.
+ * cpu-rs6000.c: New file.
+ * rs6000coff.c: New file.
+
+Thu Oct 24 02:03:24 1991 Fred Fish (fnf at cygnus.com)
+
+ * elf.c: Add partial support for ELF format corefiles. Still needs
+ support for extracting registers from corefiles.
+
+ * config/t-m68k-elf: Set DEFAULT_VECTOR to elf_big_vec.
+
+ * config/{h-amix,h-dgux,h-irix3,h-ultra3}: For systems where
+ RANLIB is defined as echo, send the output to /dev/null to help
+ reduce clutter in the output from doing a make.
+
+Mon Oct 21 17:48:48 1991 John Gilmore (gnu at cygnus.com)
+
+ * hosts/h-vaxult.h: Remove malloc/free decls covered in stdlib.h.
+ Fix HOST_PAGE_SIZE and HOST_SEGMENT_SIZE. From David Taylor.
+
+Mon Oct 21 09:34:11 1991 Steve Chamberlain (steve at rtl.cygnus.com)
+
+ * coffcode.h (coff_compute_section_file_positions): make it pad
+ section size out if there are alignment restrictions so that the
+ image will be ok on a system where section positions are worked
+ out by accumulating sizes rather than from the section headers.
+ * targets.c (proto write_armap). Changed orl_count to unsigned.
+ * 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.
+
+Wed Oct 16 22:58:45 1991 John Gilmore (gnu at cygnus.com)
+
+ * bfd.c: Make sure we don't get a macro strerror().
+ * opncls.c (bfd_fdopenr): If FASCIST_FDOPEN, use "r", not "r+".
+ * trad-core.c (trad_unix_core_file_failing_command): Suppress
+ attempt to recover command, ifdef NO_CORE_COMMAND.
+ * hosts/h-tahoe.h: Add FASCIST_FDOPEN and NO_CORE_COMMAND;
+ revamp HOST_*, etc.
+ * hosts/h-i386v.h: Use <utime.h>, not <sys/utime.h>, unlike POSIX.
+
+Wed Oct 16 12:43:49 1991 Per Bothner (bothner at cygnus.com)
+
+ * archive.c (bsd_write_argmap): The size of the ranlib structures
+ should not include the size field itself.
+ * aoutx.h, libaout.h (NAME(aout, sizeof_headers)): Use
+ adata(abfd)->exec_bytes_size field instead of constant macro,
+ because aoutx.h compiles to a simple .o file shared by
+ all 32-bits a.out targets.
+
+Wed Oct 16 11:11:05 1991 John Gilmore (gnu at cygnus.com)
+
+ * configure.in: Allow i386-sco-sysv.
+ * bout.c: Remove unused i960_align; lint dummy core file handlers.
+ * cpu-h8300.c: lint.
+
+ * host-aout.c: New strategy. We use common code, include files,
+ and data structures to handle the file, but set a few parameters
+ from the host's config file (page size, text start addr, etc).
+ * libaout.h: Define HP BSD machine types.
+ * aoutf1.h: Handle reading a.outs with these types.
+
+ * trad-core.c: Pass the u.u_ar0 value as the negative of the
+ virtual-memory-address of the .reg section. We can't just make a
+ section for "all the regs and nothing else" because only GDB knows
+ exactly where the regs are (scattered around the upage and stack).
+ Clean up memory allocation. Remove big- and little-endian
+ vectors, replace with single vector; this only runs on the host,
+ in host byte order. Replace byteswap routines with aborts in case
+ anyone calls them.
+ * targets.c: There's only one trad_core_vec now.
+ * aoutf1.h (sunos_core_file_p): VMA of .reg* now needs to be 0.
+
+Tue Oct 15 08:29:03 1991 John Gilmore (gnu at cygnus.com)
+
+ * hosts/h-amix.h (free): Fix prototype.
+
+ * aoutx.h: Don't use NULL as an integer, for braindead systems
+ that declare it as (void *)0. (From Peter Schauer.)
+
+Mon Oct 14 17:20:47 1991 Per Bothner (bothner at cygnus.com)
+
+ * opncls.c (bfd_fdopenr): Add parentheses to avoid reported
+ problem with bad Ultrix system headers.
+ * aoutx.h (NAME(aout,set_section_contents)): Try to handle the
+ various kinds of alignments for the various kinds of
+ magic numbers.
+
+Mon Oct 14 14:23:10 1991 John Gilmore (gnu at cygnus.com)
+
+ * doc/Makefile: Don't assume . is on the path (from James Clark).
+
+Fri Oct 11 22:45:14 1991 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in: Avoid Sun Make VPATH bugs.
+ * targets.c: Declare trad_core vectors extern.
+
+Fri Oct 11 13:03:02 1991 Per Bothner (bothner at cygnus.com)
+
+ * coffcode.h: Moved ALIGN macro to libbfd.h. Removed i960_align.
+ * libbfd.h: Moved ALIGN macro here.
+ * bout.c (b_out_callback): Replace i960_align by align_power.
+
+ * libaout.h (struct aoutdata): Added fields page_size,
+ segment_size and exec_bytes_size. These help generic code
+ (in aoutx.h and libaout.h) to figure out where to align
+ the various segments in a demand paged file.
+ * libaout.h (WRITE_HEADER): Use new (struct aoutdata) fields
+ to decide if the exec header counts in a_text (text segment size).
+ Also, assume D_PAGED flag is set; don't set it here.
+ * bout.c (b_out_callback): Add initialization of
+ adata fields page_size, segment_size, and exec_bytes_size.
+ * host-aout.c (NAME(host_aout, callback) and
+ NAME(host_aout,mkobject): Ditto.
+ * i386aout.c (aout386_callback) and new aout386_mkobject): Ditto.
+ * newos3.c (newsos3_callback) and new newsos_mkobject): Ditto.
+ * aoutf1.c (sunos4_callback) and new sunos_mkobject): Ditto.
+ * aoutx.h (NAME(aout,some_aout_object_p)): Don't subtract
+ EXEC_BYTES_SIZE from the a_test size; this is only appropriate
+ for some systems (mainly sunos), so do it in the callback instead.
+ Same routine: Add stuff to the THIS_IS_ONLY_DOCUMENTATION comment.
+ * aoutx.h (NAME(aout,set_section_contents): Change the way
+ filepos and size of sections are carried out to support
+ older styles of demand paged executables.
+
+
+Fri Oct 11 12:33:36 1991 Steve Chamberlain (steve at cygnus.com)
+
+ * bfd-in.h: Added more macros to COFF_SWAP_TABLE.
+ * 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
+
+Fri Oct 11 03:01:52 1991 John Gilmore (gnu at cygnus.com)
+
+ Restructure configuration scheme for bfd, binutils, ld.
+
+ * include/sys/h-*.h: Move to bfd/hosts/h-*.h.
+ * configure.in: Revise to symlink sysdep.h to hosts/h-xxx.h.
+ Change some config names to match other dirs.
+ * *.c: Include bfd.h before sysdep.h, so ansidecl and PROTO()
+ get defined first.
+ * Makefile.in: Use -I. to get sysdep.h. Remove refs to
+ ../include/sysdep.h.
+ * cpu-i960.c: Strncmp needed a length arg.
+ * ecoff.c: Don't ever call trad_unix_core_file_p from here.
+ * i386aout.c: Remove dead N_TXTOFF override.
+ * trad-core.c: Don't disable the whole file if SUN4_SYS.
+ * config/: Rename some config files to match up h-*.h names.
+ Remove all the HOST_SYS definitions from the config files.
+ * hosts/h-amix.h, h-i386v.h: Define POSIX_UTIME, not USG.
+ * hosts/h-hp9000.h: Remove USG comment.
+ * hosts/h-rs6000.h: Include <stdlib.h> for malloc.
+ * hosts/h-news.h, h-sparc-64.h: New config files that had
+ previously been kludged in the <sysdep.h> file.
+
+Thu Oct 10 17:54:08 1991 John Gilmore (gnu at cygnus.com)
+
+ * config/*: trad-core support is HOST dependent, not target
+ dependent. Target config files only set DEFAULT_VECTOR and/or
+ other vector elements. Exception: when host-aout.c is in use,
+ in which case we're forced to assume we're native (hp, vax,
+ tahoe). Rename XDEPFILES to HDEPFILES.
+ * Makefile.in: Rename XDEPFILES.
+ * config/h-sun*: Don't force static linking.
+ * trad-core.c: Document how to use it nowadays.
+ * i386aout.c, newsos3.c: Clean up.
+ * i386coff.c: Allow 386 coff files to be used as core files too
+ (for reading core files from embedded systems).
+
+Tue Oct 8 15:30:39 1991 John Gilmore (gnu at cygnus.com)
+
+ * Add i386aout.c for a.out support on the i386.
+
+Tue Oct 8 12:18:54 1991 Roland H. Pesch (pesch at cygnus.com)
+
+ * reloc.c, section.c, syms.c, targets.c: correct info-node
+ structure in *doc* comments.
+ doc/Makefile: stop hiding complaints from makeinfo.
+
+Sun Oct 6 19:10:06 1991 John Gilmore (gnu at cygnus.com)
+
+ * aoutx.h (...some_aout_object_p): Take a third parameter,
+ the internal_exec struct, and avoid ever looking at an
+ external_exec. All callers changed to read the entire
+ external_exec struct, swap and check its magic number,
+ swap in the whole structure, and pass the swapped-in version to
+ some_aout_object_p.
+ * bout.c: Bring into modern era. Use single _object_p routine
+ for big- aand little-endian. Provide internal and external
+ exec header structs. Use separate swap-in and swap-out routines.
+
+ * libaout.h: Move struct internal_exec from ../include/aout64.h
+ to here. Add obj_symbol_entry_size to struct aoutdata.
+ * aoutx.h (...some_aout_object_p): Set obj_symbol_entry_size.
+
+ * ../include/aout64.h: Change EXTERNAL_LIST_SIZE to
+ EXTERNAL_NLIST_SIZE. Callers changed.
+
+Fri Oct 4 18:18:46 1991 John Gilmore (gnu at cygnus.com)
+
+ * bfd.c: Remove strerror() to libiberty.
+
+ * 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.
+
+Fri Oct 4 17:38:03 1991 Steve Chamberlain (steve at cygnus.com)
+
+ * reloc.c: Extended NEWHOWTO macro
+ * ieee.c: Changed the way 8bit pcrel is done
+ * cpu-h8300.c: got the registers in the right order
+
+Thu Oct 3 19:39:55 1991 John Gilmore (gnu at cygnus.com)
+
+ * bfd-in.h: enum boolean => enum bfd_boolean for SVR4. Gumby's
+ prediction is vindicated!
+
+ * bfd-in.h, libbfd-in.h, doc/Makefile, doc/tolibbfd, doc/intobfd:
+ Remove refs to howto.c, since Steve forgot.
+
+Thu Oct 3 07:49:21 1991 Steve Chamberlain (steve at cygnus.com)
+
+ * elf.c: took the abort out of set_arch_mach so that objdump -i will
+ still work. Now allows any architecture/machine to be set.
+
+Wed Oct 2 13:50:35 1991 Steve Chamberlain (steve at cygnus.com)
+
+ * howto.c deleted and moved code to reloc.c
+
+ * libbfd.h, libbfd-in.h removed $id stuff for real
+
+ * cpu-h8300.c Made it match various different spellings of h8300.
+
+ * archures.c: Took out the first char filter which made it only
+ look for a cpu/arch match when the first chars of supplied and
+ tested names were the same.
+
+ * targets.c removed oasys stuff, pending someone to fix the bugs
+ in it.
+
+
+Tue Oct 1 12:29:44 1991 John Gilmore (gnu at cygnus.com)
+
+ * Makefile.in, configure.in, targets.c, elf.c: Add preliminary
+ ELF support good enough for GDB.
+ * configure.in, config/h-amix, config/t-m68k-elf: Handle
+ m68k-cbm-svr4 host and target.
+ * config/t-m68k-coff, t-m88k-coff, t-m88k-aout: Make files nonempty
+ so `diff' and `patch' can cope.
+
+Tue Oct 1 11:24:31 1991 Steve Chamberlain (steve at cygnus.com)
+
+ * archures.c: removed texinfo error
+
+ * init.c: added texinfo hooks, and removed initialization error
+ message.
+
+ * libcoff-in.h, libbfd-in.h removed $id field so cvs can merge
+ without complaints.
+
+Tue Oct 1 05:02:53 1991 John Gilmore (gnu at cygnus.com)
+
+ * cpu-i960.c: Avoid numerical count of initializers.
+
+ Vax Ultrix changes from David Taylor <taylor@think.com>:
+ * host-aout.c: Make little-endian vector really little-endian.
+ * configure.in: Separate vax and tahoe cases, handle ultrix.
+ * config/t-vax: Add trad-core.o.
+ * config/h-vaxult: New host system.
+
+Mon Sep 30 15:13:46 1991 Steve Chamberlain (steve at cygnus.com)
+
+ * bfd-in.h VERSION, change version number to 0.18, this makes a
+ gap, but now is the same as the linker version number.
+
+ * 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.
+
+ * amdcoff.c: (a29k_reloc) fix error message.
+
+ * 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.
+
+Mon Sep 30 13:31:15 1991 John Gilmore (gnu at cygnus.com)
+
+ * srec.c: Better error checking, partly from Peter Schauer.
+ (srec_object_p): Avoid assuming any file that starts with 'S' is
+ an S-record file! (Check for 3 uppercase-hex digits after it.)
+ (ISHEX): Define new macro for checking supposedly hex characters.
+ (pass_over): Treat as EOF any S-record line that:
+ * doesn't have hex in either size character
+ * produces a size larger than 0x7F
+ * has an unrecognized type number
+
+Thu Sep 26 15:27:29 1991 John Gilmore (gnu at cygnus.com)
+
+ * aoutf1.h, aoutx.h, bout.c, coffcode.h, host-aout.c, oasys.c,
+ opncls.c: Lint (saber actually).
+
+Thu Sep 26 11:24:24 1991 Per Bothner (bothner at cygnus.com)
+
+ * libaout.h (WRITE_HEADERS): Set header's a_text field always.
+ * newsos3.c: Fixed two types: newos3 -> newsos3.
+ * reloc.c (bfd_perform_relocation): Fix pc-relative relocation
+ to use correct segment.
+
+Mon Sep 23 18:24:34 1991 Per Bothner (bothner at cygnus.com)
+
+ * aoutx.h (print_symbol): Handle missing symbol->name.
+
+Fri Sep 20 12:26:01 1991 Stu Grossman (grossman at cygnus.com)
+
+ * aoutf1.h (swapcore_sparc): Change name of USRSTACK, fix comment
+ at top of routine.
+
+Tue Sep 17 17:23:49 1991 Stu Grossman (grossman at cygnus.com)
+
+ * oasys.c, configure.in, config/h-irix3, config/t-irix3:
+ add sgi/irix support.
+
+Thu Sep 12 14:29:09 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Changes for the AMD 29000 Ultracomputer port from David Wood.
+ (wood@nyu.edu).
+
+ * opncls.c (bfd_fdopenr): Handle NO_FCNTL.
+
+ * Makefile.in: Make subdirs work by using $(INCDIR) in the
+ crude dependencies.
+
+ * coffcode.h (coff_real_object_p): Pass information about the
+ current file's coff symbol format to BFD via the coff_data struct.
+ (coff_find_nearest_line): obj_icof => coff_data.
+ (coff_swap_sym_{in,out}): Check that SYMNMLEN == E_SYMNMLEN.
+ (coff_swap_aux_{in,out}): Check that FILNMLEN == E_FILNMLEN
+ and DIMNUM == E_DIMNUM.
+ * configure.in: Handle a29k-*-* hosts, and targets
+ a29k-*-coff, a29k-*-aout, and a29k-*-sym1.
+ * libcoff-in.h: Add local_n_btmask, local_n_btshft,
+ local_n_tmask, local_n_tshift, local_symesz, local_auxesz,
+ local_linesz to `coff_data' (tdata) struct.
+ (coff_data, coff_data_type, coff_tdata): Rename struct icofdata.
+ * config/h-ultra3: Handle a29k-*-* hosts as Ultracomputers.
+
+Thu Sep 12 14:07:22 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
+
+ * Makefile.in: $(MAKE) for make, $(docdir) for doc
+ * doc/Makefile: redundant dependencies for Sun-make VPATH bug
+
+Tue Sep 10 20:34:12 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * aoutf1.h (sunos4_core_file_p): Release the right storage in
+ error case.
+ (sunos4_core_file_matches_executable_p): Fix header comparison.
+ * aoutx.h: Avoid shifts of 32 bits, undefined in C. Lint.
+ * bout.c, icoff.c, ieee.c, libbfd.c, oasys.c: gcc -O -W lint.
+
+Wed Sep 4 00:44:52 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Allow GDB to patch object files.
+
+ * aoutf1.h (sunos_core_file_p): Set SEC_HAS_CONTENTS on all sections.
+ * trad-core.h (trad_unix_core_file_p): Ditto.
+ * aoutx.h (aout_set_section_contents): On first output, check
+ abfd->direction and complain if erroneous.
+
+ * Makefile.in: Add crude dependencies.
+
+Tue Sep 3 13:46:19 1991 Steve Chamberlain (steve at cygint.cygnus.com)
+
+ * config/* aoutx.h configure* shortened all the h/tmake-xxxx
+ to h/t-xxxx files so that everything will work on System V.
+
+Fri Aug 23 13:51:06 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * aoutx.h: Add information on host-aout.c and how to configure
+ to use it, to the manual.
+ * configure.in: Tix typo.
+ * ecoff.c: If compiling for DEC3100, use trad_unix core files,
+ else dummy out the core file support.
+ * trad-core.c (trad_unix_core_file_p): If HOST_DATA_START_ADDR is
+ specified, use it to locate the data section.
+ * coffcode.h (coff_write_symbols): Declare buffer as bfd_bytes
+ rather than as chars (lint).
+
+Thu Aug 22 22:20:19 1991 Stu Grossman (grossman at cygint.cygnus.com)
+
+ * aoutx.h, coffcode.h: saberized.
+
+Thu Aug 22 11:27:06 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
+
+ * bfd.texinfo: some cleanup, reincorporated more intro matter from
+ bfd.doc
+ bfd.c, targets.c: minor rewording of doc segments
+
+
+Wed Aug 21 19:13:22 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * trad-core.c (trad_unix_core_file_p): Use HOST_TEXT_START_ADDR,
+ etc, rather than TEXT_START_ADDR.
+ * host-aout.c: Remove #if 0 around whole thing.
+ Update to modern (32/64-bit) a.out naming conventions.
+ Include a large chunk of ../include/a.out.gnu.h to get macros that
+ are not defined by the system include files.
+ (host_aout_{32,64}_write_object_contents): Use the WRITE_HEADERS
+ macro used by the other a.out implementations.
+ * Makefile.in: Give dependencies to OPTIONAL_BACKENDS.
+
+Wed Aug 21 14:33:06 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
+
+ * Makefile.in: use targets "bfd.dvi" and "bfd.ps" instead of
+ texdoc and psdoc; make these depend on generated .texi's
+
+ * scanit, (new) unPROTO: turn PROTO macros into ANSI declarations in
+ doc
+
+ * bfd.c, reloc.c, syms.c: minor spelling/wording fixes in doc
+ portions
+
+ * Makefile.in, awkscan-ip, awkscan-p, intobfd,
+ libbfd.h, libcoff.h, tolibcoff; new bfd-in.h, libbfd-in.h,
+ libcoff-in.h: (a) use separate files for invariant parts of bfd.h,
+ libbfd.h, and libcoff.h; (b) in generated parts of same, use less
+ obtrusive marks indicating .c origins.
+
+ * bfd.texinfo: generalize most references to linker
+
+Tue Aug 20 15:18:02 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
+
+ * Makefile.in: include core.p in PROTOS (building better bfd.h)
+ * archures.c: remove empty foo() definition (crept in at vn1.9)
+
+Mon Aug 19 13:48:22 1991 Roland H. Pesch (pesch at cygint.cygnus.com)
+
+ * bfd.texinfo: use @setchapternewpage on instead of lots of
+ @page's; minor rephrasing in Introduction.
+
+ * aoutx.h, archive.c, archures.c, bfd.c, bfd.texinfo, cache.c,
+ coffcode.h, core.c, format.c, ieee.c, libbfd.c, libbfd.h, libcoff.h,
+ oasys.c, opncls.c, reloc.c, section.c, syms.c, targets.c (documentation
+ segments): used BFD (caps) more consistently as a name in
+ discourse, fixed a few other minor typos and uses of fonts
+
+
+Thu Aug 8 16:47:43 1991 Steve Chamberlain (steve at cygint.cygnus.com)
+
+ * coffcode.h: fixed bug where string table size wasn't being swapped.
+
+Thu Aug 1 16:35:28 1991 Steve Chamberlain (steve at cygint.cygnus.com)
+
+ * section.c: added SEC_CONSTRUCTOR_TEXT|DATA|BSS flags
+
+ * syms.c: added BSF_CONSTRUCTOR, BSF_WARNING and BSF_INDIRECT
+ flags. (bfd_print_symbol_vandf) now knows what to do with the
+ above flags.
+
+ * aoutx.h: made translate_from_native_sym_flags and
+ translate_to_native_sym_flags produce the above flags.
+
+
+Wed Jul 31 09:53:52 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * all files: update copyright notices for GPL version 2.
+ Install header comments and attribute most modules to their
+ authors. BFD's name is now officially "Binary File Descriptor",
+ so remove any conflicting pejoratives.
+ archures.h: Consists solely of comments; remove it.
+
+Fri Jul 26 18:11:34 1991 Steve Chamberlain (steve at cygint.cygnus.com)
+
+ * Makefile.in, bfd.c: Made it compile again.
+
+Fri Jul 19 08:17:09 1991 Steve Chamberlain (steve at cygint.cygnus.com)
+
+ * newsos3.c, targets.c, coffcode.h: new patches from David Wood
+
+
+Mon Jul 15 16:27:42 1991 Steve Chamberlain (steve at cygint.cygnus.com)
+
+ * aoutf1.h archive.c bfd.c coffcode.h core.c ecoff.c ieee.c
+ bfd.texinfo oasys.c opncls.c reloc.c srec.c: More documentation on
+ lint fixes.
+
+ * amdcoff.c bfd.texinfo Makefile.in : Folded in changes for amd
+ 29k coff by David Wood (wood@lab.ultra.nyu.edu).
+
+Thu Jul 4 09:53:16 1991 Steve Chamberlain (steve at cygint.cygnus.com)
+
+ * Everything: created some new files, core.c format.c, reloc.c,
+ section.c and syms.c to split the functionality a bit better.
+ Cleaned up the rest of the files a bit, and added some
+ documentation.
+
+
+Mon Jul 1 13:29:47 1991 David Wood (wood at david.ultra.nya.edu)
+
+ * opncls.c, ../include/sys/h-sun3.h ../include/sys/h-sun4.h: fcntl
+ really takes 3 arguments, patched code and ammended prototypes.
+
+Fri Jun 14 13:19:40 1991 Steve Chamberlain (steve at cygint.cygnus.com)
+
+ * ../include/bfd.h (struct bfd_target): Added new field
+ "align_power_min" which contains the minimum alignment for a
+ section. This is used in coff_new_section_hook. The field
+ insertion necessitates an update of all backends..
+
+ * aoutf1.h jump table field inserted
+
+ * archive.c(snarf_ar_hdr)(bfd_slurp_coff_armap) can now parse dgux style extended
+ filenames too.
+
+ * bout.c(b_out_squirt_out_relocs) fix to assertion tests. Jump
+ table field inserted.
+
+ * coffcode.h(just about everything) Now patches up symbol tables
+ using a different mechanism. The Intel major bug has been fixed,
+ and the linker can self host on the Aviion and be debugged with
+ gdb.
+
+ * ecoff.c: new include and jump table patch, i386coff.c: new
+ include and jump table patch, icoff.c: new include and jump table
+ patch, ieee.c: can now read archives containing ieee modules.,
+ libcoff.h: added (combined_entry_type), libieee.h: uped max
+ sections to 20, m68kcoff.c: new include and jump table patch,
+ m88kbcs.c: new include and jump table patch, oasys.c: various bugs
+ fixed. opncls.c: added bfd_alloc_grow and bfd_alloc_finish.
+ srec.c: jump table patch. trad-code.c fixed #IF typeo
+
+Fri Jun 7 12:35:46 1991 Sean Fagan (sef at cygint.cygnus.com)
+
+ * coffcode.h (coff_swap_aux_in): added else case to deal with
+ filenames less than 9 characters.
+
+
+Thu Jun 6 18:27:38 1991 Steve Chamberlain (steve at cygint.cygnus.com)
+
+ * ../include/oasys.h oasys.c (oasys_archive_p): fixed so it works
+
+ * srec.c: now allows any number of sections to be created in a
+ file. Outputs addresses of the right length.
+
+Thu May 30 15:30:10 1991 Steve Chamberlain (steve at cygint.cygnus.com)
+
+ * bfd.c (bfd_check_format): Fixed problem where when a defaulted
+ target didn't match, the format got set to the attempted match,
+ breaking a future test.
+
+ *../include/i386coff.h : fixed typo in type field with size
+
+ * i386coff.c icoff.c m88k-bcs.c ecoff.c ../include/bfd.h : Added
+ support in the jump table for the swapping routines exported to
+ gdb. Now gdb works with the 386.
+
+Tue May 28 17:21:43 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * Merge in changes from gdb-3.95 release.
+ Makefile.in: Allow hmake and tmake files to add OFILES.
+ aoutf1.h:
+ bfd.c: support specific targets as well as searching. When
+ searching, take default target in preference to others.
+ bfd.doc: typos
+ ieee.c, oasys.c: Avoid using the "tdata" macros left of assignment.
+ liba.out.h: Don't hard-code file offsets; use N_ macros for them.
+ libbfd.h: Support specific targets as well as searching.
+ opncls.c: Support specific targets as well as searching.
+ targets.c: Search is short-circuited if default target matches.
+ liboasys.c, libieee.c: Undo bothner changes that make macros
+ work to the left of assignment, but which depend on the
+ representations of different pointer types being the same.
+
+Fri May 24 18:56:52 1991 Steve Chamberlain (steve at cygint.cygnus.com)
+
+ * i386coff.c: created.
+ * coffcode.h: added support for 386.
+ * Makefile.in: added support for 386.
+ * ../include/i386coff.h: created
+
+Wed May 22 07:26:38 1991 Steve Chamberlain (steve at cygint.cygnus.com)
+
+ * coffcode.h: removed all put_x_<sizes>
+ * libbfd.c: Changed #ifdef __GNUC__ to #ifdef HOST_64_BIT, Added
+ DEFUNS
+
+
+Tue May 21 08:58:58 1991 Steve Chamberlain (steve at cygint.cygnus.com)
+ (bothner)
+ * opncls.c: Changed obstack_chunk_alloc use xmalloc
+
+Mon May 20 17:12:17 1991 Steve Chamberlain (steve at cygint.cygnus.com)
+
+ * everything: Removed sysdep.h from bfd.h and put back into files
+ from which it was split out. Now 64 bit version is built with a
+ -DHOST_64_BIT="long long" on the compile line.
+
+Fri May 17 19:35:26 1991 Steve Chamberlain (steve at cygint.cygnus.com)
+
+ Changed all the [get|put][name] routines to use [get|put]_[size
+ in bytes].
+
+ Put in support for 64 bit work. Now two versions of bfd may be
+ generated, according to the state of TARGET_64_BIT, one which is
+ 32 bit only, and one which is 64/32 bits.
+ Created new back end 'demo64' to test 64 bit functionality.
+
+ Renamed some files to work on DOS.
+
+ * archive.c: lint * bfd.c: prototypes and lint. * ecoff.c: added
+ 64bit transfer * icoff.c: added 64bit transfer * ieee.c: name
+ chage, 64 bit transfer. * liba.out.h: Split out common code from
+ sunos and newsos into liba.out. Name changes and prototype mods. *
+ libbfd.c: lint and prototypes, extra 64bit swaps. * libbfd.h:
+ prototypes for new functions. * libcoff.h: lint * libieee.h: make
+ work on DOS * liboasys.h: make work on DOS * m88k-bcs.c: Name
+ change and 64bit stuff.* newsos3.c: common code removed, new jump
+ table. * oasys.c: Name change * opncls.c: Portability fixes *
+ srec.c: Name changes * sunos.c: Removed comon code. * targets.c:
+ Added demo * aout32, aout64.c include aoutx.h * bout.c: used to
+ be called b.out.c * coffcode.h: used to be called coff-code.h, now
+ 64bit ized. * demo64.c: 64 bit a.out back end
+
+Thu May 16 16:02:07 1991 Steve Chamberlain (steve at cygint.cygnus.com)
+ from bothner
+ * libieee.h: Make ieee_data and ieee_ar_data macros usable
+ on LHS of assignment, even when using old compilers.
+ * liboasys.h: Ditto for oasys_data and oasys_ar_data.
+ * m68kcoff.c: Add enum-to-int casts to accomodate old compilers.
+ * newsos3.c: Fix definitions of SEGMENT_SIZE and TEXT_START_ADDR.
+ * opncls.c: Define S_IXUSR, S_IXGRP, S_IXOTH if undefined.
+ * targets.c: Add declaration of newsos3_vec.
+
+Mon May 13 10:03:29 1991 Steve Chamberlain (steve at cygint.cygnus.com)
+
+ * aout.c: fixxed some of the problems with filepos calculation.
+ (swap_ext_reloc): fixed problem with creation of relocs.
+ (aout_set_section_contents): fixed filepos problem
+
+ * coff-code.h: (swap_filehdr_in, swap_filehdr_out) add.
+ (swap_filehdr) delete. Changed all the usage of bfd_h_put_x.
+ (swap_aouthdr_in, swap_aouthdr_out) add. (swap_aouthdr) delete.
+ (coff_real_object_p) cleaned up, added MIPS. (coff_object_p)
+ cleaned up. (coff_write_object_contents) cleaned up.
+
+ * ecoff.c: Totally different. Now supports ecoff fully.
+
+ * icoff.c: fixed problems in relocation callout.
+
+ * libcoff.h: (struct icofdata) removed hdr structure from tdata.
+
+ * m68kcoff.c: updated target vector.
+
+ * sunos.c: (choose_reloc_size) added: (sunos4_callback) calls
+ choose_reloc_size. (sunos4_write_object_contents) now calls
+ choose_reloc_size so outputs relocs correctly, also calculates the
+ size of the sections correctly.
+
+
+
+Fri May 10 16:58:53 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Merge Per Bothner's changes to modularize BFD a.out a bit.
+
+ * libbfd.h, libbfd.c (bfd_generic_get_section_contents): Add.
+ * ieee.c: Cast enums to int before comparing them, for brain-
+ dead compilers.
+ * coff-code.h: Remove coff_get_section_contents, and use the
+ generic one instead.
+
+ * aout.c: Derive new module from sunos.c, containing generic
+ support code for all kinds of a.out files.
+
+ * sunos.c: Remove all code that goes in aout.c. Split out
+ machine dependent followup in sunos4_object_p into
+ sunos4_callback. Use JUMP_TABLE(aout) for the transver vector,
+ and redefine only the names we CHANGE, not all the names. Drop
+ the little-endian vector, and rename the vector as sunos4 rather
+ than generic.
+
+ * b.out.c: Use aout.c routines for most of the work. Slight
+ changes for the new regime. Remove close_and_cleanup and
+ get_section_contents in favor of generics. New transfer vector
+ regime.
+
+ * newsos.c: New support for Sony NEWS, another a.out format.
+
+ * ecoff.c: Remove close_and_cleanup. New tvec regime.
+ * icoff.c, m88k-bcs.c: Add write_contents to tvec.
+ * ieee.c, oasys.c: Remove close_and_cleanup, add write_contents
+ to tvec.
+ * opncls.c (bfd_close): Call format-dependent write_contents
+ routine, if writing, before calling target-dependent
+ close_and_cleanup routine (which is now always generic, I think).
+ * srec.c: Use bfd_alloc instead of malloc. Remove
+ close_and_cleanup and move code from it to
+ srec_write_object_contents. Add write_contents to tvec.
+ * targets.c: Remove a.out little vector, replace a.out big
+ vector with SunOS vector. FIXME: Need Vax support again now.
+
+ * libbfd.h: Add write_contents format-dependent-vector to the
+ bfd_target vector. Supply a generic close_and_cleanup routine.
+ * liba.out.h: Handle the new aout.c split. Add prototypes for
+ all routines defined in aout.c. Rename "sunos" things to "aout"
+ things. Add a few fields where needed for various formats.
+ * Makefile.in: Add aout.c and newsos.c.
+
+ * archive.c, ieee.c, oasys.c: Lint.
+
+Fri May 10 12:34:48 1991 Steve Chamberlain (steve at cygint.cygnus.com)
+
+ * ../include/bfd.h
+ changed forward declaration struct stat; to reduce warnings. Changed
+ comment on bfd_h_<x>_x.
+
+ * ../include/m68kcoff.h, ../include/intel-coff.h,
+ ../include/m88k-bcs.h
+ Now there are two incarnations of relocs, linenos and syments. One for
+ internal digestion, and one full of char arrays for I/O. The original
+ names have gone to detect errors.
+
+ * Makefile.in, m68kcoff.c, targets.c
+ Test new structure code with a 68k coff implementaion
+
+ * coff-code.h, icoff.c, coffswap.c, libcoff.h
+ Fixed all the places where there were problems with the size and
+ alignments of structures on disk and structures in memory. #ifed out
+ all the code in coffswap.c, since it should be done using the target
+ swap routines now.
+
+Thu May 9 11:00:45 1991 Steve Chamberlain (steve at cygint.cygnus.com)
+
+ * ieee.c (do_one, ieee_slurp_section_data): now supports the load
+ multiple reloc command.
+
+ * sunos.c (sunos4_set_section_contents): Made it so that sections
+ are always padded to their alignment size.
+
+Sat May 4 15:49:43 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * archive.c, bfd.c, coff-code.h, opncls.c, sunos.c, trad-core.c:
+ Clean up types and such (saber C problems).
+ * ecoff.c: Clean up types and such. Remove routines that are
+ not used. Fix up reading and swapping of shorts from files.
+
+ Notes on bfd-0.5.2-patch1a, from Per Bothner:
+
+ * a.out.vax.c: Remove two bogus "static" from prototypes.
+
+ * ecoff.c: Got rid of lots of non-working junk (that had
+ been copied directly from coff-code.h).
+ Updated to be consistent with updates to icoff.c and coff-code.h.
+
+ * libbfd.h: Added definitions for S_IXUSR, S_IXGRP, and S_IXOTH
+ if they're missing (as they are in (BDS-4.3-based) NewsOS-3).
+
+ * sunos.c (n_txtoff): (Re-)Add support for sony. This is a kludge,
+ but until the target_vector is automatically generated,
+ it's as good as any. Note that the text offset is the only
+ difference between NewsOS and SunOs (including magic numbers).
+ (Most of the sunos_* routines should to renamed bsd_*
+ and move to a bsd.c file. Then (and when the target_vector
+ is automatically generated) it might make sense to create
+ a separate Sony target.)
+
+ * sysdep.h: Don't declare fread and fwrite. Causes trouble
+ on some systems, and doesn't help on others.
+ Similarly, only define X_OK if not already defined.
+
+ * trad-core.c: Don't include sys/stat.h - at least
+ on NewsOS 3, it has already been included.
+
+Tue Mar 5 01:47:57 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * coff-code.h (bfd_coff_swap_sym, bfd_coff_swap_aux,
+ bfd_coff_swap_lineno): Export the routines that byte-swap COFF
+ symbol tables if necessary when reading them in, so gdb can use
+ them. Add "bfd_coff_" to the names so they won't conflict with
+ names in calling programs. FIXME-soon: if coff-code.h is
+ included in two BFD modules, this will cause duplicate
+ definitions; the routines should be exported to a separate,
+ common, module (probably along with a mess of other ones).
+
+Sat Mar 2 12:11:26 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Improve modtime support.
+
+ * bfd.h: Add boolean mtime_set, and declare bfd_get_mtime.
+ Remove #define for bfd_get_mtime. Remove gratuitous comment.
+ * bfd.c (bfd_get_mtime): New fn, caches mtime, gets if not cached.
+ BUG: archive members still do not get correct mod times.
+
+ Improve floating point support for core files.
+
+ * sunos.c (struct core): Change void *fpa_dummy to double fp_stuff.
+ (sunos4_core_file_p): Create a second registers section in the
+ core file, called ".reg2", for the float registers.
+
+Thu Feb 14 15:49:06 1991 Gumby Vinayak Wallace (gumby at cygint.cygnus.com)
+
+ * many changes to improve archive handling; found a logic flaw in
+ bfd_check_format which only just happened to work by cooncidence.
+
+Thu Feb 14 07:53:16 1991 Steve Chamberlain (steve at cygint.cygnus.com)
+
+ * bfd.c (bfd_perform_relocation): fixed to use output_offsets
+ correctly.
+
+ * bfd.h: changed type of udata in asymbol to void *, like it
+ should be. Added bfd_reloc_dangerous enum member.
+
+ * coff-code.h: Fixed it so that internally generated symbols get
+ their values relocated correctly in all cases. Removed calls to
+ xmalloc.
+
+ * icoff.c: Not understanding the destination symbol of a reloc is
+ not a failure any more, just 'dangerous'. This allows linking of
+ b.out and coff images.
+
+ * sunos.c: Cleaned up the way that ZMAGIC section sizes are
+ calculated.
+
+
+Tue Feb 12 13:25:46 1991 Steve Chamberlain (steve at cygint.cygnus.com)
+
+ * sunos.c (translate_to_native_sym_flags): fixed
+ sym_pointer->n_value so that symbols on the way out get their
+ section relative values calculated correctly.
+
+ * coff-code.h (mangle_symbols): fixed problem where tags were not
+ being relocated for structs, enums, unions. Also various lints.
+
+Mon Feb 11 19:52:26 1991 Gumby Vinayak Wallace (gumby at cygint.cygnus.com)
+
+ * archive.c (get_elt_at_filepos): system_call_error returned
+ incorrectly.
+
+Sun Feb 10 23:18:40 1991 Gumby Vinayak Wallace (gumby at cygint.cygnus.com)
+
+ * Resolve the use of no_error and system_call_error.
+ The bfd library itself now will never set bfd_error to
+ no_error.
+
+ The code still needs to be combed to make sure all the error
+ codes are correct. I suspect they are not always set correctly.
+
+ * The names of all the messages have _ prepended because the sun
+ bundled compiler can't distinguish from a macro which takes an
+ argument and the same identifier in a non-macro context.
+
+ * The reason for the above being that entry points which used to
+ be trampoline functions are now just macros which expand to a
+ direct call through the bfd's xfer vector.
+
+ * (../include/intel-coff.h) F_AR32WR: fix this constant. Why
+ must gas have its own version of everything (the gas version
+ had the correct value)
+
+Tue Feb 5 11:46:53 1991 Steve Chamberlain (steve at cygint.cygnus.com)
+
+ * b.out.c: Added patches supplied by chrisb@mipon2.intel.com to
+ properly support i960 architecture and output correct reloc stuff.
+
+ * bfd.h: added prototype for bfd_printable_arch_mach, added
+ BFD_FAIL
+
+ * coff-code.h: Applied patches from chrisb to support i960
+ architecture, zero relocs and swap them correcly and conditionally
+ compiled the timestamp.
+
+ * sunos.c: Made the default section alignment 2^3 so that doubles
+ are done properly. Fixed the same reloc bug that was in b.out.c
+
+ * sysdep.h: Now compiles on a Posix box
+
+Wed Jan 30 21:36:26 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ * icoff.c: Fix comment on big-endian version.
+ * coff-code.h: Make HAS_RELOC really work (it's backwards from
+ F_RELFLG). Set F_AR32WR in output files if little endian
+ architecture.
+
+Tue Jan 29 20:56:10 PST 1991 steve@cygnus.com
+
+ * archures.c fixed =/== typo
+
+ * sunos.c added architecture stuff for output. Fixed
+ bug where files where vma(data) != size(text)
+ were processed wrong.
+
+ * coff-code.h added a lint cast
+
+ * (../include/a.out.sun4.h) fixed it so zmagic
+ worked
+
+Mon Jan 28 19:15:29 PST 1991 steve@cygnus.com
+
+ * archive.c removed loads of includes, and fixed bug where string
+ table didn't have a null at the end.
+
+ * bfd.c fixed includes, added symbols argument to
+ canonicalize_reloc entry point.
+
+ * libbfd.c fixed includes and added some lint patches.
+
+ * targets.c added both sorts of intel coff.
+
+ * b.out.c fixed included, changed was the canonical
+ relocs were done.
+
+ * icoff.c added support for callj and big and little
+ enidian tables.
+
+ * opncls.c added chmod+xing for files with EXEC_P set.
+
+ * sunos.c fixed includes. Changed default section
+ alignement to words. Fixed relocation stuff to work with
+ new scheme
+
+ * bfd.h various new types added, prototype for new
+ reloc calls, changed bfd->iostream to a void *
+ to including files don't need stdio.h.
+
+ * libcoff.h added conversion table to tie relocs to
+ canonical symbols
+
+ * sysdep.h created
+
+ * coff-code.h fixed includes. Added code to support
+ big and little endian formats. Various lints. Better
+ processing of symbols. Changed reloc stuff to new
+ order
+
+ * libbfd.h fixed includes
+
+
+Mon Jan 21 11:53:51 PST 1991 steve@cygnus.com
+
+ * bfd.h changed name of alignment entry in sec_struct to
+ alignment_power, because of conflicting uses within bfd.
+ Now it should be obvious that it's a 2**n alignment
+ specifier. Removed start_pad, end_alignment, block, minsize,
+ output_file_alignment, subsection_alignment and original_vma fields.
+ Added align_power() macro. Fixed bfd_section_alignment
+ acessor macros. Added bfd_symbol_same_target macro.
+
+ * b.out.c (b_out_write_object_contents) fixed to use
+ new alignment member. Fixed (callj_callback) to use section
+ relative symbols properly.
+
+ * sunos.c (sunos4_object_p) fixed to use new alignment_power.
+ Fixed (translate_from_native_sym_flags) to correctly make
+ symbols section relative.
+
+ * bfd.c (bfd_errmsg) fixed various enum cast problems.
+ (bfd_make_section) took out initialization of obsolete members.
+ (bfd_print_symbol_vandf) added
+
+ * opncls.c (bfd_create) created.
+
+ * coff-code.h (coff_new_section_hook) took away refs
+ to obsolete members. (make_a_section_from_file) added
+ conversion between alignment types. (coff_symbol_from)
+ added. (coff_count_linenumbers) only counts linenumbers
+ if symbol is of coff-type. (coff_mangle_symbols) only
+ heavily mangles symbols if symbol is coff-type.
+ (coff_write_symbols) various lints. (coff_write_object_contents)
+ various lints and modification for alignment conversion.
+ (coff_slurp_relocs) fixed for use with new asection shape.
+
+Sat Jan 19 16:10:42 PST 1991 steve@cygnus.com
+
+ * archive.c lots of lint
+
+ * b.out.c added callj relocation support, upgrated reloc howto.
+ Fixed so that asymbol and reloc records are output
+ correctly.
+
+ * bfd.c lots of lint, support for new bfd entry point
+ bfd_print_symbol.
+
+ * bfd.h changed definition of asymbol to contain pointer to
+ owning bfd, removed target dependencies.
+
+ * cache.c took out print statements, put in BFD_ASSERT calls.
+
+ * coff-code.h various lints, corrected linenumber output
+ functionality. Added support for new style asymbols and
+ bfd_print_symbol. Fixed so that asymbol and
+ reloc records are handled correctly. Added timestamp.
+
+ * icoff.c Added support for new howto shape.
+
+ * liba.out.h Added support for new asymbol shape
+
+ * libbfd.c various lints
+
+ * libbfd.h various lints
+
+ * libcoff.h added support for new asymbol shape.
+
+ * sunos.c various lints. Added support for new asymbol shape
+ and bfd_print_symbol.
+
+Wed Jan 16 21:38:09 PST 1991 steve@cygnus.com
+
+ * b.out.c removed prototype of sunos4_ennativate_symtab, lots of
+ pointer lint. Added support for callj relocation. Fixed bug where
+ the last 32 bytes of the text section were overwritten by data. Fixed bug
+ where archives of b.out didn't work due bfd_slurp_extended_name_table
+ returning false.
+
+ * sunos.c added support for n_other field. Braced the howto table so
+ that it won't be affected by any lengthing of the howto struct typedef.
+ Various lints
+
+ * bfd.h added support for n_other field, added special_function
+ reloc type, modified bfd_perform_relocation prototype. Added bfd_h_get_x
+ macros.
+
+ * bfd.c upgraded bfd_perform_relocation, various lints.
+
+Wed Jan 16 01:55:53 1991 John Gilmore (gnu at rtl)
+
+ * ChangeLog: Started ChangeLog for BFD.
+ * ToDo: Create file for suggestions.
+
+ * Makefile: Support easy loading into Saber C.
+ Add dependencies for icoff.o and bcs88kcoff.o.
+ Rename coff.c to coff-code.h. Change callers.
+
+ * bfd.c (bfd_check_format): Allow the check_format routines
+ to return the desired target vector, rather than just a Boolean.
+ bfd.h (bfd_check_format): Change function pointer return type.
+ archive.c (bfd_generic_archive_p): change callee.
+ b.out.c (b_out_little_object_p, b_out_big_object_p,
+ b_out_real_object_p): change callee.
+ libbfd.c (_bfd_dummy_target): Dummy routine replacing bfd_false
+ in check_format transfer vectors that need a filler.
+ libbfd.h (bfd_generic_archive_p, _bfd_dummy_target): Fix decls.
+ bcs88kcoff.c: change callee.
+ coff-code.h (coff_real_object_p, coff_big_object_p): change callee.
+ icoff.c: change callee.
+ sunos.c (sunos4_object_p, sunos4_core_file_p): change callee.
+
+ * libbfd.c (zalloc): It should actually zero the storage!
+ This was commented out for some reason.
+
+ * libbfd.h: Add malloc, xmalloc, memcpy, and fatal decls.
+ This is so callers can avoid <stdlib.h> which doesn't exist
+ on older systems.
+
+ * bfd.c (map_over_sections): Add debugging code, since I
+ noticed the section count for sunos core files was bad, but only
+ GDB had detected the problem.
+ (bfd_set_section_lineno_size, bfd_set_section_linenos,
+ bfd_get_section_linenos): Remove obsolete functions.
+ (bfd_apply_relocations): Use longs, not ints, for the math.
+
+ * bfd.h: Declare enum boolean and struct bfd_target as well
+ as typedefs for them. Remove obsolete
+ bfd_get_section_lineno_size.
+
+ * cache.c: Make the "fdopen" support work. Keep better track
+ of how many files are open. Centralize the opening of files
+ and be sure bfd_open[rw] actually try to open the file. Evade
+ linked list initialization problems.
+
+ * b.out.c, coff-code.h, opncls.c, sunos.c: lint.
+
+ * coff-code.h (coff_slurp_symbol_table): Null-terminate symtab names.
+
+ * cplus-dem.c: Delete file, since it is not part of BFD.
+
+ * opncls.c (bfd_openr): Eliminate misplaced #if 0 code.
+ (bfd_openr, bfd_openw): Actually open the file, give error now.
+
+ * sunos.c (sunos4_core_file_p): Set section count.
+ (sunos4_set_section_linenos, stab_names, fprint_name): Eliminiate
+ obsolete definitions.
+ (_write_symbol_table): Initialize <idx> counter.
+ (foop): Eliminate debugging code.
+
+Local Variables:
+mode: change-log
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/contrib/binutils/bfd/ChangeLog-9495 b/contrib/binutils/bfd/ChangeLog-9495
new file mode 100644
index 000000000000..9868583cb4b6
--- /dev/null
+++ b/contrib/binutils/bfd/ChangeLog-9495
@@ -0,0 +1,10043 @@
+Thu Dec 21 12:43:49 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_howto_raw): Add a phony reloc to handle the
+ old style TOC16 references without using R_PPC_GOT.
+ (ppc_reloc_type): Ditto.
+ (ppc_elf_reloc_type_lookup): Add support for TOC16.
+ (ppc_elf_toc16_inner): Renamed from ppc_elf_got16_inner.
+ (ppc_elf_toc16_reloc): Renamed from ppc_elf_toc16_reloc.
+ (ppc_elf_got16_{inner,reloc}): Stubs for real GOT support.
+ (ppc_elf_check_relocs): New function for GOT/PLT support that is
+ work in progress.
+ (ppc_elf_adjust_dynamic_symbol): Ditto.
+ (ppc_elf_adjust_dynindx): Ditto.
+ (ppc_elf_size_dynamic_sections): Ditto.
+ (ppc_elf_finish_dynamic_symbol): Ditto.
+ (ppc_elf_finish_dynamic_sections): Ditto.
+ (ELF_DYNAMIC_INTERPRETER): Define.
+
+Wed Dec 20 19:14:18 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * elf.c (copy_private_bfd_data): When attaching sections to
+ segments ignore sections that won't be allocated. Patch from
+ Andreas Schwab.
+
+Tue Dec 19 20:01:43 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * config.bfd: Match on m68k-cbm-* only if OS doesn't match
+ anything else.
+
+Tue Dec 19 16:38:59 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-i960.c (CALC_ADDEND): Define.
+ (coff_i960_relocate_section): Add the input section VMA to the
+ addend for PC relative relocs.
+
+Sun Dec 17 20:11:55 1995 Kim Knuttila <krk@cygnus.com>
+
+ * peicode.h (pe_print_pdata): Must test the entire entry for zero
+ to correctly terminate.
+
+Fri Dec 15 12:05:57 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * targets.c (enum bfd_endian): Define.
+ (bfd_target): Rename byteorder_big_p to byteorder, and change it
+ from boolean to enum bfd_endian. Change header_byteorder_big_p
+ correspondingly.
+ * bfd-in.h (bfd_big_endian, bfd_little_endian): New macros.
+ (bfd_header_big_endian, bfd_header_little_endian): New macros.
+ * bfd-in2.h: Rebuild.
+ * All targets: Change initialization of byteorder and
+ header_byteorder to use enum bfd_endian values rather than
+ booleans.
+ * All files: Change all references to byteorder_big_p and
+ header_byteorder_big_p to use new bfd_*_endian macros.
+
+ * coffgen.c (make_a_section_from_file): Set lma to s_paddr, not
+ s_vaddr.
+ * coffcode.h (coff_write_object_contents): Set s_paddr to lma, not
+ vma.
+ * ecoff.c (_bfd_ecoff_write_object_contents): Likewise.
+
+Fri Dec 15 07:32:09 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * pe[i]-i386.c (TARGET_UNDERSCORE): Define to '_'.
+
+Thu Dec 14 13:45:37 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ieee.c: Lots of minor cleanups. Make many functions return
+ errors rather than calling abort. Also:
+ (ieee_write_twobyte): Remove; change callers to call existing
+ ieee_write_2bytes function.
+ (ieee_write_expression): Don't output the section twice when
+ outputting a local symbol. Don't emit an extraneous zero if there
+ is only one term.
+ (ieee_slurp_sections): Set the lma as well as the vma.
+ (ieee_archive_p): Use bfd_alloc_grow rather than an obstack.
+
+ * ihex.c (ihex_set_arch_mach): Don't accept any architecture, just
+ a recognized one or bfd_arch_unknown.
+ (ihex_get_symtab_upper_bound): Define as bfd_0l, to permit objcopy
+ to succeed.
+ (ihex_get_symtab): Likewise.
+
+Wed Dec 13 15:44:06 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * aoutx.h: Include <ctype.h>.
+ (struct aout_link_includes_table): Define.
+ (struct aout_link_includes_totals): Define.
+ (struct aout_link_includes_entry): Define.
+ (aout_link_includes_lookup): Define macro.
+ (struct aout_final_link_info): Add includes field.
+ (aout_link_includes_newfunc): New static function.
+ (NAME(aout,final_link)): Initialize includes hash table.
+ (aout_link_write_symbols): Eliminate duplicate N_BINCL entries.
+
+Wed Dec 13 10:52:14 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-config.in: Match on mips-*-* instead of mips-idt-ecoff.
+
+Wed Dec 13 11:07:45 1995 Kim Knuttila <krk@cygnus.com>
+
+ * coff-ppc.c (coff_ppc_relocate_section): removed debugging code.
+
+Tue Dec 12 17:42:06 1995 Kim Knuttila <krk@cygnus.com>
+
+ * peicode.h (pe_print_reloc): New function to dump the .reloc section.
+ (pe_print_private_bfd_data): call pe_print_reloc.
+ * coffcode.h (coff_set_alignment_hook): .reloc section alignment.
+ * coff-ppc.c (in_reloc_p): Added missing non-eligible relocs. Spiffed
+ up some debugging as well.
+
+Tue Dec 12 11:34:23 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * config.bfd: Handle sparc-*-elf*. From Ronald F. Guilmette
+ <rfg@monkeys.com>.
+
+Fri Dec 8 17:47:07 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_add_object_symbols): Set section_count to 0
+ when setting sections to NULL.
+
+Wed Dec 6 17:05:37 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (struct xcoff_loader_info): Add export_defineds
+ field.
+ (bfd_xcoff_size_dynamic_sections): Add export_defineds parameter.
+ (xcoff_build_ldsyms): If export_defineds is set, set XCOFF_EXPORT
+ for all symbols.
+ * bfd-in.h (bfd_xcoff_size_dynamic_sections): Update declaration.
+ * bfd-in2.h: Rebuild.
+
+Mon Dec 4 16:40:47 1995 Kim Knuttila <krk@cygnus.com>
+
+ * coffcode.h (coff_set_alignment_hook): Removed some debugging printf's
+
+Mon Dec 4 11:25:39 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ihex.c (ihex_scan): Handle record types 4 and 5.
+ (ihex_object_p): Permit types 4 and 5.
+ (ihex_set_section_contents): Remove check for out of range
+ addresses.
+ (ihex_write_object_contents): Generate types 4 and 5.
+
+ * elflink.h (elf_link_output_extsym): Just ignore warning and
+ indirect references to symbols which don't really exist.
+
+Sun Dec 3 19:00:27 1995 Kim Knuttila <krk@cygnus.com>
+
+ * peicode.h (pe_print_idata): Minor format fixes
+ (pe_print_edata): New function. Under private printing, this formats
+ the edata section of a PE file.
+ (pe_print_private_bfd_data): Added call to pe_print_edata.
+
+Sun Dec 3 16:46:54 1995 Richard Earnshaw (rearnsha@armltd.co.uk)
+
+ * aout-arm.c (MY_swap_std_reloc_out): Use KEEPIT to get the symbol
+ index, don't call stoi.
+
+Fri Dec 1 14:46:51 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * srec.c (srec_scan): Set lma as well as vma.
+
+ * ihex.c: New file; support for Intel Hex format.
+ * targets.c (enum bfd_flavour): Add bfd_target_ihex_flavour.
+ (ihex_vec): Declare.
+ (bfd_target_vector): Always include ihex_vec.
+ * bfd.c (struct _bfd): Add ihex_data field to tdata union.
+ * Makefile.in: Rebuild dependencies.
+ (BFD_LIBS): Add ihex.o
+ (BFD_LIBS_CFILES): Add ihex.c.
+ * bfd-in2.h: Rebuild.
+
+ * elf.c (assign_file_positions_for_segments): Sort the sections in
+ each segment.
+ (get_program_header_size): Return the right size if segment_map is
+ not NULL.
+ (copy_private_bfd_data): Don't bother to sort the sections.
+
+ * bfd.c (bfd_record_phdr): New function.
+ * bfd-in.h (bfd_record_phdr): Declare.
+ * bfd_in2.h: Rebuild.
+
+ * elf32-sparc.c (elf32_sparc_relocate_section): Remove bogus
+ BFD_ASSERT.
+
+ * libbfd.c (bfd_malloc, bfd_realloc): New functions.
+ (bfd_zmalloc): Return PTR, not char *. Take size_t, not
+ bfd_size_type.
+ * libbfd-in.h (bfd_malloc, bfd_realloc): Declare.
+ (bfd_zmalloc): Change declaration.
+ * libbfd.h: Rebuild.
+ * Many files: Use bfd_malloc and bfd_realloc rather than malloc
+ and realloc. Don't set bfd_error_no_memory if they fail.
+
+Thu Nov 30 19:32:26 1995 Kim Knuttila <krk@cygnus.com>
+
+ * coff-ppc.c: Added macros to tidy up toc cell treatment. Numerous
+ uses as well. Added a new howto to deal with TOCREL16 relocs that
+ are TOCDEFN as well.
+ (coff_ppc_relocate_section): Expanded treatment of ADDR32NB relocs
+ to handle RVA relocs from dlltool.
+ (ppc_coff_rtype2howto): TOCDEFN reloc addition.
+ (coff_ppc_rtype_to_howto): TOCDEFN reloc addition.
+ (ppc_coff_reloc_type_lookup): TOCDEFN reloc addition.
+
+ * coffcode.h (coff_set_alignment_hook): check idata$X sections
+ to get the right section alignment.
+
+Thu Nov 30 16:48:18 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (_bfd_elf_make_section_from_shdr): Don't set lma based on
+ p_paddr if p_paddr is zero.
+ (make_mapping): Set includes_filehdr and includes_phdrs for first
+ PT_LOAD segment.
+ (map_sections_to_segments): Set includes_phdrs for PT_PHDR
+ segment.
+ (assign_file_positions_for_segments): Handle includes_filehdr and
+ includes_phdrs. Remove special handling of PT_PHDR and first
+ PT_LOAD segments.
+ (copy_private_bfd_data): Set includes_filehdr and includes_phdr
+ when appropriate. Remove special handling of PT_PHDR segment.
+ Use a more complex condition for when a section is included in a
+ segment to handle Solaris linker oddities.
+
+Thu Nov 30 11:17:33 1995 Manfred Hollstein KS/EF4A 60/1F/110 #40283 <manfred@lts.sel.alcatel.de>
+
+ * coff-m88k.c (howto_table): Reformatted for easier reading;
+ special_function now points to new function m88k_special_reloc.
+ (howto_hvrt16): Function previously used for handling HVRT16 relocs
+ removed.
+ (rtype2howto): Do not add reloc's r_offset to the addend, this will
+ be done correctly by m88k_special_reloc.
+ (reloc_processing): New function to be used by RELOC_PROCESSING.
+ (RELOC_PROCESSING): Define to call reloc_processing.
+
+Wed Nov 29 12:42:36 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * peicode.h (pe_print_idata): Call malloc rather than xmalloc.
+ (pe_print_pdata): Likewise.
+
+ * opncls.c (bfd_alloc_by_size_t): Set bfd_error_no_memory if
+ obstack_alloc fails.
+ (bfd_alloc_finish): Set bfd_error_no_memory if obstack_finish
+ fails.
+ * libbfd.c (bfd_zmalloc): Set bfd_error_no_memory if malloc fails.
+ * Many files: don't set bfd_error_no_memory if one of the above
+ routines fails.
+
+ * elf.c (assign_file_positions_for_segments): Don't adjust p_paddr
+ if p_paddr_valid is set.
+ (copy_private_bfd_data): New static function.
+ (_bfd_elf_copy_private_section_data): Call copy_private_bfd_data.
+
+ * elf.c (assign_file_positions_for_segments): Fix case where extra
+ program headers were allocated.
+
+ * elf.c (_bfd_elf_print_private_bfd_data): New function.
+ * elf-bfd.h (_bfd_elf_print_private_bfd_data): Declare.
+ * elfxx-target.h (bfd_elfNN_bfd_print_private_bfd_data): Define to
+ _bfd_elf_print_private_bfd_data.
+
+ * coff-alpha.c (alpha_ecoff_swap_reloc_in): Don't abort if
+ r_symndx is RELOC_SECTION_NONE for an ALPHA_R_IGNORE reloc.
+ Change a RELOC_SECTION_LITA symndx to RELOC_SECTION_ABS.
+ (alpha_ecoff_swap_reloc_out): Change RELOC_SECTION_ABS to
+ RELOC_SECTION_LITA for ALPHA_R_IGNORE.
+ (alpha_adjust_reloc_out): For ALPHA_R_IGNORE, don't change
+ RELOC_SECTION_ABS to RELOC_SECTION_NONE.
+
+Tue Nov 28 16:59:50 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf-bfd.h (struct elf_obj_tdata): Add segment_map field.
+ * elf.c (make_mapping): New static function.
+ (map_sections_to_segments): New static function.
+ (elf_sort_sections): New static function.
+ (assign_file_positions_for_segments): New static function.
+ (map_program_segments): Remove.
+ (get_program_header_size): Remove sorted_hdrs, count, and
+ maxpagesize parameters. Simplify.
+ (assign_file_positions_except_relocs): When generating an
+ executable, use assign_file_positions_for_segments.
+ (elf_sort_hdrs): Remove.
+ (_bfd_elf_sizeof_headers): Remove eliminated parameters from call
+ to get_program_header_size.
+
+Mon Nov 27 12:27:46 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * hp300hpux.c (MY(callback)): Set lma as well as vma.
+
+ * configure, config.in: Regenerate with autoconf 2.7.
+
+ * elf32-i386.c (elf_backend_plt_readonly): Set correctly, to 1.
+ * elf32-sparc.c (elf_backend_plt_readonly): Set correctly, to 0.
+
+Wed Nov 22 12:02:09 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ecoff.c (_bfd_ecoff_new_section_hook): Handle .rconst section.
+ (ecoff_sec_to_styp_flags): Likewise.
+ (_bfd_ecoff_styp_to_sec_flags): Handle STYP_RCONST.
+ (ecoff_set_symbol_info): Handle scRConst.
+ (ecoff_slurp_reloc_table): Handle RELOC_SECTION_RCONST.
+ (ecoff_compute_section_file_positions): Handle .rconst section.
+ (_bfd_ecoff_write_object_contents): Likewise.
+ (ecoff_link_check_archive_element): Handle scRConst.
+ (ecoff_link_add_externals): Likewise.
+ (ecoff_link_write_external): Handle .rconst section.
+ (ecoff_reloc_link_order): Likewise.
+ * ecofflink.c (bfd_ecoff_debug_accumulate): Handle scRConst.
+ * coff-alpha.c (alpha_convert_external_reloc): Handle .rconst
+ section.
+ (alpha_relocate_section): Handle RELOC_SECTION_RCONST.
+
+ * sunos.c (sunos_scan_dynamic_symbol): Only set written if the
+ DEF_DYNAMIC flag is set.
+
+Tue Nov 21 13:25:29 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * host-aout.c: If TRAD_HEADER is defined, include it.
+
+Tue Nov 21 13:03:57 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * aclocal.m4 (AC_PROG_CC): Remove local definition.
+ (BFD_BINARY_FOPEN): Require AC_CANONICAL_SYSTEM.
+ (BFD_NEED_DECLARATION): New function.
+ * configure.in: Use BFD_NEED_DECLARATION.
+ * acconfig.h: Put NEED_DECLARATION_* in @TOP@ section.
+ * configure, config.in: Rebuild with autoconf 2.6.
+
+ * xcofflink.c (bfd_xcoff_size_dynamic_sections): Clear
+ special_sections before returning when called with a non XCOFF
+ BFD.
+
+ * coffgen.c (coff_renumber_symbols): Sort common symbols with
+ global symbols.
+
+ * coffcode.h (coff_compute_section_file_positions): Only pad the
+ previous section to force file alignment when creating an
+ executable.
+
+Mon Nov 20 14:54:09 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffcode.h (coff_compute_section_file_positions): If
+ RS6000COFF_C, set up the .debug section.
+
+ * xcofflink.c (xcoff_link_input_bfd): Adjust the TOC anchor value
+ if it is not large enough to accomodate the entire TOC area with
+ signed 16 bit offsets.
+ (xcoff_write_global_symbol): Handle negative TOC offsets in global
+ linkage code.
+ (_bfd_ppc_xcoff_relocate_section): Adjust relocations against a
+ TOC anchor to use the TOC value used in the output file.
+
+Sat Nov 18 18:01:41 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffgen.c (_bfd_coff_get_external_symbols): Cast malloc return.
+ (_bfd_coff_read_string_table): Likewise.
+
+Sat Nov 18 19:43:04 1995 Richard Earnshaw (rearnsha@armltd.co.uk)
+
+ * pe-arm.c: Fix typos.
+ * coff-arm.c: Likewise.
+
+Fri Nov 17 16:22:04 1995 Kim Knuttila <krk@cygnus.com>
+
+ * coff-ppc.c (list_ele): Added "cat"egory member.
+ (record_toc): New category parameter (priv or pub).
+ (ppc_record_toc_entry): Check to see if toc bounds exceeded.
+ (ppc_process_before_allocation): Removed embrionic data-in-toc from
+ the mainline. It addes extra toc cells in error.
+ (ppc_coff_swap_sym_in_hook): Added some documentation.
+ (dump_toc): Can now diagnose "virtual toc" chicanery.
+
+Fri Nov 17 10:41:25 1995 Philippe De Muyter <phdm@info.ucl.ac.be>
+
+ * elf-bfd.h (struct elf_link_hash_table): Change type of
+ dynsymcount and bucketcount fields from size_t to bfd_size_type.
+
+Fri Nov 17 10:02:58 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffcode.h (coff_pointerize_aux_hook): I960 version: don't
+ pointerize C_LEAFSTAT or C_LEAFEXT entries.
+
+ * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Only create
+ DT_INIT and DT_FINI entries if the _init or _fini symbol is
+ defined or mentioned in a regular file.
+
+Thu Nov 16 15:16:42 1995 Kim Knuttila <krk@cygnus.com>
+
+ * coff-ppc.c (ppc_record_data_in_toc_entry): new function
+ (coff_ppc_relocate_section): Handle TOCDEFN attribute
+ (coff_ppc_relocate_section): Correct REL24 handling
+ (ppc_process_before_allocation): Correct TOCDEFN handling
+
+ * peicode.h (dir_names): Added name descriptions
+
+Thu Nov 16 03:38:03 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * VERSION: Updated to cygnus-2.6.
+
+Wed Nov 15 19:30:07 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * targets.c (m68k4knetbsd_vec): Declare.
+
+Wed Nov 15 18:05:52 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * targets.c (bfd_target): Change type of second argument to
+ _bfd_print_private_bfd_data from void * to PTR.
+ * libbfd-in.h (_bfd_generic_bfd_print_private_bfd_data): Cast
+ using PTR rather than void *.
+ * bfd-in2, libbfd.h: Rebuild.
+ * peicode.h (pe_print_private_bfd_data): Change vfile from void *
+ to PTR.
+ * elfxx-target.h (bfd_elfNN_bfd_print_private_bfd_data): Define as
+ _bfd_generic_bfd_print_private_bfd_data rather than casting
+ bfd_true.
+
+Wed Nov 15 04:09:14 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * Makefile.in (.dep1): Fix stupid typo in last change. Remove any
+ "DO NOT DELETE" lines or blank lines that mkdep writes on some
+ systems.
+ (BFD_LIBS_CFILES, ALL_MACHINES_CFILES, BFD32_BACKENDS_CFILES,
+ BFD64_BACKENDS_CFILES): New variables.
+ (CFILES): Use them.
+
+Tue Nov 14 11:52:23 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * peicode.h (coff_swap_aouthdr_out): For PPC PE, start isize at 0,
+ not at the file position of the first section.
+ * coffcode.h (coff_compute_section_file_positions): Avoid using
+ unportable #elif.
+ (coff_write_object_contents): When generating a PPC PE executable
+ with no symbols, round up the file size to a COFF_PAGE_SIZE
+ boundary.
+ * cofflink.c (_bfd_coff_final_link): If there are no symbols,
+ don't write out a string table.
+
+ * elf.c (bfd_section_from_shdr): When using a different section
+ header, pass the new one to _bfd_elf_make_section_from_shdr.
+ (elf_fake_sections): Don't set sh_info and sh_entsize fields.
+ (elf_map_symbols): Add section VMA to symbol value when comparing
+ against 0.
+ (_bfd_elf_compute_section_file_positions): Only build symbol table
+ if there are some symbols. Set file offset of symtab and strtab
+ sections.
+ (assign_file_positions_except_relocs): Remove dosyms parameter.
+ Change all callers. Never set file offset of symtab and strtab
+ sections.
+ (_bfd_elf_copy_private_section_data): New function.
+ (MAP_ONESYMTAB, MAP_DYNSYMTAB, MAP_STRTAB, MAP_SHSTRTAB): Define.
+ (_bfd_elf_copy_private_symbol_data): New function.
+ (swap_out_syms): Check for special mapping of st_shndx created by
+ copy_private_symbol_data.
+ * elfxx-target.h: Use new copy routines.
+ * elf-bfd.h (_bfd_elf_copy_private_symbol_data): Declare.
+ (_bfd_elf_copy_private_section_data): Declare.
+
+ * config.bfd (sh-*-*): Set targ_defvec to shcoff_vec.
+
+ * coffcode.h (coff_slurp_symbol_table): If COFF_WITH_PE, handle
+ C_NT_WEAK.
+
+ * coff-sh.c (shlcoff_vec): Use _bfd_generic_archive_p, not
+ _bfd_dummy_target, matching the recent change to archive
+ recognition.
+
+Mon Nov 13 13:24:38 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * libbfd.c (bfd_get_file_window): Use casts to avoid doing
+ arithmetic on PTR types.
+
+ * aout-target.h (MY(callback)): Set the lma of the sections.
+
+ * ecoff.c (ecoff_reloc_link_order): Turn a reloc against a defined
+ symbol into a reloc against the section.
+
+Mon Nov 13 07:31:35 1995 Kim Knuttila <krk@cygnus.com>
+
+ * coff-ppc.c (ppc_coff_link_hash_entry): added support for inline
+ glue for the relocs: IMGLUE and IFGLUE.
+ (record_toc): new function - tracks toc contents
+ (ppc_mark_symbol_as_glue): new function - supports the IMGLUE reloc
+ (coff_ppc_relocate_section): Added support and fixes for IMGLUE/IFGLUE
+ (ppc_coff_rtype2howto): removed invalid IMGLUE hack
+ (coff_ppc_rtype_to_howto): removed invalid IMGLUE hack
+ (ppc_record_toc_entry): Removed a debug define (duh)
+
+ * peicode.h (coff_swap_scnhdr_out): Fixed invalid strcmp for ".reldata"
+ (pe_print_idata): New function - formats the idata section data
+ (pe_print_pdata): New function - formats the pdata section data
+ (pe_print_private_bfd_data): calls to above
+
+Sun Nov 12 12:23:24 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * Makefile.in (bfd_libs_here, etc): Provide empty definitions.
+ * coff-rs6000.c (rs6000coff_vec): Add conditional defines
+ TARGET_SYM and TARGET_NAME for vector and BFD name.
+ * coff-pmac.c (pmac_xcoff_vec): Remove.
+ (TARGET_SYM, TARGET_NAME): Define.
+ * coffcode.h (coff_set_arch_mach_hook) [POWERMAC]: Set the
+ machine to 0, not all PowerMacs are 601s.
+
+Fri Nov 10 12:10:14 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * elfcode.h (elf_object_p): Read in any program headers.
+ * elf.c (_bfd_elf_make_section_from_shdr): Adjust section lma
+ based on the program headers, if any.
+ (elf_fake_sections): Set sh_addr from the vma, not the lma.
+ (map_program_segments): Set p_paddr of program headers based on
+ the lma.
+
+Thu Nov 9 13:01:31 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * archive.c (bfd_generic_archive_p): Preserve tdata in case of
+ failure.
+
+ * aoutx.h (NAME(aout,final_link)): Report a reasonable error when
+ trying to do a relocateable link with a non-a.out object file.
+
+ * archive.c (bfd_generic_archive_p): Check the first object file
+ in an archive even if target_defaulted is set. If the object file
+ has the wrong xvec, reject it.
+
+ * aoutx.h (NAME(aout,set_section_contents)): If a section can not
+ be represented, report the name via _bfd_error_handler.
+ (translate_to_native_sym_flags): Likewise.
+ * elf32-mips.c (mips_elf_final_link): Likewise.
+ * oasys.c (oasys_write_sections): Likewise.
+
+ * coffcode.h (coff_set_alignment_hook): Write RS6000COFF_C version
+ which checks for STYP_OVRFLO sections.
+ (coff_compute_section_file_positions): If RS6000COFF_C, handle
+ reloc and lineno count overflows.
+ (coff_write_object_contents): Call coff_count_linenumbers before
+ coff_compute_section_file_positions. If RS6000COFF_C, handle
+ reloc and lineno count overflows.
+ * xcofflink.c (_bfd_xcoff_bfd_final_link): Count line numbers and
+ relocs before dealing with .pad sections. Count overflow section
+ headers when handling .pad sections.
+
+ * coffcode.h (coff_write_object_contents): Set a.out vstamp to 1
+ if RS6000COFF_C.
+
+ * xcofflink.c (XCOFF_DESCRIPTOR): Define.
+ (struct xcoff_link_hash_table): Add descriptor_section and
+ special_sections fields.
+ (_bfd_xcoff_bfd_link_hash_table_create): Initialize new fields.
+ (xcoff_link_add_symbols): Set linkage section alignment. Create
+ descriptor section. Check for magic symbol names (_text, etc.),
+ and record them in special_sections if found. Set
+ XCOFF_DESCRIPTOR flag for a function descriptor, and set its
+ descriptor field to point back to the function code symbol.
+ (xcoff_sweep): Always mark the special descriptor_section.
+ (bfd_xcoff_export_symbol): Check whether the symbol might be a
+ function descriptor, and mark it if it is.
+ (bfd_xcoff_size_dynamic_sections): Add new special_sections
+ parameter, and fill it in. Allocate space for the descriptor
+ section.
+ (xcoff_build_ldsyms): Set XCOFF_DEF_REGULAR flag when defining
+ global linkage code. If an undefined function descriptor is
+ exported, arrange to define it. Warn about any other undefined
+ exported symbol.
+ (_bfd_xcoff_bfd_final_link): Write out the descriptor section.
+ (xcoff_write_global_symbol): Create a function descriptor when
+ necessary.
+ * bfd-in.h (bfd_xcoff_size_dynamic_sections): Update declaration.
+ * bfd-in2.h: Rebuild.
+
+Thu Nov 9 08:40:23 1995 Kim Knuttila <krk@cygnus.com>
+
+ * coff-ppc.c (ppc_coff_link_hash_entry): new types for hashing
+ (ppc_coff_link_hash_table): new types for hashing
+ (ppc_coff_link_hash_newfunc): hash entry constructor
+ (ppc_coff_link_hash_table_init): hash table initializer
+ (ppc_coff_link_hash_table_create): hash table constructor
+ (ppc_record_toc_entry): changed references to hash table
+ (coff_ppc_relocate_section): changed references to hash table
+
+ * libcoff-in.h (coff_link_hash_entry): removed toc_offset
+ * libcoff.h: Rebuild
+
+ * cofflink.c (_bfd_coff_link_hash_newfunc): removed toc_offset init
+ (coff_link_add_symbols): removed toc_offset init
+
+Thu Nov 9 04:00:38 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * Makefile.in (.dep1): Make sure the file mkdep is to write exists
+ first.
+
+ * configure.in: Added new option --with[out]-mmap. Set USE_MMAP
+ if it is given and mmep is available.
+ * acconfig.h: Undef USE_MMAP.
+ * configure, config.in: Regenerated.
+ * aoutx.h: If USE_MMAP is not defined, do all symbol and string
+ table handling the old way.
+ (aout_get_external_symbols): Don't complain if last byte of string
+ table is nonzero.
+ * libbfd.c [HAVE_MADVISE]: Include sys/types.h and sys/mman.h.
+ (bfd_free_window) [! USE_MMAP]: Don't define.
+ (bfd_get_file_window,
+ _bfd_generic_get_section_contents_in_window) [! USE_MMAP]: Abort.
+
+Wed Nov 8 20:03:44 1995 Eric Freudenthal <freudenthal@nyu.edu>
+
+ * coff-a29k.c (SIGN_EXTEND_HWORD): Use ~0xffff rather than
+ 0xffff0000.
+
+Wed Nov 8 11:31:11 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-a29k.c (a29k_reloc): Change handling of R_IREL reloc to be
+ compatible with AMD generated COFF files. Try to support both AMD
+ and GNU formats simultaneously.
+ (coff_a29k_relocate_section): Likewise.
+
+ * libbfd.c (bfd_get_file_window): Change writable parameter from
+ int to boolean; update all callers. Pass MAP_SHARED if not
+ writable--it's required on Solaris. Cast fprintf argument to
+ avoid warning.
+ * bfd-in.h (bfd_get_file_window): Update declaration.
+ * bfd-in2.h: Rebuild.
+ * aoutx.h: Update calls to bfd_get_file_window.
+
+ * xcofflink.c (XCOFF_DEF_DYNAMIC): Rename from XCOFF_REF_DYNAMIC.
+ Change all uses.
+ (xcoff_swap_ldhdr_in): New static function.
+ (xcoff_swap_ldsym_in): New static function.
+ (xcoff_find_reloc): Handle the case of a single reloc correctly.
+ (xcoff_link_add_symbols): If we just created a descriptor, pass it
+ to _bfd_generic_link_add_one_symbol, to save a hash lookup.
+ Handle XTY_ER/XMC_XO symbols correctly.
+ (xcoff_link_add_dynamic_symbols): Rewrite to read .loader symbols
+ rather than normal symbol table.
+ (bfd_xcoff_import_symbol): It's not an error if the symbol is
+ already defined with the same absolute value.
+ (xcoff_mark): When considering called symbols, check whether the
+ descriptor is from a dynamic object, rather than the symbol
+ itself.
+ (xcoff_build_ldsyms): Likewise.
+
+ * libbfd.c (bfd_get_file_window): Change return type to boolean.
+ Cast realloc and malloc return values. If malloc or realloc fail,
+ set bfd_error_no_memory.
+ * bfd-in.h (bfd_get_file_window): Change type to boolean.
+ * bfd-in2.h: Rebuild.
+
+Tue Nov 7 11:53:48 1995 Kim Knuttila <krk@cygnus.com>
+
+ * coff-ppc.c (ppc_record_toc_entry): new function.
+ (in_reloc_p): changed return value.
+ (coff_ppc_relocate_section): much rework.
+ (ppc_allocate_toc_section): new function.
+ (ppc_process_before_allocation): new function.
+ (ppc_coff_swap_sym_in_hook): new function.
+
+ * cofflink.c (_bfd_coff_link_hash_newfunc): initialize toc_offset.
+ (coff_link_add_symbols): initialize toc_offset.
+
+ * peicode.h (coff_swap_sym_in): Added coff_swap_sym_in_hook
+ (coff_swap_aouthdr_out): Added more sections to the data
+ dictionary for the pe file header. Also changed linker version
+ number on the ppc side.
+ (dir_names): small improvements to the dictionary printing.
+ (pe_mkobject_hook): save the file level flags.
+
+ * libcoff-in.h (coff_link_hash_entry): added toc_offset field
+ (pe_tdata): added real_flags field
+ (coff_tdata): added local_toc_sym_map and access macro
+
+ * libcoff.h (coff_link_hash_entry): added toc_offset field
+ (pe_tdata): added real_flags field
+ (coff_tdata): added local_toc_sym_map and access macro
+
+ * coffcode.h (coff_set_alignment_hook): added hook for PE.
+ (coff_mkobject): init for local_toc_sym_map
+ (coff_write_object_contents): set the internal_a.magic to
+ IMAGE_NT_OPTIONAL_HDR_MAGIC which appears to be what other
+ ppc compilers use.
+
+Tue Nov 7 13:48:58 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ecofflink.c (_bfd_ecoff_locate_line): Keep looking through stabs
+ entries until both the line number address and the function name
+ address are too large.
+
+ * configure.in: Call AC_CHECK_PROG to find and cache AR.
+ * configure: Rebuilt.
+
+ * aclocal.m4 (BFD_CC_FOR_BUILD): Don't define CC_FOR_BUILD if it
+ is defined in the environment.
+
+Tue Nov 7 10:57:24 1995 Jeffrey A Law (law@cygnus.com)
+
+ * som.c (som_get_section_contents_in_window): Define to use
+ generic version.
+
+Mon Nov 6 17:13:15 1995 Harry Dolan <dolan@ssd.intel.com>
+
+ * coff-i860.c: New file, based on coff-i386.c.
+ * cpu-i860.c: New file, based on cpu-i386.c.
+ * hosts/i860mach3.h: New file, based on hosts/i386mach3.h.
+ * config.bfd (i860-*-mach3*, i860-*-osf1*, i860-*-coff*): New
+ targets, using i860coff_vec.
+ * configure.in (i860-*-mach3*, i860-*-osf1*): New hosts, using
+ trad-core.o and hosts/i860mach3.h.
+ (i860coff_vec): Use coff-i860.o and cofflink.o.
+ * configure: Rebuild.
+ * Makefile.in: Rebuild dependencies.
+ (ALL_MACHINES): Add cpu-i860.o.
+ (BFD32_BACKENDS): Add coff-i860.o.
+ (CFILES): Add cpu-i860.c and coff-i860.c.
+ * targets.c (i860coff_vec): Declare.
+ (bfd_target_vector): Add &i860coff_vec.
+ * archures.c (bfd_i860_arch): Declare.
+ (bfd_archures_list): Add &bfd_i860_arch.
+ * coffcode.h (coff_set_arch_mach_hook): Handle I860 magic number.
+ (coff_set_flags): Handle bfd_arch_i860.
+ (coff_write_object_contents): Handle I860 a.out magic number.
+
+Mon Nov 6 14:34:07 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (xcoff_link_add_symbols): Set the alignment power of
+ the created .tc section to 2.
+ (xcoff_mark): Don't keep a .loader reloc for a call to an
+ undefined symbol when creating a shared library.
+ (xcoff_build_ldsyms): When creating a shared library, generate
+ global linkage code for a call to an undefined symbol.
+
+Sun Nov 5 21:44:13 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * Makefile.in (CFILES): Rebuild list from BFD_LIBS, ALL_MACHINES,
+ BFD32_BACKENDS, BFD64_BACKENDS.
+ (.dep1): Put mkdep output in a separate file.
+ Rebuilt dependencies.
+
+ * ecoff.c (_bfd_ecoff_slurp_armap): Cast _bfd_read_ar_hdr return
+ value.
+
+ Permit use of mmap when available:
+
+ * configure.in: Check for mmap, madvise, mprotect.
+ * config.in, configure: Regenerated.
+
+ * libbfd.c (struct _bfd_window_internal): Define type.
+ (bfd_init_window, bfd_free_window, bfd_get_file_window): New
+ functions.
+ (ok_to_map): New static variable for debugging.
+ (_bfd_generic_get_section_contents_in_window): New function.
+ * bfd-in.h (bfd_window_internal): Declare type.
+ (bfd_window): Define type.
+ (bfd_init_window, bfd_free_window, bfd_get_file_window): Declare.
+ * libbfd-in.h (_bfd_generic_get_section_contents_in_window):
+ Declare.
+
+ * libaout.h (struct aoutdata): Add two window fields.
+ (obj_aout_sym_window, obj_aout_string_window): New macros.
+ * aoutx.h (some_aout_object_p): Initialize windows.
+ (aout_get_external_symbols): Get symbol data and strings in
+ windows instead of explicitly allocated buffers.
+ (slurp_symbol_table): Free window instead of memory.
+ (bfd_free_cached_info): Release windows instead of freeing storage
+ directly.
+ (aout_link_free_symbols): Ditto.
+
+ * targets.c (bfd_target): Add new field for
+ get_section_contents_in_window.
+ (BFD_JUMP_TABLE_GENERIC): Updated.
+ * aout-adobe.c, aout-target.h, binary.c, bout.c, coff-alpha.c,
+ coff-mips.c, elfxx-target.h, i386msdos.c, i386os9k.c, ieee.c,
+ libcoff-in.h, oasys.c, srec.c, tekhex.c, versados.c: Added new
+ macros for get_section_contents_in_window field.
+
+Sat Nov 4 12:23:26 1995 Fred Fish <fnf@cygnus.com>
+
+ * core.c: Renamed to corefile.c
+ * makefile.dos (OBJS): Change core.o to corefile.o
+ * Makefile.in (CFILES, BFD_LIBS): Use corefile.c instead of core.c
+
+Fri Nov 3 15:54:59 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (xcoff_link_add_symbols): Rename local variable sub
+ to o. Clobber and restore the list of new csects around the call
+ to _bfd_generic_link_add_one_symbol, in case it wants to report a
+ linker error and the linker wants to read the symbol table. Reset
+ the line number count of a real section even if it has no relocs.
+ (_bfd_xcoff_bfd_final_link): If shared, set the DYNAMIC flag.
+
+ * coffgen.c (_bfd_coff_read_string_table): Warn if the string size
+ is too small.
+
+Thu Nov 2 23:16:39 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (_bfd_ppc_xcoff_relocate_section): Don't warn about
+ an undefined symbol in a shared link.
+
+ * linker.c (_bfd_generic_link_add_one_symbol): Correct type of
+ oldtype from bfd_link_order_type to bfd_link_hash_type. From
+ phdm@info.ucl.ac.be (Philippe De Muyter).
+
+Wed Nov 1 14:26:02 1995 Manfred Hollstein KS/EF4A 60/1F/110 #40283 <manfred@lts.sel.alcatel.de>
+
+ * coff-m88k.c (rtype2howto): New static function.
+ (RTYPE2HOWTO): Use it rather than a macro definition.
+
+ * coffcode.h (coff_write_object_contents): set internal_a.magic
+ to PAGEMAGICPEXECPAGED #if defined (M68) && !defined (LYNXOS).
+
+ * configure.in: m68*-motorola-sysv* does not use ptrace-core.o;
+ define TRAD_HEADER to new file hosts/delta68.h.
+ m88*-motorola-sysv*, however, does use ptrace-core.o.
+ * hosts/delta68.h: New file.
+
+ * ptrace-core.c (ptrace_unix_core_file_p): change bfd_zmalloc to
+ bfd_zalloc; provide proper parm abfd to calls to bfd_zalloc.
+
+Wed Nov 1 13:51:54 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * i386linux.c (MY(vec)): Declare before use.
+
+Wed Nov 1 11:45:07 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * reloc16.c (bfd_coff_reloc16_get_relocated_section_contents):
+ Pass input_bfd, not in_bfd, to bfd_coff_reloc16_extra_cases.
+
+ * elf.c (bfd_elf_set_dt_needed_name): Don't do anything if the
+ BFD is not of the right type.
+ (bfd_elf_get_needed_list): Likewise.
+ * i386linux.c (bfd_linux_size_dynamic_sections): Likewise.
+ * sunos.c (bfd_sunos_get_needed_list): Likewise.
+ * xcofflink.c (XCOFF_XVECP): Define.
+ (bfd_xcoff_link_record_set): Don't do anything if the BFD is not
+ of the right type.
+ (bfd_xcoff_import_symbol): Likewise.
+ (bfd_xcoff_export_symbol): Likewise.
+ (bfd_xcoff_link_count_reloc): Likewise.
+ (bfd_xcoff_record_link_assignment): Likewise.
+ (bfd_xcoff_size_dynamic_sections): Likewise.
+
+ * sunos.c (sunos_scan_ext_relocs): Only check the reloc symbol
+ table index against the number of symbols for a base relative
+ reloc.
+
+ * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Change from macro to
+ static function.
+ * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Set
+ full_aouthdr flag here...
+ (_bfd_xcoff_bfd_final_link): ...not here.
+
+Tue Oct 31 12:52:02 1995 Fred Fish <fnf@cygnus.com>
+
+ * libelf.h: Rename to elf-bfd.h to avoid conflict with
+ 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.
+
+Tue Oct 31 15:30:07 1995 David Mosberger-Tang <davidm@azstarnet.com>
+
+ * ecoff.c (ecoff_set_symbol_info): Add new parameter weak. If
+ set, set BSF_WEAK in symbol. Change all callers.
+ (ecoff_get_extr): Set weakext based on BSF_WEAK.
+ (ecoff_link_add_externals): If weakext is set, pass BSF_WEAK to
+ _bfd_generic_link_add_one_symbol.
+ (ecoff_indirect_link_order): Check that the section tdata relocs
+ are not NULL before using them.
+
+ * configure.in (alpha*-*-linux*): Set COREFILE to trad-core.o and
+ define TRAD_HEADER as hosts/alphalinux.h.
+ * configure: Rebuild.
+ * hosts/alphalinux.h: New file.
+ * trad-core.c (trad_unix_core_file_p): Cast u.u_ar0 to bfd_vma,
+ not int.
+
+Tue Oct 31 12:34:11 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffcode.h (coff_slurp_symbol_table): Accept C_BCOMM and
+ C_ECOMM storage classes.
+
+ * xcofflink.c (xcoff_mark_symbol): New static function, broken out
+ of xcoff_mark.
+ (xcoff_mark): Call xcoff_mark_symbol.
+ (bfd_xcoff_export_symbol): Call xcoff_mark_symbol.
+ (bfd_xcoff_link_count_reloc): Call xcoff_mark_symbol rather than
+ doing it by hand.
+ (xcoff_build_ldsyms): Build a .loader symbol for an export symbol.
+
+Mon Oct 30 14:53:48 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (struct xcoff_final_link_info): Add new line_filepos
+ field.
+ (xcoff_find_reloc): New static function.
+ (xcoff_link_add_symbols): Use it.
+ (_bfd_xcoff_bfd_final_link): Set finfo.line_filepos.
+ (xcoff_link_input_bfd): Handle C_BINCL and C_EINCL. Don't
+ relocate the value of C_DECL.
+
+ * elf.c (elf_fake_sections): Remove bogus BFD_ASSERT.
+
+Sat Oct 28 01:25:34 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * cofflink.c (_bfd_coff_generic_relocate_section): Make
+ callback decide what goes in .relocs.
+ * pe[i]-i386.c (TARGET_UNDERSCORE): Define.
+ * peicode.h (pe_mkobject_hook): Only copy aouthdr if
+ there is one.
+
+Sat Oct 28 01:51:02 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (xcoff_link_add_symbols): Handle csects in the
+ absolute section.
+
+Fri Oct 27 18:14:39 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c: More improvements, mostly to fix handling of
+ constructors and a few other special cases.
+ * coff-rs6000.c (rs6000coff_vec): Set symbol_leading_char back to
+ zero, reverting yesterday's change.
+ * bfd-in.h (bfd_xcoff_link_record_set): Declare.
+ (bfd_xcoff_link_count_reloc): Declare.
+ (bfd_xcoff_record_link_assignment): Declare.
+ * bfd-in2.h: Rebuild.
+
+Fri Oct 27 14:42:15 1995 Niklas Hallqvist <niklas@appli.se>
+
+ * PORTING, aout-arm.c, aout-encap.c, aout-target.h,
+ aoutx.h, gen-aout.c, host-aout.c, hp300bsd.c, i386aout.c
+ i386bsd.c, i386dynix.c, i386linux.c, i386lynx.c, i386mach3.c,
+ i386netbsd.c, m68klynx.c, m88kmach3.c, mipsbsd.c, newsos3.c,
+ ns32knetbsd.c, pc532-mach.c, riscix.c, sparclynx.c, sparcnetbsd.c:
+ Change PAGE_SIZE to TARGET_PAGE_SIZE.
+
+ * m68knetbsd.c: Ditto as well as add support for the m68k4k object
+ format.
+
+ * netbsd.h: Double ditto (incl. m68k4k support). NetBSD's text
+ segments includes the a.out header. See to that the magic number
+ *always* is big-endian.
+
+ * config.bfd: Add m68*-hp*-netbsd* case. Cross-pollinate m68k and
+ m68k4k NetBSD configurations.
+
+ * configure.in, configure: Separate i386 & mips NetBSD
+ configurations from other BSD ones. Don't assume DEC is the only
+ thing NetBSD/mips run on. Add {m68k,ns32k,sparc}-*-netbsd*
+ configurations. Add support for m68k4k NetBSD object format.
+
+ * libaout.h: Added M_68K4K_NETBSD magic.
+
+ * m68k4knetbsd.c: New file.
+
+ * hosts/{m68k,sparc}nbsd.h: Don't define HOST_BIG_ENDIAN_P.
+
+ * hosts/nbsd.h: Define HOST_BIG_ENDIAN_P according to
+ <machine/endian.h>.
+
+ * hosts/mipsnbsd.h: New file.
+
+Thu Oct 26 14:16:47 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c: Numerous changes to get closer to a working XCOFF
+ linker.
+ * libcoff-in.h (struct xcoff_tdata): Add full_aouthdr,
+ toc_section, and entry_section fields.
+ (struct xcoff_section_tdata): Remove ldrel_count field.
+ * libcoff.h: Rebuild.
+ * coffcode.h (coff_mkobject_hook): Initialize new xcoff_data
+ fields.
+ (coff_compute_section_file_positions): If RS6000COFF_C, generate
+ full a.out header if full_aouthdr is set in xcoff_data.
+ (coff_write_object_contents): Likewise. Set o_snentry and o_sntoc
+ based on sections stored in xcoff_data.
+ * coff-rs6000.c (xcoff_copy_private_bfd_data): Copy new xcoff_data
+ fields.
+ (xcoff_reloc_type_lookup): Handle BFD_RELOC_CTOR.
+ (rs6000coff_vec): Set symbol_leading_char to '.'.
+ * coffgen.c (coff_get_symbol_info): If fix_value is set, fix the
+ value stored in ret rather than returning a pointer value.
+
+Wed Oct 25 23:10:39 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config.bfd (powerpc{,le}-{elf,sysv4,eabi,solaris2}): Remove MAC
+ format for now.
+
+Wed Oct 25 16:19:27 1995 Jeffrey A Law (law@cygnus.com)
+
+ * som.c (som_slurp_string_table): Allocate the strings with malloc
+ since they're free'd by free_cached_info.
+ (som_slurp_symbol_table): Similarly for the symbol table.
+
+Wed Oct 25 14:59:22 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * Makefile.in (diststuff): Don't make headers.
+
+Wed Oct 25 11:32:54 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in: Rebuild dependencies.
+
+ * sunos.c (bfd_sunos_record_link_assignment): Don't do anything if
+ output_bfd is not SunOS.
+ (bfd_sunos_size_dynamic_sections): Likewise. Don't scan relocs of
+ non-SunOS input files.
+
+ * xcofflink.c: Extensive changes to support linking shared objects
+ and generating a .loader section.
+ * libcoff-in.h (struct xcoff_tdata): Add import_file_id field.
+ (struct xcoff_section_tdata): Add lineno_count, first_symndx,
+ last_symndx, and ldrel_count fields.
+ * libcoff.h: Rebuild.
+ * coff-rs6000.c (xcoff_howto_table): Correct reloc names.
+ * coffcode.h (styp_to_sec_flags): Don't set any flags if STYP_PAD
+ is set.
+ * bfd-in.h (bfd_xcoff_import_symbol): Declare.
+ (bfd_xcoff_export_symbol): Declare.
+ (bfd_xcoff_size_dynamic_sections): Declare.
+ * bfd-in2.h: Rebuild.
+
+Tue Oct 24 17:44:20 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * configure.in: Add xcofflink.o to pmac_xcoff_vec.
+ * configure: Rebuild.
+ * mpw-config.in: Add xcofflink.c.o to powerpc-apple-macos.
+ * coff-pmac.c: Include coff-rs6000.c instead of duplicating its
+ contents.
+ (pmac_xcoff_vec): Update to use new xcoff support.
+ * coff-rs6000.c (xcoff_generic_stat_arch_elt): Make static.
+ (xcoff_write_armap): Declare buf as unsigned char.
+ * xcofflink.c (xcoff_link_add_symbols): Declare a local as PTR.
+
+ * mpw-make.sed: Generalize subdir_do edit.
+
+Tue Oct 24 10:25:01 1995 Jeffrey A Law (law@cygnus.com)
+
+ * hppabsd-core.c (make_bfd_asection): Initialize asect->filepos
+ correctly. Don't initialize asect->vma.
+
+Fri Oct 20 13:23:48 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * opncls.c (_bfd_new_bfd): If _bfd_chunksize wasn't preset, use
+ something a little less than the page size.
+
+Thu Oct 19 13:06:09 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-i960.c (coff_i960_adjust_symndx): Clear *adjustedp.
+
+Wed Oct 18 16:20:08 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * coff-i386.c (coff_i386_reloc_type_lookup): New.
+ * coffcode.h (coff_write_object_contents): If .bss is before
+ .data us that as data_start.
+ * cofflink.c (_bfd_coff_generic_relocate_section): Get reloc
+ calc correct.
+ * peicode.h (add_data_entry): Use _cooked_size of data directory.
+ (coff_swap_outhdr_out): Hardwire in version number.
+
+Wed Oct 18 16:50:54 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * sunos.c (sunos_add_dynamic_symbols): Rename local variables
+ major and minor to *_vno, since the former are also macros in
+ SunOS header files. Cast result of bfd_alloc to appropriate
+ type.
+
+ * coffgen.c (coff_find_nearest_line): Cast used_by_bfd value
+ before assigning to sec_data.
+
+Wed Oct 18 13:25:17 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ecoff.c (_bfd_ecoff_find_nearest_line): The offset argument is
+ now relative to the section, not absolute.
+ * ecofflink.c (_bfd_ecoff_locate_line): Use the right symbol to
+ get the file name when there is a N_SO directory name. When
+ handling stabs, remember that section->vma was added to the
+ offset.
+
+Tue Oct 17 18:24:54 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * sunos.c (struct sunos_link_hash_table): Add needed field.
+ (sunos_link_hash_table_create): Call bfd_release, not free.
+ (sunos_link_hash_table_create): Initialize needed field.
+ (sunos_add_dynamic_symbols): Record needed objects.
+ (bfd_sunos_get_needed_list): New function.
+ * bfd-in.h (bfd_sunos_get_needed_list): Declare.
+ * bfd-in2.h: Rebuild.
+
+Mon Oct 16 14:43:59 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * libcoff-in.h (pe_data_type.in_reloc_p): New.
+
+Mon Oct 16 10:52:50 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * bfd-in.h (struct bfd_link_needed_list): Rename from
+ bfd_elf_link_needed_list.
+ * bfd-in2.h: Rebuild.
+ * elf.c, elflink.h, libelf.h: Corresponding changes.
+
+ Add start at AIX linker support; no shared libraries yet.
+ * xcofflink.c: New file.
+ * configure.in (rs600coff_vec): Use xcofflink.o.
+ * configure: Rebuild.
+ * libcoff-in.h (struct xcoff_tdata): Add csects and debug_indices
+ fields.
+ (struct xcoff_section_tdata): Define.
+ (xcoff_section_data): Define macro.
+ (_bfd_xcoff_bfd_link_hash_table_create): Declare.
+ (_bfd_xcoff_bfd_link_add_symbols): Declare.
+ (_bfd_xcoff_bfd_final_link): Declare.
+ (_bfd_ppc_xcoff_relocate_section): Declare.
+ * libcoff.h: Rebuild.
+ * coff-rs6000.c: Clean up a bit.
+ (xcoff_mkobject): Default modtype to 1L, not RE. Initialize
+ cputype, csects, and debug_indices.
+ (xcoff_copy_private_bfd_data): Copy cputype.
+ (xcoff_howto_table): Rename from rs6000coff_howto_table.
+ (xcoff_rtype2howto): Rename from rs6000coff_rtype2howto.
+ (xcoff_reloc_type_lookup): Rename from
+ rs6000coff_reloc_type_lookup.
+ (coff_relocate_section): Define.
+ (_bfd_xcoff_sizeof_headers): Define.
+ (_bfd_xcoff_bfd_get_relocated_section_contents): Define.
+ (_bfd_xcoff_bfd_relax_section): Define.
+ (_bfd_xcoff_bfd_link_split_section): Define.
+ (rs6000coff_vec): For BFD_JUMP_TABLE_LINK, use _bfd_xcoff, not
+ coff.
+ * coffcode.h (coff_compute_section_file_positions): If AIX,
+ increment sofar by SMALL_AOUTSZ if not executable.
+ (coff_write_object_contents): If AIX, always output an a.out
+ header; if not executable, header size of SMALL_AOUTSZ.
+ * hash.c (struct bfd_strtab_hash): Add xcoff field.
+ (_bfd_stringtab_init): Initialize xcoff field.
+ (_bfd_xcoff_stringtab_init): New function.
+ (_bfd_stringtab_add): In XCOFF mode, leave two bytes for length.
+ (_bfd_stringtab_emit): In XCOFF mode, write out length.
+ * libbfd-in.h (_bfd_xcoff_stringtab_init): Declare.
+ * libbfd.h: Rebuild.
+ * Makefile.in: Rebuild dependencies.
+ (BFD32_BACKENDS): Add xcofflink.o.
+ (CFILES): Add xcofflink.c.
+
+ * elf32-mips.c (mips_elf_symbol_processing): Set SEC_ALLOC, not
+ SEC_NO_FLAGS, for .acommon section. From Peter Schauer
+ <Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE>.
+
+Sat Oct 14 21:36:02 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * coff-ppc.c (in_reloc_p): Add, clone from coff-i386.c.
+
+Fri Oct 13 17:48:43 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * acconfig.h (HAVE_SYS_PROCFS_H): Undef, with comment.
+ * config.in: Regenerated.
+
+ * opncls.c (getpagesize) [!HAVE_GETPAGESIZE]: Define as 2048.
+ (_bfd_chunksize): New variable.
+ (_bfd_new_bfd): Set it to getpagesize() if negative, and use it
+ for obstack chunk size.
+ * configure.in: Check for getpagesize.
+ * configure: Regenerated.
+
+ Mon Sep 25 22:49:32 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * trad-core.c (rawptr): Make it a local variable of
+ ptrace_unix_core_file_p.
+
+Fri Oct 13 11:22:01 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * coff-arm.c (in_reloc_p): New.
+ * coff-i386.c (in_reloc_p): New.
+ * coffcode.h: Allways include peicode.h if COFF_WITH_PE.
+ (coff_write_object_contents): Only set has_reloc_section
+ if PE_IMAGE.
+ * cofflink.c (_bfd_coff_generic_relocate_section): Call
+ in_reloc_p to decide if reloc should be emitted.
+ * libcoff.h (pe_data_type.in_reloc_p): New.
+ * peicode.h (pe_mkobject): Initialize in_reloc_p.
+
+Wed Oct 11 00:49:29 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * cofflink.c (_bfd_coff_internal_syment_name): Move to coffgen.c.
+ (_bfd_coff_read_internal_relocs): Likewise.
+ * coffgen.c (_bfd_coff_internal_syment_name): Copy from coffgen.c.
+ (_bfd_coff_read_internal_relocs): Likewise.
+
+ * elflink.h (elf_link_add_object_symbols): Correct conditions
+ under which type and size change warnings are issued.
+
+Tue Oct 10 18:32:46 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffgen.c (coff_count_linenumbers): Don't count line numbers for
+ a symbol which is not in a real section.
+ (coff_write_native_symbol): Corresponding change.
+
+ * cofflink.c (_bfd_coff_link_hash_newfunc): Rename from
+ coff_link_hash_newfunc and make non-static.
+ (_bfd_coff_link_hash_table_init): New function, broken out of
+ _bfd_coff_link_hash_table_create.
+ (_bfd_coff_link_hash_table_create): Use it.
+ (process_embedded_commands): Make static.
+ * libcoff-in.h ((_bfd_coff_link_hash_newfunc): Declare.
+ (_bfd_coff_link_hash_table_init): Declare.
+ * libcoff.h: Rebuild.
+
+ * coffcode.h (coff_mkobject_hook): If RS6000COFF_C, set cputype
+ field in XCOFF tdata.
+ (coff_set_arch_mach_hook): Check ifdef RS6000COFF_C, not ifdef
+ U802ROMAGIC, for clarity. Try to set arch and machine correctly
+ based on cputype stored in a.out header, or in n_type of initial
+ .file symbol.
+ (coff_write_object_contents): Set cputype correctly in a.out
+ header.
+ (coff_slurp_symbol_table): Add casts to file_ptr to avoid
+ warnings.
+ * coffswap.h (coff_swap_aouthdr_in): Swap in cputype field.
+ (coff_swap_aouthdr_out): Swap out cputype field. Don't clear
+ old resv1 field.
+ * libcoff-in.h (struct xcoff_tdata): Add cputype field.
+ * libcoff.h: Rebuild.
+
+ * cpu-rs6000.c (rs6000_compatible): New static function.
+ (bfd_rs6000_arch): Use it.
+ * cpu-powerpc.c (powerpc_compatible): New static function.
+ (arch_info_struct): Define various flavours of PowerPC.
+ (bfd_powerpc_arch): Use powerpc_compatible. Point at
+ arch_info_struct.
+
+Tue Oct 10 10:50:46 1995 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (FLAGS_TO_PASS): Remove BISON.
+
+Tue Oct 10 01:28:29 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_add_object_symbols): Don't warn about
+ changing the size or type if the old definition was weak.
+
+Mon Oct 9 11:24:08 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffcode.h (combined_entry_type): Add fix_line field.
+ (coff_slurp_line_table): Warn if we try to set the lineno field of
+ a symbol twice.
+ (coff_slurp_symbol_table): If RS6000COFF_C, handle C_BINCL and
+ C_EINCL by setting fix_line. Fix C_BSTAT symbol value.
+ * coffgen.c (coff_mangle_symbols): Handle fix_line.
+ (coff_write_symbol): Only use N_DEBUG if the symbol is in the
+ absolute section.
+ (coff_print_symbol): Print fix_value symbols in a useful fashion.
+ * libcoff.h: Rebuild.
+
+ * libcoff-in.h (struct xcoff_tdata): Define.
+ (xcoff_data): Define.
+ * bfd.c (struct _bfd): Add xcoff_obj_data field to tdata union.
+ * bfd-in2.h, libcoff.h: Rebuild.
+ * coff-rs6000.c (xcoff_mkobject): New static function.
+ (coff_mkobject): Define.
+ (xcoff_copy_private_bfd_data): New static function.
+ (coff_bfd_copy_private_bfd_data): Define.
+ (rs6000coff_howto_table): Change R_TOC complain_on_overflow from
+ signed to bitfield.
+ (rs6000coff_vec): Add DYNAMIC to object_flags.
+ * coffcode.h (sec_to_styp_flags): If RS6000COFF_C, handle .pad and
+ .loader sections specially.
+ (coff_new_section_hook): If RS6000COFF_C, get the .text and .data
+ section alignment from the XCOFF tdata information.
+ (coff_mkobject_hook): If RS6000COFF_C, set DYNAMIC based on
+ F_SHROBJ, and copy the extra a.out header information into the
+ XCOFF tdata structure.
+ (coff_write_object_contents): If RS6000COFF_C, set F_SHROBJ,
+ F_DYNLOAD and the extra a.out header information.
+ (coff_slurp_symbol_table): Set BSF_NOT_AT_END for a C_EXT or
+ C_HIDEXT symbol with attached csect information.
+ * coffswap.h (coff_swap_aouthdr_in): If RS6000COFF_C, swap
+ in the o_maxdata field.
+ (coff_swap_aouthdr_out): If RS6000COFF_C, swap extra XCOFF fields.
+ * coffgen.c (coff_renumber_symbols): Don't move any symbol to the
+ end if BSF_NOT_AT_END is set.
+
+ * targets.c (bfd_target): Rename _bfd_read_ar_hdr field to
+ _bfd_read_ar_hdr_fn.
+ * libbfd-in.h (_bfd_read_ar_hdr): Update accordingly.
+ * bfd-in2.h, libbfd.h: Rebuild.
+ * archive.c (_bfd_get_elt_at_filepos): Cast _bfd_read_ar_hdr
+ return value.
+ (do_slurp_bsd_armap, do_slurp_coff_armap): Likewise.
+ (bfd_slurp_bsd_armap_f2): Likewise.
+ (_bfd_slurp_extended_name_table): Likewise.
+
+Fri Oct 6 16:18:35 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ Mon Sep 25 22:49:32 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * archive.c (bfd_get_next_mapent): Return BFD_NO_MORE_SYMBOLS
+ when the symbol table is empty.
+
+ * elf32-m68k.c (elf_m68k_size_dynamic_sections): Don't reserve
+ space for section symbols, since we don't output them either.
+ (elf_m68k_adjust_dynindx): Removed.
+
+ * ptrace-core.c (rawptr): Make it a local variable of
+ ptrace_unix_core_file_p.
+
+Fri Oct 6 12:24:47 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * coff-rs6000.c (xcoff_write_archive_contents): Return false, not
+ NULL.
+
+ * config.bfd (powerpc{,le}-{elf,sysv4,eabi,solaris2}): Add NT, and
+ Mac object file formats.
+
+Fri Oct 6 12:04:02 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffgen.c (coff_fix_symbol_name): Don't try to set up file
+ auxent if there isn't one.
+ (coff_write_symbols): If there is no file auxent, use SYMNMLEN
+ rather than FILNMLEN as the maximum name length.
+
+ * coffcode.h (bfd_coff_backend_data): Add new field
+ _bfd_coff_print_aux.
+ (bfd_coff_print_aux): New static function.
+ (coff_pointerize_aux_hook (RS6000COFF_C version)): Pointerize the
+ scnlen field of an XTY_LD csect aux entry.
+ (coff_print_aux): New static function.
+ (coff_slurp_symbol_table): Don't pointerize scnlen field; now done
+ in coff_pointerize_aux_hook.
+ (bfd_coff_std_swap_table): Initialize new field.
+ * coffgen.c (coff_print_symbol): Call bfd_coff_print_aux.
+ * libcoff.h: Rebuild.
+ * coff-alpha.c (alpha_ecoff_backend_data): Initialize new field.
+ * coff-mips.c (mips_ecoff_backend_data): Likewise.
+
+ * coffcode.h (coff_write_object_contents): On AIX, clear F_RELFLG
+ if there are symbols, for native AIX ld compatibility.
+
+ * coffcode.h (bfd_coff_backend_data): Add new field
+ _bfd_coff_pointerize_aux_hook.
+ (coff_pointerize_aux_hook): Define as a function if RS6000COFF_C
+ or I960, and as 0 otherwise.
+ (bfd_coff_std_swap_table): Initialize new field.
+ * libcoff.h: Rebuild.
+ * coffgen.c (coff_pointerize_aux): Change parameters to take
+ symbol pointer instead of type and class, and to take aux index.
+ Call _bfd_coff_pointerize_aux_hook if it is defined.
+ (coff_get_normalized_symtab): Always call coff_pointerize_aux.
+ * coff-alpha.c (alpha_ecoff_backend_data): Initialize all fields.
+ * coff-mips.c (mips_ecoff_backend_data): Likewise.
+
+ * coff-rs6000.c: Add full support for AIX archives. Rewrite old
+ read-only/host-only support.
+
+ * coffcode.h (coff_slurp_symbol_table): Set C_HIDEXT symbols to be
+ BSF_LOCAL.
+ (OTHER_GLOBAL_CLASS): Do not define to be C_HIDEXT if
+ RS6000COFF_C.
+
+ * targets.c (bfd_target): Add _bfd_read_ar_hdr field. Modify
+ BFD_JUMP_TABLE_ARCHIVE accordingly.
+ * libbfd-in.h (_bfd_snarf_ar_hdr): Don't declare.
+ (_bfd_compute_and_write_armap): Declare.
+ (_bfd_generic_read_ar_hdr): Declare.
+ (_bfd_read_ar_hdr): Define.
+ (_bfd_noarchive_read_ar_hdr): Define.
+ (_bfd_archive_bsd_read_ar_hdr): Define.
+ (_bfd_archive_coff_read_ar_hdr): Define.
+ * archive.c: Change all callers of _bfd_snarf_ar_hdr to call
+ _bfd_read_ar_hdr instead.
+ (_bfd_generic_read_ar_hdr): Rename from _bfd_snarf_ar_hdr.
+ (_bfd_compute_and_write_armap): Rename from
+ compute_and_write_armap. Make non-static. Change all callers.
+ * ecoff.c (_bfd_ecoff_slurp_armap): Call _bfd_read_ar_hdr rather
+ than _bfd_snarf_ar_hdr.
+ * aout-target.h (MY_read_ar_hdr): Define if not defined.
+ * ieee.c (ieee_read_ar_hdr): Define.
+ * libecoff.h (_bfd_ecoff_read_ar_hdr): Define.
+ * oasys.c (oasys_read_ar_hdr): Define.
+ * som.c (som_read_ar_hdr): Define.
+ * bfd-in2.h, libbfd.h: Rebuild.
+
+Thu Oct 5 14:04:07 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * peicode.c (coff_swap_filehdr_in): If symptr is
+ zero, there aren't any symbols, even if nsyms is set.
+
+Thu Oct 5 11:45:02 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * libecoff.h (struct ecoff_backend_data): Add adjust_headers
+ field.
+ * ecoff.c (ecoff_sec_to_styp_flags): Check for various Alpha
+ sections, and set styp correctly for them: .got, .hash, .dynamic,
+ .liblist, .rel.dyn, .conflic, .dynstr, .dynsym, .comment.
+ (_bfd_ecoff_styp_to_sec_flags): Check for various Alpha section
+ types.
+ (ecoff_sort_hdrs): New static function.
+ (ecoff_compute_section_file_positions): Return boolean, not void.
+ Sort the sections by VMA before looking through them. Put the
+ first non SEC_ALLOC section on a new page. Put every SEC_ALLOC
+ section on an appropriate boundary within the page.
+ (ecoff_compute_reloc_file_positions): Check return value of
+ ecoff_compute_section_file_positions.
+ (_bfd_ecoff_set_section_contents): Likewise.
+ (_bfd_ecoff_write_object_contents): Check for various Alpha
+ section types when incrementing text_size and data_size. Call
+ adjust_headers backend function if it exists.
+ * coff-alpha.c (alpha_adjust_headers): New static function.
+ (alpha_ecoff_backend_data): Initialize adjust_headers field.
+ * coff-mips.c (mips_ecoff_backend_data): Likewise.
+
+ * hosts/i386bsd.h: Restore file incorrectly deleted on Sep 6.
+
+Wed Oct 4 18:15:02 1995 Jeff Law (law@hurl.cygnus.com)
+
+ * rs6000-core.c (CORE_VERSION_1): Use CORE_VERSION_1 instead
+ of ALTERNATE_AIX_CORE_FORMAT.
+ * configure.in (aix4): No longer need CORE_FLAGS.
+ * configure: Updated.
+
+Wed Oct 4 15:36:36 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ NS32k changes from Ian Dall:
+ * aoutx.h (MY_final_link_relocate, MY_relocate_contents): New
+ macros.
+ (aout_link_input_section_std, aout_link_input_section_ext,
+ aout_link_reloc_link_order): Call them instead of _bfd_*
+ versions.
+ * aout-target.h (MY_exec_header_not_counted): New macro, defaults
+ to zero.
+ (backend_data): Use it instead of hardcoded zero.
+
+ * aout-ns32k.c (CTOR_TABLE_RELOC_HOWTO): New macro.
+ (MY_swap_std_reloc_out): Use udata.i for KEEPIT, don't call stoi.
+
+ * ns32knetbsd.c: Include bfd.h.
+ (MY_text_includes_header, MY_bfd_reloc_type_lookup): New macros.
+ (MY_bfd_reloc_type_lookup): Declare function too.
+ * pc532-mach.c (set_sizes): Don't declare.
+ (MY_text_includes_header, MY_exec_header_not_counted): Define.
+ (backend_data, MY_backend_data): Don't define.
+
+ * config.bfd: Treat ns32k-pc532-ux* like ns32k-pc532-mach*, and
+ ns32k-*-lites* like ns32k-*-netbsd*.
+
+ * hosts/nbsd.h: Swap order of sys/vmparam.h and sys/param.h, to
+ compile on lites.
+
+Wed Oct 4 14:15:52 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffcode.h (coff_write_object_contents): Restore setting
+ f_timdat to 0, deleted on August 22.
+
+Tue Oct 3 16:28:32 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * coffcode.h (coff_bfd_copy_private_symbol_data,
+ coff_bfd_copy_private_section_data,
+ coff_bfd_copy_private_bfd_data): ifdef to allow overrides.
+ * peicode.h (coff_bfd_copy_private_bfd_data): New
+ (pe_bfd_copy_private_bfd_data): New.
+ (coff_swap_scnhdr_in): Swap bss size into the right place.
+ (pe_print_private_bfd_data): Add some newlines.
+
+Tue Oct 3 11:53:04 1995 Jeff Law (law@hurl.cygnus.com)
+
+ * som.c (setup_sections): Don't die if a space has no subspaces.
+
+Mon Oct 2 14:08:55 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_add_object_symbols): Don't let a weak
+ dynamic symbol override a common symbol. Don't change the size or
+ type if they have been set and the new symbol is not a definition.
+ Warn if the size or type changes.
+
+Sun Oct 1 01:34:41 1995 Jeff Law (law@hurl.cygnus.com)
+
+ * som.c (som_begin_writing): Don't write the symbol table or
+ symbol strings.
+ (som_finish_writing): Write them here. Place them after the
+ subspace data, but before the relocs.
+
+Fri Sep 29 11:01:55 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * sunos.c (sunos_add_one_symbol): Just pass false, not
+ info->shared_library, to sunos_create_dynamic_sections.
+ (sunos_scan_ext_relocs): Don't warn about a reloc in the .text
+ section.
+ (sunos_check_dynamic_reloc): Remove .text section assertion.
+
+Thu Sep 28 18:48:47 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * config.bfd: Add powerpc-*-macos*, powerpc-*-mpw*.
+ * configure, configure.in: Add pmac_xcoff_vec case.
+ * Makefile.in (BFD32_BACKENDS): Add coff-pmac.o.
+ * coff-pmac.c: New file, PowerMac XCOFF support.
+ * coffcode.h (coff_set_arch_mach_hook): Add PowerMac case.
+ * targets.c (pmac_xcoff_vec): Declare.
+
+ * mpw-config.in: Various changes to be compatible with the
+ autoconf-based configury.
+ * mpw-make.sed: New file, sed commands to translate Unix
+ makefile into MPW syntax.
+ * mpw-make.in: Remove.
+ * hosts/mpw.h: Remove.
+ * bfd-in.h, bfd-in2.h: If MPW, include the file that defines
+ true and false as enums, then define TRUE_FALSE_ALREADY_DEFINED.
+
+Thu Sep 28 17:06:23 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * binary.c (binary_get_symtab): Return an empty string on error.
+ * opncls.c (bfd_fdpenr): Change WIN32 restriction to WINGDB.
+
+Thu Sep 28 15:30:44 1995 Kim Knuttila <krk@nellie>
+
+ * coff-ppc.c: Reformatted according to gnu conventions
+ Removed irrelevant "if 0" code
+
+Thu Sep 28 11:19:53 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * hp300hpux.c (convert_sym_type): Treat secondary symbols as weak
+ symbols rather than as indirect symbols.
+ (MY(slurp_symbol_table)): Don't do anything special about
+ secondary symbols.
+
+ * coffcode.h (coff_new_section_hook): Make sure that the alignment
+ of .ctors and .dtors sections is no larger than 2.
+
+ * sunos.c (sunos_add_one_symbol): Don't change
+ bfd_link_hash_common to bfd_link_hash_new, since it may be on the
+ undef list.
+ (bfd_sunos_record_link_assignment): Don't put __DYNAMIC in the
+ dynamic symbols when creating a shared library.
+ (sunos_scan_ext_relocs): Handle relocs correctly when creating a
+ shared library.
+ (sunos_scan_dynamic_symbol): Don't mark the __DYNAMIC symbol as
+ written even if it is not defined in a regular object.
+ (sunos_write_dynamic_symbol): Use plt_offset for the address of
+ the jump table reloc. Add an assertion. Use RELOC_JMP_SLOT
+ rather than the constant 22.
+ (sunos_check_dynamic_reloc): Handle creating a shared library.
+ (sunos_finish_dynamic_link): Set the first entry in the GOT to
+ zero when creating a shared library.
+ * aoutx.h (NAME(aout,final_link)): If there is a symbol __DYNAMIC,
+ write it out at the start of the symbol table.
+
+ * Makefile.in (BFD32_BACKENDS): Add coff-arm.o.
+
+Thu Sep 28 00:58:05 1995 Doug Evans <dje@deneb.cygnus.com>
+
+ * config.bfd: Add arm-*-coff.
+ * configure.in, configure: Add armcoff_{little,big}_vec.
+ * targets.c (armcoff_{little,big}_vec): Declare.
+ (bfd_target_vector): Add armcoff_{little,big}_vec.
+ * coff-arm.c (armcoff_{little,big}_vec): Always define.
+
+Wed Sep 27 10:37:14 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * targets.c (bfd_find_target): Remove debugging code.
+
+Wed Sep 27 07:23:39 1995 Kim Knuttila <krk@nellie>
+
+ * coff-ppc.c, pe-ppc.c, pei-ppc.c: Initial bfd for coff/PE
+ support on powerpc.
+ * Makefile.in: added *-ppc files
+ * coffcode.h: ppc MAGIC, and use peicode.h rather than coffswap.h to
+ allow pe based .o's to be shared with other tools on ppc/NT
+ * config.bfd: added powerpc[le]-[pe|winnt] config support
+ * configure, configure.in: added bfd_powerpc[le]_pe[i]_vec
+ * peicode.h: Added more section flags for PE on ppc
+ Added coff_swap_filehdr_out to allow peicode.h to be
+ used for non-image PE files on ppc.
+ Check for image, or not, before copying pe_opthdr
+ * targets.c: Added new bfd's
+ * targets.c: Removed two inactive bfds that shouldn't have made it this
+ far.
+
+Tue Sep 26 14:06:41 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (ppc_reloc_type): Rename from reloc_type, and use
+ explicit values to initialize all relocs. Change all users.
+ (ppc_elf_brtaken_inner): New function to handle branch predicition
+ relocs.
+ (ppc_elf_brtaken_reloc): Ditto.
+ (ppc_elf_howto_raw): Use new functions. Make sure all unsupported
+ relocs use ppc_elf_unsupported_reloc.
+ (ppc_elf_merge_private_bfd_data): Keep track of whether an error
+ needs to be reported.
+ (ppc_elf_relocate_section): Support branch prediction relocs.
+
+Tue Sep 26 12:48:05 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * bfd.c (bfd_assert): Remove \n from string passed to
+ _bfd_error_handler.
+
+ * coff-i386.c: (TWO_DATA_SECS): Don't define.
+ * coffcode.h (bfd_coff_backend_data): Remove _bfd_make_section_hook.
+ (bfd_coff_make_section_hook): Don't define.
+ (coff_make_section_hook): Remove.
+ (sec_to_styp_flags): Remove TWO_DATA_SECS case.
+ (styp_to_sec_flags): Likewise.
+ (coff_write_object_contents): Likewise.
+ (bfd_coff_std_swap_table): Don't initialize make_section_hook
+ field.
+ * libcoff.h: Rebuild.
+ * coffgen.c (make_a_section_from_file): Just call
+ bfd_make_section_anyway, not bfd_make_section or
+ bfd_coff_make_section_hook.
+ * ecoff.c (_bfd_ecoff_make_section_hook): Remove.
+ * libecoff.h (_bfd_ecoff_make_section_hook): Don't declare.
+ * coff-alpha.c (alpha_ecoff_backend_data): Don't initialize
+ make_section_hook field.
+ * coff-mips.c (mips_ecoff_backend_data): Likewise.
+
+ * aoutx.h (translate_from_native_sym_flags): Don't try to stuff
+ pointers into value field for warning and indirect symbols; just
+ leave the value field alone.
+ * linker.c (generic_link_add_symbol_list): Use next symbol for
+ warning and indirect symbols, rather than looking in symbol value.
+ * ecoff.c (ecoff_set_symbol_info): Remove indirect_ptr_ptr
+ parameter. Change all callers. Remove support for indirect
+ symbols; it didn't work anyhow.
+ (_bfd_ecoff_slurp_symbol_table): Remove indirect_ptr variable.
+ * syms.c: Change comments about BSF_WARNING and BSF_INDIRECT.
+ * bfd-in2.h: Rebuild.
+
+Mon Sep 25 16:04:09 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_howto_raw): For all 14-bit branch relocs,
+ go back to telling the tools this reloc operates on 32 bits.
+
+Mon Sep 25 11:48:02 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * aout-adobe.c (aout_adobe_callback): Use _bfd_error_handler
+ rather than a direct fprintf.
+ * archive.c (_bfd_write_archive_contents): Likewise.
+ * coffcode.h (coff_slurp_symbol_table): Likewise.
+ * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Likewise.
+ (ppc_elf_unsupported_reloc): Likewise.
+ (ppc_elf_relocate_section): Likewise.
+ * i386linux.c (linux_tally_symbols): Likewise.
+ (linux_finish_dynamic_link): Likewise.
+ * osf-core.c (osf_core_core_file_p): Likewise.
+ * rs6000-core.c (rs6000coff_get_section_contents): Likewise.
+ * som.c (som_sizeof_headers): Likewise.
+ * srec.c (srec_bad_byte): Likewise.
+ * bfd.c (bfd_assert): Likewise. Also change file to be const.
+ * libbfd-in.h (bfd_assert): Declare first parameter const.
+ * libbfd.h: Rebuild.
+ * coff-a29k.c (a29k_reloc): Don't bother to fprintf; returning
+ bfd_reloc_overflow is enough.
+ * coff-h8300.c (rtype2howto): Don't bother to fprintf; just abort.
+ * coff-h8500.c (rtype2howto): Likewise.
+ * coff-z8k.c (rtype2howto): Likewise.
+ * coffcode.h (dummy_reloc16_extra_cases): Likewise.
+ * elf.c (_bfd_elf_get_lineno): Likewise.
+ (_bfd_elf_no_info_to_howto): Likewise.
+ (_bfd_elf_no_info_to_howto_rel): Likewise.
+ * hp300hpux.c (convert_sym_type): Likewise.
+ (MY(swap_std_reloc_in)): Likewise.
+ * elf.c (bfd_section_from_shdr): Remove #if 0 sections.
+
+ * libaout.h (struct aoutdata): Add line_buf field.
+ * aoutx.h (NAME(aout,find_nearest_line)): Remove statics buffer
+ and filename_buffer. Instead, use a malloc buffer stored in the
+ new line_buf field. Remove length restrictions.
+
+ * coffgen.c (string_size): Remove static variable.
+ (debug_string_size, debug_string_section): Likewise.
+ (coff_fix_symbol_name): Add string_size_p, debug_string_section_p,
+ and debug_string_size_p parameters. Use them instead of the
+ global variables. Change all callers.
+ (coff_write_symbol): Likewise.
+ (coff_write_alien_symbol, coff_write_native_symbol): Likewise.
+ (coff_write_symbols): Add local variables to replace removed
+ global variables.
+
+ * libcoff-in.h (struct coff_section_tdata): Add offset, i,
+ function, and line_base fields.
+ * libcoff.h: Rebuild.
+ * coffgen.c (coff_find_nearest_line): Use section tdata to cache
+ information, rather than using static variables.
+
+ * sunos.c (sunos_read_dynamic_info): Adjust offsets in an NMAGIC
+ file. From Peter DeWolf <pld@amt.tay1.dec.com>.
+
+ * init.c (initialized): Remove static variable.
+ (bfd_init): Don't bother setting initialized.
+ (bfd_check_init): Remove.
+ * opncls.c (_bfd_new_bfd): Don't call bfd_check_init.
+ * libbfd.h: Rebuild.
+
+Sat Sep 23 01:22:23 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * rs6000-core.c (rs6000coff_core_p): Don't check the core file
+ size for full core dumps. Copy core file header to private data.
+ (rs6000coff_core_file_failing_command,
+ rs6000coff_core_file_failing_signal): New functions to extract
+ the file name and terminating signal from the core file.
+ * coff-rs6000.c: Use them.
+
+Fri Sep 22 17:44:47 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ Change arch info to be const, initialized at compile time.
+ * archures.c: Reindent many functions. Change CONST to const.
+ (bfd_arch_info_type): Make arch_name const. Remove disassemble;
+ nothing set it anyhow. Make next const.
+ (bfd_arch_info_list): Remove.
+ (bfd_archures_list): Rename from archures_init_table. Change from
+ a table of function pointers to a table of bfd_arch_info_type
+ structure addresses.
+ (bfd_scan_arch): Rewrite accordingly. Return a const pointer.
+ (bfd_lookup_arch): Likewise.
+ (bfd_set_arch_info): Rewrite accordingly. Change argument to be a
+ const pointer.
+ (bfd_default_arch_struct): Make const.
+ (bfd_arch_init, bfd_arch_linkin): Remove.
+ (bfd_get_arch_info): Return a const pointer.
+ * init.c (bfd_init): Don't call bfd_arch_init.
+ * bfd.c (struct _bfd): Make arch_info const.
+ * bfd-in2.h: Rebuild.
+ * libbfd.h: Rebuild.
+ * configure.in: Put & before everything in $selarchs.
+ * configure: Rebuild.
+ * cpu-*.c: Change bfd_*_arch from a function which calls
+ bfd_arch_linkin to a const structure.
+ * ieee.c (ieee_object_p): Make arch const.
+
+Fri Sep 22 16:23:18 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * reloc.c (bfd_reloc_code_type): Add relocations to support all of
+ PowerPC V.4.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
+
+ * elf32-ppc.c (reloc_type): Update names to match current draft.
+ (ppc_elf_howto_raw): Mark 14 bit relocs as short sized and PC
+ relative. Update names to current V.4 draft.
+ (ppc_elf_reloc_type_lookup): Add support for more relocations.
+ (ppc_elf_relocate_section): Rename relocations to match draft.
+
+Thu Sep 21 21:53:18 1995 Michael Meissner <meissner@cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Allow modules
+ compiled with -mrelocatable-lib to be linked with either normal
+ modules or -mrelocatable modules.
+
+Wed Sep 20 12:03:26 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffcode.h (coff_write_object_contents): Clear the vstamp field
+ in the a.out header.
+
+ * aoutx.h (NAME(aout,swap_ext_reloc_out)): Don't set r_extern for
+ a reloc against a local symbol, even if it's not a section.
+
+Tue Sep 19 17:02:26 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * targets.c (bfd_target): Remove unused align_power_min field.
+ * bfd-in2.h: Rebuild.
+ * All backends: Remove initialization of align_power_min.
+
+Tue Sep 19 14:02:21 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * peicode.h (coff_swap_scnhdr_out): Get sizes for BSS right.
+
+Mon Sep 18 14:35:01 1995 Arne H. Juul <arnej@pvv.unit.no>
+
+ * config.bfd (mips-dec-netbsd*): New target.
+ * configure.host (mips-dec-netbsd*): New host.
+ * configure.in (mips-dec-netbsd*): New native.
+ * configure: Rebuild.
+
+Fri Sep 15 10:24:36 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ Make the COFF backend linker merge common types:
+ * cofflink.c (struct coff_debug_merge_element): Define.
+ (struct coff_debug_merge_type): Define.
+ (struct coff_debug_merge_hash_entry): Define.
+ (struct coff_debug_merge_hash_table): Define.
+ (coff_debug_merge_hash_table_init): Define.
+ (coff_debug_merge_hash_table_free): Define.
+ (coff_debug_merge_hash_lookup): Define.
+ (struct coff_final_link_info): Add debug_merge field.
+ (coff_debug_merge_hash_newfunc): New static function.
+ (_bfd_coff_final_link): Allocate and free debug_merge table.
+ (coff_link_input_bfd): Merge identical enum, struct and union
+ types.
+
+Thu Sep 14 14:53:58 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ Convert i960 COFF to use COFF backend linker.
+ * coff-i960.c (coff_i960_relocate): Use a coff_section_data
+ structure to store the symbol being used.
+ (coff_i960_start_final_link): New static function.
+ (coff_i960_relocate_section): New static function.
+ (coff_i960_adjust_symndx): New static function.
+ (coff_start_final_link): Define.
+ (coff_relocate_section): Define.
+ (coff_adjust_symndx): Define.
+ * coffcode.h (bfd_coff_backend_data): Add new callback function
+ _bfd_coff_start_final_link.
+ (bfd_coff_start_final_link): Define.
+ (coff_start_final_link): Define if not defined.
+ (bfd_coff_std_swap_table): Add coff_start_final_link.
+ * cofflink.c (_bfd_coff_internal_syment_name): Make globally
+ visible.
+ (_bfd_coff_final_link): Call bfd_coff_start_final_link if the
+ function callback is not NULL.
+ * libcoff-in.h (struct coff_section_tdata): Add tdata field.
+ (_bfd_coff_internal_syment_name): Declare.
+ * libcoff.h: Rebuild.
+ * configure.in (icoff_big_vec): Add cofflink.o.
+ (icoff_little_vec): Likewise.
+ * configure: Rebuild.
+
+Wed Sep 13 17:38:23 1995 Fred Fish <fnf@rtl.cygnus.com>
+
+ * Makefile.in (clean-info): Remove extraneous tab from line
+ following action.
+
+Wed Sep 13 13:27:53 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * cofflink.c (coff_link_input_bfd): Fail if a section with no
+ contents has relocs.
+
+Thu Sep 12 12:45:34 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * coffcode.h (coff_compute_section_file_positions): Keep the
+ raw size safe.
+ (coff_write_object_contents): Remember if it's a relocatable
+ file.
+ * libcoff-in.h (pe_data_type): New member 'has_reloc_section'
+ * peicode.h (coff_swap_filehdr_out): Clear not-reloc flag
+ if relocatable file. Swap out saved raw size.
+
+Tue Sep 12 12:14:33 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (do_maintainer_clean): Rename from do_realclean.
+ (maintainer-clean): Rename from realclean, passing
+ maintainer-clean down to subdirectories, but leave realclean as a
+ synonym.
+
+ * linker.c (_bfd_generic_link_add_one_symbol): Pass symbol name to
+ warning callback.
+
+ * dep-in.sed: Remove config.h from generated dependencies.
+
+ * sunos.c (sunos_slurp_dynamic_symtab): New static function,
+ broken out of sunos_canonicalize_dynamic_symtab.
+ (sunos_canonicalize_dynamic_symtab): Call new function
+ sunos_slurp_dynamic_symtab.
+ (sunos_add_dynamic_symbols): Add three new parameters. Return the
+ dynamic symbol table to the caller.
+ * aoutx.h (aout_link_add_symbols): Permit add_dynamic_symbols
+ callback to override the symbols being read.
+ * libaout.h (struct aout_backend_data): Add three new parameters
+ to add_dynamic_symbols callback.
+
+ Extensive minor changes to avoid various gcc warnings. Also:
+ * Makefile.in (BFD32_BACKENDS): Remove coff-arm.o.
+ * archures.c (bfd_arch_info_type): Change mach field from long to
+ unsigned long.
+ (bfd_lookup_arch): Change machine parameter from long to unsigned
+ long.
+
+Mon Sep 11 10:55:47 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * sunos.c (sunos_scan_std_relocs): Fix BFD_ASSERT: it's OK to find
+ a symbol with a non-zero plt_offset.
+
+Fri Sep 8 11:47:24 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * elfcode.h (align_file_position): Remove; not used.
+
+ * configure.in: Only check for <sys/procfs.h> on a native system,
+ and make sure it defines prstatus_t.
+ * configure: Rebuild.
+
+Thu Sep 7 12:48:01 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * sunos.c (sunos_write_dynamic_symbol): Correct m68k abort test.
+
+ * config.in: Rename from config.h.in.
+ * configure.in: Call AC_CONFIG_HEADER with config.h:config.in.
+ Check for config.h:config.in when creating stamp-h.
+ * configure: Rebuild.
+ * Makefile.in (stamp-h): Depend upon config.in rather than
+ config.h.in. Set CONFIG_HEADERS to config.h:config.in when
+ calling config.status.
+
+ * Makefile.in (do_distclean): Remove config.h and stamp-h.
+ (Makefile): Just rebuild Makefile.
+ (config.h, stamp-h): New targets.
+ * configure.in: Create stamp-h when rebuilding config.h.
+ * configure: Rebuild.
+
+Wed Sep 6 15:00:33 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Call AC_CONFIG_HEADER. Substitute
+ 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.
+
+ * aclocal.m4 (BFD_BINARY_FOPEN): Define.
+ (BFD_CC_FOR_BUILD): Define.
+ * configure.in: Use BFD_CC_FOR_BUILD.
+ * configure: Rebuild.
+
+Tue Sep 5 19:35:28 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * aclocal.m4: Don't try to grep ../Makefile if it doesn't exist.
+ * configure: Rebuild.
+
+ * coff-sparc.c (CALC_ADDEND): Don't set the addend to the value of
+ a global symbol.
+
+Tue Sep 5 12:48:26 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * config.bfd: i386pe_ve -> i386pe_vec.
+
+Mon Sep 4 14:02:43 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.host: Incorporate host Makefile fragments by setting
+ 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.
+
+ * config.bfd: Rewrite to incorporate the contents of the Makefile
+ fragments by setting shell variables, rather than merely returning
+ the name of a Makefile fragment.
+ * configure.in: Use shell variables set by config.bfd rather than
+ looking at the target Makefile fragment files. Don't substitute
+ target_makefile_frag. Do substitute TDEFINES.
+ * configure: Rebuild.
+ * Makefile.in (@target_makefile_frag@): Remove.
+ (ALL_CFLAGS): Change $(TDEFINES) to @TDEFINES@.
+ * config/*.mt: Remove.
+
+Mon Sep 4 03:13:28 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * configure.in: Put changequote lines around "i[345]86" patterns
+ section of core file support.
+
+Sun Sep 3 11:31:58 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.c (som_bfd_print_private_bfd_data): Define to use the
+ generic version.
+
+Fri Sep 1 17:08:40 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * peicode.h (coff_swap_aouthdr_in): Add ImageBase to
+ entry, text_start and data_start.
+
+Fri Sep 1 18:06:28 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (OFILES): Remove $(TDEPFILES).
+ * config/apollo.mt (TDEPFILES): Remove.
+ * config/README: Update.
+
+ * configure.in: For a native configuration, set COREFILE and
+ COREFLAG based on the canonical host name.
+ * configure: Rebuild.
+ * Makefile.in: Rebuild dependencies.
+ (ALL_CFLAGS): Add @COREFLAG@.
+ (OFILES): Replace $(HDEPFILES) with @COREFILE@.
+ * coff-rs6000.c: Check AIX_CORE rather than HOST_AIX for core file
+ support routines. Check LYNX_CORE rather than HOST_LYNX.
+ * lynx-core.c: Check LYNX_CORE rather than HOST_LYNX.
+ * i386lynx.c: Likewise.
+ * m68klynx.c: Likewise.
+ * sparclynx.c: Likewise.
+ * rs6000-core.c: Check AIX_CORE rather than HOST_AIX.
+ * *-core.c: Comment changes.
+ * config/decstation.mh (HDEPFILES): Remove.
+ (HDEFINES): Remove -DTRAD_CORE.
+ * config/irix3.mh (RANLIB): Remove.
+ * config/irix4.mh (HDEPFILES, RANLIB): Remove.
+ (HDEFINES): Remove -DIRIX_CORE.
+ * config/riscos.mh (RANLIB, HDEPFILES): Remove.
+ (HDEFINES): Remove -DTRAD_CORE.
+ * config/ncr3000.mh (AR_FLAGS, RANLIB): Remove.
+ * config/ultra3.mh (RANLIB): Remove.
+ * config/aix4.mh, config/alphaosf.mh, config/amix.mh: Remove.
+ * config/apollo.mh, config/delta68.mh, config/delta88.mh: Remove.
+ * config/dpx2.mh, config/esix.mh, config/harris.mh: Remove.
+ * config/hp300.mh, config/hp300bsd.mh, config/hppabsd.mh: Remove.
+ * config/hppahpux.mh, config/hppaosf.mh: Remove.
+ * config/i386aix.mh, config/i386bsd.mh: Remove.
+ * config/i386linux.mh, config/i386mach3.mh: Remove.
+ * config/i386sco.mh, config/i386v.mh, config/i386v4.mh: Remove.
+ * config/irix5.mh, config/m88kmach3.mh, config/mipsbsd.mh: Remove.
+ * config/mipsmach3.mh, config/news-mips.mh: Remove.
+ * config/news.mh, config/pc532mach.mh, config/riscix.mh: Remove.
+ * config/rs600.mh, config/rs6000lynx.mh: Remove.
+ * config/solaris2.mh, config/stratus.mh: Remove.
+ * config/symmetry.mh, config/sysv4.mh, config/tahoe.mh: Remove.
+ * config/vaxbsd.mh, config/vaxult.mh, config/vaxult2.mh: Remove.
+
+Fri Sep 1 15:18:50 1995 Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>
+
+ * elflink.h (elf_bfd_final_link): Don't change a DT_INIT or
+ DT_FINI entry if the appropriate symbol is not in the hash table.
+
+ * libelf.h (struct elf_backend_data): Add create_program_headers
+ and want_hdr_in_seg fields.
+ * elfxx-target.h (elf_backend_want_hdr_in_seg): Define if not
+ defined.
+ (elf_backend_create_program_headers): Likewise.
+ (elfNN_bed): Initialize create_program_headers and
+ want_hdr_in_seg.
+ * elf.c (get_program_header_size): Call create_program_headers
+ backend routine.
+ (map_program_segments): Check want_hdr_in_seg backend field. Call
+ create_program_headers backend routine.
+
+ * elf.c (assign_file_positions_except_relocs): Align non allocated
+ sections when creating an executable.
+
+ * elfcode.h (elf_swap_phdr_in): Make non static.
+ (elf_swap_phdr_out): Make non static.
+ * libelf.h (bfd_elf32_swap_phdr_in): Declare.
+ (bfd_elf32_swap_phdr_out): Declare.
+ (bfd_elf64_swap_phdr_in): Declare.
+ (bfd_elf64_swap_phdr_out): Declare.
+
+ * ecofflink.c (ecoff_collect_shuffle): New static function.
+ (_bfd_ecoff_get_accumulated_pdr): New function.
+ (_bfd_ecoff_get_accumulated_sym): New function.
+ (_bfd_ecoff_get_accumulated_ss): New function.
+ * libbfd-in.h (_bfd_ecoff_get_accumulated_pdr): Declare.
+ (_bfd_ecoff_get_accumulated_sym): Declare.
+ (_bfd_ecoff_get_accumulated_ss): Declare.
+ * libbfd.h: Rebuild.
+
+Fri Sep 1 13:20:25 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * libecoff.h (_bfd_ecoff_bfd_print_private_bfd_data): Fix typo.
+
+ * elflink.h (elf_link_add_object_symbols): Handle indirect and
+ warning symbols. If any section is named .gnu.warning.XXX, treat
+ the contents as a warning to be issued if the symbol XXX is
+ referenced.
+ (elf_link_output_extsym): For an indirect or warning symbol, just
+ output the symbol it points to.
+
+ * linker.c (_bfd_link_hash_newfunc): Don't bother to set bfd_error
+ if bfd_hash_allocate fails, since it will already be set.
+ (generic_link_hash_newfunc): Likewise.
+ (archive_hash_newfunc): Likewise.
+ (hash_entry_bfd): New static function.
+ (_bfd_generic_link_add_one_symbol): Pass new arguments to warning
+ callback. Allocate a new warning using the hash table newfunc.
+ Use bfd_hash_replace to update the entry in the hash table, rather
+ than assuming we can copy the fields with structure assignment.
+
+ * hash.c (bfd_hash_replace): New function.
+ * bfd-in.h (bfd_hash_replace): Declare.
+ * bfd-in2.h: Rebuild.
+
+Fri Sep 1 08:12:50 1995 James G. Smith <jsmith@beauty.cygnus.com>
+
+ * config.bfd: Add mips*vr4300-*-elf* target.
+ * config/mipsbvr4300.mt: Added.
+
+Thu Aug 31 16:00:53 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * Makefile.in: Update dependencies.
+ * aout-target.h (MY_bfd_print_private_bfd_data): New.
+ * bfd-in.h (PE STUFF): Deleted.
+ * bfd.c (tdata->pe_obj_data): New.
+ (bfd_print_private_bfd_data): New.
+ * coff-i386.c, coff-arm.c (coff_*-rtype_to_howto): Get image base from
+ new place.
+ * libcoff.h, libbfd.h, bfd-in2.h: Rebuilt.
+ * coffcode.h (pe_value): Delete
+ (coff_mkobject, coff_mkobject_hook): Conditionally build.
+ (coff_compute_section_file_positions): Look in new place.
+ (add_data_entry, fill_pe_header_info): Deleted.
+ (coff_write_object_contents): Remove PE stuff.
+ (coff_bfd_print_private_bfd_data): New.
+ * coffswap.h: Remove PE stuff.
+ * elfxx-target.h (bfd_elfNN_bfd_print_private_bfd_data): New.
+ * libbfd-in.h (_bfd_generic_bfd_print_private_bfd_data): New.
+ * libcoff-in.h (pe_data_type): New.
+ * libecoff.h (_bfd_ecoff_bfd_print_private_bfd_data): New.
+ * targets.c (_bfd_print_private_bfd_data): New.
+ * peicode.h: New file.
+
+Thu Aug 31 11:49:21 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * bfd-in.h: Add extern "C" if __cplusplus.
+ * bfd-in2.h: Rebuild.
+
+ * coff-mips.c (mips_relocate_section): Don't convert a reloc
+ against an absolute symbol into a reloc against a section.
+
+Thu Aug 31 08:00:14 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * coff-arm.c (coff_arm_reloc): Fix common size problem.
+ (i3coff_object_p): Delete.
+
+Wed Aug 30 20:41:27 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * coff-arm.c (deletemeacoff_arm_reloc): Deleted.
+ (arm26): Not partial inplace.
+ * coffcode.h (coff_compute_section_file_positions): Don't
+ do page aligning if COFF_PAGE_SIZE isn't defined.
+ * coffswap.h (coff_swap_scnhdr_in): Update image base correctly.
+
+Tue Aug 29 13:50:21 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * coffcode.h (coff_compute_section_file_positions):
+ Compile even if COFF_PAGE_SIZE isn't defined.
+ * cofflink.c (_bfd_coff_generate_reloc_section): Write
+ base file info as rvas.
+ * coff-arm.c (coff_rtype_to_howto): Deal with reloc 11.
+ * coffcode.h (coff_write_object_contents): Remove #if0ed code
+ Only remove empty sections in PE inmage files.
+ * libbfd.h, bfd-in2.h: regenerated.
+ * coff-arm.c (aoutarm_std_relo): New entry at 11.
+ (arm_reloc_type_lookup) : Understand type 11.
+ * coff-i386.c (howto_table): fix name of rva type.
+ (coff-i386_rtype_to_howto): Understand R_IMAGEBASE type.
+ * coffcode.h (sec_to_styp_flags): .edata is data.
+ (coff_compute_section_file_positions): Get page size right for PE.
+ Pagesize info is only valid in PE image files.
+ (fill_pe_header_info): Fix fields.
+ (coff_write_object_contents): Remove end_of_image calc.
+ (_bfd_coff_generate_reloc_section): Remove orphaned comment.
+ * coffswap.h (coff_swap_scnhdr_in): Don't always add IMAGE_BASE.
+ Swap in PE header.
+ (coff_swap_scnhdr_out): Setup PE flags correctly.
+ * reloc.c (BFD_RELOC_RVA): New field.
+
+Thu Aug 24 17:49:59 1995 Ian Lance Taylor (ian@cygnus.com)
+
+ * cofflink.c (coff_link_input_bfd): Don't include line numbers for
+ a section if its output section has no contents.
+
+Wed Aug 23 16:48:52 1995 Ian Lance Taylor (ian@cygnus.com)
+
+ * ecoff.c (_bfd_ecoff_slurp_symbolic_info): Add parentheses to FIX
+ expression to avoid compiler bug on HP-UX 9.01.
+
+Wed Aug 23 09:49:39 1995 Steve Chamberlain <sac@rtl.cygnus.com>
+
+ * coffcode.h (pe_value): Unansify.
+
+Mon Aug 21 17:49:28 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * bfd-in.h (bfd_link_subsystem): Turn enum into #defines.
+ (bfd_link_pe_info_dval): New
+ (bfd_link_stack_heap): Renamed and massaged into bfd_link_pe_info.
+ * bfd-in2.h: rebuilt.
+ * bfd.c (NT_subsystem, NT_stack_heap): Deleted.
+ * coffcode.h (pe_value): New function.
+ (fill_pe_header_info): New function.
+ (coff_write_object_contents): Use new function.
+ (coff_write_object_contents): Initialze link_data if not set.
+ * cofflink.c (coff_final_link_info): Remove pe randomness.
+ (dores_com): Update info in bfd_link_pe_info_dval.
+ (process_embedded_commands): Use the bfd_link_pe_info_dval.
+ (_bfd_coff_final_link): Remove PE stuff, initialize
+ coff_data->link_info.
+ * coffswap.h (coff_swap_[aout|filehdr]_out): Use indirect PE pointer.
+ (coff_swap_scnhdr_out): Use real imagebase.
+ * libcoff-in.h (coff_data_type.link_info): New field.
+
+Mon Aug 21 11:10:32 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * linker.c (link_action): If an undefined reference follows an
+ undefined weak reference, change the type to undefined.
+ * elflink.h (elf_link_add_archive_symbols): Don't record an
+ undefined weak reference as defined, in case it turns into a real
+ undefined reference later in the same archive.
+
+Thu Aug 17 16:29:09 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com>
+
+ * coff-sh.c (sh_relax_section): Cast value for used_by_bfd field
+ to PTR, not coff_section_tdata pointer, since PTR is the real type
+ of the field.
+ * cofflink.c (_bfd_coff_read_internal_relocs): Ditto.
+
+Thu Aug 17 14:44:26 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ Add support for linking SPARC SunOS PIC compiled code.
+ * sunos.c (SPARC_PLT_PIC_WORD0): Define.
+ (SPARC_PLT_PIC_WORD1, SPARC_PLT_PIC_WORD2): Define.
+ (struct sunos_link_hash_entry): Add got_offset and plt_offset
+ fields.
+ (struct sunos_link_hash_table): Add dynamic_sections_created and
+ dynamic_sections_needed fields.
+ (sunos_link_hash_newfunc): Initialize new fields.
+ (sunos_link_hash_table_create): Initialize new fields.
+ (sunos_create_dynamic_sections): New static function, broken out
+ of sunos_add_dynamic_symbols.
+ (sunos_add_dynamic_symbols): Call sunos_create_dynamic_sections.
+ (sunos_add_one_symbol): Call sunos_create_dynamic_sections.
+ (bfd_sunos_size_dynamic_sections): Call sunos_scan_relocs before
+ checking whether we need to set up the dynamic link information.
+ Define __GLOBAL_OFFSET_TABLE if anything referred to it.
+ (sunos_scan_std_relocs): Call sunos_create_dynamic_sections. Use
+ plt_offset field; only put symbol in .plt if it is not defined by
+ a regular object.
+ (sunos_scan_ext_relocs): Likewise. Handle base relative relocs.
+ (sunos_scan_dynamic_symbol): Store dynobj in local variable.
+ (sunos_write_dynamic_symbol): Check plt_offset rather than
+ checking whether symbol is in .plt section. If symbol is defined
+ in a regular object file, use SPARC_PLT_PIC_WORD[012], and don't
+ add a JMP_TBL reloc.
+ (sunos_check_dynamic_reloc): Add contents and relocationp fields.
+ If plt_offset is set, redirect relocation to PLT. If this is a
+ base relative reloc, redirect relocation to GOT. Check
+ dynamic_sections_needed field rather than whether dynobj is set.
+ (sunos_finish_dynamic_link): Check dynamic_sections_needed field
+ rather than whether dynobj is set. Don't die if .need and .rules
+ sections were not created.
+ * aoutx.h (howto_table_ext): Mark PC10, PC22, and JMP_TBL entries
+ PC relative. Mark PC10 complain_overflow_dont. Mark PC22 and
+ JMP_TBL complain_overflow_signed.
+ (NAME(aout,final_link)): If info->shared is set, set DYNAMIC.
+ (aout_link_input_section_std): Call check_dynamic_reloc for all
+ relocs. Pass contents and &relocation. Don't warn about an
+ undefined symbol until check_dynamic_reloc has been called. Don't
+ warn about an undefined symbol for a base relative reloc.
+ (aout_link_input_section_ext): Likewise. For a base relative
+ reloc, always treat r_index as an index into the symbol table.
+ * libaout.h (struct aout_backend_data): Add contents and
+ relocation argument to check_dynamic_reloc entry point.
+ (struct aoutdata): Add local_got_offsets field.
+
+Wed Aug 16 01:03:07 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-i386.c (elf_i386_check_relocs): Fix bug in last change.
+
+Mon Aug 14 11:39:24 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * aoutx.h (NAME(aout,machine_type)): Handle a machine of
+ bfd_mach_sparc or bfd_mach_sparc64.
+
+ * elflink.h (elf_link_add_object_symbols): If a symbol is a weak
+ definition, add it to the dynamic symbol table if any dynamic
+ object mentions it. If we do add it, make sure we add the
+ corresponding real symbol.
+ (elf_adjust_dynamic_symbol): Adjust a weak defined symbol which we
+ put in the dynamic symbol table, even if no regular object refers
+ to it.
+ * elf32-i386.c (elf_i386_check_relocs): When creating a shared
+ library, don't allocate space for a PC relative reloc against a
+ local symbol.
+ * elf32-m68k.c (elf_m68k_check_relocs): Likewise.
+ * elf32-sparc.c (elf32_sparc_check_relocs): Likewise.
+ * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Change assertion
+ to accept symbol with weakdef set.
+ * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
+ * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
+ * elf32-m68k.c (elf_m68k_relocate_section): When creating a shared
+ libary, don't copy over a PC relative reloc against a local
+ symbol.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+
+Sun Aug 13 00:40:58 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.h (R_HPPA_BEGIN_BRTAB): Define.
+ (R_HPPA_END_BRTAB): Likewise.
+ * som.c (som_write_fixups): Handle R_BEGIN_BRTAB and R_END_BRTAB.
+
+Thu Aug 10 15:53:29 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffswap.h (coff_swap_aux_in): Swap the array dimensions
+ whenever x_fcnary is not being used for something else, rather
+ than only for an array.
+ (coff_swap_aux_out): Likewise.
+
+Tue Aug 8 16:34:57 1995 steve chamberlain <sac@slash.cygnus.com>
+
+ * cofflink.c (_bfd_coff_generic_relocate_section): Remove most
+ of special case stuff for PE. Now handled by relocs.
+ * coff-i386.c (coff_i386_reloc): Special case of PE type 7s.
+ (howto_table): Type 7 is dir32-rva.
+
+Tue Aug 8 10:15:43 1995 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * configure.host: Recognize aix4 explicitly.
+ * rs6000-core.c (CORE_DATA_SIZE_FIELD): New macro to get a the size
+ of a core dump's data section. Provide alternate definition for aix4.
+ (SAVE_FIELD): Similarly for save state field (register info).
+ (STACK_END_ADDR): Provide definition suitable for aix4.
+ * config/{aix4.mh,aix4.mt}: New configuration files.
+ * hosts/aix4.h: Likewise.
+
+Mon Aug 7 23:03:21 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * som.c (som_bfd_copy_private_symbol_data): Cast initializations
+ to avoid warnings.
+
+Mon Aug 7 14:51:08 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.c (som_decode_symclass): Handle absolute symbols by checking
+ the SOM type (since they will rarely if ever be in the absolute
+ section).
+
+Wed Aug 6 09:12:50 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * archures.c (bfd_mach_sparc, bfd_mach_sparc64): Define.
+ * bfd-in2.h: Regenerated.
+ * cpu-sparc.c (sparc_arch_info): Renamed from arch_info_struct.
+ (sparc64_arch_info): New static variable.
+ (bfd_sparc_arch): Link in sparc64_arch_info.
+ * elf64-sparc.c (sparc64_elf_xxx): Renamed from elf64_xxx.
+ (sparc64_elf_object_p): New static function.
+ (elf_backend_object_p): Define.
+ * config/sparc64-elf.mt (SELECT_VECS): Add bfd_elf32_sparc_vec.
+
+Sat Aug 5 00:04:08 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * som (som_get_reloc_upper_bound): Return -1 on error. Compute
+ return value with sizeof (arelent *), not sizeof (arelent).
+
+Wed Aug 2 12:32:21 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (bfd_section_from_shdr): If the section pointed to by the
+ sh_link field of a reloc section is not a symbol table, and the
+ file contains a single symbol table, clobber the sh_link field of
+ the reloc section to point to the symbol table.
+
+Tue Aug 1 10:09:01 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * coff-arm.c (howto reloc ARM26): Change size from 3 to 2.
+ (howto reloc ARM26D): Likewise.
+
+Mon Jul 24 14:17:50 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * aoutx.h (NAME(aout,find_nearest_line)): Use the line just before
+ the offset, not the one just after. Break out of the loop after
+ finding a function past the offset, not merely when finding a
+ function with a line defined.
+
+ * ecofflink.c (_bfd_ecoff_locate_line): When handling stabs:
+ correct setting of sym_ptr_end to consider symbols skipped when
+ setting sym_ptr; don't leave loop early unless an N_FUN is found
+ with a larger value.
+
+ * coff-sh.c (sh_coff_howtos): Mark R_SH_PCDISP8BY2 and R_SH_PCDISP
+ as PC relative. Describe R_SH_IMM16. Add entries for
+ R_SH_SWITCH16, R_SH_SWITCH32, R_SH_USES, R_SH_COUNT, and
+ R_SH_ALIGN.
+ (SWAP_IN_RELOC_OFFSET): Define.
+ (SWAP_OUT_RELOC_OFFSET): Define.
+ (CALC_ADDEND): Define.
+ (sh_reloc): Change sym_value and addr to type bfd_vma. Skip reloc
+ types other than R_SH_IMM32 and R_SH_PCDISP on an external symbol.
+ (coff_bfd_relax_section): Define.
+ (coff_bfd_get_relocated_section_contents): Define.
+ (sh_relax_section): New static function.
+ (sh_relax_delete_bytes): New static function.
+ (sh_relocate_section): Handle R_SH_PCDISP on an external symbol.
+ (sh_coff_get_relocated_section_contents): New static function.
+
+ * cofflink.c (coff_link_add_object_symbols): Call
+ _bfd_coff_get_external_symbols, not coff_link_get_symbols. Call
+ _bfd_coff_free_symbols, not coff_link_free_symbols. Call
+ _bfd_coff_read_string_table, not coff_read_string_table.
+ (coff_link_check_archive_element): Likewise.
+ (coff_link_input_bfd): Likewise.
+ (coff_link_get_symbols): Move to coffgen.c.
+ (coff_read_string_table): Likewise.
+ (coff_link_free_symbols): Likewise.
+ (_bfd_coff_internal_syment_name): New static function.
+ (coff_link_check_ar_symbols): Use _bfd_coff_internal_syment_name.
+ (coff_link_add_symbols): Likewise.
+ (coff_link_input_bfd): Likewise.
+ (_bfd_coff_generic_relocate_section): Likewise.
+ (_bfd_coff_read_internal_relocs): New function.
+ (coff_link_input_bfd): Use cached section contents if available.
+ Use _bfd_coff_read_internal_relocs.
+ * coffcode.h (coff_slurp_symbol_table): Don't call bfd_seek.
+ (coff_bfd_get_relocated_section_contents): Only define if not
+ already defined.
+ (coff_bfd_relax_section): Likewise.
+ * coffgen.c (build_string_table): Remove.
+ (_bfd_coff_get_external_symbols): New function, moved in from old
+ coff_link_get_symbols in cofflink.c.
+ (_bfd_coff_read_string_table): New function, moved in from old
+ coff_read_string_table in cofflink.c.
+ (_bfd_coff_free_symbols): New function, moved in frmo old
+ coff_link_free_symbols in cofflink.c.
+ (coff_get_normalized_symtab): Use _bfd_coff_get_external_symbols
+ rather than reading the symbols directly. To free them, call
+ _bfd_coff_free_symbols. Use _bfd_coff_read_string_table rather
+ than build_string_table.
+ * libcoff-in.h (obj_coff_keep_syms): Define.
+ (obj_coff_keep_strings): Define.
+ (coff_data_type): Add fields keep_syms and keep_strings.
+ (coff_section_tdata): Define new structure.
+ (coff_section_data): Define.
+ (_bfd_coff_get_external_symbols): Declare.
+ (_bfd_coff_read_string_table): Declare.
+ (_bfd_coff_free_symbols): Declare.
+ (_bfd_coff_read_internal_relocs): Declare.
+ * libcoff.h: Rebuild.
+
+Fri Jul 21 22:32:54 1995 Michael Meissner <meissner@cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_howto_raw): Add support for R_PPC_SDAREL
+ relocation.
+ (ppc_elf_reloc_type_lookup): Ditto.
+ (ppc_elf_got16_inner): Ditto.
+ (ppc_elf_relocate_section): Ditto.
+
+Thu Jul 20 19:19:06 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * elf32-hppa.c (hppa_elf_gen_reloc_type): Add new (ignored)
+ argument.
+ * elf32-hppa.h: Corresponding change.
+
+Thu Jul 20 19:01:07 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * libaout.h (set_aout_section_data): New macro.
+ * sunos.c (sunos_scan_relocs): Use it.
+
+ * aout-ns32k.c (MY_swap_std_reloc_out): Undef KEEPIT before
+ defining it.
+
+Thu Jul 20 13:48:00 1995 Fred Fish <fnf@cygnus.com>
+
+ * hosts/i386v4.h (getgid, getuid): Change prototypes to be
+ compatible with Unixware 1.x and Unixware 2.x, and probably other
+ i386 svr4 versions as well.
+
+Thu Jul 20 13:41:21 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * targets.c (bfd_target_vector): Since armpe and armpei have been
+ split into big- and little-endian variants, list all of them,
+ instead of the now-nonexistant armpe[i]_vec.
+
+Thu Jul 20 00:06:39 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (bfd_section_from_phdr): Set lma based on p_paddr.
+ (elf_fake_sections): Set sh_addr based on lma, not vma.
+
+Wed Jul 19 15:52:01 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * coff-arm.c (TARGET_LITTLE_SYM, TARGET_BIG_SYM): Replaces TARGET_SYM.
+ * configure.in (armpe_vec, armpei_vec): Add bi-endian support.
+ * configure: "regenerated".
+ * pe-arm.c (TARGET_LITTLE_SYM, TARGET_BIG_SYM): Replaces TARGET_SYM.
+ (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Replaces TARGET_NAME.
+ * pei-arm.c (TARGET_LITTLE_SYM, TARGET_BIG_SYM): Replaces TARGET_SYM.
+ (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Replaces TARGET_NAME.
+ * targets.c (armpe_vec, armpei_vec): Deleted.
+ (armpe_little_vec, armpe_big_vec, armpei_little_vec, armpei_big_vec):
+ Added.
+ * config/arm-pe.mt (DEFAULT_VECTOR): Default is armpe_little_vec.
+ (SELECT_VECS): Add bi-endian support.
+
+Wed Jul 19 10:47:25 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-sh.c: Clean up and comment.
+ (r_imm32): Remove.
+ (sh_coff_howtos): New static array.
+ (SH_COFF_HOWTO_COUNT): Define.
+ (get_symbol_value): Make relocation bfd_vma rather than long.
+ (RTYPE2HOWTO): Rewrite to use sh_coff_howtos.
+ (coff_relocate_section): Define to sh_relocate_section.
+ (sh_relocate_section): New static function.
+
+Sat Jul 15 01:02:53 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * configure.host: Add support for generic m68k SVR4 host.
+
+Fri Jul 14 13:13:55 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * aoutx.h (KEEPIT): Change definition to udata.i.
+ (KEEPITTYPE): Remove.
+ (NAME(aout,reloc_type_lookup)): Add cases to the
+ extended reloc type switch: SPARC_GOT10, SPARC_GOT13, SPARC_GOT22,
+ SPARC_PC10, SPARC_PC22, SPARC_WPLT30.
+ (NAME(aout,swap_std_reloc_out)): Don't bother to use stoi when
+ retrieving KEEPIT value.
+ (NAME(aout,swap_ext_reloc_out)): Likewise. Also, only add in
+ output section VMA for section symbols, and check BSF_SECTION_SYM
+ to control whether to set r_extern to 1.
+
+ * syms.c: Fix comments so that `make info' works.
+
+ * elf32-mips.c (mips_elf_find_nearest_line): Set SEC_HAS_CONTENTS
+ in .mdebug section, in case backend linker has cleared it.
+
+Fri Jul 14 11:58:34 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_addr16_ha_inner): Rewrite to take just one
+ argument, the final relocated address.
+ (ppc_elf_addr16_ha_inner): Adjust ppc_elf_addr16_ha_inner caller.
+ (ppc_elf_relocate_section): Ditto.
+
+Thu Jul 13 17:22:03 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.c (hppa_som_gen_reloc_type): Choose a reasonable field
+ selector relocation for the difference of two symbols.
+
+Thu Jul 13 10:33:25 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * aoutx.h (NAME(aout,slurp_reloc_table)): Cast argument to size_t
+ for malloc.
+ * coff-mips.c (mips_relocate_section): Likewise, for memmove.
+ (mips_relax_section): Likewise, for malloc.
+ * cofflink.c (process_embedded_commands): Likewise.
+ (_bfd_coff_final_link): Likewise.
+ * ecoff.c (_bfd_ecoff_write_object_contents): Likewise.
+ (ecoff_final_link_debug_accumulate): Likewise.
+ (ecoff_indirect_link_order): Likewise, for memcpy and malloc.
+ (ecoff_reloc_link_order): Likewise, for malloc.
+ * ecofflink.c (ecoff_align_debug): Likewise, for memset.
+ (ecoff_write_symhdr): Likewise, for malloc.
+ * elf32-hppa.c (elf32_hppa_read_symext_info): Likewise.
+ * elf.c (assign_file_positions_except_relocs): Likewise, for
+ qsort.
+ * elf32-mips.c (mips_elf_read_ecoff_info): Likewise, for malloc.
+ * elfcode.h (elf_slurp_reloc_table): Likewise.
+ * elfcore.h (elf_corefile_note): Likewise.
+ * elflink.h (elf_link_add_object_symbols): Likewise.
+ (elf_link_read_relocs): Likewise.
+ (NAME(bfd_elf,size_dynamic_sections)): Likewise, for memset.
+ * i386linux.c (bfd_linux_size_dynamic_sections): Likewise.
+ * ieee.c (do_with_relocs): Likewise.
+ * linker.c (default_indirect_link_order): Likewise, for malloc.
+ * nlmcode.h (nlm_object_p): Likewise.
+ (nlm_write_object_contents): Likewise.
+ * oasys.c (oasys_set_section_contents): Likewise, for memcpy.
+ * reloc.c (bfd_generic_get_relocated_section_contents): Likewise,
+ for malloc.
+ * section.c (bfd_get_section_contents): Likewise, for memcpy.
+ * srec.c (srec_get_section_contents): Likewise.
+ (srec_set_section_contents): Likewise.
+ * sunos.c (bfd_sunos_size_dynamic_sections): Likewise, for
+ realloc and memset.
+ (sunos_scan_relocs): Likewise, for malloc.
+ (sunos_scan_dynamic_symbol): Likewise, for realloc.
+ * syms.c (_bfd_generic_read_minisymbols): Likewise, for malloc.
+ * versados.c (versados_get_section_contents): Likewise, for
+ memcpy.
+
+ * libbfd.c (real_read): Add prototype. Change argument types from
+ int to size_t.
+ (bfd_read): Cast real_read argument to size_t, not int.
+ (bfd_write): Cast fwrite argument to size_t, not int.
+
+ * elf64-gen.c (elf_info_to_howto): Fix definition for recent elf.c
+ changes.
+
+ * configure.in: Fix typo: change {$enableval} to ${enableval}.
+ * configure: Rebuild.
+
+ * Makefile.in (BFD32_BACKENDS): Add elflink.o.
+
+ * targets.c (bfd_target): Add fields _read_minisymbols and
+ _minisymbol_to_symbol.
+ (BFD_JUMP_TABLE_SYMBOLS): Add _read_minisymbols and
+ _minisymbol_to_symbol.
+ (bfd_read_minisymbols): Define.
+ (bfd_minisymbol_to_symbol): Define.
+ * syms.c (_bfd_generic_read_minisymbols): Define.
+ (_bfd_generic_minisymbol_to_symbol): Define.
+ * libbfd-in.h (_bfd_nosymbols_read_minisymbols): Define.
+ (_bfd_nosymbols_minisymbol_to_symbol): Define.
+ (_bfd_generic_read_minisymbols): Declare.
+ (_bfd_generic_minisymbol_to_symbol): Declare.
+ * bfd-in2.h: Rebuild.
+ * libbfd.h: Rebuild.
+ * aoutx.h (MINISYM_THRESHOLD): Define.
+ (NAME(aout,read_minisymbols)): New function.
+ (NAME(aout,minisymbol_to_symbol)): New function.
+ * libaout.h (NAME(aout,read_minisymbols)): Declare.
+ (NAME(aout,minisymbol_to_symbol)): Declare.
+ * aout-target.h (MY_read_minisymbols): Define.
+ (MY_minisymbol_to_symbol): Define.
+ * All targets: Define read_minisymbols and minisymbol_to_symbol.
+
+Wed Jul 12 17:55:55 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * elflink.h (elf_link_add_object_symbols): Cast return value from
+ bfd_alloc.
+
+ * elfcode.h (size_info): Don't use "&" before function names.
+
+Wed Jul 12 00:16:48 1995 Ken Raeburn <raeburn@kr-pc.cygnus.com>
+
+ * libelf.h (elf_backend_data): Use unsigned, not unsigned char,
+ for bitfields.
+
+Tue Jul 11 15:19:53 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (bfd_section_from_shdr): In case SHT_REL[A], only get the
+ BFD section for the sh_link section if it is a SYMTAB section.
+
+ * 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.
+
+ * 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.
+
+ * 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.
+
+ * 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.
+
+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.
+
+Mon Jul 10 11:45:55 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * makefile.dos (OBJS): Add binary.o and tekhex.o. From DJ
+ Delorie.
+
+Mon Jul 10 11:09:58 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * linker.c (set_symbol_from_hash): bfd_link_hash_new case: Don't
+ abort; it can happen for constructor symbols when not building
+ constructors.
+
+ * coff-i960.c (coff_i960_relocate): Correct typo: use ! on strcmp,
+ not on string.
+ * cofflink.c (_bfd_coff_generic_relocate_section): Remove unused
+ local i.
+ * coff-arm.c (coff_arm_rtype_to_howto): Don't declare.
+ (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.
+
+ * 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.
+
+ 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.
+
+ * config/m68k-coff.mt (SELECT_VECS): Rename from SELECT_VECTORS.
+ Correct elements to be actual BFD vector names.
+
+ * Makefile.in (Makefile): Don't depend upon @frags@.
+ (config.status): Depend upon @frags@.
+
+Fri Jul 7 17:36:44 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * 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.
+
+Fri Jul 7 17:16:15 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * Makefile.in (do_mostlyclean): Remove config.log.
+ (do_distclean): Remove config.cache.
+
+Thu Jul 6 14:37:43 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-i386.c (elf_i386_relocate_section): Revert May 24 patch.
+ Don't copy PC32 reloc against section into shared object.
+
+ * 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.
+
+Wed Jul 5 20:17:14 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * elfcore.h, elflink.h, elfcode.h, elf.c, elflink.c: Moved some
+ primarily size-independent code from elfcode.h to elf.c and new
+ file elflink.c; moved out other core- or linker-related routines
+ into other new .h files for clarity. Renamed many routines to
+ start with bfd_elf or _bfd_elf. Added a structure of
+ size-dependent but target-independent info to elfcode.h.
+ * Makefile.in: Build elflink.o. Update dependencies.
+ * libelf.h: Updated some declarations. Added a definition for the
+ new structure in elfcode.h. Added more fields to elf backend data
+ structure.
+ * elfxx-target.h: Refer to the appropriate size-dependent info.
+ * elf32-*.c: Changed some function names. Moved common
+ create_dynamic_sections code from m68k, sparc, and i386 support
+ into elflink.c. Define some new macros to fill in new fields of
+ back end data. Also clean up some "gcc -Wall" warnings regarding
+ unused or uninitialized variables.
+
+ * Makefile.in (BFD_LIBS): No, don't put elflink.o here.
+ * configure.in: Include it here whenever elf.o is specified.
+
+Wed Jul 5 10:31:47 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * 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.
+
+ * 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.
+
+ * configure.in: Use $ac_config_sub, not $configsub.
+ * configure: Likewise.
+
+ Permit --enable-targets=ieee:
+ * config.bfd (*-*-ieee*): New target.
+ * config/ieee.mt: New file.
+
+Wed Jul 5 04:16:35 1995 Ken Raeburn <raeburn@kr-pc.cygnus.com>
+
+ * config/i386aix.mh (HDEFINES): Remove -DFASCIST_FDOPEN.
+
+ Autoconfiscation:
+ * configure.in, Makefile.in, doc/Makefile.in: Switch from Cygnus
+ configure to autoconf ways of processing --enable arguments,
+ setting up symlinks, incorporating makefile fragments, printing
+ messages at configuration time, setting variables in Makefile.
+ Deleted some unused variables. Check for ranlib via autoconf.
+ For now, configure script removes doc/config.status.
+ * configure: New file.
+ * dep-in.sed: Use @SRCDIR@ instead of @srcdir@, so Makefile.in
+ line doesn't get broken by configure.
+ * doc/configure.in: Removed.
+
+Tue Jul 4 12:22:21 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * 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.
+ (_bfd_write_archive_contents): Revert June 1 change.
+
+ * 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.
+
+ * 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.
+
+ * ecoff.c (_bfd_ecoff_find_nearest_line): Also initialize
+ find_buffer and fdrtab_len fields of newly allocated
+ find_line_info structure.
+
+Mon Jul 3 17:03:52 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * 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.
+
+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.
+
+Mon Jul 3 11:30:45 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ecoff.c (_bfd_ecoff_find_nearest_line): If we allocate
+ find_line_info, clear the fdrtab field.
+
+ * targets.c (enum bfd_flavour): Add bfd_target_msdos_flavour here,
+ rather than in bfd-in2.h.
+
+ * bfd.c (enum bfd_error): Define bfd_error_no_armap.
+ (bfd_errmsgs): Add string for bfd_error_no_armap.
+ * bfd-in2.h: Rebuild.
+ * ecoff.c (ecoff_link_add_archive_symbols): If an archive has no
+ armap, set bfd_error_no_armap rather than bfd_error_no_symbols.
+ * elfcode.h (elf_link_add_archive_symbols): Likewise.
+ * linker.c (_bfd_generic_link_add_archive_symbols): Likewise.
+
+ * 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.
+
+ * Makefile.in: Rebuild dependencies.
+ (BFD32_BACKENDS): Add versados.o.
+ (CFILES): Add pe-i386.c, pei-i386.c, and versados.c.
+
+Sun Jul 2 17:49:32 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * cofflink.c (_bfd_coff_generic_relocate_section): Cast base_file
+ to FILE * before using it.
+ * stab-syms.c: Revert yesterday's patch.
+
+Sat Jul 1 12:10:42 1995 Fred Fish <fnf@cygnus.com>
+
+ * stab-syms.c (stdio.h): Include prior to libaout.h, which
+ includes bfdlink.h, which now uses FILE.
+
+Sat Jul 1 00:11:08 1995 Ken Raeburn <raeburn@cygnus.com>
+
+ * elfxx-target.h: New file.
+
+ * libelf.h (struct elf_backend_data): Remove elf_64_p field.
+ * elfxx-target.h (elfNN_bed): Don't set it.
+
+ * elf32-target.h, elf64-target.h: Deleted.
+ * Makefile.in (elf32-target.h, elf64-target.h): Build them from
+ elfxx-target.h.
+
+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.
+
+Fri Jun 30 15:47:37 1995 Fred Fish <fnf@cygnus.com>
+
+ * cofflink.c (_bfd_coff_generic_relocate_section):
+ Remove extra '+'.
+
+Thu Jun 29 17:24:52 1995 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * coff-h8300.c (COFF_LONG_FILENAMES): Define.
+
+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.
+
+Mon Jun 26 13:53:49 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * elf32-hpa.c (elf32_hppa_relocate_section): Close comment before
+ R_PARISC_DPREL21L handling.
+
+Thu Jun 22 19:28:36 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ Sun May 7 11:53:41 MDT 1995 Bryan Ford <baford@cs.utah.edu>
+
+ * config/i386-moss.mt: created.
+
+Thu Jun 22 08:56:10 1995 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * reloc.c (bfd_perform_relocation): Add case for -ve words.
+
+Wed Jun 21 13:13:49 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * elf32-hppa.c (elf32_hppa_relocate_section): Don't try to apply a
+ relocation against an undefined symbols.
+
+Wed Jun 21 10:16:10 1995 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * versados.c: Second pass/rewrite.
+
+Mon Jun 19 08:40:45 1995 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * syms.c (coff_section_type): Compare only the front part
+ of a section name.
+
+Sat Jun 17 09:40:44 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * elf32-hppa.c (elf32_hppa_size_stubs): Set the size of the stub
+ section if we get an error.
+
+ * 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".
+
+Fri Jun 16 15:04:47 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * 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.
+
+Fri Jun 16 00:07:25 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * elf32-hppa.c (elf32_hppa_bfd_link_link_relocate): Use the right
+ type field (there are two!) when checking to see if $global$ is
+ defined.
+
+Thu Jun 15 14:03:47 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * bfd-in.h, bfd-in2.h (bfd_boolean): Rename bfd_true, bfd_false
+ to bfd_tttrue, bfd_fffalse so as not to conflict with functions.
+ * coffswap.h (coff_swap_scnhdr_out): Remove version that was
+ hacked for MPW C.
+ * mpw-config.in: Set shell vars instead of pasting to makefile
+ for each configuration, edit coffswap.h to make MPW C not choke.
+ (i386-unknown-coff, sh-hitachi-hms): Recognize.
+ * mpw-make.in (BFD_LIBS): Add versados.c.o.
+
+ * versados.c (versados_scan): Properly cast results from bfd_alloc.
+
+Wed Jun 14 15:27:32 1995 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * cofflink.c (process_embedded_commands): New function
+ reads and handles .drectve sections for PE.
+ (coff_link_input_bfd): Call new function if PE.
+
+Mon Jun 12 12:09:39 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * bfd-in.h (bfd_set_section_vma): Case true to a boolean.
+ (bfd_set_cacheable): Likewise.
+ * bfd-in2.h: Rebuilt.
+
+Fri Jun 9 12:20:28 1995 Steve Chamberlain <sac@rtl.cygnus.com>
+
+ * elfcode.h (elf_sort_hdrs): Rewrite to be symmetrical.
+
+Fri Jun 9 12:49:00 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * targets.c: Add copy_private_symbol_data and link_split_section
+ to the target vector.
+ * libbfd-in.h (_bfd_generic_bfd_copy_private_symbol_data): Define.
+ (_bfd_nolink_bfd_link_split_section): Likewise.
+ (bfd_generic_link_split_section): Declare.
+ * syms.c (bfd_copy_private_symbol_data): Define.
+ * linker.c (bf_link_split_section): Likewise.
+ * som.c (som_bfd_copy_private_symbol_data): New function
+ (som_bfd_link_split_section): Likewise.
+ * All other targets updated with default versions of new routines.
+
+ * Take out my braindamaged bfd_true/bfd_false changes from earlier
+ today. Replace with just:
+ * bfd-in.h: (TRUE_FALSE_ALREADY_DEFINED): Define this if
+ compiling with g++-2.6 or later.
+ * bfd-in2.h: Rebuilt.
+
+Fri Jun 9 07:54:29 1995 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * versados.c (struct esd, get_4): Lint; use unsigned chars.
+
+ * coff-i960.c (coff_i960_relocate): Compare output section names
+ when converting for vxworks.
+
+Wed Jun 7 19:01:30 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * elfcode.h (elf_fake_sections): Permit .scommon or COMMON
+ sections as random SHT_NOBITS sections, in case a linker script is
+ strange.
+
+Tue Jun 6 17:29:32 1995 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * bfd-in.h (NT_subsystem, NT_stack_heap): Moved from pe.h
+ * coff-i386.c (coff_i386_rtype_to_howto): Get PE relocs right.
+ * coffcode.h (coff_mkobject): Set pe tdata bit when using PE.
+ * cofflink.c (COFF_WITH_PE code): Test on obj_pe bit rather
+ than conditional compile.
+ * configure.in: Fix PE dependencies.
+ * libcoff-in.h (obj_pe): New.
+ (coff_tdata): Added pe entry.
+ * libcoff.h: Regenerated.
+
+Mon Jun 5 09:07:13 1995 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * coff-a29k.c (coff_a29k_adjust_symndx): Completely parenthesize
+ macro.
+
+Mon Jun 5 02:15:20 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com>
+
+ Linker support for m68k-elf from Andreas Schwab
+ <schwab@issan.informatik.uni-dortmund.de>:
+ * elfcode.h (elf_link_add_object_symbols): Check for NULL when
+ looping through the symbol hashes.
+ (elf_bfd_final_link): When looking for _init and _fini don't use
+ the symbol if it is imported from another object.
+ * elf32-m68k.c: Relocation type changed from REL to RELA. Regular
+ and dynamic linking support functions added, similar to other elf
+ targets.
+
+ * config.bfd (i[345]86-*-gnu*): Use ELF configuration.
+
+Fri Jun 2 18:54:59 1995 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * versados.c: New file.
+ * bfd-in2.h (struct _bfd): New field.
+ * bfd.c (struct _bfd): New field.
+ * configure.in (versados_vec): New field.
+ * targets.c (bfd_flavor): Added versados.
+
+Thu Jun 1 13:51:49 1995 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * coffcode.h (sec_to_styp_flags, styp_to_sec_flags,
+ coff_new_section_hook): Any section that starts ".stab"
+ is now marked as debugging.
+
+Thu Jun 1 16:15:16 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * archive.c (_bfd_write_archive_contents): Disable extended name
+ table until it can be made optional, so that native AR has half a
+ chance on SunOS and HP/UX.
+
+ * linker.c (_bfd_generic_link_output_symbols, case
+ bfd_link_hash_indirect): Add cast to correct pointer types.
+
+Sat May 27 21:37:31 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * config.bfd (m68k-bull-sysv*): Added strip_underscore=yes.
+ (m68k-est-coff): Removed. target does not effect object format.
+
+Wed May 24 10:52:01 1995 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * linker.c (_bfd_generic_link_output_symbols): Cope with
+ indirect symbols.
+
+ * 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, coff-arm.c, reloc.c, targets.c, config/arm-pe.mt:
+ Support for ARM COFF/PE.
+
+Tue May 23 19:24:58 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * bfd.c (bfd_get_relocated_section_contents): Now a function,
+ tries calling routine from input bfd target vector for
+ bfd_indirect_link_order. Put a declaration into the header file.
+ * bfd-in2.h: Regenerated.
+ * elf32-mips.c (gprel16_with_gp): New function, split out from
+ mips_elf_gprel16_reloc.
+ (mips_elf_gprel16_reloc): Call it. If output bfd target vector
+ isn't elf flavoured, abort, since it's assumed to be elf in some
+ of this code, including the code that looks up the gp value.
+ (elf32_mips_get_relocated_section_contents): New function,
+ modified from bfd_generic_get_relocated_section_contents to deal
+ with passing gp to gprel16_with_gp.
+ (bfd_elf32_bfd_get_relocated_section_contents): New macro.
+ * elf32-target.h (bfd_elf32_bfd_get_relocated_section_contents):
+ Don't define if already defined.
+
+Tue May 23 15:58:15 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * Makefile.in: Install bfdlink.h too.
+
+Sun May 21 22:25:09 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * elf32-hppa.c (elf32_hppa_relocate_section): Handle undefined and
+ notsupported return codes from final_link_relocate (used when
+ $global$ is undefined or nonexistant).
+ (elf32_hppa_bfd_link_link_relocate): If $global$ exists, but is
+ not defined,then return bfd_reloc_undefined.
+
+Fri May 19 10:00:14 1995 Steve Chamberlain <sac@rtl.cygnus.com>
+
+ * coffswap.h: (IMAGE_BASE): Define to 0 if not.
+
+Thu May 18 04:24:01 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com>
+
+ Wed May 10 14:28:16 1995 Richard Earnshaw (rearnsha@armltd.co.uk)
+
+ * aoutx.h (aout_link_input_section_standard): If defined, call
+ MY_relocatable_reloc before doing a partial relocation.
+
+ * aout-arm.c: (WRITE_HEADERS): Delete.
+ (NAME): Define version to override default in aoutx.h
+ (MY(howto_table)): Reformat. Alter some entries slightly.
+ (RELOC_ARM_BITS_NEG_{BIG,LITTLE}): Define.
+ (MY(reloc_howto), MY(put_reloc), MY(relocatable_reloc)): New functions.
+ (MY_reloc_howto, MY_put_reloc, MY_relocatable_reloc): Define.
+ (MY(fix_pcrel_26)): Renamed from aoutarm_fix_pcrel_26, return
+ bfd_reloc_ok not bfd_reloc_continue.
+ (MY(fix_pcrel_26_done)): Likewise.
+ (MY(bfd_reloc_type_lookup)): Renamed from aoutarm_reloc_type_lookup.
+ (MY_bfd_link_hash_table_create, MY_bfd_link_add_symbols,
+ MY_bfd_final_link): Delete.
+ (MY_swap_std_reloc_in, MY_swap_std_reloc_out, MY_get_section_contents):
+ Define.
+ (aoutx.h): Include it.
+ (MY(swap_std_reloc_{in,out})): New functions.
+ Use RELOC_ARM_BITS_NEG_{BIG,LITTLE} to extract negative reloc bit.
+ (aoutarm_squirt_out_relocs): Delete.
+
+ From: David Taylor (dtaylor@armltd.co.uk)
+ * config/arm[lb]-aout.mt: New files.
+ * aout-arm.c: New file.
+ * config.bfd: Handle arm{,e[lb]}-*-aout
+ * configure.in: Add vetor for aout_arm_{big,little}_vec.
+ * reloc.c: New relocation types for the ARM.
+ * targets.c (aout_arm_{big,little}_vec): declare.
+
+Tue May 16 10:29:51 1995 Jim Kingdon <kingdon@deneb.cygnus.com>
+
+ * libbfd.c (bfd_stat): If bfd_cache_lookup returns an error,
+ return an error to the caller. Call bfd_set_error on errors.
+
+Tue May 16 14:44:45 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * libcoff-in.h (coff_renumber_symbols): Modified prototypes in
+ accordance with 11 May libcoff.h change.
+
+Thu May 11 16:43:14 1995 Steve Chamberlain <sac@slash.cygnus.com>
+
+ 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>
+
+ * 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.
+
+Tue May 9 17:01:38 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config.bfd: Add little endian PowerPC support.
+ * configure.in: Ditto.
+ * targets.c: Ditto.
+ * config/ppcle-elf.mt: New file, for little endian PowerPC
+ support.
+ * config/ppc-elf.mt: Add little endian powerpc to the BFD
+ selection vectors.
+ * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Complain if
+ linking a different endian object than we expect.
+ (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Define, to provide little
+ endian support.
+
+Tue May 2 16:32:24 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * config.bfd (hppa*-*-lites*): Treat just like hppa*-*-*elf*.
+
+Tue Apr 25 19:38:43 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * coffgen.c (make_a_section_from_file): Initialize lma same as
+ vma.
+
+Tue Apr 25 11:03:21 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+
+ * hosts/std-host.h: #include ansidecl.h 'cause PTR is used in
+ std-host.h.
+
+Mon Apr 24 23:56:44 1995 Ken Raeburn (raeburn@kr-pc.cygnus.com)
+
+ * hosts/i386linux.h (HAVE_PROCFS): Don't define it. Added lengthy
+ comment explaining why.
+
+Mon Apr 24 10:34:02 1995 Michael Meissner <meissner@cygnus.com>
+
+ * hosts/i386linux.h (HAVE_PROCFS): If NO_PROCFS is defined, don't
+ define HAVE_PROCFS.
+
+Mon Apr 24 08:33:12 1995 Michael Meissner <meissner@cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_relocate_section): Do not continue
+ processing unknown symbols to prevent a cascade of errors.
+
+Fri Apr 21 12:48:48 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ Patches from H.J. Lu for Linux ELF core file support.
+ * elfcode.h (elf_core_file_matches_executable_p) [HAVE_PROCFS]:
+ Use prpsinfo_t instead of struct prpsinfo, for consistency.
+ * hosts/i386linux.h (HAVE_PROCFS): Define.
+
+Thu Apr 20 09:07:39 1995 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * linker.c (link_action): Do the right thing when a undefined
+ strong symbol appears after an undefined weak symbol.
+
+Fri Apr 14 16:51:17 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_relocate_section): New function to relocate
+ a whole section for the linker, bypassing bfd_perform_relocation.
+ (ppc_elf_reloc_type_lookup): New function to map the BFD
+ enumeration code into a howto structure.
+ (ppc_elf_howto_raw): Rename from ppc_elf_howto_table.
+ (ppc_elf_howto_table): New array that maps PowerPC relocation
+ numbers to howto structures without a linear search. Change from
+ using bfd_elf_generic_reloc to use ppc_elf_std_reloc.
+ (ppc_elf_howto_init): Initialize ppc_elf_howto_table from
+ ppc_elf_howto_raw.
+ (ppc_elf_reloc_type_lookup): Use a case statement instead of a
+ loop.
+ (ppc_elf_std_reloc): Replacement for bfd_elf_generic_reloc.
+ (ppc_elf_unsupported_reloc): Print a real error message, instead
+ of calling abort.
+ (ppc_elf_addr16_ha_inner): Abstract getting adjustment from
+ ppc_elf_addr16_ha_reloc, so ppc_elf_relocate_section can use it
+ too.
+ (ppc_elf_addr16_ha_reloc): Call it.
+ (ppc_elf_got16_inner): Abstract getting adjustment from
+ ppc_elf_got16_reloc, so ppc_elf_relocate_section can use it too.
+ (ppc_elf_got16_reloc): Call it.
+ (ppc_elf_info_to_howto): Rename from powerpc_info_to_howto.
+
+ * elfcode.h (elf_symbol_from_bfd_symbol): Omit space in debugging
+ output.
+ (elf_symbol_flags): Add debug function to decode flags so that
+ defining DEBUG to be 4 will compile again.
+ (elf_debug_section): Fix typo in debug output.
+
+Fri Apr 14 16:03:04 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * config.bfd: Add m68*-*-elf*.
+ * elf32-m68k.c: Filled out implementation, except for dynamic
+ linking support.
+ * reloc.c (enum bfd_reloc_code_real): Added *_GOT_PCREL, *_GOTOFF,
+ *_PLT_PCREL, *_PLTOFF, *_68K_* relocations for ELF.
+ * libbfd.h, bfd-in2.h: Regenerated.
+
+Thu Apr 13 14:28:04 1995 Torbjorn Granlund <tege@adder.cygnus.com>
+
+ * coff-m68k.c (COFF_DEFAULT_SECTION_ALIGNMENT_POWER): Change from
+ 1 to 2.
+ (bfd_target): Change minimum section alignment from 1 to 2.
+
+Wed Apr 12 12:40:04 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * aoutx.h (machine_type, case bfd_arch_mips): Treat R8000 like
+ R6000 and R4000 for now.
+
+Tue Apr 4 12:28:25 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-config.in: New file, MPW version of configure.in.
+ * mpw-make.in: New file, MPW version of Makefile.in.
+ * hosts/mpw.h: New file, MPW host definitions.
+ * ecoffswap.h (ecoff_swap_pdr_in, ecoff_swap_pdr_in) [MPW_C]:
+ Alternate versions without ECOFF_64 that chokes MPW C.
+ * coffswap.h (coff_swap_scnhdr_out): Add alternative version with
+ partly-expanded macros.
+
+Thu Mar 30 14:56:21 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * reloc.c (bfd_perform_relocation): Don't bother to check for
+ overflow if the symbol is undefined.
+
+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.
+
+Wed Mar 29 12:01:30 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * 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.
+
+ * cpu-h8500.c (arch_info_struct): Change name from "H8/300" to
+ "h8300" for consistency with other cpu-* files.
+
+Tue Mar 28 15:14:11 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * bout.c (b_out_canonicalize_reloc): Handle SEC_CONSTRUCTOR
+ sections.
+ (b_out_get_reloc_upper_bound): Likewise.
+
+ * 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.
+
+Tue Mar 21 10:50:32 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * 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.
+
+Mon Mar 20 22:39:10 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.c (som_slurp_symbol_table): Tighten test to determine
+ what symbols are section symbols.
+
+Sat Mar 18 01:54:45 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * elfcode.h (elf_bfd_link_add_symbols): An empty archive is OK.
+
+Fri Mar 17 16:29:02 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.c (som_bfd_copy_private_section_data): Just return true when
+ either the input or output section isn't attached to a SOM BFD.
+ (som_bfd_copy_private_bfd_data): Similarly for BFD private data.
+
+Fri Mar 17 11:50:34 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * elfcode.h (elf_link_add_object_symbols): Check whether a dynamic
+ object has already been included, and ignore it the second time.
+
+Wed Mar 15 11:56:40 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-sparc.c (elf_sparc_howto_table): Change R_SPARC_GOT13 from
+ complain_overflow_bitfield to complain_overflow_signed.
+
+ * libelf.h (bfd_elf32__write_relocs): Don't declare.
+ (bfd_elf64__write_relocs): Don't declare.
+
+Tue Mar 14 05:54:33 1995 Ken Raeburn (raeburn@kr-pc.cygnus.com)
+
+ * stab-syms.c (aout_stab_name): Moved aout_stab_names to be local
+ to this function. Recoded function to stop using table, to
+ improve performance (on i486-netbsd host). Left old version
+ intact under "#if 0" for further performance testing.
+
+Mon Mar 13 13:48:49 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * 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.
+
+ * 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.
+
+ * archive.c (bsd_write_armap): Cast getuid and getgid results to
+ long, and print with %ld.
+
+Fri Mar 10 16:41:05 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * aoutx.h (translate_to_native_sym_flags): Always use the output
+ section if it is not NULL.
+
+Thu Mar 9 15:06:25 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * 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.
+
+ * 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.
+
+ * 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.
+
+Thu Mar 9 12:04:05 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * bfd.c (bfd_merge_private_bfd_data): New function vector to be
+ called by the linker to merge any private bfd data of the input
+ files and the output file. Used by the PowerPC ELF support to
+ check whether -mrelocatable is used for all modules.
+ (bfd_set_private_flags): New function vector to be called by the
+ assembler to set private flags. Used by the PowerPC ELF support
+ to set that a particular object file was assembled with the
+ -mrelocatable option.
+
+ * targets.c (BFD_JUMP_TABLE_COPY): Add intiialization of the
+ bfd_merge_private_bfd_data and bfd_set_private_flags function
+ vectors.
+
+ * bfd-in2.h, libbfd-in.h: Rebuild with bfd.c and targets.c
+ changes.
+
+ * elf32-ppc.c (ppc_elf_set_private_flags): New function to set the
+ ELF e_flags field.
+ (ppc_elf_copy_private_bfd_data): Copy the e_flags field from the
+ input file to the output file.
+ (ppc_elf_merge_private_bfd_data): Check for a mismatch between the
+ e_flags field of all of the linker input files.
+
+ * libelf.h (elf_obj_tdata): Add ppc_flags_init field so that the
+ PowerPC support can check if compataible e_flags are present.
+
+ * aout-target.h: Add NOP for the bfd_merge_private_bfd_data
+ and bfd_set_private_flags function vectors.
+ * coffcode.h: Ditto.
+ * elf32-target.h: Ditto.
+ * elf64-target.h: Ditto.
+ * libbfd.h: Ditto.
+ * libecoff.h: Ditto.
+ * som.c: Ditto.
+
+Wed Mar 8 00:53:54 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * cpu-mips.c (arch_info_struct): Add mips:8000 entry.
+
+ * elfcode.h (swap_out_syms): Mark an undefined BSF_WEAK symbol as
+ STB_WEAK rather than STB_GLOBAL.
+
+Tue Mar 7 12:23:47 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * 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.
+
+ * format.c (bfd_check_format_matches): Skip binary_vec when
+ searching through bfd_target_vector.
+
+ * elfcode.h (elf_sort_hdrs): Check SHT_NOBITS before checking
+ sh_size.
+
+Mon Mar 6 23:31:36 1995 Doug Evans <dje@chestnut.cygnus.com>
+
+ * elfcode.h (elf_sort_hdrs): Keep SHT_NOBITS sections after
+ !SHT_NOBITS ones.
+
+Mon Mar 6 09:53:08 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * 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.
+
+Thu Mar 2 15:58:24 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * aoutx.h (NAME(aout,swap_ext_reloc_in)): Treat the index of a
+ base relative reloc as an index into the symbol table, regardless
+ of the setting of r_extern.
+ (NAME(aout,swap_std_reloc_in)): Likewise.
+
+ * aoutx.h (NAME(aout,set_section_contents)): Double check that the
+ caller is writing to a valid section.
+
+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.
+
+Wed Mar 1 17:30:46 1995 Michael Meissner <meissner@cygnus.com>
+
+ * elf32-ppc.c (elf_powerpc_howto_table): For relocation
+ R_PPC_GOT16, change complain_on_overflow to be
+ complain_overflow_signed.
+
+Wed Mar 1 11:52:55 1995 Jason Molenda <crash@phydeaux.cygnus.com>
+
+ * configure.host: Recognize powerpc-*-aix*.
+
+Wed Mar 1 11:57:39 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-i960.c (COFF_PAGE_SIZE): Define.
+
+ * configure.in: Rewrite output of TDEFAULTS to avoid relying on
+ semantics of single quotes in parameter substitution.
+
+Tue Feb 28 12:53:09 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * elfcode.h (elf_sort_hdrs): Sort empty sections before non-empty
+ sections, if they have the same VMA.
+
+ * 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.
+
+Mon Feb 27 12:58:25 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * config.bfd: add a29k-*-vxworks configuration.
+
+Wed Feb 22 14:40:26 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * libaout.h (NAME(aout,slurp_reloc_table)): Change declaration to
+ use reloc_howto_type rather than const struct reloc_howto_struct.
+
+Tue Feb 21 18:19:22 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * bout.c (b_out_slurp_reloc_table): Don't return an error if asked
+ for relocations for the .bss section.
+
+Tue Feb 21 15:13:05 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.c (som_bfd_ar_write_symbol_stuff): Handle objects with odd
+ lengths.
+
+Fri Feb 17 12:34:36 1995 Michael Meissner <meissner@cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_got16_reloc): Make GOT style relocs add
+ 32768, so the GOT pointer can point to 16384 pointers, instead of
+ 8192.
+
+Fri Feb 17 11:45:38 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * 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.
+
+ * syms.c (bfd_decode_symclass): Return 'W' for a weak symbol.
+
+ * 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.
+
+ * coffgen.c: Reindented.
+
+Thu Feb 16 14:37:23 1995 Doug Evans <dje@cygnus.com>
+
+ * reloc.c (bfd_perform_relocation): Don't use bitpos in overflow
+ calculations.
+ (bfd_install_relocation): Likewise.
+
+Thu Feb 16 13:22:29 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * hosts/std-host.h: Remove all function declarations which return
+ int or void, except the one for free.
+
+Wed Feb 15 14:54:18 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (elf_powerpc_howto_table): Use a destination mask of
+ 0xffffffff for R_PPC_REL32, not 0.
+ (powerpc_reloc_map): Add low 16 bit, high 16 bit, and high 16 bit
+ adjusted relocations.
+
+Tue Feb 14 17:47:17 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * 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.
+
+Tue Feb 14 14:04:22 1995 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * libelf.h (elf_backend_data): Add fields elf_machine_alt1 and
+ elf_machine_alt2 which provide alternate versions of the machine
+ code.
+
+ * elf32-ppc.c (ELF_MACHINE_ALT1, ELF_MACHINE_ALT2): Define to
+ recognize old versions of the PowerPC machine code.
+
+ * elf32-target.h (elf32_bed): Initialize alternate machine code
+ fields defined by ELF_MACHINE_ALT1 and ELF_MACHINE_ALT2.
+
+ * elf64-target.h (elf64_bed): Initialize alternate machine code
+ fields defined by ELF_MACHINE_ALT1 and ELF_MACHINE_ALT2.
+
+ * elfcode.h (elf_object_p, elf_core_file_p): In addition to the
+ main machine code field, check the two alternate machine code
+ fields.
+
+Tue Feb 14 12:46:48 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * 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.
+
+Mon Feb 13 23:25:38 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * 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.
+
+Thu Feb 9 18:36:52 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * Makefile.in (BFD32_BACKENDS): Add i386msdos.o.
+
+Thu Feb 9 12:02:35 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * i386linux.c (NEEDS_SHRLIB): Define.
+ (linux_tally_symbols): Crash if a NEEDS_SHRLIB symbol is
+ undefined. From hjl@nynexst.com (H.J. Lu).
+
+Wed Feb 8 17:26:00 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * 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.
+
+Wed Feb 8 09:53:42 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * elfcode.h (elf_sort_hdrs): Put SHT_NOBITS sections after !SHT_NOBITS.
+
+Tue Feb 7 16:27:33 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.c (som_bfd_find_nearest_line): Just return false, don't
+ abort.
+
+Tue Feb 7 14:43:33 1995 Ken Raeburn (raeburn@kr-pc.cygnus.com)
+
+ * ecoff.c: Reformatted some comments and brace constructs in
+ recent changes to GNU style.
+ (cmp_fdrtab_entry, mk_fdrtab, lookup): Use old-style function
+ definitions.
+
+Tue Feb 7 14:21:28 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * ecoffswap.h (ecoff_swap_pdr_in): Zero out intern before setting
+ any of the fields.
+
+Mon Feb 6 20:01:24 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ Sat Feb 4 14:20:24 1995 David Mosberger-Tang <davidm@piston.cs.arizona.edu>
+
+ * ecoffswap.h (ecoff_swap_pdr_in, ecoff_swap_pdr_out): added
+ internalizing/externalizing new "prof" field.
+
+ * libecoff.h (ecoff_tdata): added fdrtab.
+
+ * ecoff.c (_bfd_ecoff_find_nearest_line): Fixed.
+
+Mon Feb 6 14:25:24 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * 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.
+
+ * 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.
+
+ 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.
+
+Mon Feb 6 03:20:17 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ Changes from Bryan Ford, baford@schirf.cs.utah.edu:
+ * config.bfd (i[345]86-*-msdos*): New target.
+ * configure.in (i386msdos_vec): Handle it.
+ * i386msdos.c: New file.
+ * config/i386-msdos.mt: New file.
+ * bfd.c (enum bfd_error): Added new value bfd_error_file_too_big.
+ (bfd_errmsgs): Added string to table.
+ * libaout.h (reloc_type-lookup): Declare it.
+ * targets.c (enum bfd_flavour): Added bfd_target_msdos_flavour.
+ (i386msdos_vec): Declare.
+ (bfd_target_vector): Add it to the list.
+ * bfd-in2.h: Regenerated.
+
+Wed Feb 1 01:32:14 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.c (som_set_reloc_info, case R_DATA_ONE_SYMBOL): If there's
+ nothing in R_DATA_OVERRIDE, then try to find the addend in the
+ section's contents.
+ (som_write_fixups): Ignore the addend in a R_DATA_ONE_SYMBOL fixup.
+
+ * 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.
+
+Tue Jan 31 21:53:28 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * 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.
+
+Tue Jan 31 15:27:53 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * 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.
+
+Mon Jan 30 22:04:53 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * 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.
+
+Mon Jan 30 11:22:11 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * elfcode.h (NAME(bfd_elf,record_link_assignment)): Don't do
+ anything if we are not linking an ELF file.
+ (NAME(bfd_elf,size_dynamic_sections)): Likewise.
+
+Sat Jan 28 12:48:57 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * 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.
+
+ * som.c (som_object_setup): New heuristic to determine if the
+ entry and flags fields are switched in the exec header.
+
+Sat Jan 28 00:16:01 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * elfcode.h (elf_link_add_object_symbols): Use *sym_hash instead
+ of h if we might not be doing an ELF link.
+
+Fri Jan 27 16:13:42 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * 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.
+
+ * elfcode.h (elf_sort_hdrs): Correct SHF_ALLOC test.
+ (assign_file_positions_except_relocs): Free sorted_hdrs.
+
+Thu Jan 26 09:00:12 1995 Steve Chamberlain <sac@splat>
+
+ * srec.c (srec_set_section_contents): Fix off by
+ one end address calculation.
+
+ * config.bfd: (m68*-est-coff): New configuration.
+
+Thu Jan 26 11:39:21 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * elfcode.h (elf_link_add_object_symbols): Only examine weakdef if
+ we are using an ELF hash table.
+
+ * 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.
+
+Thu Jan 26 11:12:54 1995 Michael Meissner <meissner@cygnus.com>
+
+ * elfcode.h (prep_headers): Use EM_PPC instead of
+ EM_CYGNUS_POWERPC.
+
+ * elf32-ppc.c (reloc_type): Add all System V.4 and eABI
+ relocations currently defined.
+ (powerpc_reloc_map): Adjust to new relocation names.
+ (elf_powerpc_howto_table): Add most of the new relocations.
+ (ELF_MACHINE_CODE): Use EM_PPC instead of EM_CYGNUS_POWERPC.
+
+ * config.bfd: Add support for powerpc-*-eabi.
+
+ * config/ppc-elf.mt: Add rs6000 architecture support to the
+ PowerPC. Also add XCOFF support.
+
+Wed Jan 25 23:26:13 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-sh.c (CALC_ADDEND): Don't define.
+ (coff_sh_relocate_section): Remove.
+ (coff_relocate_section): Use _bfd_coff_generic_relocate_section.
+
+Tue Jan 24 14:22:47 1995 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * elf32-mips.c (mips_elf_output_extsym): Set the value of the
+ ECOFF symbol from the hash table entry.
+
+Mon Jan 23 14:53:35 1995 Steve Chamberlain <sac@splat>
+
+ * coff-sh.c (coff_sh_relocate_section): Don't subtract
+ vma twice.
+
+Mon Jan 23 13:33:18 1995 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * coff-sh.c (sh_reloc): Don't ignore the previous contents of an
+ R_SH_IMM32 reloc.
+
+ * config.bfd (i[345]86-*-gnu*): Set bfd_name to i386-gnu.
+ * config/i386-gnu.mt: New file. Include ELF support.
+
+ * opncls.c (bfd_openstreamr): Call bfd_cache_init.
+
+Fri Jan 20 11:44:45 1995 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * sunos.c (sunos_add_one_symbol): Only set the sunos specific
+ fields if we are doing a sunos link.
+
+Wed Jan 18 12:28:17 1995 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * cpu-h8300.c (h8300_info_struct): Change name from "H8/300" to
+ "h8300" for consistency with other cpu-* files.
+ (h8300h_info_struct): Change name from "H8/300H" to "h8300h".
+ * coff-h8300.c (special): Remove unused variable diff.
+
+Tue Jan 17 10:52:32 1995 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * 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.
+
+ * opncls.c (bfd_openstreamr): New function.
+ * bfd-in2.h: Rebuilt.
+
+ * 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.*.
+
+ * srec.c (srec_init): Remove unused local variable i.
+
+Sat Jan 14 19:09:48 1995 Steve Chamberlain <sac@jonny>
+
+ * archures.c, Makefile.in, targets.c, bfd-in2.h, coffcode.h,
+ config.bfd, configure.in, config/w65.mt: Initial support for the W65.
+
+Sun Jan 15 13:57:45 1995 Steve Chamberlain <sac@splat>
+
+ * opncls.c (bfd_fdopenr): Configure for WIN32.
+
+Thu Jan 12 16:30:47 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * Makefile.in (diststuff): Include `headers'.
+
+ * sunos.c (m68k_plt_first_entry, sparc_plt_first_entry): Now
+ const.
+ * tekhex.c (digs): Ditto.
+ * elf32-i386.c (elf_i386_plt0_entry, elf_i386_plt_entry): Ditto.
+
+ * srec.c, tekhex.c: Include libiberty.h. Delete static array
+ hex_value and replace references to it with references to
+ hex_init, hex_p, and hex_value.
+ * Makefile.in: Updated dependencies.
+
+ * archures.c (archures_init_table): Now const.
+ (bfd_arch_init): Adjusted type of local var `ptable'.
+
+Thu Jan 12 09:33:24 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * hosts/symmetry.h: Redefine `shared' to enable compilation
+ with the native Dynix cc compiler.
+ * i386dynix.c: Include aoutx.h instead of using routines
+ from aout32.c.
+
+Wed Jan 11 21:31:41 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * reloc.c (reloc_howto_type): Make typedef include `const'.
+ * aout-ns32k.c, aoutx.h, bout.c, cf-m68klynx.c, coff-i386.c,
+ coff-i960.c, coff-m68k.c, cofflink.c, cpu-ns32k.c, ecoff.c,
+ elf32-hppa.c, elf32-i386.c, elf32-mips.c, elf32-sparc.c,
+ elfcode.h, libbfd-in.h, linker.c, mipsbsd.c, nlm32-ppc.c, oasys.c,
+ reloc.c, som.c: Don't use `const' in combination with
+ `reloc_howto_type'.
+ * bfd-in2.h, libbfd.h: Regenerated.
+
+ * ecoff.c (ecoff_type_to_string): Local variable `buffer1' doesn't
+ need to be static.
+
+Wed Jan 11 14:36:41 1995 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * sunos.c (sunos_add_one_symbol): Don't core dump if a multiple
+ definition of an absolute symbol is encountered.
+
+ * linker.c (_bfd_generic_link_add_one_symbol): Ignore
+ redefinitions of an absolute symbol to the same value.
+
+Mon Jan 9 15:51:32 1995 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * elfcode.h (elf_link_add_object_symbols): It's reasonable for no
+ flags to be set, so don't insist otherwise.
+
+Fri Jan 6 16:39:40 1995 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * elfcode.h (elf_slurp_symbol_table): Don't set BSF_GLOBAL for an
+ undefined or common symbol.
+ (elf_link_add_object_symbols): Likewise.
+
+Wed Jan 4 14:14:05 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.c (bfd_section_from_som_symbol): Only return sections which
+ correspond to subspaces.
+
+ * som.c (som_begin_writing): Don't forget to bump the
+ total_subspaces when writing the unloadable subspaces.
+
+Wed Dec 28 20:54:47 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.c (som_write_fixups): Use SEC_HAS_CONTENTS to identify
+ bss-like sections.
+ (som_get_section_contents): Likewise.
+ (som_set_section_contents): Likewise.
+
+Tue Dec 27 14:03:47 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.c (setup_sections): Turn off SEC_HAS_CONTENTS for bss-like
+ sections.
+
+Tue Dec 20 15:30:12 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * coffgen.c (bfd_debug_section): Deleted.
+ (coff_section_from_bfd_index): Return absolute section for debug
+ symbol.
+ (coff_write_symbol): Set BSF_DEBUGGING for C_FILE symbols. If
+ BSF_DEBUGGING is set, set section to N_DEBUG.
+ (coff_bfd_make_debug_symbol): Use absolute section.
+
+ * elfcode.h (assign_file_positions_except_relocs): In assertion,
+ force all values to the same type.
+
+Tue Dec 20 11:11:58 1994 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * coff-h8300.c (howto_table): All relocs get a special function.
+ (special): Never do anything when linking -r.
+
+Tue Dec 20 13:58:01 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * i386linux.c (linux_add_one_symbol): Don't do anything Linux
+ specific if this is not a Linux hash table. From Eric Youngdale
+ <eric@aib.com>.
+
+ Patches from kkojima@mix.or.jp (Kazumoto Kojima):
+ * mipsbsd.c (mips_howto_table_ext): Change sizes of memory relocs
+ apply to from two bytes to four bytes.
+ * MY(reloc_howto_type_lookup): Handle BFD_RELOC_CTOR.
+
+ * elf32-i386.c (elf_i386_relocate_section): Correct and expand the
+ list of cases for which relocation need not be computed.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+
+Mon Dec 19 23:09:16 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * elf32-hppa.c (elf32_hppa_read_symext_info): Delete do_locals and
+ do_globals arguments, always read symbol extension information for
+ globals and locals. All callers changed.
+ (elf32_hppa_size_stubs): Rework to only read symbol extension
+ information once for each input bfd. 10% improvement in linker
+ performance.
+
+Fri Dec 16 12:28:46 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * elfcode.h (elf_section_from_bfd_section): Check
+ bfd_is_abs_section, etc., only after checking for the section in
+ the BFD and after calling the backend routine.
+
+Wed Dec 14 20:21:58 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * elfcode.h (elf_map_symbols): Only use section symbols whose
+ value is the start of the section, checking output_offset when
+ using output_section. When creating a new symbol, set the value
+ to 0, since BFD symbol values are section relative.
+
+Tue Dec 13 13:31:06 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * cpu-z8k.c (arch_info_struct): Make z8002 the default
+ architecture.
+
+Fri Dec 9 12:43:05 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * elfcode.h (elf_bfd_link_add_symbols): If the first object in the
+ archive is not an ELF object, pass the archive to the add_symbols
+ entry point appropriate for the first object. From Eric Youngdale
+ <eric@aib.com>.
+ * aoutx.h (NAME(aout,link_add_symbols)): Similar change if the
+ first object is not an a.out object.
+
+ * elf32-i386.c (elf_i386_relocate_section): Don't compute
+ relocation in cases where we won't use it.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+
+Thu Dec 8 14:19:41 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * pc532-mach.c (NAME): Define to use ns32kaout prefix.
+ * ns32knetbsd.c (NAME): Ditto.
+ (ns32kaout_32_get_section_contents): Define to standard aout-32
+ version.
+
+Fri Dec 2 13:56:49 1994 Ian Lance Taylor <ian@rtl.cygnus.com>
+
+ * coff-mips.c (mips_read_relocs): New static function, broken out
+ of mips_relax_section.
+ (mips_relax_section): Call mips_read_relocs.
+ (bfd_mips_ecoff_create_embedded_relocs): New function.
+ * bfd-in.h (bfd_mnips_ecoff_create_embedded_relocs): Declare.
+ * bfd-in2.h: Rebuild.
+
+Wed Nov 30 14:12:55 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * coff-sh.c: Use _bfd_dummy_target instead of no_archive.
+
+Tue Nov 29 14:00:19 1994 J.T. Conklin <jtc@.rtl.cygnus.com>
+
+ * config.bfd (i[345]86-*-freebsd*): Use i386-bsd as bfd_name.
+ * configure.host (i[345]86-*-freebsd*): Use i386bsd as my_host.
+
+Mon Nov 28 15:36:04 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * config/m68k-nbsd.mt (DEFAULT_VECTOR): set to m68knetbsd_vec.
+ * Makefile.in: Rebuilt dependancies.
+ (CFILES): Added m68knetbsd.c.
+ (HFILES): Added netbsd.h.
+
+Wed Nov 23 19:21:41 1994 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * coff-sh.c (shlcoff_vec): New target vector.
+ (no_archive): New function.
+ * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Handle
+ little endian SH.
+ * configure.in: Handle shl.
+ * targets.c (bfd_target_vector): Add shlcoff_vec.
+ * config/sh-coff.mt (SELECT_VECS): Handle shl_coff_vec.
+
+Wed Nov 23 10:50:13 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * elfcode.h (write_relocs): Do not subtract the section's vma from
+ the reloc's offset when writing .o's. Instead add the section's
+ vma to the reloc's offset when writing an executable or shared
+ library.
+
+Tue Nov 22 23:34:37 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Do not add
+ input_section->vma to the relocation's offset.
+
+Mon Nov 21 12:37:25 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * srec.c (srec_get_reloc_upper_bound): Define.
+ (srec_canonicalize_reloc): Define.
+ (srec_bfd_reloc_type_lookup): Define.
+ (srec_vec, symbolsrec_vec): Use BFD_JUMP_TABLE_RELOCS (srec).
+
+Sat Nov 19 03:10:51 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * configure.host (i[345]86-*-solaris*): Use solaris2 to
+ enable extraction of procfs info from core file for GDB.
+
+Thu Nov 17 17:37:39 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * reloc.c (bfd_reloc_code_type): Add new value BFD_RELOC_12_PCREL.
+ * bfd-in2.h, libbfd.h: Rebuilt.
+
+Thu Nov 17 13:12:08 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * bfd/elf32-hppa.c (elf32_hppa_bfd_final_link_relocated): Use the
+ vma from the output_section containing $global$ when computing
+ global_vlaue.
+
+Thu Nov 17 14:29:13 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * archive.c (_bfd_write_archive_contents): Round up the archive
+ header size of the extended name table to an even number.
+
+Wed Nov 16 16:08:06 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * coff-sh.c: Deleted some code that was commented out or inside
+ "#if 0".
+ (COFF_LONG_FILENAMES): Define.
+
+ * cpu-sh.c (arch_info_struct): Convert name to lowercase, for
+ consistency with other architectures.
+
+Sat Nov 12 23:50:10 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elfcode.h (elf_export_symbol): Also export symbols which are
+ referenced by a regular file.
+
+Fri Nov 11 14:29:31 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add
+ export_dynamic argument, and handle it.
+ (elf_export_symbol): New function.
+ * bfd-in.h (bfd_elf32_size_dynamic_sections): Update declaration.
+ (bfd_elf64_size_dynamic_sections): Update declaration.
+ * bfd-in2.h: Rebuild.
+
+Fri Nov 11 10:35:33 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hpux-core.c (hpux_core_struct): Delete handles for the
+ data, reg and stack sections. They're never used. Delete
+ accessor macros.
+ (make_bfd_asection): Use bfd_make_section_anyway since debugging
+ cores from dynamic executables may have several sections with the
+ same logical name.
+ (hpux_core_core_file_p): Don't save handles to data, reg and
+ stack sections. Handle CORE_TEXT, CORE_MMF and CORE_SHM.
+
+Tue Nov 8 13:03:30 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * bout.c (callj_callback): Add new argument shrinking. Change all
+ callers. Handle relocs against section symbols correctly. If not
+ shrinking, don't subtract out dstidx; the subtraction is already
+ in the object file.
+
+Sun Nov 6 12:52:00 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.h: Conditionally include <shl.h> and <dl.h>.
+
+Thu Nov 3 18:19:13 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * Makefile.in (ALL_MACHINES): Include m68knetbsd.o.
+
+ * config/i386linux.mh (EXTRALIBS): Include -lm.
+
+ Patches from DJ Delorie:
+ * coff-go32.c: Replacement file, uses coff-i386.c with minor
+ changes.
+ * coff-i386.c (TARGET_UNDERSCORE): allow other files to override
+ underscore also
+ * makefile.dos: del ctor.o, add cofflink.o and elf32.o
+
+ * aoutx.h (adjust_o_magic): If user set data section vma, use it
+ to determine the default bss vma. Patch from Takada Hiroaki,
+ hiro@is.s.u-tokyo.ac.jp.
+ (machine_type, case bfd_arch_vax): Set *unknown to false. Patch
+ from John David Anglin <dave@hiauly1.hia.nrc.ca>.
+
+ * configure.in (tb): Rename ns32knetbsd_vec to pc532netbsd_vec,
+ since that's what it's called.
+
+Wed Nov 2 15:24:51 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * archive.c (normalize): Change to take a BFD as an argument.
+ Change VMS version to use bfd_alloc rather than malloc, so that we
+ don't lose the memory forever.
+ (_bfd_construct_extended_name_table): Check the name of an archive
+ entry which is not being extended, and correct it if it is wrong.
+ This is necessary in case the archive was constructed by another
+ program which put an entry in the extended name table which we
+ don't plan to put in ourselves. From jjc@jclark.com (James
+ Clark).
+ (bfd_dont_truncate_arname): Check return value of normalize.
+
+Mon Oct 31 14:19:08 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * elf32-hppa.c (ELF32_PARISC_SX_SIZE): Define.
+ (ELF32_PARISC_SX_GET, ELF32_PARISC_SX_PUT): Define.
+ (symextn_entry): Don't define.
+ (symext_chain_size): Change type to bfd_size_type.
+ (symextn_contents): Change type to bfd_byte *.
+ (elf32_hppa_backend_begin_write_processing): Use
+ ELF32_PARISC_SX_SIZE instead of sizeof (symext_entryS).
+ (elf32_hppa_size_symext): Likewise. Also, change type of sizep to
+ bfd_size_type *.
+ (elf_hppa_tc_make_sections): Cast symextn_contents assignment to
+ bfd_byte *. Use ELF32_PARISC_SX_PUT instead of direct assignment.
+ (elf32_hppa_backend_symbol_table_processing): Use
+ ELF32_PARISC_SX_SIZE instead of sizeof (symext_entryS). Use
+ ELF32_PARISC_SX_GET insetad of direct assignment.
+ (elf32_hppa_read_symext_info): Change type of contents, and its
+ assignment cast, to bfd_byte *. Use ELF32_PARISC_SX_SIZE instead
+ of sizeof (symextn_entry). Use symext_entryS instead of
+ symextn_entry. Use ELF32_PARISC_SX_GET instead of direct
+ assignment.
+
+ * archive.c (bfd_dont_truncate_arname): Add the ar padding
+ character, if there is room for it, even if the name is the
+ maximum length.
+
+ * elfcode.h (assign_file_positions_except_relocs): Sort the ELF
+ headers by section address when assigning file positions.
+ (elf_sort_hdrs): New static function.
+
+Sun Oct 30 18:56:58 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Create DT_INIT
+ and DT_FINI dynamic entries based on the existence of _init and
+ _fini symbols, not on the .init and .fini sections. This is
+ compatible with some SVR4 linkers.
+ (elf_bfd_final_link): Corresponding change.
+
+Sat Oct 29 12:18:10 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Don't move a
+ symbol with a PLT entry into the .plt section if it is defined in
+ a regular file.
+ * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
+
+ * linker.c (_bfd_generic_link_add_archive_symbols): It's not an
+ error if an empty archive has no symbol table.
+ * ecoff.c (ecoff_link_add_archive_symbols): Likewise.
+ * elfcode.h (elf_link_add_archive_symbols): Likewise.
+
+Fri Oct 28 10:08:41 1994 J.T. Conklin (jtc@rtl.cygnus.com)
+
+ NetBSD/m68k support, based on work by mikeb@snow.datametrics.com:
+ * config.bfd (m68*-*-netbsd*): Use m68k-nbsd as bfd_name.
+ * configure.in (m68knetbsd_vec): Added.
+ * targets.c (bfd_m68knetbsd_vec): Added.
+ * hosts/m68knbsd.h, config/m68k-nbsd.mt, m68knetbsd.c: New files.
+ * Makefile.in (BFD32_BACKENDS, CFILES): Add m68knetbsd.c.
+
+ miscellaneous cleanup required by all netbsd targets, based on work
+ by Andrew Cagney <cagney@highland.com.au>:
+ * netbsd.h (N_MAGIC, N_SET_MAGIC, N_GETMAGIC, N_GETMAGIC2, N_TXTADDR,
+ N_TXTOFF, N_ALIGN, N_DATADDR, N_DATOFF): Removed. Generic a.out
+ definitions work.
+ * i386nbsd.c, ns32knbsd.c, sparcnbsd.c (__LDPGSZ): Removed.
+ (MY(write_object_contents)): Use NetBSD's magic numbers
+
+Thu Oct 27 16:59:52 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * libelf.h (struct bfd_elf_section_data): Add field dynindx.
+ * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Don't finalize
+ the .dynsym, .dynstr or .hash sections until after the backend
+ size_dynamic_sections routine, so that it can add dynamic symbols
+ if it wants to.
+ * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Don't define the
+ symbol to be in the .plt section when generating a shared library
+ if it is a defined symbol.
+ * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
+ (elf32_sparc_size_dynamic_sections): When generating a shared
+ library, allocate space for a dynamic symbol for each output
+ section, storing the index in the dynindx field of the ELF section
+ data. Adjust the other dynindx fields to account for this.
+ (elf32_sparc_adjust_dynindx): New static function.
+ (elf32_sparc_relocate_section): When copying a reloc into a shared
+ library, use the original addend as appropriate. Convert an
+ R_SPARC_32 reloc into an R_SPARC_RELATIVE reloc. Use the dynamic
+ symbol index of the output section, not the normal symbol index.
+ (elf32_sparc_finish_dynamic_sections): Don't die if a section does
+ not exist when setting the value of the dynamic tags. Write out
+ a dynamic symbol for each output section.
+
+Wed Oct 26 01:15:51 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * aoutx.h (aout_link_input_section): Don't bother to read or write
+ the relocs if there aren't any.
+
+Tue Oct 25 11:44:38 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * Makefile.in (ALL_MACHINES): Add tekhex.o.
+ * targets.c (bfd_target_vector): If SELECT_VECS is not defined,
+ include tekhex_vec.
+ * tekhex.c (NIBBLE, ISHEX): Cast array arguments to unsigned char.
+ (getvalue, getsym, out): Likewise.
+ (find_chunk): Remove unused variable s.
+ (first_phase): Remove unused variable s.
+ (pass_over): Remove unused variable address.
+ (tekhex_object_p): Remove unused variable section.
+ (move_section_contents): Change return type from boolean to void.
+ (tekhex_write_object_contents): Remove unused variables tdata and
+ list.
+
+ * linker.c (enum link_action): Add CIND.
+ (link_action): Change COMMON_ROW\indr from MDEF to CREF. Change
+ INDR_ROW\common from MDEF to CIND.
+ (_bfd_generic_link_add_one_symbol): In CREF case, handle an
+ existing symbol which is indirect rather than defined. Add new
+ CIND case.
+
+Mon Oct 24 15:33:16 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ Change S-record backend to use multiple sections to handle gaps in
+ file.
+ * srec.c (srec_data_list_struct): Move field next from last place
+ to first. Change type of data to bfd_byte *.
+ (struct srec_symbol): Define.
+ (tdata_type): Remove done_symbol_read, count, strings, symbol_idx,
+ string_size, string_idx. Change type of symbols to struct
+ srec_symbol *. Add symtail and csymbols.
+ (low, high): Remove.
+ (size_symbols, fillup_symbols, size_srec, fillup): Remove.
+ (white, skipwhite, pass_over, object_p): Remove.
+ (srec_mkobject): Call srec_init. Adjust tdata initialization for
+ field changes.
+ (srec_get_byte, srec_bad_byte): New static functions.
+ (srec_new_symbol, srec_scan): New static functions.
+ (srec_object_p): Change type of b to bfd_byte. Explicitly set
+ wrong_format error. Call srec_mkobject and srec_scan instead of
+ object_p.
+ (symbolsrec_object_p): Likewise. Also, change b to be only two
+ bytes.
+ (srec_read_section): New static function.
+ (srec_get_section_contents): Call srec_read_section rather than
+ pass_over. Handle zero length section correctly.
+ (set_set_arch_mach): Change from function to macro.
+ (srec_set_section_contents): Change data to bfd_byte *.
+ (srec_write_record): Change data, end and src to bfd_byte *.
+ (srec_write_header): Change buffer and dst to bfd_byte *.
+ (srec_write_section): Change location to bfd_byte *.
+ (srec_write_terminator): Change buffer to bfd_byte *.
+ (srec_get_symtab_upper_bound): Don't call
+ srec_get_section_contents.
+ (srec_get_symtab): Rewrite.
+
+ * ecoff.c (ecoff_set_symbol_info): Set udata.i to 0, not NULL.
+
+Fri Oct 21 16:43:13 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * libaout.h (machine_type): added M_68K_NETBSD and M_SPARC_NETBSD.
+ * i386netbsd.c, ns32knetbsd.c, sparcnetbsd.c: removed RCS Id's.
+ changed how PAGE_SIZE and SEGMENT_SIZE are defined so they are
+ consistant with each other.
+ * netbsd.h (N_HEADER_IN_TEXT, TEXT_START_ADDR): NetBSD fits its
+ header into the start of its text segment.
+
+Fri Oct 21 17:13:07 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * targets.c (BFD_JUMP_TABLE_ARCHIVE): Add case for
+ _construct_extended_name_table.
+ (bfd_target): Add _bfd_construct_extended_name_table.
+ * archive.c (_bfd_archive_bsd_construct_extended_name_table): New
+ function.
+ (_bfd_archive_coff_construct_extended_name_table): New function.
+ (_bfd_construct_extended_name_table): Renamed by adding a leading
+ underscore, and made externally visible. Added trailing_slash
+ argument, and used it instead of elf_style. Changed type of
+ tablen to bfd_size_type *.
+ (_bfd_write_archive_contents): Use BFD_SEND to call
+ construct_extended_name_table. Use the returned name.
+ * libbfd-in.h (_bfd_construct_extended_name_table): Declare.
+ (_bfd_noarchive_construct_extended_name_table): Define.
+ (_bfd_archive_bsd_construct_extended_name_table): Declare.
+ (_bfd_archive_coff_construct_extended_name_table): Declare.
+ * bfd-in2.h: Rebuild.
+ * libbfd.h: Rebuild.
+ * som.c (som_construct_extended_name_table): New static function.
+ * aout-target.h (MY_construct_extended_name_table): Define.
+ * coff-rs6000.c (rs6000coff_construct_extended_name_table):
+ Define.
+ * ieee.c (ieee_construct_extended_name_table): Define.
+ * libecoff.h (_bfd_ecoff_construct_extended_name_table): Define.
+ * oasys.c (oasys_construct_extended_name_table): Define.
+
+ Fix the ELF linker to not require an interpreter if no dynamic
+ objects were seen, even when linking PIC code.
+ * libelf.h (ELF_LINK_HASH_NEEDS_PLT): Define.
+ (struct elf_link_hash_table): Add field dynamic_sections_created.
+ * elfcode.h (elf_link_record_dynamic_symbol): Create dynstr if it
+ doesn't already exist.
+ (elf_link_add_object_symbols): Create dynamic sections based on
+ dynamic_sections_created field, not dynobj field. Don't bother to
+ set dynobj.
+ (elf_link_create_dynamic_sections): If dynamic sections were
+ already created, don't do anything. If dynobj is already set, use
+ it; otherwise, set it to the bfd argument. Don't initialize
+ dynsymcount. Only create dynstr if it does not exist. Set
+ dynamic_sections_created to true.
+ (NAME(bfd_elf,size_dynamic_sections)): Skip most of this function
+ if no dynamic objects were seen.
+ (elf_adjust_dynamic_symbol): If a symbol has the
+ ELF_LINK_HASH_NEEDS_PLT flag set, let the backend adjust it.
+ (elf_bfd_final_link): Change most decisions based on dynobj to
+ check dynamic_sections_created instead.
+ (elf_link_output_extsym): Only handle dynamic symbols if a dynamic
+ object was seen.
+ * elf.c (_bfd_elf_link_hash_table_init): Initialize new field
+ dynamic_sections_created. Set dynsymcount to 1, not 0.
+ * elf32-i386.c (elf_i386_create_dynamic_sections): Call
+ elf_i386_create_got_section rather than creating the .got and
+ .got.plt sections.
+ (elf_i386_create_got_section): New static function.
+ (elf_i386_check_relocs): Just call elf_i386_create_got_section if
+ a GOT table is needed, not bfd_elf32_link_create_dynamic_sections.
+ Only create the .rel.got section, and only make space for a reloc,
+ for a global symbol or when generating a shared object. For a
+ R_386_PLT32 reloc, just set the ELF_LINK_HASH_NEEDS_PLT flag.
+ (elf_i386_adjust_dynamic_symbol): Rework initial assertion to
+ permit ELF_LINK_HASH_NEEDS_PLT non dynamic symbols. Create a
+ procedure linkage table entry for such symbols. But, if no
+ dynamic objects were seen, never create a PLT entry.
+ (elf_i386_size_dynamic_sections): If no dynamic objects were seen,
+ skip most of this function, and force the size of the .rel.got
+ section to zero.
+ (elf_i386_relocate_section): For a R_386_GOT32 reloc against a global
+ symbol when no dynamic object was seen, initialize the contents of
+ the .got section. For a R_386_GOT32 against a local symbol, only
+ create a R_386_RELATIVE reloc when generating a shared object.
+ Treat a R_386_PLT32 reloc against a symbol for which we did not
+ create a PLT entry as a R_386_PC32 reloc.
+ (elf_i386_finish_dynamic_sections): Only fiddle with the dynamic
+ entries and the PLT if we saw a dynamic object.
+ * elf32-sparc.c (elf_sparc_howto_table): Fix R_SPARC_PC22 by
+ setting rightshift to 10. Fix R_SPARC_WPLT20 by setting
+ rightshift to 2, size to 2, bitsize to 30, and dst_mask to
+ 0x3fffffff.
+ (elf32_sparc_create_dynamic_sections): Don't set the size of the
+ .plt section. Call elf32_sparc_create_got_section rather than
+ creating the .got section.
+ (elf32_sparc_check_relocs): Call elf32_sparc_create_got_section if
+ a GOT table is needed, not bfd_elf32_link_create_dynamic_sections.
+ Only create the .rela.got section, and only make space for a
+ reloc, for a global symbol or when generating a shared object.
+ Set the alignment of the .rela.got section to 2. For a
+ R_SPARC_WPLT30 reloc, just set the ELF_LINK_HASH_NEEDS_PLT flag.
+ (elf32_sparc_adjust_dynamic_symbol): Rework initial assertion to
+ permit ELF_LINK_HASH_NEDS_PLT non dynamic symbols. Create a
+ procedure linkage table for such symbols. But, if no dynamic
+ objects were seen, never create a PLT entry. Initialize the size
+ of the .plt section.
+ (elf32_sparc_size_dynamic_sections): If no dynamic objects were
+ seen, skip most of this function, and force the size of the
+ .rela.got section to zero. Strip empty reloc sections, and strip
+ an empty .plt section.
+ (elf32_sparc_relocate_section): For a GOT reloc against a global
+ symbol when no dynamic object was seen, initialize the contents of
+ the .got section. For a GOT reloc against a local symbol, only
+ create a R_SPARC_RELATIVE reloc when generating a shared object.
+ Treat a R_SPARC_WPLT30 reloc against a symbol for which we did not
+ create a PLT entry as a R_SPARC_WDISP30 reloc.
+ (elf32_sparc_finish_dynamic_sections): Only fiddle with the
+ dynamic entries and the PLT if we saw a dynamic object.
+
+Thu Oct 20 13:28:45 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elfcode.h (elf_map_symbols): Don't worry about section symbols
+ in a section not owned by any BFD.
+ (elf_section_from_bfd_section): Separate out loop which calls
+ backend routine. Check bfd_section and call the backend routine
+ even for a section not owned by any BFD.
+ * elf32-mips.c (mips_elf_section_from_bfd_section): Handle
+ .acommon section.
+
+Wed Oct 19 13:28:29 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * coffgen.c (coff_print_symbol): Make names for section number and
+ storage class slightly more verbose. It's not clear how many
+ characters I can justify using up, but before this change they
+ both were abbreviated "sc" which is (IMHO) clearly unacceptable.
+
+Wed Oct 19 01:26:39 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * binary.c (binary_set_section_contents): Set the base file
+ position from the lowest section VMA, not the start address.
+
+ * aoutx.h (NAME(aout,slurp_symbol_table)): Don't return an error
+ if there are no symbols.
+ * coffgen.c (coff_get_normalized_symtab): Likewise.
+ * hp300hpux.c (MY(slurp_symbol_table)): Likewise.
+
+Tue Oct 18 12:56:43 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * aout-target.h (MY_bfd_copy_private_section_data): Only copy
+ subformat to another bfd_target_aout_flavour file.
+
+ * binary.c: New file for raw binary output format.
+ * Makefile.in (BFD_LIBS): Add binary.o.
+ (CFILES): Add binary.c.
+ * targets.c (binary_vec): Declare.
+ (bfd_target_vector): Include binary_vec.
+
+ * srec.c (tdata_type): Add field tail.
+ (srec_mkobject): Initialize tail.
+ (srec_set_section_contents): Sort S record list by address.
+
+Mon Oct 17 11:38:16 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * elfcode.h (elf_map_symbols): Sort the symbols into a new array,
+ rather than messing with Elf_Sym_Extra. Store the symbol index in
+ the udata.i field.
+ (swap_out_syms): Use outbound_syms as a pointer rather than as an
+ array. Don't worry about elf_sym_num.
+ * libelf.h (struct elf_sym_extra): Don't define.
+ (Elf_Sym_Extra): Don't define.
+ (struct elf_obj_tdata): Remove sym_extra field.
+ (elf_sym_extra): Don't define.
+ * elf32-hppa.c (elf32_hppa_backend_final_write_processing): Use
+ udata.i rather than elf_sym_extra array.
+
+ * syms.c (asymbol): Change udata field into a union.
+ * bfd-in2.h: Rebuild.
+ * aoutx.h (NAME(aout,translate_symbol_table)): Use udata.p rather
+ than just udata.
+ * bout.c (perform_slip): Likewise.
+ * hp300hpux.c (MY(slurp_symbol_table)): Likewise.
+ * ieee.c (ieee_slurp_external_symbols): Likewise.
+ * linker.c (generic_link_add_symbol_list): Likewise.
+ (default_indirect_link_order): Likewise.
+ * oasys.c (oasys_slurp_symbol_table): Likewise.
+ * reloc16.c (bfd_perform_slip): Likewise.
+ * srec.c (fillup_symbols): Likewise.
+ * coffcode.h (get_index): Use udata.i rather than just udata.
+ (coff_slurp_symbol_table): Likewise.
+ * coffgen.c (set_index): Likewise.
+ * ecoff.c (ecoff_set_symbol_info): Likewise.
+ * elfcode.h (elf_symbol_from_bfd_symbol): Likewise.
+ * libecoff.h (ecoff_get_sym_index, ecoff_set_sym_index): Likewise.
+ * som.c (compare_syms): Likewise.
+ (som_prep_for_fixups): Likewise.
+ (som_write_fixups): Likewise.
+
+ Use a hash table when writing out ELF symbol names.
+ * elfcode.h (elf_stringtab_init): New static function.
+ (bfd_new_strtab, bfd_add_to_strtab, bfd_add_2_to_strtab): Remove.
+ Change all callers to use elf_stringtab_init or
+ _bfd_stringtab_add, and get stringtab lengths using
+ _bfd_stringtab_size.
+ (elf_fake_sections): Change ignored argument to pointer to
+ boolean, and set the boolean to true if an error occurs. If an
+ error has already occurred, don't do anything.
+ (assign_section_numbers): Just set sh_size, not contents.
+ (elf_compute_section_file_positions): Pass the address of a
+ boolean to elf_fake_sections. Pass the address of a
+ bfd_strtab_hash to swap_out_syms. Write out the .strtab section.
+ (prep_headers): Change shstrtab to bfd_strtab_hash.
+ (swap_out_syms): Take a pointer to a bfd_strtab_hash as an
+ argument. Set it to the symbol names.
+ (NAME(bfd_elf,write_object_contents)): Write out the section
+ header names using _bfd_stringtab_emit.
+ (elf_debug_section): Remove first argument; get the section name
+ via the bfd_section pointer. Change caller.
+ (elf_bfd_final_link): Write out the symbol names using
+ _bfd_stringtab_emit. Likewise for the .dynstr section contents.
+ Free the symbol names at the end of the function.
+ (elf_link_input_bfd): Remove the last argument, output_names,
+ from relocate_section. Save the old symbol contents before
+ calling elf_link_output_sym, and restore them afterward.
+ * libelf.h (struct elf_link_hash_table): Change dynstr field to
+ struct bfd_strtab_hash.
+ (struct elf_backend_data): Remove last argument, output_names,
+ from elf_backend_relocate_section field.
+ (struct strtab): Don't define.
+ (struct elf_obj_tdata): Change strtab_ptr field to struct
+ bfd_strtab_hash.
+ * elf32-hppa.c (elf32_hppa_relocate_section): Remove last
+ argument, output_names.
+ * elf32-i386.c (elf_i386_relocate_section): Likewise.
+ * elf32-mips.c (mips_elf_relocate_section): Likewise.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+
+ * libbfd-in.h (DEFAULT_STRING_SPACE_SIZE): Don't define.
+ (bfd_add_to_string_table): Don't declare.
+ * libbfd.h: Rebuild.
+ * libbfd.c (bfd_add_to_string_table): Remove.
+
+ * elfcode.h (elf_swap_shdr_in): Use bfd_section, not rawdata.
+ Clear contents field.
+ (bfd_section_from_shdr): In SHT_STRTAB case, check bfd_section,
+ not rawdata. Don't set rawdata if e_shstrndx. Use bfd_section
+ rather than rawdata in commented out code. In SHT_REL[A] case,
+ don't bother to check elf_section_data of section returned by
+ section_from_elf_index.
+ (elf_fake_sections): Set bfd_section, not rawdata. Don't set
+ size.
+ (elf_map_symbols): Don't set elf_num_section_syms. Don't create
+ section symbols that already exist.
+ (assign_file_position_for_section): Use bfd_section, not rawdata.
+ (section_from_elf_index): Just check bfd_section field.
+ (elf_section_from_bfd_section): Likewise.
+ (elf_debug_section): Don't print rawdata, contents, or size.
+ (elf_link_add_object_symbols): Don't error out if
+ section_from_elf_index returns NULL.
+ (elf_bfd_final_link): Check return value from
+ section_from_elf_index against NULL, not bfd_is_abs_section.
+ (elf_link_input_bfd): Don't check section_from_elf_index return
+ value.
+ * libelf.h (struct elf_obj_tdata): Remove num_section_syms field.
+ (elf_num_section_syms): Don't define.
+ * elf.c (elf_get_str_section): Store section contents in contents
+ field rather than rawdata field.
+ (elf_string_from_elf_section): Likewise.
+ (_bfd_elf_make_section_from_shdr): Store BFD section pointer in
+ bfd_section field rather than rawdata field.
+ * elf32-hppa.c (elf32_hppa_read_symext_info): Use bfd_section
+ rather than rawdata.
+ (elf32_hppa_size_stubs): Likewise.
+ (elf32_hppa_backend_symbol_table_processing): Don't set
+ symextn_hdr->size; just use sh_size.
+ * elf32-mips.c (mips_elf_final_write_processing): Use bfd_section
+ rathern than rawdata.
+ (mips_elf_section_from_shdr): Likewise.
+ (mips_elf_section_processing): Likewise.
+ (mips_elf_section_from_bfd_section): Remove rawdata check.
+
+ * srec.c (pass_over): Set the start address for S7, S8 or S9.
+
+Fri Oct 14 19:15:46 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * VERSION: Updated to 2.5.
+
+Fri Oct 14 11:07:50 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * bfd.c (bfd_scan_vma): Cast end to be non const before passing it
+ to strtoul.
+
+Thu Oct 13 14:40:41 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * bfd.c (bfd_scan_vma): Pass end argument on to strtoul.
+
+Wed Oct 12 16:46:43 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * opncls.c (bfd_realloc): Deleted, since it's broken and fixing it
+ would make it slow. Besides, it isn't used much.
+ * elfcode.h (elf_map_symbols): Always allocate new storage for the
+ symbol table.
+
+Wed Oct 12 11:54:37 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * ecoff.c (ecoff_set_symbol_info): Mark local stProc, stLabel or
+ stabs symbols as BSF_DEBUGGING.
+
+ * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Make
+ str1 and str2 const pointers.
+
+ * Makefile.in (INSTALL): Use top level install.sh script.
+ * config/README (INSTALL): Remove.
+ * config/delta88.mh (INSTALL): Remove.
+ * config/i386v4.mh (INSTALL): Remove.
+ * config/irix4.mh (INSTALL): Remove.
+ * config/irix5.mh (INSTALL): Remove.
+ * config/ncrt3000.mh (INSTALL): Remove.
+
+Tue Oct 11 13:57:56 1994 Eric Youngdale (eric@andante.aib.com)
+
+ * elf32-i386.c (elf_i386_check_relocs): Make sure that a symbol
+ with a global offset table entry or a procedure linkage table
+ entry is added to the dynamic symbol table.
+ * elf32-sparc.c (elf32_sparc_check_relocs): Likewise.
+ * elf32-i386.c (elf_i386_adjust_dynamic_symbol): If a symbol has
+ already gotten a procedure linkage table entry, change the
+ definition to the PLT entry.
+ * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
+
+Tue Oct 11 17:12:00 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * lynx-core.c (lynx_core_file_p): SPARC Lynx appears to start
+ dumping the .data section in a core file at a page boundary.
+
+Mon Oct 10 16:24:44 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * cofflink.c (_bfd_coff_final_link): Cast argument to bfd_h_put_32
+ to correct type.
+ (coff_read_string_table): Cast argument to bfd_h_get_32 to correct
+ type.
+ * elfcode.h (elf_link_output_extsym): Cast argument to
+ bfd_elf_hash to correct type.
+
+ * elf32-sparc.c (elf_sparc_howto_table): The PC10, PC22, and
+ WPLT30 relocations are PC-relative.
+
+Thu Oct 6 12:57:26 1994 Richard Earnshaw (rwe@pegasus.esprit.ec.org)
+
+ * aoutx.h (adjust_o_magic): Correctly initialize vma if the vma of
+ the text section was user-defined.
+
+Wed Oct 5 14:42:12 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * archive.c (bfd_construct_extended_name_table): SVR4 uses slash
+ newline at the end of the file name, not just newline.
+
+Tue Oct 4 11:23:12 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * ecoff.c (_bfd_ecoff_new_section_hook): Default section alignment
+ power to 4, rather than using align_power_min.
+
+ * coffcode.h (coff_new_section_hook): Don't use align_power_min;
+ use COFF_DEFAULT_SECTION_ALIGNMENT_POWER instead. Force the .stab
+ and .stabstr sections to be aligned to no more than 2. Remove
+ COFF_SPARC special cases.
+ * coff-a29k.c: Define COFF_DEFAULT_SECTION_ALIGNMENT_POWER.
+ * coff-apollo.c, coff-go32.c, coff-h8300.c: Likewise.
+ * coff-h8500.c, coff-i386.c, coff-i960.c, coff-m68k.c: Likewise.
+ * coff-m88k.c, coff-rs6000.c, coff-sh.c, coff-sparc.c: Likewise.
+ * coff-we32k.c, coff-z8k.c: Likewise.
+
+ * configure.in: Use ${config_shell} when running config.bfd.
+
+ * cofflink.c (coff_link_input_bfd): Don't try to convert a long
+ filename if the offset field is zero.
+
+ * elfcode.h (swap_out_syms): If the alignment of a common symbol
+ was not set, use a sensible default rather than zero.
+
+Mon Oct 3 16:04:29 1994 H.J. Lu (hjl@nynexst.com)
+
+ * opncls.c (bfd_close): Honor umask when setting execution bits.
+ (bfd_close_all_done): Likewise.
+
+Mon Oct 3 04:41:49 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * rs6000-core.c (rs6000coff_core_p): Set SEC_HAS_CONTENTS flag
+ for .stack and .ldinfo sections. Cast coredata.c_tab to a
+ file_ptr to avoid warnings from gcc.
+
+Fri Sep 30 13:11:38 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
+
+ * elfcode.h (elf_bfd_final_link): Remove assertion when a non
+ SEC_IN_MEMORY section is found in dynobj. This can happen when
+ linking PIC compiled code.
+
+Thu Sep 29 15:21:44 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * reloc.c (bfd_install_relocation): Change type of "data" to
+ bfd_byte *, to go along with yesterday's change.
+
+ * elf.c (bfd_elf_print_symbol): Moved here from elf_print_symbol
+ in elfcode.h. (case bfd_print_symbol_all): Print symbol's size
+ field, except for common symbols; print their alignment.
+ * elfcode.h (elf_print_symbol): Deleted.
+ * libelf.h (bfd_elf_print_symbol): Declare.
+ (bfd_elf{32,64}_print_symbol): Replace declarations with macros.
+
+ * syms.c (bfd_print_symbol_vandf): Show BSF_LOCAL and BSF_GLOBAL
+ in one column. Use the column freed up to show BSF_FUNCTION and
+ BSF_FILE.
+
+Thu Sep 29 12:29:01 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * syms.c (stt): Add .rdata and .rodata.
+
+Wed Sep 28 13:35:05 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * reloc.c (bfd_install_relocation): Cast data_start to bfd_byte *
+ before trying to add values to it.
+
+Tue Sep 27 16:47:58 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * elf32-hppa.c (elf32_hppa_backend_final_write_processing): Cast
+ return value from elf_sym_extra.
+ (elf32_hppa_build_stubs): Cast return value from bfd_zalloc.
+ (elf32_hppa_size_stubs): Cast return value from malloc.
+
+ * gen-aout.c (main): Declare and initialize "arch".
+
+ * cofflink.c (coff_link_add_symbols): Cast return value of
+ bfd_hash_allocate.
+
+ * riscix.c (riscix_callback): Use PARAMS macro in prototype.
+
+ * reloc.c (bfd_install_relocation): New function, mostly copied
+ from bfd_perform_relocation, adjusted for the assembler's needs.
+ * bfd-in2.h: Regenerated.
+
+Mon Sep 26 11:00:14 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * elfcode.h (assign_file_positions_except_relocs): Align the
+ section VMA and the file position even if D_PAGED is not set.
+
+ * bfd-in.h (bfd_seek): Change declaration to not mark fp const.
+ * bfd-in2.h: Rebuild.
+ * libbfd.c (bfd_seek): Don't mark parameters const, to avoid
+ conflicts with declaration.
+
+Fri Sep 23 15:15:31 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * elfcode.h (map_program_segments): Don't abort if we allocated
+ too much space for the program header, only if we allocated too
+ little.
+ (assign_file_positions_except_relocs): Similar change.
+
+Tue Sep 20 13:17:07 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * libaout.h: Fix comment.
+ * ns32knbsd.h: Changed M_NS32K_NETBSD to M_532_NETBSD to match
+ libaout.h.
+
+Tue Sep 20 15:23:21 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * Makefile.in: Rebuilt dependencies.
+ (BFD32_BACKENDS): Add sparcnetbsd.o.
+ (CFILES): Add ns32knetbsd.c and sparcnetbsd.c.
+ * targets.c: ns32knetbsd_vec was renamed to pc532netbsd_vec.
+
+ * coff-sh.c (rtype2howto): Remove; unused.
+ (coff_sh_relocate_section): Remove unused local variable rstat.
+ (reloc_processing): Comment out; unused.
+
+Fri Sep 16 12:12:27 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * aoutx.h (aout_link_write_other_symbol): If h->indx is -2, then
+ always write it out even if it would normally be stripped.
+ (aout_link_input_section_std): If we find a reloc against a
+ stripped global symbol, force it to be written out rather than
+ merely calling unattached_reloc.
+ (aout_link_input_section_ext): Likewise.
+ (aout_link_reloc_link_order): Likewise.
+
+Wed Sep 14 15:37:19 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.h (struct somdata): New field sorted_syms.
+ (obj_som_sorted_syms): Accessor macro.
+ * som.c (som_object_setup): Initialize sorted_syms to NULL.
+ (som_prep_for_fixups): Sort a copy of the BFD's symbol table;
+ store the sorted symbol table in sorted_syms.
+ (som_write_fixups): Initalize tmp_reloc to NULL to make GCC happy.
+ (som_begin_writing): Similarly for exec_header. Pass the sorted
+ symbol table to som_write_symbol_strings.
+ (som_build_and_write_symbol_table): Use the sorted symbols rather
+ than the canonical symbol table.
+
+ * som.h (som_symbol_type): Add "stringtab_offset" field.
+ * som.c (som_write_symbol_strings): Use "stringtab_offset"
+ rather than destroying the "name" field in the BFD symbol.
+ (som_build_and_write_symbol_table): Likewise.
+
+Wed Sep 14 15:06:55 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * aoutx.h (aout_link_write_symbols): Rename skip_indirect to
+ skip_next. If we find an N_WARNING symbol which has already been
+ written out, set skip_next.
+
+ * libecoff.h (struct ecoff_tdata): Add field find_buffer.
+ * ecoff.c: Include aout/stab_gnu.h.
+ (ecoff_find_nearest_line): Handle stabs debugging information.
+
+ * elfcode.h (elf_link_output_extsym): Keep a symbol marked as weak
+ even if it is referenced by another object.
+
+Tue Sep 13 17:57:00 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.c (som_fixup_formats): Case R_ENTRY (0xb3), set both
+ 'T' and 'U' to grab all the unwind information.
+ (som_set_reloc_info): Make 'U' unwind bits persist across
+ multiple SOM relocations. Set the addend field of an R_ENTRY
+ relocation to the value in 'T'; set the addend field on an
+ R_EXIT relocation to the value in 'U'.
+
+ * som.h (som_symbol_type): Delete unwind field.
+
+ * som.c (som_write_fixups): For R_ENTRY fixups, get 32bits of
+ unwind information from the addend field of the R_ENTRY, get the
+ other 32bits from the addend field of the R_EXIT.
+ (bfd_som_attach_unwind_info): Delete function and all references.
+
+ * som.h (som_symbol_type): Delete unused a.out-related fields.
+
+ * som.c (bfd_section_from_som_symbol): Use bfd_abs_section_ptr
+ instead of &bfd_abs_section.
+
+ * som.c (som_object_setup): Handle exec_entry and exec_flags being
+ switched in executables created by the OSF1 linker.
+ (som_write_fixups): Handle R_EXIT just like the R_{F,L,R}SEL
+ fixups. Support R_ALT_ENTRY (handle just like R_EXIT).
+
+Tue Sep 13 16:04:07 1994 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * cofflink.c (coff_link_input_bfd): syment_base is unsigned
+ so can't compare -ve numbers with it.
+
+Mon Sep 12 20:31:17 1994 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * configure.in (shcoff_vec): Use cofflink.o now.
+ * coff-sh.c: Rewritten to use new fast coff backend.
+
+Tue Sep 13 16:23:57 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * aoutx.h (NAME(aout,final_link)): Don't assume that all the input
+ files are a.out.
+
+Tue Sep 13 11:09:39 1994 J.T. Conklin (jtc@rtl.cygnus.com)
+
+ * configure.host (sparc-*-netbsd): use sparcnbsd.
+ (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.
+
+Mon Sep 12 21:56:20 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.c (som_reloc_skip): Correct off-by-one error for 4-byte
+ R_NO_RELOCATION fixups.
+ (bfd_section_from_som_symbol): Return the absolute section if the
+ symbol isn't contained in any section in the output file.
+ (som_slurp_symbol_table): ST_PRI_PROG and ST_SEC_PROG symbols are
+ not function symbols (they are magic code labels which *can* be the
+ targets of cross space branches). $START$ is not a section symbol.
+
+Mon Sep 12 11:43:08 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * coff-alpha.c (ecoffalpha_little_vec): Add SEC_CODE and SEC_DATA
+ to section_flags.
+ * coff-mips.c (ecoff_little_vec, ecoff_big_vec): Likewise.
+
+ * elfcode.h (swap_out_syms): Set the type of an undefined symbol
+ to STT_FUNC if the BSF_FUNCTION flag is set.
+
+ * cofflink.c (coff_link_input_bfd): If r_symndx is -1, don't
+ change it.
+ (_bfd_coff_generic_relocate_section): If r_symndx is -1, it is an
+ absolute reloc. Don't dump core using r_symndx as an array index.
+ * cf-m68klynx.c (coff_bfd_link_add_symbols): Define.
+ (lynx_link_add_symbols): New static function (copy of function in
+ coff-i386.c).
+ (coff_m68k_lynxrtype_to_howto): sym argument may be NULL.
+ * coff-i386.c (coff_i386_rtype_to_howto): Likewise.
+ * coff-a29k.c (coff_a29k_relocate_section): Handle an r_symndx
+ value of -1, meaning an absolute reloc.
+
+ * ctor.c: Remove; obsolete.
+ * Makefile.in: Rebuild dependencies.
+ (BFD_LIBS): Remove ctor.o.
+ (CFILES): Remove ctor.c.
+ * libbfd.h: Rebuild.
+
+Mon Sep 12 01:58:47 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * elf32-hppa.c (elf32_hppa_relocate_section): If there was a link
+ error of some sort (for example, undefined symbols), then do not
+ apply any relocs, just notify the user of the errors.
+ (elf32_hppa_backend_begin_write_processing): Do not build a symbol
+ extension section for an executable (it's useless).
+ (elf32_hppa_link_output_symbol_hook): Do nothing if there was a
+ link error of some sort (for example, undefined symbols).
+ (elf32_hppa_read_symext_info): Kludge. Turn off SEC_HAS_CONTENTS
+ for all the input symbol extension sections to keep the generic
+ BFD code happy. Temporarily turn it on to read the contents of
+ the symbol extension section.
+
+Sun Sep 11 21:58:59 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * config/hppaosf.mh (RANLIB): Do not set.
+ * config/hppabsd.mh (RANLIB): Likewise.
+
+Sun Sep 11 22:50:49 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * cf-i386lynx.c: Remove #if 0 code.
+ (i386_lynxos_coff_object_p): Remove unused function.
+ (coff_bfd_link_add_symbols): Define.
+ (lynx_link_add_symbols): New static function.
+ * coffcode.h (coff_bfd_link_hash_table_create): If
+ coff_relocate_section is defined, only define this if not already
+ defined.
+ (coff_bfd_link_add_symbols, coff_bfd_final_link): Likewise.
+
+ * linker.c (_bfd_generic_final_link): Handle
+ bfd_indirect_link_order explicitly, rather than via
+ _bfd_default_link_order.
+ (set_symbol_from_hash): New static function, broken out of
+ _bfd_generic_link_write_global_symbol.
+ (_bfd_generic_link_write_global_symbol): Symbol setting code moved
+ to set_symbol_from_hash; call it.
+ (default_indirect_link_order): Add generic_linker argument.
+ Change all callers. If false, set the generic symbols based on
+ the hash table entries.
+
+Fri Sep 9 11:51:49 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * coffgen.c (coff_get_symtab): Reindented. Removed commented out
+ call to bfd_constructor_entry.
+
+ Convert m68k COFF to use new COFF backend linker.
+ * coff-m68k.c (coff_relocate_section): Define.
+ * cf-m68klynx.c (coff_rtype_to_howto): Define.
+ (coff_m68k_lynx_rtype_to_howto): New static function.
+ * configure.in (m68kcoff_vec): Build cofflink.o.
+ (m68kcoffun_vec, m68klynx_coff_vec): Likewise.
+
+Thu Sep 8 16:20:38 1994 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * coff-h8300.c (h8300_reloc16_extra_cases, case RELBYTE): Flag
+ overflows correctly.
+
+Wed Sep 7 19:01:42 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * libelf.h (struct elf_backend_data): Change second argument of
+ elf_backend_final_write_processing hook to boolean.
+ (struct elf_obj_tdata): Add linker field.
+ * elfcode.h (NAME(bfd_elf,write_object_contents)): Pass value of
+ tdata linker field to final_write_processing, rather than NULL.
+ (elf_bfd_final_link): Don't call final_write_processing hook. Set
+ tdata linker field to true.
+ * elf32-mips.c (mips_elf_final_write_processing): Change type of
+ second argument to boolean.
+ * elf32-hppa.c (elf32_hppa_backend_final_write_processing):
+ Likewise.
+
+ * coff-go32.c (RTYPE2HOWTO): Fully parenthesize arguments.
+ * coff-i960.c (RTYPE2HOWTO): Likewise.
+ * coff-m88k.c (RTYPE2HOWTO): Likewise.
+ * coff-we32k.c (RTYPE2HOWTO): Likewise.
+
+ Make i386 COFF use new COFF backend linker.
+ * coff-i386.c (RTYPE2HOWTO): Fully parenthesize arguments.
+ (coff_relocate_section): Define.
+ (coff_i386_rtype_to_howto): New function.
+ * configure.in (i386coff_vec): Use cofflink.o.
+ (i386lynx_coff_vec): Likewise.
+
+ * coffcode.h (bfd_coff_backend_data): Add new field
+ _bfd_coff_rtype_to_howto.
+ (bfd_coff_rtype_to_howto): Define.
+ (coff_rtype_to_howto): Define to use RTYPE2HOWTO, if not already
+ defined.
+ (bfd_coff_std_swap_table): Initialize new field.
+ * cofflink.c (_bfd_coff_final_link): Allocate section_count + 1
+ section_info structures, since the target_index is 1 based.
+ (coff_link_input_bfd): Set *secpp to bfd_com_section_ptr for a
+ common symbol. Adjust rel_hash by the output reloc count.
+ (_bfd_coff_generic_relocate_section): New function.
+ * libcoff-in.h (_bfd_coff_generic_relocate_section): Declare.
+ * libcoff.h: Rebuild.
+ * coff-alpha.c (alpha_ecoff_backend_data): Initialize new field.
+ * coff-mips.c (mips_ecoff_backend_data): Likewise.
+
+Tue Sep 6 23:28:52 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.c (som_bfd_derive_misc_symbol_info): Treat undefined code
+ symbols and undefined symbols which no type in the same manner
+ if the associated BFD symbol has BSF_FUNCTION set. For a defined
+ symbol which no type, select a SOM type based on the flags of the
+ section containing the symbol.
+ (som_slurp_symbol_type): Set BSF_FUNCTION for undefined ST_STUB
+ or ST_CODE symbols (importing a non-function code symbol is
+ meaningless in SOM).
+ (som_set_reloc_info): Don't set "offset" to the section's vma; it
+ should always start at zero.
+
+Tue Sep 6 14:51:11 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ Add new style linker support to COFF backend. a29k only for now.
+ * 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. Don't check obj_raw_syment_count
+ until after coff_write_symbols is called.
+ (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): Set obj_raw_syment_count, not
+ 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.
+
+Tue Sep 6 14:00:45 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * coffgen.c (coff_print_symbol, case bfd_symbol_print_all): Check
+ for section symbol, and print its aux fields with appropriate
+ labels.
+
+ * Makefile.in (ALL_MACHINES): Added cpu-arm.o.
+
+Sun Sep 04 17:58:10 1994 Richard Earnshaw (rwe@pegasus.esprit.ec.org)
+
+ * aoutx.h (NAME(aout,machine_type)): Recognize the ARM processor.
+ * archures.c, config.bfd, configure.host, libaout.h, reloc.c,
+ targets.c: Add support for the ARM.
+ * cpu-arm.c, riscix.c, config/riscix.mh, config/riscix.mt: New files.
+
+ * aoutx.h (add_to_stringtable): Check that str isn't a NULL pointer.
+
+Fri Sep 2 14:10:30 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * reloc.c (enum bfd_reloc_code_real): Rewrote definition to use
+ new "chew" commands for simultaneous definition of enumerator and
+ enumerator name table.
+ (bfd_get_reloc_code_name): New function, for retrieving a symbolic
+ name associated with an enumerator.
+ * libbfd.h, bfd-in2.h: Regenerated.
+
+Tue Aug 30 21:24:54 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.c (som_write_fixups, case R_ENTRY): Handle case where no
+ unwind descriptor information is available.
+
+Tue Aug 30 11:43:30 1994 Eric Youngdale (ericy@cais.cais.com)
+
+ * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add soname
+ argument, and use it to set DT_SONAME dynamic entry.
+ * bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype.
+ (bfd_elf64_size_dynamic_sections): Update prototype.
+ * bfd-in2.h: Rebuilt.
+
+Fri Aug 26 15:47:57 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * coffgen.c (coff_real_object_p): Set obj_raw_syment_count.
+ (coff_get_normalized_symtab): Verify obj_raw_syment_count, rather
+ than setting it.
+
+Thu Aug 25 10:44:53 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * archive.c (bsd_write_armap): Remove host dependencies.
+
+ * aoutx.h (add_to_stringtab): Check for _bfd_stringtab_add error
+ before adding BYTES_IN_WORD.
+
+ * coffgen.c (coff_find_nearest_line): Look for the best C_FILE,
+ not merely the first.
+
+ * coffgen.c (coff_write_alien_symbol): If we are not using the
+ symbol, clear the name so that it is not put in the string table.
+ From Antti.Miettinen@ntc.nokia.com.
+
+Wed Aug 24 11:49:19 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * coffgen.c (coff_print_symbol): Cast pointer different to long
+ and use %ld to print it.
+ * osf-core.c (osf_core_core_file_p): Remove unused variable
+ dseccnt.
+ * ecoffswap.h (ecoff_swap_ext_out): If ECOFF_64, clear remaining
+ bytes in bits2.
+
+ * configure.host, config.bfd: Change i[34]86 to i[345]86.
+ * coffgen.c (coff_real_object_p): Set obj_conv_table_size here,
+ rather than waiting until coff_slurp_symbol_table.
+ (coff_write_alien_symbol): Just ignore BSF_DEBUGGING symbols.
+ From Antti.Miettinen@ntc.nokia.com.
+
+ * section.c (bfd_make_section_anyway): Fix failure check of
+ bfd_make_empty_symbol. From Antti.Miettinen@ntc.nokia.com.
+
+ * aoutx.h (translate_to_native_sym_flags): Use the output_section
+ (and output_offset) if there is one.
+
+ * aoutx.h (aout_link_check_archive_element): Discard the symbols
+ if the archive element was not needed.
+
+ * aoutx.h (aout_get_external_symbols): Ensure that a zero string
+ index yields an empty string.
+ (aout_link_write_symbols): If info->keep_memory is false, use name
+ from original hash table entry, not from entry in *sym_hash.
+
+ * aoutx.h (struct aout_final_link_info): Add fields contents,
+ relocs, symbol_map and output_syms.
+ (NAME(aout,final_link)): Work out the largest section size, reloc
+ size, and number of symbols. Use them to preallocate buffers that
+ are large enough for all cases.
+ (aout_link_input_bfd): Use preallocated symbol_map.
+ (aout_link_write_symbols): Remove symbol_map argument; use
+ preallocated symbol_map instead. Change all callers. Use
+ preallocated output_syms.
+ (aout_link_input_section): Remove symbol_map argument. Change all
+ callers. Use preallocated contents and relocs.
+ (aout_link_input_section_std): Remove symbol_map argument; use
+ preallocated symbol_map instead. Change all callers.
+ (aout_link_input_section_ext): Likewise.
+
+Tue Aug 23 10:51:09 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * archive.c (_bfd_write_archive_contents): Don't update the
+ symbol map timestamp if there is no symbol map. From
+ schwab@issan.informatik.uni-dortmund.de (Andreas Schwab).
+
+Mon Aug 22 12:26:42 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * targets.c (BFD_JUMP_TABLE_ARCHIVE): Add _update_armap_timestamp.
+ (bfd_target): Add field _bfd_update_armap_timestamp.
+ * bfd.c (bfd_update_armap_timestamp): Define.
+ * bfd-in2.h: Rebuilt.
+ * libbfd-in.h (_bfd_noarchive_update_armap_timestamp): Define.
+ (_bfd_archive_bsd_update_armap_timestamp): Declare.
+ (_bfd_archive_coff_update_armap_timestamp): Define.
+ * libbfd.h: Rebuilt.
+ * archive.c (_bfd_write_archive_contents): Call
+ bfd_update_armap_timestamp instead of checking for a BSD archive
+ and calling bsd_update_armap_timestamp.
+ (_bfd_archive_bsd_update_armap_timestamp): Rename from
+ _bsd_update_armap_timestamp. Don't assume that armap_datepos is
+ already set.
+ * aout-target.h (MY_update_armap_timestamp): Define if not already
+ defined.
+ * coff-rs6000.c (rs6000coff_update_armap_timestamp): Define.
+ * ieee.c (ieee_update_armap_timestamp): Define.
+ * libecoff.h (_bfd_ecoff_update_armap_timestamp): Define.
+ * oasys.c (oasys_update_armap_timestamp): Define.
+ * som.c (som_update_armap_timestamp): Define.
+
+ * hash.c: Copy string hash functions from aoutx.h.
+ * aoutx.h: String hash functions moved to hash.c. Retain
+ simplified versions of add_to_stringtab and emit_stringtab.
+ Change all callers to use new function and structure names.
+ * libbfd-in.h (_bfd_stringtab_init, _bfd_stringtab_free): Declare.
+ (_bfd_stringtab_size, _bfd_stringtab_add): Declare.
+ (_bfd_stringtab_emit): Declare.
+ * libbfd.h: Rebuilt.
+
+Mon Aug 22 10:49:37 1994 Eric Youngdale (ericy@cais.cais.com)
+
+ * i386linux.c (linux_add_one_symbol): Create a fixup for any
+ defined absolute symbol, not just GOT or PLT symbols.
+ (linux_tally_symbols): Correct handling of references to defined
+ symbols.
+
+Thu Aug 18 16:29:57 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ Get ld -x -r to handle a.out set symbols correctly.
+ * aoutx.h (adjust_o_magic): If the .bss VMA was set outside of
+ BFD, pad the .data section up to the VMA of the .bss section.
+ (aout_link_add_symbols): If a set symbol does not get modified,
+ treat it as a local symbol.
+ (aout_link_write_symbols): Set the value of set symbols
+ correctly. Don't discard set symbols even if discarding local
+ symbols.
+ (aout_link_write_other_symbol): Don't abort on bfd_link_hash_new,
+ since it can now happen for set symbols.
+
+ * elfcode.h (elf_fake_sections): Just check for ".rela" and
+ ".rel", not ".rela." and ".rel."; make this work by checking
+ use_rela_p.
+ * elf32-i386.c (elf_i386_check_relocs): Just check for ".rel", not
+ ".rel."
+ (elf_i386_size_dynamic_sections): Likewise.
+ (elf_i386_relocate_section): Likewise.
+ * elf32-sparc.c (elf32_sparc_check_relocs): Just check for
+ ".rela", not ".rela."
+ (elf32_sparc_size_dynamic_sections): Likewise.
+ (elf32_sparc_relocate_section): Likewise.
+
+Wed Aug 17 16:54:18 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * linker.c (_bfd_generic_link_add_archive_symbols): Initialize
+ PASS to the old value + 1.
+
+ * coffgen.c (coff_get_normalized_symtab): If a C_FILE symbol has
+ no aux entries, use the symbol name as the file name.
+ (coff_find_nearest_line): Look for the right C_FILE symbol, rather
+ than always using the first one. If there is a debugging symbol
+ after a function symbol, skip it. Add the section VMA to the line
+ offset, since it was subtracted out in coff_slurp_line_table.
+
+Tue Aug 16 16:53:00 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.c (som_prep_headers): If writing some form of an executable,
+ allocate and attach an exec header to the BFD private data.
+ (som_begin_writing): Don't fill fields of the exec header based
+ on BFD private data here (like the exec flags). Do not write
+ the exec header here.
+ (som_write_headers): Instead do it here.
+ * som.h (struct somdata): New field "exec_hdr" for the executable
+ file header.
+ (obj_som_exec_hdr): New accessor macro.
+
+Tue Aug 16 00:12:31 1994 Eric Youngdale (ericy@cais.cais.com)
+
+ * i386linux.c (linux_link_create_dynamic_sections): Create section
+ named .linux-dynamic, not .dynamic.
+ (linux_add_one_symbol): Use .linux-dynamic, not .dynamic.
+ (bfd_linux_size_dynamic_sections): Likewise.
+ (linux_finish_dynamic_link): Likewise.
+
+Mon Aug 15 12:16:56 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * coffgen.c (STRING_SIZE_SIZE): Define.
+ (coff_fix_symbol_name): Use STRING_SIZE_SIZE, not 4.
+ (coff_write_symbols, build_string_table): Likewise.
+ (coff_get_normalized_symtab): Likewise.
+
+ * libcoff-in.h (obj_symbol_slew): Don't define.
+ (struct coff_tdata): Remove unused fields index_slew, raw_linenos,
+ and flags.
+ * libcoff.h: Rebuilt.
+ * coffcode.h (coff_mkobject): Don't initialize raw_linenos.
+ (coff_mkobject_hook): Don't initialize flags.
+
+ * aout-target.h (MY_zmagic_contiguous): Define as 0 if not already
+ defined.
+ (MY(backend_data)): Use MY_zmagic_contiguous, not hardcoded 0.
+ * i386linux.c (MY_zmagic_contiguous): Define.
+
+ * elfcode.h (bfd_section_from_shdr): If a SHT_SYMTAB section in a
+ shared object has SHF_ALLOC set, create a BFD section for it.
+ (elf_section_from_bfd_section): There may be a BFD section for a
+ SHT_SYMTAB section.
+
+ * coffcode.h (styp_to_sec_flags): Add name argument. If no flags
+ are recognized, chose section flags based on the name.
+ (bfd_coff_backend_data): _bfd_styp_to_sec_flags_hook field: Add
+ name argument.
+ (bfd_coff_styp_to_sec_flags_hook): Add name argument.
+ (coff_compute_section_file_positions): Don't adjust the section
+ position by COFF_PAGE_SIZE unless SEC_ALLOC is set.
+ * libcoff.h: Rebuilt.
+ * coffgen.c (make_a_section_from_file): Pass section name to
+ bfd_coff_styp_to_sec_flags_hook.
+ * ecoff.c (_bfd_ecoff_styp_to_sec_flags): Add unused name
+ argument.
+ * libecoff.h (_bfd_ecoff_styp_to_sec_flags): Add name argument to
+ prototype.
+
+Fri Aug 12 11:22:40 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * elfcode.h (section_from_elf_index): Correct check for invalid
+ section index.
+
+ * elfcode.h (elf_link_add_object_symbols): If there is no symbol
+ table, try using the dynamic symbol table. From Eric Youngdale
+ <ericy@cais.cais.com>.
+
+ * configure.host (sparc-*-solaris2*): Use solaris2, not sysv4.
+ The linker depends upon configuring for solaris2.
+ * hosts/solaris2.h: New file; include hosts/sysv4.h.
+ * config/solaris2.mh: New file; copy of config/sysv4.mh.
+
+Wed Aug 10 13:09:38 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * aoutx.h (adjust_z_magic): Make sure data section is padded to
+ page boundary when the VMA is set by the calling program. From
+ Eric Youngdale <ericy@cais.cais.com>.
+
+Mon Aug 8 17:18:49 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ Update to ns32k support, from Ian Dall (dall@hfrd.dsto.gov.au).
+ * aout-ns32k.c: Add declarations that were in aout-ns32k.h, change
+ declarations to traditional form.
+ (MY_reloc_howto, MY_put_reloc): Change from macro to function.
+ (ns32k_relocate_contents): New function.
+ * aout-ns32k.h: Remove.
+ * cpu-ns32k.c: Add declarations that were in aout-ns32k.h, change
+ declarations to traditional form.
+ (ns32k_final_link_relocate): Call ns32k_relocate_contents.
+ * netbsd532.c: Reformat to standards, add copyright notice.
+ (ARCH): Don't define.
+ (aout-ns32k.h): Don't include.
+ * pc532-mach.c: Ditto.
+
+Mon Aug 8 17:55:52 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * coff-i960.c (coff_i960_relocate): Don't try to convert relocs
+ against common symbols.
+
+Sat Aug 6 22:27:30 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * irix-core.c (irix_core_core_file_p): Ignore sections that
+ are not contained in the core file.
+
+Thu Aug 4 11:32:23 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * coff-m68k.c (m68k_reloc_type_lookup): New function.
+ (coff_bfd_reloc_type_lookup): Define.
+ * cf-m68klynx.c (_bfd_m68kcoff_reloc_type_lookup): Define.
+
+ * elfcode.h (elf_bfd_final_link): Force the vma of sections which
+ do not have SEC_ALLOC set to be 0. This is needed to handle
+ relocs against debugging sections.
+
+Wed Aug 3 16:45:41 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * coff-i960.c (coff_i960_relocate): Rewrote to change relocs
+ against locally defined symbols into relocs against section
+ symbols, for VxWorks 5.1.
+
+Wed Aug 3 10:34:37 1994 Eric Youngdale (ericy@cais.cais.com)
+
+ * i386linux.c (linux_add_one_symbol): Only handle
+ SHARABLE_CONFLICTS specially if BSF_CONSTRUCTOR is set. Set hashp
+ for a GOT or PLT symbol. Set jump field of fixup for a PLT symbol.
+ (linux_tally_symbols): Check section of real symbol. When looking
+ for a builtin fixup, check builtin and jump flags. Create no more
+ than one fixup, and always create one if the real symbol is in the
+ absolute section. Only strip absolute symbols.
+
+Wed Aug 3 05:08:24 1994 D. V. Henkel-Wallace (gumby@cygnus.com)
+
+ * coffcode.h (coff_write_object_contents): set internal_a.magic to
+ LYNXCOFFMAGIC whenever 68k, SPARC or i386 LynxOS
+ (yes, they have the same magic number!)
+
+Tue Aug 2 10:43:21 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * hp300hpux.c (BMAGIC): Define as HPUX_DOT_O_MAGIC, to make test
+ in aoutx.h work correctly.
+
+ * coff-i960.c (coff_i960_relocate): New function.
+ (howto_rellong, howto_iprmed): Use it as special_function.
+
+ * libbfd-in.h: Move declarations of bfd_read, bfd_write, bfd_seek,
+ bfd_tell, bfd_flush, and bfd_stat from here...
+ * bfd-in.h: ...to here, to make them visible to programs which
+ know more about the object file format than BFD does.
+ * libbfd.h, bfd-in2.h: Rebuilt.
+
+Mon Aug 1 17:55:53 1994 Fred Fish (fnf@cygnus.com)
+
+ * ptrace-core.c (ptrace_unix_core_file_p): Convert zalloc usage
+ to bfd_zalloc.
+
+Mon Aug 1 12:04:40 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * elf64-sparc.c (ELF_MAXPAGESIZE): Define.
+
+ ELF linker patches from Eric Youngdale <ericy@cais.cais.com>.
+ * elfcode.h (elf_link_create_dynamic_sections): Set type of
+ _DYNAMIC to STT_OBJECT.
+ (NAME(bfd_elf,record_link_assignment)): Always create hash table
+ entry. Set type to STT_OBJECT.
+ (elf_link_output_extsym): Don't set type of weak defined symbol to
+ STB_WEAK if symbol was referenced.
+ (map_program_segments): Check DYNAMIC as well as EXEC_P.
+ (assign_file_positions_except_relocs): Likewise.
+ * elf32-i386.c (elf_i386_create_dynamic_sections): Set type of
+ _GLOBAL_OFFSET_TABLE to STT_OBJECT.
+ (elf_i386_check_relocs): Ignore local PLT32 relocs.
+ (elf_i386_relocate_section): Treat local PLT32 relocs as PC32.
+
+ * elfcode.h (elf_adjust_dynamic_symbol): Correct weak symbol
+ handling again.
+
+ * elfcode.h (elf_slurp_reloc_table): Don't try to read the relocs
+ if there aren't any.
+
+ * configure.host (sparc-*-solaris2*): Use sysv4, not solaris2.
+ * hosts/solaris2.h: Remove.
+ * config/solaris2.mh: Remove.
+
+Sun Jul 31 14:27:04 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * elf32-hppa.c, elf32-hppa.h: Update comment reflecting which
+ HPPA ELF spec the code implements.
+
+Tue Jul 26 17:38:01 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * cpu-i960.c (MAX_ARCH): New macro.
+ (compatible): Use it in computing array bounds. Put comma after
+ last entry in array, for regularity.
+ (arch_info_struct): Adjust spacing for easier reading.
+
+ * coff-i960.c (howto_rellong, howto_iprmed, howto_optcall): Use
+ HOWTO macro.
+
+ * cpu-i960.c (JX): Define as bfd_mach_i960_jx.
+ (scan_960_mach): Recognize jx machine.
+ (MAX_ARCH): Define to be JX.
+ (compatible): Add JX row to array.
+ (arch_info_struct): Add JX entry.
+
+ * archures.c (bfd_mach_i960_jx): New macro.
+ * bfd-in2.h: Regenerated.
+
+ * coffcode.h (coff_set_arch_mach_hook): For F_I960JX, set machine
+ to bfd_mach_i960_jx.
+ (coff_set_flags): For bfd_mach_i960_jx, set F_I960JX.
+
+Tue Jul 26 11:04:00 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * elfcode.h (elf_adjust_dynamic_symbol): When handling a weak
+ symbol, correct check to see whether the equivalent normal symbol
+ was referenced.
+
+ Add support for creating shared libraries under i386 ELF and SPARC
+ ELF. Based on patches by Eric Youngdale <ericy@cais.cais.com>.
+ * libelf.h (struct elf_link_hash_entry): Remove copy_offset field.
+ Add got_offset and plt_offset fields.
+ (ELF_LINK_HASH_REF_DYNAMIC_MULTIPLE): Don't define.
+ (ELF_LINK_HASH_DEF_DYNAMIC_MULTIPLE): Don't define.
+ (ELF_LINK_HASH_NEEDS_COPY): Define.
+ (struct elf_backend_data): Add check_relocs field.
+ (struct bfd_elf_section_data): Change relocs from PTR to
+ Elf_Internal_Rela *.
+ (struct elf_obj_tdata): Add local_got_offsets field.
+ (elf_local_got_offsets): Define accessor macro.
+ (bfd_elf32_link_create_dynamic_sections): Declare.
+ (bfd_elf32_link_record_dynamic_symbol): Declare.
+ (bfd_elf64_link_create_dynamic_sections): Declare.
+ (bfd_elf64_link_record_dynamic_symbol): Declare.
+ * elfcode.h (elf_slurp_reloc_table): Don't use the section data
+ relocs field.
+ (elf_link_record_dynamic_symbol): Make globally visible. Use
+ macro to rename to NAME(bfd_elf,link_record_dynamic_symbol).
+ (elf_link_add_object_symbols): If creating a shared library, put
+ make all local symbols dynamic. Don't bother with the
+ DYNAMIC_MULTIPLE flags. Call the check_relocs backend function if
+ it is defined.
+ (elf_link_create_dynamic_sections): Make globally visible. Use
+ macro to rename to NAME(bfd_elf,link_create_dynamic_sections). If
+ creating a shared library, make sure that _DYNAMIC is added as a
+ dynamic symbol.
+ (elf_link_read_relocs): New function.
+ (NAME(bfd_elf,record_link_assignment)): If creating a shared
+ library, always create symbols, and always make them dynamic.
+ (elf_bfd_final_link): Permit creation of shared libraries.
+ (elf_link_input_bfd): Use elf_link_read_relocs to get the relocs.
+ * elf.c (_bfd_elf_link_hash_newfunc): Don't initialize
+ copy_offset. Initialize got_offset and plt_offset.
+ * elf32-target.h (elf_backend_check_relocs): Define as 0 if not
+ defined.
+ (elf32_bed): Initialize check_relocs field.
+ * elf64-target.h (elf_backend_check_relocs): Define as 0 if not
+ defined.
+ (elf64_bed): Initialize check_relocs field.
+ * elf32-i386.c (elf_howto_table): Change R_386_PLT32 and
+ R_386_GOTPC to be pc_relative and pcrel_offset.
+ (elf_i386_pic_plt0_entry): Define.
+ (elf_i386_pic_plt_entry): Define.
+ (elf_i386_create_dynamic_sections): Create a .got.plt section, and
+ define _GLOBAL_OFFSET_TABLE_ at the start of it. If creating a
+ shared library, make sure that _GLOBAL_OFFSET_TABLE_ is added as a
+ dynamic symbol. Don't create .rel.bss if creating a shared
+ library.
+ (elf_i386_check_relocs): New function.
+ (elf_i386_adjust_dynamic_symbol): Don't make a PLT entry if the
+ symbol already has one. When making a PLT entry, set plt_offset.
+ Don't create a copy reloc when creating a shared library. Don't
+ set copy_offset, just set ELF_LINK_HASH_NEEDS_COPY.
+ (elf_i386_allocate_dynamic_section): Remove.
+ (elf_i386_size_dynamic_sections): Look through all the sections
+ rather than assuming we know their names. Remove any empty reloc
+ or plt sections. Only add a DT_DEBUG entry if not creating a
+ shared library. Only add a DT_PLTGOT entry if there is a PLT.
+ Add a DT_TEXTREL entry if required.
+ (elf_i386_relocate_section): Permit undefined symbols when
+ creating a shared library. Handle the special relocation types
+ specially.
+ (elf_i386_finish_dynamic_symbol): Create a PLT entry if plt_offset
+ is set. If creating a shared library, produce a PIC PLT entry.
+ Only mark a PLT symbol as undefined if it was not defined by a
+ regular object file. Create a GOT entry if got_offset is set.
+ Create a copy reloc if ELF_LINK_HASH_NEEDS_COPY is set.
+ (elf_i386_finish_dynamic_sections): Change the handling of
+ DT_RELSZ to simply subtract out the size of .rel.plt. If creating
+ a shared library, produce PIC PLT code.
+ (elf_backend_check_relocs): Define.
+ * elf32-sparc.c (elf_sparc_howto_table): Change R_SPARC_GOT10,
+ R_SPARC_GOT22, and R_SPARC_PC10 to not warn about reloc overflow.
+ (elf32_sparc_create_dynamic_sections): If creating a shared
+ library, make sure that _GLOBAL_OFFSET_TABLE_ is added as a
+ dynamic symbol, and set the type to STT_OBJECT. Likewise for
+ _PROCEDURE_LINKAGE_TABLE_. Don't create .rel.bss if creating a
+ shared library.
+ (elf32_sparc_check_relocs): New function.
+ (elf32_sparc_adjust_dynamic_symbol): Don't make a PLT entry if the
+ symbol already has one. When making a PLT entry, set plt_offset.
+ Don't create a copy reloc when creating a shared library. Don't
+ set copy_offset, just set ELF_LINK_HASH_NEEDS_COPY.
+ (elf32_sparc_allocate_dynamic_section): Remove.
+ (elf32_sparc_size_dynamic_sections): Look through all the sections
+ rather than assuming we know their names. Only add a DT_DEBUG
+ entry if not creating a shared library. Add a DT_TEXTREL entry if
+ required.
+ (elf32_sparc_relocate_section): Permit undefined symbols when
+ creating a shared library. Handle the special relocation types
+ specially.
+ (elf32_sparc_finish_dynamic_symbol): Create a PLT entry if plt_offset
+ is set. Only mark a PLT symbol as undefined if it was not defined
+ by a regular object file. Create a GOT entry if got_offset is
+ set. Create a copy reloc if ELF_LINK_HASH_NEEDS_COPY is set.
+ (elf32_sparc_finish_dynamic_sections): Store dynobj in a local
+ variable.
+ (elf_backend_check_relocs): Define.
+
+Mon Jul 25 12:21:07 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * configure.in (pc532mach_vec): Change to pc532machaout_vec.
+ * config.bfd (ns32k-*-netbsd*): Use ns32k-nbsd as bfd_name.
+ * Makefile.in (ALL_MACHINES): Add cpu-ns32k.o.
+ (BFD32_BACKENDS): Add aout-ns32k.o, netbsd532.o, m88kmach3.o,
+ pc532-mach.o.
+ * targets.c (pc532machaout_vec): Use instead of pc532mach_vec.
+ * config/pc532-mach.mt (DEFAULT_VECTOR): Ditto.
+ (SELECT_VECS): Remove.
+ * config/ns32k-nbsd.mt: New file, was ns32k-netbsd.mt.
+ * config/ns32k-netbsd.mt: Remove, name too long.
+
+Fri Jul 22 11:07:14 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * linker.c (generic_link_check_archive_element): When changing a
+ symbol to common, set the alignment.
+ (_bfd_generic_link_add_one_symbol): When creating a common symbol,
+ set the alignment.
+ * aoutx.h (aout_link_check_ar_symbols): When changing a symbol to
+ common, set the alignment.
+ (aout_link_add_symbols): Restrict the alignment of a common symbol
+ to the alignment power given by the architecture.
+ * libelf.h (struct elf_link_hash_entry): Remove align field. Add
+ copy_offset field.
+ * elfcode.h (elf_link_add_object_symbols): Store alignment in
+ new bfd_link_hash_entry field, not in elf_link_hash_entry field.
+ (elf_link_output_extsym): Similar change when getting alignment.
+ * elf.c (_bfd_elf_link_hash_newfunc): Don't initialize align. Do
+ initialize copy_offset.
+ * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Use copy_offset
+ field rather than align field. Get alignment using bfd_log2
+ rather than switch.
+ * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
+ * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use copy_offset,
+ not align.
+ * elf32-sparc.c (elf32_sparc_finish_dynamic_symbol): Likewise.
+
+ * aoutx.h (NAME(aout,some_aout_object_p)): Just check
+ STAT_FOR_EXEC, don't check MACH.
+ * m88kmach3.c (MACH): Don't define.
+ * config/i386-mach3.mt (TDEFINES): Define STAT_FOR_EXEC.
+ * config/m88k-mach3.mt (TDEFINES): Likewise.
+ * config/mips-mach3.mt (TDEFINES): Likewise.
+
+Thu Jul 21 17:24:31 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * i386mach3.c: Reverted to version from before Jul 5 1994 changes.
+
+Thu Jul 21 12:26:01 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * reloc.c (struct reloc_howto_struct): Remove special_function1.
+ It's the wrong way to do things.
+ (HOWTO): Change accordingly.
+ (HOWTO2): Remove.
+ (_bfd_final_link_relocate): Remove references to
+ special_function1.
+ * bfd-in2.h: Rebuilt.
+ * aoutx.h (aout_link_input_section_std): Remove references to
+ special_function1.
+ (aout_link_reloc_link_order): Likewise.
+
+Wed Jul 20 15:46:44 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add rpath
+ argument. If it is not NULL, use it to set DT_RPATH.
+ * bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype.
+ (bfd_elf64_size_dynamic_sections): Likewise.
+ * bfd-in2.h: Rebuilt.
+
+Sat Jul 16 21:10:39 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * elfcode.h (elf_get_dynamic_symtab_upper_bound): If there is no
+ dynamic symtab, return error.
+
+ * libelf.h (ELF_LINK_HASH_DEFINED_WEAK): Define.
+ * elfcode.h (elf_link_add_object_symbols): If symbol is defined as
+ weak, set ELF_LINK_HASH_DEFINED_WEAK.
+ (elf_link_output_extsym): If symbol is defined as weak, mark it
+ STB_WEAK.
+
+ * libelf.h (struct bfd_elf_section_data): Add relocs field.
+ (shdr_name): Remove; unused.
+ * elfcode.h (elf_slurp_reloc_table): Rewrote to handle both REL
+ and RELA relocs. Free up the unswapped relocs. Permit the relocs
+ to be cached in the section_data. Correct the reloc address.
+ (elf_slurp_reloca_table): Remove.
+ (elf_canonicalize_reloc): Rewrote.
+ (elf_link_input_bfd): Permit the relocs to be cached in the
+ section data.
+
+Sat Jul 16 13:55:38 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * config.bfd (m88*-harris-cxux*): Recognize.
+ * hosts/harris.h (POSIX_UTIME, HAVE_PROCFS): Define.
+
+ * configure.host (m68*-atari-sysv4*): New host.
+ (m68*-cbm-sysv4*): Use m68kv4 instead of amix.
+ * hosts/amix.h: Remove.
+ * hosts/m68kv4.h: New file, was amix.h.
+
+Thu Jul 14 15:12:24 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * reloc.c (enum bfd_reloc_code_real, bfd_type, struct
+ reloc_howto_struct, reloc_howto_type, HOWTO, HOWTO2): Copied
+ changes over from bfd-in2.h so they get generated properly next
+ time someone runs "make headers".
+ * bfd-in2.h: Rebuilt.
+
+ * targets.c (netbsd532_vec, pc532mach_vec): Declare const.
+ (m88kmach3_vec): Restore deleted declaration.
+
+ * configure.in: Alphabetize target vector names.
+
+ * config/pc532mach.mh: New file.
+ (HDEPFILES, HDEFINES): Define here.
+ * config/pc532-mach.mt (HDEPFILES, HDEFINES): Deleted.
+ * config/ns32k-netbsd.mt (HDEPFILES, HDEFINES): Deleted.
+
+ Sun Jul 10 00:04:20 1994 Ian Dall (dall@hfrd.dsto.gov.au)
+
+ * pc532-mach.c: New File. pc532-mach a.out format.
+
+ * netbsd532.c: New file. pc532-netbsd532 a.out format.
+
+ * hosts/pc532mach.h: New file. pc532-mach host support.
+
+ * cpu-ns32k.c: New file. ns32k support cpu specific code rather
+ than format specific code.
+
+ * config/pc532-mach.mt: New file. Support for pc532-mach target.
+
+ * config/ns32k-netbsd.mt: New file. Support for netbsd532 target.
+
+ * aout-ns32k.c, aout-ns32k.h: New files supporting aout format for
+ ns32k series.
+
+ * targets.c: Add netbsd532_vec and pc532machaout_vec into
+ bfd_target_vector array. Move netbsd386_vec to alphabetic order
+ location.
+
+ * reloc.c (_bfd_final_link_relocate) Add support for
+ special_function1 in howto.
+
+ * libaout.h: add M_NS32032, M_NS32532, M_532_NETBSD entries in
+ machine_type enum.
+
+ * configure.in: add pc532mach_vec and netbsd532_vec entries.
+
+ * config.bfd: add pc532mach host entries. Use for both
+ ns32k-pc532-mach and ns32k-pc532-netbsd.
+
+ * config.bfd: it doesn't work to use i386-mach3 for ns32k*-*-mach.
+ add ns32k-pc532-mach* and ns32k-*-netbsd* entries.
+
+ * bfd-in2.h: Add ns32k specific relocations to bfd_reloc_code_real
+ enum.
+
+ * bfd-in2.h: Add special_function1 to struct howto. Change HOWTO
+ and NEWHOWTO macros to make special_function1 NULL. Neww HOWTO2
+ macro.
+
+ * bfd-in2.h: Split definition of struct reloc_howto_struct
+ and corresponding typedef into two statements.
+
+ * bfd-in2.h: Add entry bfd_arch_ns32k to bfd_architecture enum.
+
+ * archures.c: Add bfd_ns32k_arch prototype, and entry in
+ archures_init_table.
+
+ * aoutx.h (aout_link_reloc_link_order): Allow for target dependent
+ MY_put_reloc macro. Allow for target dependent special_function1
+ to apply the relocation.
+
+ * aoutx.h (aout_link_input_section_std): Allow for target
+ dependent determination of reloc howto. Allow for target dependent
+ special_function1 to apply the relocation.
+
+ * aoutx.h (get_reloc_upper_bound): Detect bss and return 0.
+
+ * aoutx.h (slurp_reloc_table): Detect bss and succesfully read
+ zero reloc entries.
+
+ * aoutx.h (machine_type): Add bfd_arch_ns32k case.
+
+ * aoutx.h: Stat to determine executable status if STAT_FOR_EXEC
+ is defined (not just MACH). Use fstat instead of stat and check
+ for fstat error.
+
+ * aoutx.h: Allow target dependent swap_std_reloc_{in,out}.
+
+ * aoutx.h: Allow CTORS reloc info to be in target dependent reloc
+ table.
+
+ * aout-target.h: Apply SWAP_MAGIC (if defined) after
+ swap_exec_header_in, otherwise we have magic in the wrong order.
+
+Thu Jul 14 11:47:27 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * coff-sparc.c (sparccoff_vec): Have leading underscores.
+
+Tue Jul 12 12:08:10 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * aix386-core.c, aoutf1.h, cisco-core.c, elfcode.h, hppabsd-core.c,
+ hpux-core.c, irix-core.c, lynx-core.c, osf-core.c, ptrace-core.c,
+ rs6000-core.c, trad-core.c: Remove SEC_ALLOC flag from .reg
+ sections, .reg sections are not allocated and contain debug
+ information only.
+ * osf-core.c (make_bfd_asection, osf_core_core_file_p): Use
+ bfd_make_section_anyway instead of building unique section names.
+
+Tue Jul 12 11:41:22 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * libelf.h (bfd_elf32_swap_symbol_in): Declare.
+ (bfd_elf32_swap_symbol_out): Declare.
+ (bfd_elf64_swap_symbol_in, bfd_elf64_swap_symbol_out): Declare.
+ * elf32-hppa.c (elf32_hppa_args_hash_table_init): Correct cast.
+
+ * aout-encap.c (ARCH): Don't define. Obsolete.
+ * aout0.c, aoutx.h, gen-aout.c, hp300bsd.c, hp300hpux.c: Likewise.
+ * i386aout.c, i386bsd.c, i386dynix.c, i386linux.c: Likewise.
+ * i386lynx.c, m68klynx.c, mipsbsd.c, netbsd386.c: Likewise.
+ * newsos3.c, sparclynx.c, sunos.c: Likewise.
+
+Mon Jul 11 20:08:23 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * section.c (STD_SECTION): Make the sixth argument boolean, not
+ the seventh. From gary@tuva.pacsemi.oz.au (gary kopff).
+
+Sun Jul 10 09:12:02 1994 D. V. Henkel-Wallace (gumby@cygnus.com)
+
+ * aoutx.h (bfd_free_cached_info): Change name of FREE to BFCI_FREE
+ in order not to collide with LynxOS's definition of FREE in
+ /usr/include/sys/proc.h
+
+Thu Jul 7 14:18:06 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * reloc.c (bfd_perform_relocation): Don't clobber the relocation
+ value for coff-Intel-little or coff-Intel-big. Hack upon hack.
+
+Thu Jul 7 10:10:34 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * aoutx.h (howto_table_std): Add entry for GOT relocations
+ which are present in sun3 shared libraries, to avoid assertions
+ when reading the dynamic relocations.
+
+Thu Jul 7 10:19:20 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.h (R_HPPA_COMPLEX): Fix dumb typo.
+
+Wed Jul 6 19:21:57 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * hosts/sysv4.h (qsort, strtol): Don't declare.
+
+ * elfcode.h (elf_link_output_sym): Don't call output_symbol_hook
+ if it is NULL.
+
+ * elf32-mips.c (mips_elf_final_write_processing): Add ignored info
+ argument to correspond to recent libelf.h change.
+
+Wed Jul 6 00:48:57 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * coff-alpha.c (alpha_ecoff_mkobject_hook): New hook to
+ additionally copy object type information from the alpha file
+ header to the BFD flags.
+ (alpha_ecoff_backend_data): Use it.
+ (ecoffalpha_little_vec): Add DYNAMIC to object_flags.
+ * aout64.c: Fix typo in conditional QMAGIC definition.
+
+Wed Jul 6 00:13:17 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * hppabsd-core.c (hppabsd_core_core_file_p): Sanity check the
+ value of clicksz to help weed out non HPPA BSD core files.
+
+Tue Jul 5 13:26:02 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ Mach 3 support.
+ * config.bfd (m88*-*-mach3*, mips*-dec-mach3*, mips*-*-mach3*):
+ New targets.
+ * configure.host (i[34]86-*-mach3*, ns32k-*-mach3*): Recognize
+ "mach3" instead of "mach".
+ (m88*-*-mach3*, mips*-dec-mach3*, mips*-*-mach3*): New hosts.
+ * targets.c (m88kmach3_vec): New target vector.
+ (bfd_target_vector): Add i386mach3_vec and m88kmach3_vec, but
+ inside #if 0.
+ * aoutx.h (some_aout_object_p) [MACH]: Recognize executables by
+ checking for execute permission, instead of looking at entry
+ point.
+ * i386mach3.c: Update, define MACH, N_TXTOFF, N_TXTADDR,
+ N_SHARED_LIB, don't include aout/*.h files, etc.
+ * m88kmach3.c: New file, m88k Mach 3 target.
+ * config/m88k-mach3.mt, config/mips-mach3.mt: New files, target
+ makefile fragments.
+ * config/i386mach3.mh, config/m88kmach3.mh, config/mipsmach3.mh:
+ New files, host makefile fragments.
+ * hosts/m88kmach3.h, hosts/mipsmach3.h: New files, host definitions.
+
+Tue Jul 5 13:56:52 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * elfcode.h (swap_out_syms): Get alignment of common symbol from
+ st_value field of saved ELF symbol information, if there is any.
+
+Mon Jul 4 19:13:32 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.h (R_HPPA_COMPLEX): Define.
+ * elf32-hppa.h (R_HPPA_COMPLEX): Define.
+ (elf32_hppa_reloc_type): Delete R_PARISC_STUB_CALL_17.
+
+Fri Jul 1 12:07:41 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * Support code for enabling the new style linker for PA ELF.
+ * elfcode.h (swap_symbol_in, swap_symbol_out): Externalize.
+ (elf_compute_section_file_positions): Pass link_info to
+ the begin_write_processing hook.
+ (bfd_elf_write_object_contents): Pass NULL for new link_info
+ argument to final_write_processing hook.
+ (elf_link_output_sym): Accept new "input_section" argument for
+ the symbols's input section. All callers changed. Call the
+ link_output_symbol_hook if it's defined.
+ (elf_bfd_final_link): Call the final_write_processing hook if
+ it's defined.
+ * libelf.h (elf_backend_link_output_symbol_hook): Declare.
+ (elf_backend_begin_write_processing): Add new "info" argument.
+ (elf_backend_final_write_processing): Likewise.
+ * elf32-target.h (elf_backend_link_output_symbol_hook): Provide
+ a default definition.
+ (elf32_bed): Add elf_backend_link_output_symbol_hook.
+ * elf64-target.h: Likewise.
+
+ * Major rework of the PA ELF code. Uses the new style BFD
+ linker, major cleanups.
+ * hppa_stubs.h: Rewrite from scratch. Much smaller and simpler.
+ * elf32-hppa.h: Delete all symbol extension related code.
+ (hppa_look_for_stubs_in_section): Delete decl.
+ (elf32_hppa_size_stubs, elf32_hppa_build_stubs): New decls.
+ * elf32-hppa.c: Symbol extension stuff moved form elf32-hppa.h
+ into elf32-hppa.c. Do not include aout64.h.
+ (typdef hppa_stub_type): Delete.
+ (elf32_hppa_stub_name_list_struct): Delete.
+ (elf32_hppa_stub_description_struct): Delete.
+ (arg_reloc_type): Use simpler enumerations. All references changed.
+ (arg_location, arg_reloc_relocation): Likewise.
+ (elf32_hppa_symextn_map_struct): Delete.
+ (get_symbol_value): Delete.
+ (elf32_hppa_get_sym_extn): Delete.
+ (find_stubs, new_stubs, type_of_mismatch): Delete.
+ (find_stub_by_name, add_stub_by_name): Delete.
+ (hppa_elf_stub_finish, hppa_elf_stub_reloc): Delete.
+ (hppa_elf_arg_reloc_needed): Renamed. Simplify.
+ (hppa_elf_build_linker_stub, hppa_elf_create_stub_sec): Delete.
+ (hppa_elf_long_branch_needed_p): Delete.
+ (hppa_look_for_stubs_in_section): Delete.
+ (hppa_elf_get_section_contents): Delete.
+ (elf32_hppa_backend_symbol_processing): Delete.
+ (elf32_hppa_backend_section_processing): Delete.
+ (elf32_hppa_backend_section_from_shdr): Delete.
+ (elf32_hppa_backend_fake_sections): Delete.
+ (elf32_hppa_backend_section_from_bfd_section): Delete.
+ (NEW_INSTRUCTION): Delete.
+ (CURRENT_STUB_OFFSET): Delete.
+ (elf32_hppa_relocate_section): New function.
+ (elf32_hppa_bfd_final_link_relocate): New function.
+ (elf32_hppa_size_symext): New function.
+ (elf32_hppa_link_output_symbol_hook): New function.
+ (elf32_hppa_read_symext_info): New function.
+ (elf32_hppa_add_symbol_hook): New function.
+ (elf32_hppa_name_of_stub): New function.
+ (elf32_hppa_size_of_stub): New function.
+ (elf32_hppa_build_one_sub): New function.
+ (elf32_hppa_build_stubs): New function.
+ (elf32_hppa_size_stubs): New function.
+ (linker, stub and argument hash tables): Add appropriate
+ structures, definitions and functions to implement all three
+ hash tables.
+ (hppa_elf_relocate_insn): Don't need argument location information
+ in this function.
+ (add_entry_to_symext_chain): Accept a symbol's argument location
+ information rather than the symbol itself. All callers changed.
+ (hppa_elf_gen_reloc_type): Simplify.
+ (hppa_elf_set_section_contents): Stub section is no longer special.
+ (hppa_elf_reloc): Greatly simplify.
+ (elf32_hppa_begin_write_processing): Accept link_info argument.
+ Handle being called from the BFD backend linker.
+ (elf32_hppa_final_write_processing): Likewise.
+ (elf_hppa_tc_make_sections): No longer call stub_finish.
+
+Mon Jun 27 18:07:06 1994 Steve Chamberlain (sac@cirdan.cygnus.com)
+
+ * section.c (bfd_get_section_contents): Put in parens to get
+ precedence right.
+
+Sun Jun 26 18:08:29 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * libelf.h (relocate_section): New argument "output_names" added
+ to prototype.
+ * elfcode.h (elf_link_input_bfd): New argument "output_names"
+ added to prototype of relocate_section. Pass the output symbol
+ names to relocate_section.
+ * elf32-i386.c (elf_i386_relocate_section): Use "output_names" to
+ determine the name of a local symbol.
+ * elf32-mips.c (mips_elf_relocate_section): Likewise.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+
+Fri Jun 24 08:15:42 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ Add Solaris BCP (the part of Solaris which allows it to run
+ SunOS4 a.out files) core file handling.
+ * aoutf1.h (external_solaris_bcp_core, swapcore_solaris_bcp):
+ New structure and its swap in function.
+ (internal_sunos_core): New member c_data_addr, to receive the
+ start address of the data section in the core file.
+ (swapcore_sun3, swapcore_sparc, sunos4_core_file_p): Use it.
+ (sunos4_core_file_p): Recognize Solaris BCP core file.
+ (sunos4_core_file_matches_executable_p): Always indicate match
+ for Solaris BCP core files.
+
+Thu Jun 23 15:31:28 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ Preliminary support for generating shared libraries, from Eric
+ Youngdale <ericy@cais.cais.com>.
+ * elfcode.h (prep_headers): If DYNAMIC, set e_type to ET_DYN.
+ (elf_link_add_object_symbols): If generating a shared library,
+ create dynamic sections for first input BFD with the right format.
+ (elf_link_create_dynamic_sections): Don't create .interp section
+ if creating a shared library.
+ (elf_link_input_bfd): Skip dynamic sections in input file.
+ (elf_bfd_final_link): If creating a shared library, it's OK for
+ dynobj to have sections which are not SEC_IN_MEMORY.
+ * elf32-i386.c (elf_i386_size_dynamic_sections): Only set .interp
+ section if not creating a shared library.
+ * elf32-sparc.c (elf_sparc_size_dynamic_sections): Likewise.
+
+ * elfcode.h (elf_object_p): Don't set DYNAMIC just because there
+ is an SHT_DYNAMIC section.
+
+ * cf-i386lynx.c (i386coff_vec): Don't include DYNAMIC in
+ object_flags.
+ * coff-sparc.c (sparccoff_vec): Likewise.
+ * hppabsd-core.c (hppabsd_core_vec): Likewise.
+
+ * aoutx.h (NAME(aout,some_aout_object_p)): Don't set SEC_RELOC
+ just because DYNAMIC is set.
+
+Thu Jun 23 12:53:41 1994 David J. Mackenzie (djm@rtl.cygnus.com)
+
+ * configure.in: Change --with-targets to --enable-targets and
+ --with-64-bit-bfd to --enable-64-bit-bfd.
+ * Makefile.in, mpw-make.in, targets.c: Change comments.
+
+Wed Jun 22 17:59:59 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * config.bfd (powerpc-*-elf*): New target, just like
+ powerpc-*-sysv4*.
+
+ * linker.c (FAIL): Undefine macro before defining as enum.
+
+Wed Jun 22 10:52:47 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * linker.c (_bfd_generic_link_add_archive_symbols): Initialize
+ pass from abfd->archive_pass, and save it there as well.
+
+ * hash.c (bfd_hash_allocate): Don't call bfd_set_error if
+ obstack_alloc returns NULL unless the size is non-zero.
+
+ * linker.c (archive_hash_allocate): Define.
+ (_bfd_generic_link_add_archive_symbols): Use archive_hash_allocate
+ rather than obstack_alloc, for clarity.
+
+ * elfcode.h (elf_get_reloc_upper_bound): Correct.
+
+ * aout64.c (BMAGIC, QMAGIC): Define if not already defined. From
+ Peter Schauer <pes@regent.e-technik.tu-muenchen.de>.
+
+ Linux ZMAGIC support from Eric Youngdale <ericy@cais.cais.com>.
+ * libaout.h (struct aoutdata): Add field zmagic_disk_block_size.
+ * aout-target.h (MY(callback)): Only set alignment according to
+ architecture if the section sizes are aligned to that alignment,
+ for backward compatibility.
+ (MY(set_sizes)): Initialize zmagic_disk_block_size field.
+ * aoutx.h (adjust_z_magic): Set ztih if using q_magic_format. Set
+ text section filepos to zmagic_disk_block_size if not ztih. Use a
+ different padding algorithm if not ztih.
+ * i386linux.c (MY_text_includes_header): Don't define.
+
+ * aoutx.h (aout_link_check_ar_symbols): Just skip N_STAB and N_FN
+ symbols; don't look them up in the hash table. From
+ ralphc@pyramid.com (Ralph Campbell).
+
+Tue Jun 21 11:47:20 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * coff-go32.c (go32coff_archive_p): Remove unused function.
+
+ * section.c (bfd_abs_section): Make const.
+ (bfd_abs_section_ptr, bfd_is_abs_section): Define.
+ (bfd_und_section): Make const.
+ (bfd_und_section_ptr, bfd_is_und_section): Define.
+ (bfd_com_section): Make const.
+ (bfd_com_section_ptr): Define.
+ (bfd_ind_section): Make const.
+ (bfd_ind_section_ptr, bfd_is_ind_section): Define.
+ (bfd_abs_symbol, bfd_com_symbol): Make const.
+ (bfd_und_symbol, bfd_ind_symbol): Likewise.
+ (global_syms): Cast initialization of section field.
+ (STD_SECTION): Define as const, and cast initializations.
+ * bfd-in2.h: Rebuilt.
+ * Many files: Change uses of bfd_abs_section, etc., to use
+ bfd_abs_section_ptr or bfd_is_abs_section, etc.
+
+Mon Jun 20 11:06:27 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * Many files: change all bfd_target vectors to be const. Change
+ 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 *.
+
+ * ecoff.c, libecoff.h, ecoffswap.h, coff-alpha.c, coff-mips.c,
+ elf32-mips.c: Renamed all externally visible ECOFF routines which
+ are local to BFD to start with _bfd_ecoff instead of just ecoff.
+
+ * ecoff.c (ecoff_swap_tir_in): Change input argument to const.
+ (ecoff_swap_tir_out): Likewise.
+ (ecoff_swap_rndx_in, ecoff_swap_rndx_out): Likewise.
+ (ecoff_slurp_symbolic_info): Add new arguments to correspond to
+ read_debug_info entry point in ecoff_debug_swap structure.
+ Change all calls.
+ * libecoff.h (ecoff_slurp_symbolic_info): Change declaration.
+ * ecoffswap.h (ecoff_swap_tir_in, ecoff_swap_tir_out): Declare.
+ (ecoff_swap_rndx_in, ecoff_swap_rndx_out): Declare.
+ * coff-alpha.c (alpha_ecoff_backend_data): Initialize new
+ ecoff_debug_swap fields.
+ * coff-mips.c (mips_ecoff_backend_data): Likewise.
+ * elf32-mips.c (mips_elf_read_ecoff_info): Undefine READ.
+ (mips_elf_ecoff_debug_swap): Initialize new ecoff_debug_swap
+ fields.
+ * configure.in (bfd_elf32_bigmips_vec): Use ecoff.o and
+ ecofflink.o.
+ (bfd_elf32_littlemips_vec): Likewise.
+ (ecoff_big_vec, ecoff_little_vec): Likewise.
+ (ecoffalpha_little_vec): Likewise.
+ * Makefile.in (BFD_LIBS): Remove ecoff.o and ecofflink.o.
+ (BFD32_BACKENDS): Add ecoff.o and ecofflink.o.
+
+ * aoutx.h (NAME(aout,final_link)): Check flavour of sub, not abfd,
+ when computing reloc sizes. From Eric Youngdale
+ <ericy@cais.cais.com>.
+ * elfcode.h (elf_bfd_final_link): Don't try to compute maximum
+ reloc count or size for a non-ELF file.
+
+ * mipsbsd.c (MY_final_link_callback): Define to avoid warning.
+
+ * hp300hpux.c (MY_final_link_callback): Define to avoid warning.
+ (BMAGIC, QMAGIC): Define; used by aoutx.h.
+ (MY(slurp_symbol_table)): Change translate_from_native_sym_flags
+ calls to use new parameters.
+
+Fri Jun 17 14:45:32 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * aout-target.h (MY(callback)): Set the alignments of the text,
+ data and bss sections after determining the architecture.
+
+ * sunos.c (sunos_add_one_symbol): Treat a common symbol from a
+ dynamic object as being in the .bss section of the object, rather
+ than as being undefined.
+
+Fri Jun 17 11:16:50 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * libhppa.h (bfd_hppa_insn2fmt, hppa_rebuild_insn): Make INLINE.
+
+ * elf32-hppa.h (elf_hppa_final_processing): Delete decl.
+
+Thu Jun 16 23:36:23 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * elfcode.h (elf_link_input_bfd): Don't try to read local symbols
+ if there aren't any in the input file.
+
+Thu Jun 16 14:25:22 1994 Eric Youngdale (ericy@cais.cais.com)
+
+ * i386linux.c: Many new functions and definitions for linker
+ support for Linux shared libraries.
+ * bfd-in.h (bfd_linux_size_dynamic_sections): Declare.
+ * bfd-in2.h: Rebuild.
+
+Thu Jun 16 14:23:46 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * config.bfd: If second argument is ``_'', then, instead of
+ echoing config file name, echo whether target uses leading
+ underscores on symbol names. Add appropriate settings to
+ different cases. Used by binutils/configure.in to set default for
+ c++filt.
+
+ * elfcode.h (elf_bfd_final_link): If trying to generate a shared
+ object, warn and return false.
+
+ * aoutx.h (NAME(aout,some_aout_object_p)): Accept BMAGIC objects
+ and treat them as OMAGIC.
+
+Wed Jun 15 18:02:21 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ Enable sparc v9 support for release. Note that this is still a
+ work in progress, pending release of an ABI specification.
+ * config.bfd, configure.in: Include sparc v9 elf config.
+ * elfcode.h (prep_headers): Handle sparc v9 (64 bit).
+ * reloc.c (bfd_reloc_code_real): New reloc types.
+ * elf64-sparc.c: Implement elf64-sparc target.
+ * Makefile.in, targets.c: Updated.
+
+Wed Jun 15 01:34:07 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * libelf.h (struct elf_obj_tdata): New field dt_needed_name.
+ (elf_dt_needed_name): New accessor macro.
+ * elfcode.h (elf_link_add_object_symbols): If elf_dt_needed_name
+ is set, use that instead of the filename for the DT_NEEDED dynamic
+ entry.
+ * elf.c (bfd_elf_set_dt_needed_name): New function.
+ * bfd-in.h (bfd_elf_set_dt_needed_name): Declare.
+ * bfd-in2.h: Rebuilt.
+
+ * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add sinterpptr
+ argument, and set it to the .interp section.
+ * bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype.
+ (bfd_elf64_size_dynamic_sections): Likewise.
+ * bfd-in2.h: Rebuilt.
+
+ * coff-sparc.c (SWAP_OUT_RELOC_EXTRA): Define to clear the r_spare
+ field of the reloc rather than letting it be garbage.
+
+ * archive.c (bfd_slurp_armap): Recognize __.SYMDEF/ as well as
+ __.SYMDEF; the former was used in old Linux archives. From
+ jrs@world.std.com (Rick Sladkey).
+
+ * i386linux.c (i386linux_write_object_contents): Define; like
+ MY(write_object_contents) in aout-target.h, but set MACHTYPE to
+ M_386. From jrs@world.std.com (Rick Sladkey).
+ (MY_write_object_contents): Define.
+
+ * aoutx.h (translate_from_native_sym_flags): Treat N_SETV symbols
+ as N_DATA symbols.
+ (aout_link_add_symbols): Likewise.
+
+ * aoutx.h: Rewrite symbol duplicate elimination to use BFD hash
+ tables.
+ (struct stringtab_entry, struct stringtab_data): Remove.
+ (HASHMAXLEN, HASH_CHAR, hash, compare, log2, emit_strtab): Remove.
+ (struct strtab_hash_entry, struct strtab_hash): Define.
+ (strtab_hash_newfunc, strtab_hash_lookup): Define.
+ (stringtab_free, emit_stringtab): Define.
+ (stringtab_init, add_to_stringtab): Rewrite.
+ (NAME(aout,write_syms)): Use new stringtab code.
+ (struct aout_final_link_info, NAME(aout,final_link)): Likewise.
+ (aout_link_write_symbols, aout_link_write_other_symbol): Likewise.
+
+ * bfd-in.h (BFD_TRADITIONAL_FORMAT): Define new BFD flag to
+ request BFD to write object in the traditional format, whatever
+ that means for the particular backend.
+ * bfd-in2.h: Rebuilt.
+
+ * hash.c (bfd_hash_allocate): If obstack_alloc fails, set
+ bfd_error_no_memory.
+
+Tue Jun 14 13:00:04 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * libaout.h (struct aoutdata): Add q_magic_format to subformat
+ enum.
+ * aout-target.h (MY_bfd_copy_private_bfd_data): Define as function
+ if not already defined. Copy subformat information.
+ (MY_text_includes_header): Define as 0 if not already defined.
+ (MY(backend_data)): Use MY_text_includes_header rather than 0.
+ (MY_final_link_callback): Rename from final_link_callback, and
+ define only if MY_final_link_callback is not already defined.
+ (MY_bfd_final_link): Rename use of final_link_callback to
+ MY_final_link_callback.
+ * aoutx.h (NAME(aout,some_aout_object_p)): Handle QMAGIC like
+ ZMAGIC, but set the subformat to q_magic_format. Abort if the
+ magic number if not recognized.
+ (adjust_z_magic): Use QMAGIC if q_magic_format.
+ * i386linux.c (MY_text_includes_header): Define as 1.
+ (i386linux_bfd_final_link): New static function.
+ (MY_bfd_final_link): Define as i386linux_bfd_final_link.
+
+ * aoutx.h (translate_to_native_sym_flags): Check both section and
+ output_section against sections of abfd.
+
+ * libecoff.h (struct ecoff_link_hash_entry): Change type of
+ written from boolean to char. Add new field small.
+ * ecoff.c (ecoff_link_hash_newfunc): Initialize written to 0
+ rather than false. Initialize small to 0.
+ (ecoff_link_add_externals): If ECOFF type is scSUndefined, set
+ small. If small is set, and hash table type is common, force the
+ symbol into a section named SCOMMON and change the ECOFF type from
+ scCommon to scSCommon.
+ (ecoff_link_write_external): Set written to 1 rather than true.
+ * coff-mips.c (mips_relocate_section): Correct JMPADDR reloc
+ overflow check to consider section VMA of input file.
+
+Mon Jun 13 14:20:07 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * aoutf1.h (aout_32_sunos4_write_object_contents): Handle a
+ machine type of 68000.
+ * aoutx.h (NAME(aout,machine_type)): Add new argument unknown.
+ Set *unknown to true if machine type is really unknown, as opposed
+ to M_UNKNOWN for the 68000.
+ (NAME(aout,set_arch_mach)): Change NAME(aout,machine_type) call
+ accordingly.
+ * libaout.h (NAME(aout,machine_type)): Add new argument to
+ prototype.
+
+Sun Jun 12 20:21:03 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.c (EXEC_AUX_ID): Define based on availablity of HPUX_AUX_ID
+ or HIUX_AUX_ID.
+ (som_begin_writing): Use EXEC_AUX_ID instead of HPUX_AUX_ID.
+ (som_write_armap): Use CPU_PA_RISC1_0 as the magic number. Note
+ som.c is careful to always define CPU_PA_RISC1_0.
+
+Sat Jun 11 16:32:30 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ Add weak symbols as an extension to a.out.
+ * aoutx.h (sym_in_text_section): Don't define.
+ (sym_in_data_section, sym_in_bss_section): Likewise.
+ (sym_is_undefined, sym_is_global_defn): Likewise.
+ (sym_is_debugger_info, sym_is_fortrancommon): Likewise.
+ (sym_is_absolute, sym_is_indirect): Likewise.
+ (translate_from_native_sym_flags): Rewrite for clarity. Rearrange
+ arguments and change caller. Handle weak symbols.
+ (translate_to_native_sym_flags): Likewise.
+ (aout_link_check_ar_symbols): Don't ignore weak symbols. Pull
+ object in from archive if a weak defintion is found for an
+ existing undefined symbol.
+ (aout_link_add_symbols): Put all cases in switch. Set flags of an
+ undefined symbol to 0. Handle weak symbols.
+ (aout_link_write_symbols): Handle weak symbols.
+ (aout_link_write_other_symbol): Likewise.
+ (aout_link_input_section_std): Likewise.
+ (aout_link_input_section_ext): Likewise.
+ * sunos.c (sunos_write_dynamic_symbol): Likewise.
+
+Fri Jun 10 13:25:13 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * aoutx.h (NAME(aout,canonicalize_reloc)): Handle .bss section.
+ (NAME(aout,get_reloc_upper_bound)): Likewise.
+
+ * coff-i960.c (coff_i960_reloc_type_lookup): Add BFD_RELOC_CTOR.
+ * linker.c (_bfd_generic_link_write_global_symbol): Don't assume
+ the section of a common symbol is not NULL.
+
+Wed Jun 8 23:15:53 1994 Stu Grossman (grossman@cygnus.com)
+
+ * nlmcode.h (nlm_object_p): Set EXEC_P and start address for GDB.
+
+Wed Jun 8 23:57:34 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * aoutx.h (aout_get_external_symbols): Don't try to read the
+ strings if there are no symbols.
+ (aout_link_write_other_symbol): Use the output section when
+ working out the type.
+
+Tue Jun 7 13:25:08 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elfcode.h (assign_section_numbers): Put shstrtab, symtab and
+ strtab sections at end of file. Avoids bug in some versions of
+ SVR4 strip. From Eric Youngdale <eric@tantalus.nrl.navy.mil>.
+
+ * coffcode.h (styp_to_sec_flags): If COFF_PAGE_SIZE is defined,
+ set SEC_DEBUGGING for STYP_INFO sections.
+ (coff_compute_section_file_positions): If COFF_PAGE_SIZE is
+ defined, and D_PAGED is set, set the file position equal to the
+ section VMA modulo COFF_PAGE_SIZE.
+ * coffgen.c (coff_real_object_p): If F_EXEC is set, set D_PAGED.
+ * coff-i386.c: Set D_PAGED in BFD target.
+ (COFF_PAGE_SIZE): Define.
+ * coff-m68k.c, coff-sparc.c: Likewise.
+
+Mon Jun 6 10:57:28 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elfcode.h (bfd_section_from_shdr): Don't turn a reloc section
+ into a BFD section just because SHF_ALLOC is set; require that it
+ not use the normal symbol table.
+ (elf_section_from_bfd_section): Corresponding change.
+
+ Better indirect and warning symbol handling inspired by Stuart
+ Quick <stuck@cs.man.ac.uk>.
+ * linker.c (enum link_action): Add REF, MIND, CWARN, REFC.
+ (link_action): Change UNDEF_ROW/def and UNDEFW_ROW/def from NOACT
+ to REF. Change UNDEF_ROW/indr and UNDEFW_ROW/indr from CYCLE to
+ REFC. Change DEF_ROW/indr and COMMON_ROW/indr from CYCLE to MDEF.
+ Change DEFW_ROW/indr from CYCLE to NOACT. Change INDR_ROW/indr
+ from MDEF to MIND. Change INDR_ROW/warn from WARNC to CYCLE.
+ Change WARN_ROW/def and WARN_ROW/indr from MWARN to CWARN. Change
+ WARN_ROW/com from MWARN to WARN. Change WARN_ROW/warn from NOACT
+ to CYCLE. Change SET_ROW/warn from WARNC to CYCLE>
+ (_bfd_generic_link_add_one_symbol): Handle REF, MIND, CWARN and
+ REFC. If a new indirect symbol has been referenced, push the
+ reference down to the symbol it points to. FIx handling of WARN.
+ * aoutx.h (translate_from_native_sym_flags): If N_WARNING, don't
+ clobber e_type of next symbol.
+ (translate_to_native_sym_flags): Likewise.
+ (aout_link_write_symbols): Loop on bfd_link_hash_warning as well
+ as bfd_link_hash_indirect.
+
+ * libaout.h (struct aout_link_hash_entry): New field written.
+ * aoutx.h (NAME(aout,link_hash_newfunc)): Initialize written.
+ (aout_link_write_symbols): Use written, not root.written.
+ (aout_link_write_other_symbol): Likewise.
+ * sunos.c (sunos_scan_dynamic_symbol): Likewise.
+ * libecoff.h (struct ecoff_link_hash_entry): New field written.
+ * ecoff.c (ecoff_link_hash_newfunc): Initialize written.
+ (ecoff_link_write_external): use written, not root.written.
+ * genlink.h (struct generic_link_hash_entry): New field written.
+ * linker.c (_bfd_link_hash_newfunc): Don't initialize written.
+ (generic_link_hash_newfunc): Initialize written.
+ (_bfd_generic_link_output_symbols): Use written, not root.written.
+ (_bfd_generic_link_write_global_symbol): Likewise.
+ (_bfd_generic_reloc_link_order): Likewise.
+
+ * libecoff.h (ecoff_data_type): Add linker field.
+ * ecoff.c (ecoff_write_object_contents): Check new tdata linker
+ field, rather than outsymbols being non-NULL, to decide whether to
+ output the symbols and relocs.
+ (ecoff_bfd_final_link): Set new tdata linker field to true.
+
+ * ecoff.c (ecoff_bfd_copy_private_bfd_data): Don't try to copy
+ data to a non-ECOFF file.
+
+ * libbfd-in.h: Add warning that libbfd.h is a generated file.
+ * libbfd.h: Rebuilt.
+
+Sun Jun 5 15:02:30 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ Changes to support ELF strip and objcopy on dynamically linked
+ files.
+ * elfcode.h (elf_fake_sections): Add prototype.
+ (bfd_section_from_shdr): Make a BFD section from an SHT_HASH
+ section, and from an SHT_DYNSYM section, and from the dynamic
+ string table section.
+ (elf_object_p): Set D_PAGED if there is a program header.
+ (elf_make_sections): Remove.
+ (fix_up_strtabs): Remove.
+ (elf_fake_sections): Rewrite. Now sets sh_entsize.
+ (assign_section_numbers): Rewrite. Now sets sh_link and sh_info
+ for all sections.
+ (elf_compute_section_file_positions): Don't call obsolete
+ functions elf_make_sections or fix_up_strtabs.
+ (swap_out_syms): Set sh_addralign to FILE_ALIGN rather than 4.
+ (NAME(bfd_elf,write_object_contents)): Permit writing DYNAMIC
+ objects.
+ (elf_section_from_bfd_section): Treat SHT_DYNSYM like other normal
+ sections. If an SHT_REL or SHT_RELA section is allocated or uses
+ an unusual symbol table, permit a BFD section to map to it.
+ Permit most SHT_STRTAB sections to have a BFD section mapped to
+ them.
+ (elf_bfd_final_link): Don't set sh_link, sh_info or sh_entsize
+ fields of dynamic sections here; do it in assign_section_numbers.
+ * elf32-target.h, elf64-target.h: Add D_PAGED to permitted object
+ flags.
+
+ * elf.c (_bfd_elf_make_section_from_shdr): Only set SEC_DATA if
+ SEC_LOAD is set, rather than checking SEC_ALLOC.
+
+ * libbfd-in.h (bfd_realloc): Change last arg to "size_t size".
+
+Fri Jun 3 10:58:02 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.c (som_write_object_contents): Don't compute the file header's
+ checksum here.
+ (som_write_headers): Instead do it here.
+
+ * libbfd.h (bfd_realloc): Change last arg to "size_t size".
+
+Thu Jun 2 17:39:22 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * hosts/sun3.h: Include <stdlib.h>. Don't declare free, exit or
+ getenv.
+
+ Add linker support for SunOS shared libraries.
+ * sunos.c: Include bfdlink.h. Add many new functions and
+ definitions for SunOS shared library support.
+ * bfd-in.h (bfd_sunos_record_link_assignment): Declare.
+ (bfd_sunos_size_dynamic_sections): Declare.
+ * bfd-in2.h: Rebuilt.
+ * aoutx.h (struct aout_link_hash_entry): Move to libaout.h.
+ (struct aout_link_hash_table): Likewise.
+ (aout_link_hash_lookup, aout_link_hash_traverse): Likewise.
+ (aout_hash_table): Likewise.
+ (NAME(aout,link_hash_newfunc)): Rename from aout_link_hash_newfunc
+ and make externally visible.
+ (NAME(aout,link_hash_table_init)): New function.
+ (NAME(aout,link_hash_table_create)): Call
+ NAME(aout,link_hash_table_init), not _bfd_link_hash_table_init.
+ (aout_link_add_symbols): Don't fail if no symbols. If it exists,
+ call add_dynamic_symbols backend entry point for dynamic objects.
+ Use add_one_symbol backend entry point if it exists.
+ (NAME(aout,final_link)): Call finish_dynamic_link backend entry
+ point, if it exists.
+ (aout_link_input_bfd): For a dynamic object, call
+ link_dynamic_object backend entry point, if it exists.
+ (aout_link_write_other_symbol): Call write_dynamic_symbol backend
+ entry point, if it exists.
+ (aout_link_input_section): Don't read the relocs if they have
+ already been read.
+ (aout_link_input_section_std): When doing a final link, for a
+ reloc against an external symbol, call check_dynamic_reloc backend
+ entry point, if it exists.
+ (aout_link_input_section_ext): Likewise.
+ * libaout.h: Protect against multiple inclusion. Include
+ bfdlink.h.
+ (struct aout_link_hash_entry): Move in from aoutx.h.
+ (struct aout_link_hash_table): Likewise.
+ (aout_link_hash_lookup, aout_link_hash_traverse): Likewise.
+ (aout_hash_table): Likewise.
+ (struct aout_backend_data): Add fields add_dynamic_symbols,
+ add_one_symbol, link_dynamic_object, write_dynamic_symbol,
+ check_dynamic_reloc, and finish_dynamic_link.
+ (struct aout_section_data_struct): Define new structure.
+ (aout_section_data): Define new accessor macro.
+ (NAME(aout,link_hash_newfunc)): Declare.
+ (NAME(aout,link_hash_table_init)): Declare.
+ * aoutf1.h (sunos4_aout_backend): Initialize new aout_backend_data
+ fields.
+ * aout-target.h (MY(backend_data)): Likewise.
+ * i386aout.c (MY(backend_data)): Likewise.
+ * i386mach3.c (MY(backend_data)): Likewise.
+ * mipsbsd.c (MY(backend_data)): Likewise.
+ * sparclynx.c (sparclynx_aout_backend): Likewise.
+
+ * aoutx.h (NAME(aout,slurp_symbol_table)): Don't zero out cached
+ until we know it is non-NULL.
+ (aout_link_write_symbols): Don't skip a warning symbol even if it
+ has already been written out. If skipping an indirect symbol,
+ skip the next symbol as well.
+
+Wed Jun 1 14:37:50 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * hosts/sun3.h: Don't declare qsort, malloc or realloc.
+
+Thu May 26 13:56:03 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * nlmcode.h (nlm_swap_auxiliary_headers_in): Cast bfd_byte pointer
+ to char pointer to avoid compiler warnings.
+
+ * dep-in.sed: Remove spaces before colons.
+
+ Merged changes back in from FSF gas release 2.3:
+
+ * Makefile.in (stmp-bfd.h): Wrap `if' block around grep
+ invocation, to avoid a bug in BSD 4.4 make.
+
+ From Ralph Campbell:
+ * mipsbsd.c (mips_fix_jmp_addr): If symbol is undefined, return an
+ error.
+ (mips_fix_hi16_s): Ditto.
+
+ Fri May 13 21:21:00 1994 DJ Delorie (dj@ctron.com)
+
+ * makefile.dos: define a default target, or archives won't work
+ due to multiple matches.
+
+ Wed May 11 22:32:00 1994 DJ Delorie (dj@ctron.com)
+
+ * configure.bat: update for latest files
+ * makefile.dos: update for correct targets and sources
+ * coff-go32.c: [new] go32's COFF format (i386coff with underscores)
+ * targets.c: add go32coff target
+ * makefile.in: add coff-go32.c support
+
+Thu May 26 10:10:21 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.c (som_prep_headers): Do not set the system_id here, private
+ bfd data has not been copied yet.
+ (som_write_headers): Instead do it here.
+
+Tue May 24 16:17:18 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ Make MIPS ELF use new ELF backend linker. No shared library
+ support yet.
+ * elf32-mips.c (bfd_mips_elf32_swap_gptab_in): New function.
+ (bfd_mips_elf32_swap_gptab_out): New function.
+ (mips_elf_object_p): If last symbol is LOCAL, set elf_bad_symtab.
+ (mips_elf_final_write_processing): Set sh_info field for .gptab.*
+ sections.
+ (mips_elf_fake_sections): Set sh_entsize for .gptab.* sections.
+ (mips_elf_read_ecoff_info): Read and free external symbols last,
+ not first, for clarity.
+ (struct mips_elf_link_hash_entry): Define new structure.
+ (struct mips_elf_link_hash_table): Define new structure.
+ (mips_elf_link_hash_lookup): Define new macro.
+ (mips_elf_link_hash_traverse): Define new macro.
+ (mips_elf_hash_table): Define new macro.
+ (mips_elf_link_hash_newfunc): New static function.
+ (mips_elf_link_hash_table_create): New static function.
+ (mips_elf_add_symbol_hook): New static function.
+ (struct extsym_info): Define new structure.
+ (mips_elf_get_extr, mips_elf_set_index): Remove.
+ (mips_elf_output_extsym): New static function.
+ (gptab_compare): New static function.
+ (mips_elf_final_link): Rewrite to use ELF backend linker, and to
+ merge gptab information in input files.
+ (mips_elf_relocate_hi16): New static function.
+ (mips_elf_relocate_section): New static function.
+ (bfd_elf32_bfd_link_hash_table_create): Define as macro before
+ including elf32-target.h.
+ (elf_backend_relocate_section): Likewise.
+ (elf_backend_add_symbol_hook): Likewise.
+ * elf.c (_bfd_elf_link_hash_newfunc): Rename from
+ elf_link_hash_newfunc and make globally visible. Change caller.
+ (_bfd_elf_link_hash_table_init): New function, broken out of
+ _bfd_elf_link_hash_table_create.
+ (_bfd_elf_link_hash_table_create): Use
+ _bfd_elf_link_hash_table_init.
+ * libelf.h (struct elf_obj_tdata): Add new field bad_symtab.
+ (elf_bad_symtab): Define new accessor macro.
+ (_bfd_elf_link_hash_newfunc): Declare.
+ (_bew_elf_link_hash_table_init): Declare.
+ * elfcode.h (elf_object_p): Call backend object_p hook after
+ swapping in all the section headers.
+ (map_program_segments): Correct typo: Internal for External.
+ (elf_link_add_object_symbols): If elf_bad_symtab is set, read all
+ the symbols. Skip STB_LOCAL symbols rather than giving an error.
+ (elf_bfd_final_link): If elf_bad_symtab is set, allocate space for
+ all symbols, not just locals.
+ (elf_link_output_extsym): Only skip a symbol not mentioned by a
+ regular file if it is mentioned by a dynamic object.
+ (elf_link_input_bfd): If elf_bad_symtab is set, read all the
+ symbols.
+
+Fri May 20 13:38:23 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * som.c (som_set_reloc_info): Do not set any relocation info
+ for SOM fixups which are never passed to BFD.
+
+Fri May 20 11:57:05 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * coff-mips.c (mips_relocate_section): Add MIPS_R_JMPADDR overflow
+ checking.
+
+ * elf32-i386.c (elf_i386_size_dynamic_sections): Add DT_DEBUG to
+ the dynamic linking information for the benefit of the debugger.
+ From Peter Schauer.
+ * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise.
+
+ * elf.c (_bfd_elf_make_section_from_shdr): New function, based on
+ code repeated three times in bfd_section_from_shdr in elfcode.h.
+ * libelf.h (_bfd_elf_make_section_from_shdr): Declare.
+ * elfcode.h (bfd_section_from_shdr): Use new function
+ _bfd_elf_make_section_from_shdr to create BFD sections. If a
+ reloc section does not use the main symbol table, or it is part of
+ the process image, treat it as a normal section, not relocs.
+ * elf32-mips.c (mips_elf_section_from_shdr): Use new function
+ _bfd_elf_make_section_from_shdr.
+
+Thu May 19 11:37:11 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elf32-target.h, elf64-target.h: Change ar_max_namelen value from
+ 15 to 14 to match SVR4 ar.
+
+ Add support for ELF shared libraries. Loosely based on work by
+ Eric Youngdale <ericy@cais.com>.
+ * libelf.h (struct elf_backend_data): Add new fields for dynamic
+ linking: elf_backend_create_dynamic_sections,
+ elf_backend_adjust_dynamic_symbol,
+ elf_backend_size_dynamic_sections,
+ elf_backend_finish_dynamic_symbol,
+ elf_backend_finish_dynamic_sections.
+ (struct elf_link_hash_entry): Change type of align field to
+ bfd_size_type. Add fields dynindx, dynstr_index, weakdef,
+ elf_link_hash_flags.
+ (struct elf_link_hash_table): Add fields dynobj, dynsymcount,
+ dynstr, bucketcount.
+ (bfd_elf32_swap_reloc_in, bfd_elf32_swap_reloc_out): Declare.
+ (bfd_elf32_swap_reloca_in, bfd_elf32_swap_reloca_out): Declare.
+ (bfd_elf32_swap_dyn_in, bfd_elf32_swap_dyn_out): Declare.
+ (bfd_elf32_add_dynamic_entry): Declare.
+ (bfd_elf64_swap_reloc_in, bfd_elf64_swap_reloc_out): Declare.
+ (bfd_elf64_swap_reloca_in, bfd_elf64_swap_reloca_out): Declare.
+ (bfd_elf64_swap_dyn_in, bfd_elf64_swap_dyn_out): Declare.
+ (bfd_elf64_add_dynamic_entry): Declare.
+ * elfcode.h (Elf_External_Dyn): Define.
+ (elf_swap_reloc_in): Define as macro using NAME. Make externally
+ visible.
+ (elf_swap_reloc_out): Likewise.
+ (elf_swap_reloca_in, elf_swap_reloca_out): Likewise.
+ (elf_swap_dyn_in, elf_swap_dyn_out): Define as macro using NAME
+ and as new externally visible function.
+ (elf_fake_sections): Set section type of dynamic sections based on
+ section names.
+ (elf_write_phdrs): Remove.
+ (assign_file_position_for_section): Add new align argument.
+ Change all callers.
+ (get_program_header_size): New static function.
+ (struct seg_info): Remove.
+ (map_program_segments): Completely rewrite.
+ (assign_file_positions_except_relocs): Completely rewrite.
+ (assign_file_positions_for_relocs): Don't set a file position for
+ sections which already have one. Don't bother to align the file
+ position here.
+ (section_from_elf_index): Handle SHT_HASH and SHT_DYNAMIC
+ section types.
+ (elf_section_from_bfd_section): Likewise.
+ (elf_slurp_symbol_table): If section_from_elf_index fails, just
+ use bfd_abs_section rather than returning an error.
+ (elf_sizeof_headers): Make useful.
+ (elf_link_record_dynamic_symbol): New static function.
+ (elf_link_add_object_symbols): Handle dynamic objects.
+ (elf_link_create_dynamic_sections): New static function.
+ (elf_add_dynamic_entry): Define as macro using NAME and as new
+ externally visible function.
+ (NAME(bfd_elf,record_link_assignment)): New function.
+ (elf_buckets): New static variable.
+ (NAME(bfd_elf,size_dynamic_sections)): New function.
+ (struct elf_final_link_info): Add dynsym_sec and hash_sec fields.
+ (elf_bfd_final_link): Handle dynamic linking. Create a section
+ symbol for all ELF sections, not all BFD sections. Store section
+ symbol index in target_index field, not index field. Traverse
+ over global symbols even if stripping.
+ (elf_link_output_extsym): Output dynamic symbols. Mark symbols
+ defined by dynamic objects as undefined.
+ (elf_link_input_bfd): Ignore dynamic objects. Use target_index
+ field for section relocs, and make sure it is set.
+ (elf_reloc_link_order): Use target_index field for section relocs,
+ and make sure it is set.
+ * elf.c (elf_link_hash_newfunc): Initialize dynindx, dynstr_index,
+ weakdef and elf_link_hash_flags fields.
+ (_bfd_elf_link_hash_table_create): Initialize dynobj, dynsymcount,
+ dynstr and bucketcount fields.
+ * elf32-target.h: Initialize new dynamic linking fields.
+ * elf64-target.h: Likewise.
+ * elf32-i386.c: New functions for dynamic linking support.
+ * elf32-sparc.c: Likewise.
+ * bfd-in.h (bfd_elf32_record_link_assignment): Declare.
+ (bfd_elf64_record_link_assignment): Declare.
+ (bfd_elf32_size_dynamic_sections): Declare.
+ (bfd_elf64_size_dynamic_sections): Declare.
+ * bfd-in2.h: Rebuilt.
+
+Wed May 18 08:29:04 1994 Ian Lance Taylor (ian@cygnus.com)
+
+ * som.c: Don't include <sys/dir.h> or <sys/user.h>.
+ (som_reloc_queue_find): Call memcmp instead of bcmp.
+ (som_bfd_reloc_type_lookup): Change first argument to bfd *.
+ (compare_syms): Change types of arguments to const void *.
+ (bfd_section_from_som_symbol): Removed unused local found.
+ (som_write_armap): Add elength, map, orl_count and int arguments.
+ (som_write_armap): Use %ld and cast to long for getuid result.
+
+Wed May 18 09:09:32 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * elf32-hppa.h (R_HPPA_ABS_CALL): Define.
+ * elf32-hppa.c (hppa_elf_gen_reloc_type): Handle absolute calls.
+
+ * som.h (R_HPPA_ABS_CALL): Define.
+ * som.c (hppa_som_gen_reloc_type): Delete complex relocation types.
+
+Tue May 17 19:33:12 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * coff-i960.c (icoff_little_vec, icoff_big_vec): Indicate leading
+ underscore, for compatibility with Intel tool chain (gnu960v2).
+
+Mon May 16 10:09:22 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * bfd-in2.h: Rebuilt.
+
+ * elf32-hppa.c: Change .hppa_linker_stubs to .PARISC.stubs,
+ likewise for other PA specific sections.
+ (hppa_elf_relocate_unwind_table): Delete unused
+ function.
+ (elf_hppa_howto_table): Completely new table based on 94-02-02
+ draft PA ELF spec. Change relocation tags appropriately
+ throughout elf32-hppa.c
+ (hppa_elf_gen_reloc_type): Rewrite and simplify based on 94-02-02
+ spec.
+ (hppa_elf_reloc): Likewise.
+ (hppa_look_for_stubs_in_section): Likewise
+ (ELF_MACHINE_CODE): Change to EM_PARISC.
+ * elf32-hppa.h: Include "elf/hppa.h". Change relocation tags
+ appropriately throughout elf32-hppa.h.
+ (elf32_hppa_reloc_type): New table based on 94-02-02 draft PA ELF
+ spec.
+ (R_HPPA_ABS_CALL, R_HPPA_COMPLEX*, R_HPPA_UNWIND): Delete definitions.
+ * elfcode.h (prep_headers): Use EM_PARISC instead of EM_HPPA.
+ * reloc.c (bfd_reloc_code_real): Delete unused HPPA relocations.
+ * som.h (R_HPPA_ABS_CALL, R_HPPA_COMPLEX): Delete definitions.
+
+ * libhppa.h (hppa_field_adjust): Avoid adding constant_value into
+ the final value twice for LR and RR field selectors.
+
+Sat May 14 09:09:19 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * aoutx.h (add_to_stringtab): Use BFD_ASSERT not assert. This
+ avoids __eprintf troubles.
+
+Fri May 13 10:51:21 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * bout.c (b_out_bfd_reloc_type_lookup): Handle BFD_RELOC_CTOR.
+
+ * config/mipsbelf.mt (SELECT_VECS): Add ecoff_big_vec and
+ ecoff_little_vec since Irix 5 supports ECOFF executables.
+
+Wed May 11 00:31:57 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * ecoff.c (ecoff_find_nearest_line): Handle fdr.adr != pdr.adr
+ correctly.
+
+ * Makefile.in (stmp-bfd.h): Use || instead of ; to force SunOS
+ make to invoke the shell.
+
+Tue May 10 14:23:43 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * section.c (SEC_COFF_SHARED_LIBRARY): Renamed from
+ SEC_SHARED_LIBRARY for clarity. Changed all uses.
+ * bfd-in2.h: Rebuilt.
+ * coffcode.h (sec_to_styp_flags): If SEC_COFF_SHARED_LIBRARY is
+ set, set STYP_NOLOAD.
+ * coffgen.c (coff_section_from_bfd_index): Don't get an assertion
+ failure because of a bad shared library.
+
+Mon May 9 18:53:40 1994 Bill Cox (bill@rtl.cygnus.com)
+
+ * linker.c: Add missing comment terminator.
+
+Mon May 9 11:53:54 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * linker.c (_bfd_generic_link_add_one_symbol): If hashp and *hashp
+ are not NULL, assume the caller has already looked up the symbol
+ in the hash table and has stored the entry in *hashp.
+ (generic_link_add_symbol_list): Set h to NULL before calling
+ _bfd_generic_link_add_one_symbol.
+ * ecoff.c (ecoff_link_add_externals): Likewise.
+
+ * elfcode.h (assign_file_positions_except_relocs): Don't require
+ page shared between .data and .bss segments to contain zeroes.
+
+ * elfcode.h: Include bfdlink.h. Added several new functions to do
+ linking.
+ (ELF_R_TYPE): Define.
+ (bfd_add_to_strtab): Return unsigned long. Change check for
+ realloc failure.
+ (elf_fake_sections): Check return value of bfd_add_to_strtab.
+ (elf_compute_section_file_positions): Add link_info argument.
+ Call elf_backend_begin_write_processing hook and prep_headers
+ here. Only call swap_out_syms if link_info is NULL. Set up
+ .shstrtab section here. Pass dosyms argument to
+ assign_file_positions_except_relocs. Set output_has_begun flag.
+ (assign_file_positions_for_symtab_and_strtabs): Add dosyms
+ argument, and use it to control setting .symtab and .strtab file
+ positions.
+ (assign_file_positions_except_relocs): Add dosyms argument, and
+ pass it on.
+ (prep_headers): Check return value of bfd_add_to_strtab.
+ (swap_out_syms): Likewise. Also, don't set up .shstrtab here.
+ (NAME(bfd_elf,write_object_contents)): Some calls moved into
+ elf_compute_section_file_positions.
+ (elf_set_section_contents): Likewise.
+ (elf_slurp_symbol_table): SHN_LORESERV corrected to SHN_LORESERVE.
+ * libelf.h: Include bfdlink.h.
+ (struct elf_backend_data): Add fields collect,
+ elf_add_symbol_hook, elf_backend_relocate_section.
+ (struct bfd_elf_section_data): Add field rel_hashes.
+ (struct elf_obj_tdata): Remove fields internal_syms and symbols.
+ Add field sym_hashes.
+ (obj_symbols, obj_internal_syms): Remove definitions.
+ (elf_sym_hashes): Define.
+ (struct elf_link_hash_entry): Define.
+ (struct elf_link_hash_table): Define.
+ (elf_link_hash_lookup): Define.
+ (elf_link_hash_traverse): Define.
+ (elf_hash_table): Define.
+ (_bfd_elf_link_hash_table_create): Declare.
+ (bfd_elf32_bfd_link_add_symbols): Declare.
+ (bfd_elf32_bfd_final_link): Declare.
+ (bfd_elf64_bfd_link_add_symbols): Declare.
+ (bfd_elf64_bfd_final_link): Declare.
+ * elf.c: Include bfdlink.h.
+ (elf_link_hash_newfunc): New function.
+ (_bfd_elf_link_hash_table_create): New function.
+ * elf32-target.h (elf_backend_relocate_section): If not defined,
+ define as 0 and use generic linker. Otherwise, use ELF backend
+ linker.
+ (elf_backend_collect): If not defined, define as false.
+ (elf_backend_add_symbol_hook): If not defined, define as 0.
+ (elf32_bed): Initialize new fields.
+ * elf64-target.h: Same changes as elf32-target.h.
+ * elf32-i386.c: Include bfdlink.h.
+ (elf_i386_relocate_section): New function.
+ (elf_backend_relocate_section): Define.
+ * elf32-sparc.c: Include bfdlink.h.
+ (elf_info_to_howto): Change type of dst from Elf32_Internal_Rela
+ to Elf_Internal_Rela (they're the same type anyhow).
+ (elf_sparc_relocate_section): New function.
+ (elf_backend_relocate_section): Define.
+ * elf32-mips.c (elf_backend_collect): Define.
+
+ * Makefile.in (stmp-bfd.h): Avoid useless make error message in a
+ different way; touch takes a numeric argument on some systems.
+
+Fri May 6 13:34:14 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * nlmcode.h (nlm_swap_auxiliary_headers_in): Rework custom header
+ handling for latest suggested format.
+ (nlm_swap_auxiliary_headers_out): Likewise.
+ (nlm_compute_section_file_positions): Likewise.
+
+Fri May 6 11:11:50 1994 D. V. Henkel-Wallace (gumby@rtl.cygnus.com)
+
+ * config.bfd: handle erricsson config (for OSE).
+
+Thu May 5 15:40:47 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ Patches from Ralph Campbell:
+ * mipsbsd.c (mips_fix_jmp_addr): New function.
+ (mips_fix_hi16_s): Use bfd_is_com_section.
+ (mips_howto_table_ext): Call mips_fix_jmp_addr for MIPS_RELOC_JMP.
+
+Fri May 6 11:48:55 1994 Steve Chamberlain (sac@cygnus.com)
+
+ * config/go32.mh: XX support.
+
+ From bill
+ * Makefile.in: Build sysdep.h without causing worrying but
+ harmless error message.
+
+Wed May 4 11:09:53 1994 Ian Lance Taylor (ian@cygnus.com)
+
+ Changed m68k-aout to set flags to 0; m68k-sunos still uses 1.
+ * aout0.c: New file.
+ * targets.c (aout0_big_vec): Declare.
+ (bfd_target_vector): Add aout0_big_vec.
+ * config.bfd (m68*-*-aout*): Use m68k-0aout, not m68k-aout.
+ * config/m68k-aout.mt (SELECT_VECS): Removed.
+ * config/m68k-0aout.mt: New file.
+ * configure.in (aout0_big_vec): New target vector: use aout0.o,
+ aout32.o and stab-syms.o.
+ * Makefile.in: Rebuilt dependencies.
+ (BFD32_BACKENDS): Add aout0.o.
+ (CFILES): Add aout0.c.
+
+ * libaout.h (struct aout_backend_data): Add field exec_hdr_flags.
+ * aout-target.h (MY_exec_hdr_flags): If not defined, define as 0.
+ MY(backend_data): Initialize exec_hdr_flags field.
+ * aoutf1.h (sunos_32_set_arch_mach): Make static.
+ (aout32_sunos4_write_object_contents): Set flags from backend
+ info.
+ (MY_exec_hdr_flags): If not defined, define as 1.
+ (sunos4_aout_backend): Initialize exec_hdr_flags field.
+ * aout-encap.c (encap_write_object_contents): Set flags from
+ backend info.
+ (MY_exec_hdr_flags): Define as N_FLAGS_COFF_ENCAPSULATE.
+ * hp300hpux.c (MY_exec_hdr_flags): Define as 0x2.
+ (MY(write_object_contents)): Set flags from backend info.
+ * i386aout.c (MY(backend_data)): Initialize exec_hdr_flags field.
+ * i386mach3.c (MY(backend_data)): Likewise.
+ * mipsbsd.c (MY(backend_data)): Likewise.
+ * sparclynx.c (NAME(aout,sparclynx_write_object_contents)): Set
+ flags from backend info.
+ (sparclynx_aout_backend): Initialize exec_hdr_flags field.
+
+Wed May 4 02:56:00 1994 Ken Raeburn (raeburn@kr-pc.cygnus.com)
+
+ * config.bfd (i386-*-gnu*): Treat like i386-*-mach*.
+ (m68*-apollo-*): Treat all Apollo configs the same, don't handle
+ BSD specially.
+
+Tue May 3 19:43:21 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * cache.c: Rewrote to work correctly.
+ * libbfd.h: Rebuilt.
+ * opncls.c (bfd_cache_init, bfd_open_file): Don't declare.
+ (bfd_fdopenr): Check return value of bfd_cache_init.
+
+Fri Apr 29 15:08:23 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * cf-m68klynx.c (CALC_ADDEND): Check for PC relative relocs by
+ enumerating them, since the reloc type can not serve as an index
+ into the m68k COFF howto_table.
+
+Fri Apr 29 09:42:39 1994 Steve Chamberlain (sac@cygnus.com)
+
+ * config.bfd (*-go32): Changed to coff.
+ * coff-h8300.c (JMPL1): Get HOWTO right for 24bit branches.
+ * srec.c (srec_write_symbols): Write out the correct number of
+ symbols and don't stick in extra nulls.
+
+Tue Apr 26 15:07:24 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * cf-sparclynx.c (LYNXOS, COFF_LONG_FILENAMES): Define.
+ * coff-sparc.c (BADMAG): Recognize LYNXCOFFMAGIC.
+ (COFF_SPARC): Define.
+ * coffcode.h (coff_new_section_hook): If COFF_SPARC, set alignment
+ power of data and bss sections to 3.
+ * hosts/lynx.h (__LYNXOS): Define.
+
+Tue Apr 26 15:04:26 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * elf32-hppa.c (hppa_elf_reloc): Adjust the addend of relocations
+ against section symbols to avoid losing during ld -r.
+
+Tue Apr 26 12:16:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elfcode.h (shstrtab_length_fixed): Remove useless static
+ variable.
+ (struct elf_sect_data): Remove unused structure.
+ (elf_object_p): Free memory if error occurs. Check return value
+ of bfd_default_set_arch_mach. If elf_get_str_section fails,
+ preserve error code rather than setting wrong_format.
+ (null_shdr): Remove static variable.
+ (assign_section_numbers): Remove shstrtab_length_fixed assignment.
+ Allocate first section header on BFD obstack rather than using
+ null_shdr.
+ (bfd_prpsinfo): Remove unused local variable newsect.
+
+Mon Apr 25 15:31:04 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elfcode.h (write_relocs): Undo patch of Apr 10; breaks Solaris.
+
+ * elfcode.h (bfd_section_from_shdr): Use bfd_make_section_anyway
+ to create sections. Check return value of recursive calls.
+ (bfd_section_from_phdr): Check return value of bfd_make_section.
+ (elf_symbol_from_bfd_symbol): Likewise.
+ (elf_object_p): Check return value of bfd_section_from_shdr.
+ (section_from_elf_index): Likewise.
+ (elf_slurp_symbol_table): Check return value of
+ section_from_elf_index.
+ (bfd_prstatus): Return boolean value. Check return value of
+ bfd_make_section.
+ (bfd_fpregset): Likewise.
+ (bfd_prpsinfo): Return boolean value.
+ (elf_corefile_note): Check return values of bfd_prstatus,
+ bfd_fpregset, and bfd_prpsinfo.
+ (elf_core_file_p): Check return value of elf_corefile_note.
+
+Fri Apr 22 11:08:38 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ Get rid of the ECOFF .reginfo section hack.
+ * ecoff.c (ecoff_mkobject_hook): Don't create a .reginfo section.
+ (ecoff_new_section_hook): Don't handle the .reginfo section.
+ (ecoff_sizeof_headers): Likewise.
+ (ecoff_get_section_contents): Likewise.
+ (ecoff_compute_section_file_positions): Likewise.
+ (ecoff_compute_reloc_file_positions): Likewise.
+ (ecoff_set_section_contents): Likewise.
+ (ecoff_write_object_contents): Likewise.
+ (ecoff_bfd_final_link): Likewise.
+ (ecoff_bfd_copy_private_bfd_data): Copy the GP value and the
+ register masks.
+ (bfd_ecoff_get_gp_value): New function.
+ (bfd_ecoff_set_gp_value): New function.
+ (bfd_ecoff_set_regmasks): New function.
+ * bfd-in.h (bfd_ecoff_get_gp_value): Declare.
+ (bfd_ecoff_set_gp_value): Declare.
+ (bfd_ecoff_set_regmasks): Declare.
+ * bfd-in2.h: Rebuilt.
+
+ Fix ECOFF objcopy to actually copy debugging information.
+ * ecoff.c (ecoff_bfd_copy_private_bfd_data): New function.
+ (ecoff_get_extr): Assume that any ECOFF symbol with local clear is
+ an external symbol, rather than checking the symbol flags. Only
+ check the flags for non-ECOFF symbols.
+ * ecofflink.c (bfd_ecoff_debug_externals): Don't crash if the
+ output_section field of the symbol section is NULL.
+ * libecoff.h (ecoff_bfd_copy_private_bfd_data): Declare as
+ function rather than defining as macro.
+
+ * ieee.c (ieee_object_p): Set bfd_error_got_wrong_format if
+ appropriate.
+
+ * targets.c (bfd_target_vector): Add bfd_elf32_powerpc_vec.
+
+ * aout-adobe.c (aout_adobe_set_arch_mach): Check return value of
+ bfd_default_set_arch_mach. Accept bfd_arch_m68k as well as
+ bfd_arch_unknown.
+ * coffcode.h (coff_set_arch_mach): Check return value of
+ bfd_default_set_arch_mach.
+ * elfcode.h (elf_set_arch_mach): Don't check a list of ELF
+ architectures, just see if the desired architecture matches what
+ the ELF backend permits.
+
+ * coffcode.h (coff_set_arch_mach_hook): Rename SHMAGIC to
+ SH_ARCH_MAGIC to match change in coff/sh.h.
+ (coff_set_flags): Likewise.
+
+ Follow convention in which each NLM header has an 8 byte stamp
+ followed by a four byte length.
+ * libnlm.h (struct nlm_obj_tdata): Rename nlm_cygnus_section_hdr
+ to nlm_cygnus_ext_header, and change type to
+ Nlm_Internal_Cygnus_Ext_Header.
+ (nlm_cygnus_ext_header): Rename from nlm_cygnus_section_header.
+ * nlmcode.h (nlm_swap_auxiliary_headers_in): Use CyGnUsEx instead
+ of CyGnUsSeCs. Rename from cygnus_section to cygnus_ext. Require
+ length word to be 8.
+ (nlm_swap_auxiliary_headers_out): Rename from cygnus_section to
+ cygnus_ext. Set length word to 8.
+ (nlm_compute_section_file_positions): Rename from cygnus_section
+ to cygnus_ext.
+
+Thu Apr 21 22:54:22 1994 Stu Grossman (grossman at cygnus.com)
+
+ * nlmcode.h (nlm_swap_auxiliary_headers_in): Keep section table
+ (from CyGnUsSeCs) in more permanent memory to keep section names
+ from getting trashed.
+
+Thu Apr 21 09:29:37 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * libelf.h (elf_obj_tdata): Add members for dynamic symbol table
+ handling.
+ * elfcode.h (bfd_section_from_shdr): Handle dynamic symbol table.
+ * elfcode.h (elf_slurp_symbol_table): Take additional parameter
+ to select static or dynamic symbol table and return number of
+ symbols slurped or -1 on error.
+ * elfcode.h (elf_get_symtab): Set bfd symcount from
+ elf_slurp_symbol_table result.
+ * elfcode.h (elf_get_dynamic_symtab_upper_bound,
+ elf_canonicalize_dynamic_symtab): New functions to handle dynamic
+ symbol table.
+ * elf32-target.h, elf64-target.h (BFD_JUMP_TABLE_DYNAMIC):
+ Change to handle dynamic symbol table, provide default definitions
+ for dynamic relocs.
+ * aoutx.h (howto_table_std, NAME(aout,swap_std_reloc_out),
+ NAME(aout,swap_std_reloc_in), aout_link_input_section_std,
+ aout_link_reloc_link_order): Handle r_jmptable and r_relative
+ relocations.
+
+Thu Apr 21 11:58:19 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ Clean up uses of _bfd_dummy_target (from Peter Schauer).
+ * libbfd.c (_bfd_dummy_target): Set bfd_error_wrong_format.
+ * nlm-target.h (nlm_core_file_p): Define as _bfd_dummy_target, not
+ NULL.
+ * srec.c (srec_vec): Use _bfd_dummy_target, not NULL, in
+ _bfd_check_format.
+ (symbolsrec_vec): Likewise.
+ * tekhex.c (tekhex_vec): Likewise.
+
+ * libnlm.h (struct nlm_obj_tdata): Add nlm_cygnus_section_hdr
+ field.
+ (nlm_cygnus_section_header): New accessor macro.
+ * nlmcode.h (nlm_object_p): Free new tdata structure if failure.
+ Add fixed sections before swapping in auxiliary headers. After
+ adding sections, treat errors as real, not as wrong format.
+ (nlm_swap_auxiliary_headers_in): Swap in the sections header; add
+ sections to the BFD for each section it describes.
+ (nlm_swap_auxiliary_headers_out): Swap out the sections header.
+ (nlm_compute_section_file_positions): Account for the size of the
+ sections header.
+
+Wed Apr 20 16:45:51 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * coff-sparc.c (sparccoff_vec): Change minimum alignment power to
+ 2, so that stab sections can be multiples of 4 bytes only.
+
+ * hosts/i386aix.h: Changes to avoid prototypes conflicts with the
+ ones defined in stdlib.h. (From Minh Tran-Le.)
+
+Wed Apr 20 14:15:21 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * nlm32-ppc.c: Complete rewrite for new version of PowerPC
+ NetWare. Old code still present, but ifdeffed out.
+
+ * nlmcode.h (nlm_swap_auxiliary_headers_in): Don't assume a
+ particular format for the customer header. Allocate a block of
+ memory and read it into that.
+ (nlm_swap_auxiliary_headers_out): Write out the block of memory.
+ (nlm_compute_section_file_positions): Include length of customer
+ header when computing its size.
+
+Mon Apr 18 14:27:17 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (som_prep_headers): Get the space's number from the
+ backend private section data rather than target_index.
+ (bfd_som_set_section_attributes): Store the space's number
+ in the backend private section data rather than target_index.
+
+ * som.h (som_copyable_section_data_struct): Add space_number.
+
+Fri Apr 15 12:22:07 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * coff-a29k.c (reloc_processing): Always set the address of a
+ R_IHCONST reloc to that of the immediately preceding R_IHIHALF.
+ gas does this anyhow, but some other assemblers seem to leave
+ garbage in the R_IHCONST address field.
+
+ * bfd/archive.c: Consistently use ARFMAG; from
+ schwab@issan.informatik.uni-dortmund.de (Andreas Schwab).
+ (_bfd_write_archive_contents): Use ARFMAG rather than '`' and
+ '\012'.
+ (bsd_write_armap): Likewise.
+ (coff_write_armap): Likewise.
+
+ * coff-mips.c (mips_relocate_section): When relaxing, adjust local
+ relocs against the .text section as required.
+ * ecofflink.c (bfd_ecoff_debug_accumulate): When relaxing, adjust
+ PDR addresses as required.
+
+ * ecoff.c (ecoff_emit_aggregate): Take fdr argument. Map fdr
+ index through rfd map if it exists. Check for a couple of cases
+ which gdb handles specially. Change all callers.
+ (ecoff_type_to_string): Take fdr argument rather than aux_ptr and
+ bigendian argument. Change all callers.
+ (ecoff_print_symbol): Handle stStruct, stUnion and stEnum.
+
+Thu Apr 14 13:05:10 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * coff-mips.c (mips_howto_table): Add dummy entries to account for
+ numbering changes in include/coff/mips.h. Add entries for
+ MIPS_R_RELHI and MIPS_R_RELLO.
+ (mips_ecoff_swap_reloc_in): Handle an extra bit for the reloc type
+ when little endian. Treat internal MIPS_R_RELLO or MIPS_R_RELHI
+ relocs like MIPS_R_SWITCH, and convert r_offset from 24 to 32
+ bits.
+ (mips_ecoff_swap_reloc_out): Likewise.
+ (mips_adjust_reloc_in): Handle internal MIPS_R_RELLO or
+ MIPS_R_RELHI relocs like MIPS_R_SWITCH.
+ (mips_adjust_reloc_out): Likewise.
+ (mips_relhi_addr, mips_relhi_addend): New static variables.
+ (mips_relhi_reloc, mips_rello_reloc): New functions.
+ (mips_bfd_reloc_type_lookup): Turn BFD_RELOC_PCREL_HI16_S into
+ MIPS_R_RELHI and turn BFD_RELOC_PCREL_LO16 into MIPS_R_RELLO.
+ (mips_relocate_hi): Rename from mips_relocate_refhi, and add pcrel
+ argument. Changed all callers.
+ (mips_relocate_section): Rename got_reflo to got_lo and
+ reflo_int_rel to lo_int_rel. Handle MIPS_R_RELLO and MIPS_R_RELHI
+ relocs.
+ (mips_relax_section): Adjust MIPS_R_RELHI/MIPS_R_RELLO pairs when
+ expanding a PC relative call.
+
+ * reloc.c (bfd_reloc_code_real_type): Add BFD_RELOC_PCREL_HI16_S
+ and BFD_RELOC_PCREL_LO16.
+ * bfd-in2.h: Rebuilt.
+
+Wed Apr 13 11:50:07 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * coff-sparc.c (sparccoff_vec): Set minimum alignment power to 3.
+
+Tue Apr 12 13:36:20 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (som_write_fixups): Always emit at least
+ one relocation for any non-bss section.
+
+Mon Apr 11 14:41:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elfcode.h (assign_file_positions_except_relocs): Don't require
+ the file alignment to correspond to the page size when linking
+ with -N.
+
+Sun Apr 10 01:02:24 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * elfcode.h (write_relocs): For rela relocations, adjust the
+ addend for relocations involving section symbols to account
+ for the lossage of 1:1 mapping from input section symbols to
+ output section symbols.
+
+Fri Apr 8 12:22:02 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * aoutx.h (NAME(aout,make_sections)): New function.
+ (NAME(aout,some_aout_object_p)): Call NAME(aout,make_sections)
+ rather than making sections inline.
+ (NAME(aout,mkobject)): Don't make any sections.
+ (NAME(aout,adjust_sizes_and_vmas)): Call NAME(aout,make_sections).
+ (NAME(aout,final_link)): Don't dereference obj_textsec (abfd) or
+ obj_datasec (abfd) if they are NULL.
+ * libaout.h (NAME(aout,make_sections)): Declare.
+ * bout.c (b_out_mkobject): Don't make any sections.
+ (b_out_write_object_contents): Call aout_32_make_sections.
+ (b_out_set_section_contents): Likewise.
+ * i386os9k.c (os9k_mkobject): Don't make any sections.
+ (os9k_write_object_contents): Call aout_32_make_sections.
+ (os9k_set_section_contents): Likewise.
+
+ * aoutx.h (NAME(aout,new_section_hook)): Don't set N_EXT in target
+ index.
+
+Wed Apr 6 20:44:56 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config.bfd, configure.host: Add mips-*-sysv4* support.
+
+Thu Apr 7 14:23:05 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * coff-mips.c (mips_howto_table): Add entry for MIPS_R_SWITCH.
+ (mips_ecoff_swap_reloc_in): For MIPS_R_SWTICH, copy r_symndx into
+ r_offset and set r_symndx to RELOC_SECTION_TEXT.
+ (mips_ecoff_swap_reloc_out): For MIPS_R_SWITCH, get the r_symndx
+ value from the r_offset field.
+ (mips_adjust_reloc_in): Maximum r_type value is now MIPS_R_SWITCH.
+ For MIPS_R_SWITCH, copy the r_offset field into the addend field.
+ (mips_adjust_reloc_out): For MIPS_R_SWITCH, copy the addend field
+ into the r_offset field.
+ (mips_switch_reloc): New function.
+ (mips_bfd_reloc_type_lookup): Translate BFD_RELOC_GPREL32 into
+ MIPS_R_SWITCH.
+ (mips_relocate_section): Handle MIPS_R_SWITCH.
+ (mips_relax_section): Adjust MIPS_R_SWITCH offset if necessary.
+
+Thu Apr 7 11:10:51 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * elfcode.h (elf_set_section_contents): Support calling the backend
+ function elf_backend_begin_write_processing when just beginning to
+ write an object file.
+
+ * libelf.h (elf_backend_begin_write_processing): Declare.
+
+ * elf{32,64}-target.h (elf_backend_begin_write_processing): Provide
+ a default definition.
+ (elf{32,64}_bed): Add elf_backend_begin_write_processing.
+
+ * elf32-hppa.h (elf_hppa_tc_symbol): Delete extern declaration.
+ (elf_hppa_tc_make_sections): Likewise.
+
+ * elf32-hppa.c (symext_chain_built): Delete.
+ (symext_chain_size): Renamed from symextn_contents_real_size.
+ (elf32_hppa_backend_{begin,final}_write_processing): New functions.
+ (add_entry_to_symext_chain): New function.
+ (hppa_elf_set_section_contents): Ignore writes to the symbol extension
+ section until it's been rebuilt internally.
+ (hppa_elf_get_section_contents): Symbol extension section is no
+ longer special.
+ (elf_backend_{begin,final}_write_processing): Define.
+ (elf_hppa_tc_make_sections): Simplify now that much code has
+ migrated into elf32_hppa_backend_{being,final}_write_processing.
+
+Wed Apr 6 17:24:14 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ Add new target vectors to read the dynamic symbols and dynamic
+ relocs. Change a.out to use these rather than reading the dynamic
+ symbols and relocs along with the normal symbols and relocs.
+ * targets.c (bfd_target): Add fields
+ _bfd_get_dynamic_symtab_upper_bound,
+ _bfd_canonicalize_dynamic_symtab,
+ _bfd_get_dynamic_reloc_upper_bound,
+ _bfd_canonicalize_dynamic_reloc.
+ (BFD_JUMP_TABLE_DYNAMIC): Define.
+ * libbfd-in.h (_bfd_nodynamic_get_dynamic_symtab_upper_bound):
+ Define.
+ (_bfd_nodynamic_canonicalize_dynamic_symtab): Define.
+ (_bfd_nodynamic_get_dynamic_reloc_upper_bound): Define.
+ (_bfd_nodynamic_canonicalize_dynamic_reloc): Define.
+ * bfd.c (bfd_get_dynamic_symtab_upper_bound): Define.
+ (bfd_canonicalize_dynamic_symtab): Define.
+ (bfd_get_dynamic_reloc_upper_bound): Define.
+ (bfd_canonicalize_dynamic_reloc): Define.
+ * sunos.c (MY_read_dynamic_symbols): Don't define.
+ (MY_read_dynamic_relocs): Don't define.
+ (MY_get_dynamic_symtab_upper_bound): Define.
+ (MY_canonicalize_dynamic_symtab): Define.
+ (MY_get_dynamic_reloc_upper_bound): Define.
+ (MY_canonicalize_dynamic_reloc): Define.
+ (struct sunos_dynamic_info): Change type of dynsym_count and
+ dynrel_count to long. Add fields canonical_dynsym and
+ canonical_dynrel.
+ (sunos_read_dynamic_info): Check that BFD had DYNAMIC flag set.
+ Clear info->canonical_dynsym and info->canonical_dynrel.
+ (MY(read_dynamic_symbols)): Removed.
+ (MY(read_dynamic_relocs)): Removed.
+ (sunos_get_dynamic_symtab_upper_bound): New function.
+ (sunos_canonicalize_dynamic_symtab): New function.
+ (sunos_get_dynamic_reloc_upper_bound): New function.
+ (sunos_canonicalize_dynamic_reloc): New function.
+ * libaout.h: Declare struct reloc_ext_external and
+ reloc_std_external to avoid prototype problems.
+ (struct aout_backend_data): Remove fields read_dynamic_symbols and
+ read_dynamic_relocs.
+ (NAME(aout,translate_symbol_table)): Declare.
+ (NAME(aout,swap_ext_reloc_in)): Declare.
+ (NAME(aout,swap_std_reloc_in)): Declare.
+ * aoutx.h (NAME(aout,translate_symbol_table)): Renamed from
+ translate_symbol_table and made non-static. Changed all callers.
+ (NAME(aout,slurp_symbol_table)): Don't read dynamic symbols.
+ (NAME(aout,slurp_reloc_table)): Don't read dynamic relocs.
+ (NAME(aout,get_reloc_upper_bound)): Don't count dynamic relocs.
+ * aoutf1.h (aout_32_sunos4_write_object_contents): Don't bother to
+ remove dynamic symbols and relocs. They will no longer be
+ present.
+ (MY_read_dynamic_symbols): Don't define.
+ (MY_read_dynamic_relocs): Don't define.
+ (sunos4_aout_backend): Don't initialize dynamic entry points.
+ * aout-target.h (MY_read_dynamic_symbols): Don't define.
+ (MY_read_dynamic_relocs): Don't define.
+ (MY(backend_data)): Don't initialize dynamic entry points.
+ (MY_get_dynamic_symtab_upper_bound): If not defined, define to
+ _bfd_nodynamic version.
+ (MY_canonicalize_dynamic_symtab): Likewise.
+ (MY_get_dynamic_reloc_upper_bound): Likewise.
+ (MY_canonicalize_dynamic_reloc): Likewise.
+ * All backends: Added BFD_JUMP_TABLE_DYNAMIC to target vector.
+ * bfd-in2.h: Rebuilt.
+ * libbfd.h: Rebuilt.
+
+ * cf-m68klynx.c: Include sysdep.h.
+
+ * hp300hpux.c: Removed some spaces in uses of NAME to avoid
+ problems with traditional C compilers.
+
+ * targets.c (bfd_target): Rearranged fields in target vector.
+ 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.
+
+Tue Apr 5 22:10:04 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * Crude support for examining dynamic libraries.
+ * som.c (som_object_setup): Set DYNAMIC flag for SHL_MAGIC and
+ DL_MAGIC objects.
+ (som_prep_headers): Preserve the system_id for DYNAMIC objects.
+ Use SHL_MAGIC as the magic number of the DYNAMIC flag is set.
+ Write exec headers for DYNAMIC objects.
+ (som_begin_writing): DYNAMIC objects have the same alignment
+ restrictions as D_PAGED objects.
+ (bfd_section_from_som_symbol): Treat DYNAMIC objects like EXEC_P
+ objects.
+ (object_flags): Add DYNAMIC.
+
+Tue Apr 5 17:48:52 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * i386lynx.c, sparclynx.c (NAME): Remove embedded whitespace in
+ macro uses, confuses some non-ANSI compilers.
+
+Tue Apr 5 15:50:01 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (som_bfd_free_cached_info): Add missing PARAMS decl.
+ Don't free anything if we don't have a bfd_object.
+ (som_close_and_cleanup): Call som_bfd_free_cached_info.
+
+Tue Apr 5 11:22:38 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elf32-mips.c (mips_elf_final_link): Don't remove empty sections.
+ It turns out not to be required on Irix 5, and it causes problems
+ if the sections happen to contain symbols.
+
+ * elfcode.h (write_shdrs_and_ehdr): Correct bfd_write check.
+
+ * aoutx.h (NAME(aout,canonicalize_reloc)): Don't error out if
+ 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.
+
+Mon Apr 4 15:30:49 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * aoutx.h (NAME(aout,bfd_free_cached_info)): Don't free anything
+ if we don't have a bfd_object.
+
+ Made sure that every call to bfd_read, bfd_write, and bfd_seek
+ checks the return value and handled bfd_error correctly. These
+ changes are not itemised. Also:
+ * aoutx.h (emit_strtab): Change return type to boolean, and return
+ errors.
+ (NAME(aout,write_syms)): Check emit_strtab return value.
+ (NAME(aout,final_link)): Likewise.
+ * coffcode.h (coff_write_relocs): Change return type to boolean,
+ and return errors.
+ (coff_write_object_contents): Check coff_write_relocs return
+ value.
+ * i386os9k.c (os9k_swap_exec_header_in): Change return type to
+ boolean.
+ (os9k_object_p): Check os9k_swap_exec_header_in return value.
+ * oasys.c (oasys_read_record): Change return type to boolean.
+ (oasys_slurp_symbol_table: Check oasys_read_record return value.
+ (oasys_object_p, oasys_slurp_section_data): Likewise.
+ (oasys_write_record): Change return type to boolean.
+ (oasys_write_syms): Likewise. Also, check oasys_write_record
+ return value.
+ (oasys_write_sections): Check oasys_write_record return value.
+ (oasys_write_header): Change return type to boolean. Check
+ oasys_write_record return value.
+ (oasys_write_end, oasys_write_data): Likewise.
+ (oasys_write_object_contents): Check return values of
+ oasys_write_header, oasys_write_syms, oasys_write_data, and
+ oasys_write_end.
+ * srec.c (srec_write_record): Change return type to boolean.
+ (srec_write_header): Likewise. Also, check srec_write_record
+ return value.
+ (srec_write_section, srec_write_terminator): Likewise.
+ (srec_write_symbols): Change return type to boolean.
+ (internal_srec_write_object_contents): Check return value of
+ srec_write_symbols, srec_write_header, srec_write_section, and
+ srec_write_terminator.
+
+ * Makefile.in: Rebuilt dependencies.
+
+Mon Apr 4 10:56:45 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * aix386-core.c (aix386_bfd_is_local_label): Correct cast from
+ asection to asymbol.
+ * ptrace-core.c (ptrace_unix_bfd_is_local_label): Correct cast from
+ bfd to asymbol.
+ * trad-core.c (trad_unix_bfd_is_local_label): Correct cast from
+ asection to asymbol.
+
+Sun Apr 3 18:27:29 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (som_slurp_string_table): Use malloc to allocate space
+ for the cached copy of the native string table.
+ (som_slurp_symbol_table): Likewise for the native symbol table.
+ (som_slurp_reloc_table): Likewise for the native and generic
+ relocation tables.
+ (som_bfd_free_cached_info): Free the cached native strings,
+ symbols, and relocations. Also free the canonical cached
+ relocations.
+
+Fri Apr 1 12:40:58 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * aoutx.h (aout_link_write_symbols): If keep_memory is false, make
+ sure the symbol name is stored in permanent memory before adding
+ it to the string table.
+
+ * archive.c (_bfd_write_archive_contents): Once we've found an
+ object, don't bother to look for more when deciding whether to
+ build a map.
+ (compute_and_write_armap): After adding the symbols for a BFD,
+ call bfd_free_cached_info on it.
+
+ Add bfd_free_cached_info support to a.out backends.
+ * 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.
+
+ Add a new entry point to free memory cached by a BFD.
+ * targets.c (bfd_target): Add _bfd_free_cached_info field.
+ * 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.
+
+ * elf32-hppa.c (elf_hppa_reloc_type_lookup): Correct type of
+ first, unused, argument.
+ (hppa_elf_is_local_label): Declare instead of
+ som_bfd_is_local_label.
+
+ * coff-a29k.c (a29k_reloc): Add reloc_entry->address to value of
+ absolute R_IREL reloc.
+
+Thu Mar 31 11:52:15 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ Added some support for Irix 4 shared libraries.
+ * ecoff.c (ecoff_new_section_hook): Set SEC_SHARED_LIBRARY for a
+ .lib section.
+ (ecoff_sec_to_styp_flags): Set SEC_SHARED_LIBRARY if
+ STYP_ECOFF_LIB bit is set.
+ (ecoff_compute_section_file_positions): Round the contents of a
+ .lib section up to the next page boundary.
+ (ecoff_set_section_contents): If we see a .lib section, increment
+ the vma by one to count the number of shared libraries we have.
+ (ecoff_write_object_contents): Don't crash if we see a
+ STYP_ECOFF_LIB section, and don't adjust text_start or data_start
+ or bss_size either.
+
+ * coffcode.h (CALC_ADDEND): Change to fetch original symbol value
+ from original BFD, rather than using value of current BFD symbol.
+ Needed for new linker.
+ * coff-sparc.c (CALC_ADDEND): Likewise.
+
+ * ecoff.c (ecoff_write_object_contents): Set the text_start and
+ data_start entries in the optional header correctly even if a text
+ or data section starts at location zero.
+
+ * reloc.c (bfd_reloc_code_real_type): Added BFD_RELOC_26 (from sef
+ and raeburn).
+ * bfd-in2.h: Rebuilt.
+
+ * nlm32-i386.c (nlm_i386_read_import): Null terminate the symbol
+ name.
+ * nlm32-alpha.c (nlm_alpha_read_import): Likewise.
+ * nlm32-sparc.c (nlm_sparc_read_import): Likewise.
+
+ * coffgen.c (coff_write_symbol): Reindented. Changed to return
+ boolean, and changed written to unsigned int *. Check error
+ returns from called functions.
+ (coff_write_alien_symbol): Likewise.
+ (coff_write_native_symbol): Likewise.
+ (coff_write_symbols): Likewise. Reworked checks on whether to
+ write symbol name to string table for clarity and to avoid core
+ dumping when given a non COFF symbol.
+ * libcoff-in.h (coff_write_symbols): Declare as returning boolean.
+ * libcoff.h: Rebuilt.
+ * coffcode.h (coff_write_object_contents): Check return value of
+ coff_write_symbols.
+
+Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ 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.
+
+Wed Mar 30 08:33:04 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * hosts/dpx2.h: Define POSIX_UTIME.
+
+Wed Mar 30 00:31:49 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * i386dynix.c, config/i386-dynix.mt: New files, handling Dynix
+ 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.
+ * hosts/symmetry.h: Do not define TRAD_CORE_USER_OFFSET for Dynix.
+ Define HOST_DATA_START_ADDR and TRAD_UNIX_CORE_FILE_FAILING_SIGNAL
+ for Dynix. Remove inclusion of dynix3.h, Dynix bfd is now handled by
+ i386dynix.c
+
+Mon Mar 28 12:53:27 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * Makefile.in (BFD32_BACKENDS): Add coff-sparc.o.
+
+ * coffcode.h (coff_set_flags): Handle bfd_arch_powerpc like
+ bfd_arch_rs6000.
+
+ * config.bfd (powerpc-*-aix*): New target; use rs6000.mt.
+ * config/rs6000.mt (SELECT_ARCHITECTURES): Add bfd_powerpc_arch.
+
+ * aoutx.h (translate_from_native_sym_flags): Set SEC_RELOC flag
+ for generated constructor section.
+
+Sun Mar 27 16:25:22 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (som_begin_writing): New approach at dealing with holes
+ in executables left by the HP linker. Does not rely on subspace
+ alignments as subspaces are *NOT* guaranteed to be properly
+ aligned in an executable (can you believe that!).
+
+Sat Mar 26 10:25:43 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (som_get_section_contents): New function. Do not try
+ to actually read data from a section that doesn't have either
+ SEC_LOAD or SEC_DEBUGGING set (eg $BSS$) just return true.
+
+ * libbfd.c (bfd_read): Set bfd_error as appropriate for a short
+ 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.
+
+Fri Mar 25 11:44:06 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * hosts/sysv4.h (HAVE_PROCFS): Add comments about ptx4.
+ * config/sysv4.mh: Add comment.
+ * config/symmetry.mh: Change comment.
+ * configure.host: Use sysv4, not symmetry, for i[34]86-sequent-sysv4*.
+
+Fri Mar 25 17:10:45 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ Changes to support linker relaxing of embedded MIPS PIC code to
+ use a five instruction sequence for function calls which are out of
+ range of the bal instruction.
+ * libecoff.h (struct ecoff_section_tdata): Define.
+ (ecoff_section_data): Define.
+ (ecoff_bfd_relax_section): Don't define.
+ * ecoff.c (ecoff_final_link_debug_accumulate): Don't read or free
+ the debugging information if it has already been read.
+ (ecoff_indirect_link_order): Handle _cooked_size being different
+ from _raw_size. Don't reread the contents or the relocs if they
+ have already been read in.
+ * coff-mips.c (mips_howto_table): Change bitsize of PCREL16 from
+ 18 to 16.
+ (PCREL16_EXPANSION_ADJUSTMENT): Define.
+ (mips_relocate_refhi): Take adjust argument.
+ (mips_relocate_section): Handle reloc offsets stored in section
+ used_by_bfd field. Call mips_relax_pcrel16 to handle details of
+ expanding an out of range PCREL16. Keep trace of adjustments
+ required by expansions. Set s and unset h when converting a reloc
+ from undefined to section. Change handling of PC relative relocs:
+ if against a section, they are correct in the object file, if
+ against an external symbol they are pcrel_offset.
+ (mips_relax_section): New function.
+ (mips_relax_pcrel16): New function.
+ (ecoff_bfd_relax_section): Define.
+ * coff-alpha.c (ecoff_bfd_relax_section): Define.
+ * ecofflink.c (bfd_ecoff_debug_accumulate): Handle adjustments
+ built by mips_relax_section when writing out addresses.
+ * elf32-mips.c (mips_elf_read_ecoff_info): Clear adjust field.
+
+ * aoutx.h (NAME(aout,find_nearest_line)): The caller expects
+ functionname_ptr to be set to a symbol name, so prepend
+ symbol_leading_char.
+
+Thu Mar 24 11:33:46 1994 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * coff-h8300.c (h8300_reloc16_extra_cases): Add relaxing info
+ for 16bit relative branches.
+ * coff-h8500.c (r_high8, r_low16, r_high16): Don't complain on
+ overflow.
+
+Thu Mar 24 09:21:13 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (som_bfd_prep_for_ar_write): Ignore non-SOM objects.
+ (som_bfd_ar_write_symbol_stuff, som_write_armap): Likewise.
+
+Wed Mar 23 14:29:31 1994 David J. Mackenzie (djm@rtl.cygnus.com)
+
+ * netbsd386.c (N_SET_FLAGS): Delete the old definition.
+
+Wed Mar 23 14:58:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ Clean up the relaxing code for the new linker.
+ * targets.c (_bfd_relax_section): Take boolean *again argument
+ rather than asymbol list.
+ * bfd.c (bfd_relax_section): Change name of fourth argument from
+ symbols to again.
+ * reloc.c (bfd_generic_relax_section): Take boolean *again
+ argument rather than asymbol list. Always return true.
+ * bout.c: Include genlink.h.
+ (aligncode, perform_slip): Declare.
+ (perform_slip): Take BFD argument rather than asymbol list.
+ Changed all callers. Get the symbols from the BFD. Change the
+ hash table entry value as well as the symbol value.
+ (abs32code): Take BFD argument rather than asymbol list. Changed
+ all callers.
+ (aligncode): Likewise.
+ (b_out_relax_section): Take boolean *again argument rather than
+ asymbol list. Only return false if an error occurred. Set *again
+ to false. Get symbols from BFD.
+ * reloc16.c: Include genlink.h.
+ (bfd_perform_slip): Take BFD argument rather than asymbol list.
+ Get the symbols from the BFD. Change the hash table entry value
+ as well as the symbol value.
+ (bfd_coff_reloc16_relax_section): Take boolean *again argument
+ rather than asymbol list. Only return false if an error occurred.
+ Set *again to false. Get symbols from BFD.
+ * coffcode.h (bfd_coff_backend_data): Change
+ _bfd_coff_reloc16_estimate to take BFD argument rather than
+ asymbol list.
+ (bfd_coff_reloc16_estimate): Corresponding change.
+ (dummy_reloc16_estimate): Corresponding change.
+ * libcoff-in.h (bfd_coff_reloc16_relax_section): Change
+ declaration to take boolean * rather than asymbol list.
+ (bfd_perform_slip): Change declaration to take BFD rather than
+ asymbol list.
+ * coff-h8300.c (h300_reloc16_estimate): Take BFD argument rather
+ than asymbol list. Changed calls to bfd_perform_slip.
+ * bfd-in2.h: Rebuilt.
+ * libbfd.h: Rebuilt.
+ * libcoff.h: Rebuilt.
+ * Makefile.in: Rebuilt dependencies.
+
+ * genlink.h (_bfd_generic_link_get_symbols): Define.
+ (_bfd_generic_link_get_symcount): Define.
+ * linker.c (generic_link_read_symbols): New function.
+ (generic_link_add_object_symbols): Use it. Use
+ _bfd_generic_link_get_symbols and _bfd_generic_link_get_symcount
+ to get the symbols from the BFD.
+ (generic_link_check_archive_element): Likewise.
+ (_bfd_generic_final_link): Likewise.
+ (_bfd_generic_link_output_symbols): Likewise.
+ (default_indirect_link_order): Likewise.
+ (generic_link_add_symbol_list): Store pointer to hash table entry
+ in asymbol udata field.
+
+Tue Mar 22 13:09:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * coff-mips.c (mips_howto_table): Add entry for new MIPS_R_PCREL16
+ reloc, used in embedded PIC code.
+ (mips_adjust_reloc_in): Change sanity check to permit new reloc.
+ (mips_bfd_reloc_type_lookup): Turn BFD_RELOC_16_PCREL_S2 into
+ MIPS_R_PCREL16.
+
+ * elf32-mips.c (mips_elf_final_link): Account for link_order
+ relocs when allocating space for relocations. Set SEC_RELOC flag
+ for any section which has relocs. Handle link_order relocs in
+ link_order loop. Use _bfd_generic_link_add_symbols_collect for
+ add_symbls entry point.
+
+ * linker.c (_bfd_generic_final_link): Set reloc_count to 0 before
+ counting relocs. Set SEC_RELOC flag for any section which has
+ relocs.
+
+ * linker.c (_bfd_default_link_order): Handle bfd_data_link_order.
+
+ * linker.c (_bfd_generic_link_add_symbols): Just call
+ generic_link_add_symbols.
+ (_bfd_generic_link_add_symbols_collect): New function, like
+ _bfd_generic_link_add_symbols but also collect constructors and
+ destructors by name as collect2 does.
+ (generic_link_add_symbols): New function, like old
+ _bfd_generic_link_add_symbols but with collect argument.
+ (generic_link_add_object_symbols): Take collect argument.
+ (generic_link_check_archive_element_no_collect): New function.
+ (generic_link_check_archive_element_collect): New function.
+ (generic_link_check_archive_element): Take collect argument.
+ (generic_link_add_symbol_list): Take collect argument.
+ (_bfd_generic_link_add_one_symbol): Rename constructor argument to
+ collect.
+ * libbfd-in.h (_bfd_generic_link_add_symbols_collect): Declare.
+ * libbfd.h: Rebuilt.
+
+Tue Mar 22 10:04:00 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * archive.c (bfd_construct_extended_name_table): Use ar_padchar
+ for first character in an extended name.
+ (_bfd_write_archive_contents): If ar_padchar == '/', then use
+ "//" as the name of the special archive member holding the
+ extended name table.
+
+Mon Mar 21 12:28:19 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ Support for link_order types which generate relocs in order to
+ support -Ur in the linker.
+ * linker.c (generic_link_add_symbol_list): Remove bitsize argument
+ from call to _bfd_generic_link_add_one_symbol.
+ (_bfd_generic_link_add_one_symbol): Remove bitsize argument.
+ Don't pass bitsize to constructor call back. Pass BFD_RELOC_CTOR
+ instead of bitsize to add_to_set call back.
+ (_bfd_generic_final_link): Account for link_order relocs when
+ allocating space for relocations. Handle them in link_order loop.
+ (_bfd_generic_reloc_link_order): New function.
+ (_bfd_default_link_order): If a reloc_link_order is seen here,
+ abort.
+ (_bfd_count_link_order_relocs): New function.
+ * libbfd-in.h (_bfd_generic_link_add_one_symbol): Remove bitsize
+ argument from declaration.
+ (_bfd_generic_reloc_link_order): Declare.
+ (_bfd_count_link_order_relocs): Declare.
+ * libbfd.h: Rebuilt.
+ * aoutx.h (aout_link_add_symbols): Remove bitsize argument from
+ call to _bfd_generic_link_add_one_symbol.
+ (NAME(aout,final_link)): Account for link_order relocs when
+ allocating space for relocations. Handle them after handling all
+ input BFDs.
+ (aout_link_reloc_link_order): New function.
+ * ecoff.c (ecoff_link_add_externals): Remove bitsize argument from
+ call to _bfd_generic_link_add_one_symbol.
+ (ecoff_bfd_final_link): Account for link_order relocs when
+ allocating space for relocations. Handle them in link_order loop.
+ (ecoff_link_write_external): Set the storage class of a defined
+ linker created symbol based on the section it is in. Correct
+ bfd_link_hash_weak case to use .sc rather than .st.
+ (ecoff_reloc_link_order): New function.
+ * coff-alpha.c (alpha_bfd_reloc_type_lookup): Handle
+ BFD_RELOC_CTOR.
+ * coff-mips.c (mips_bfd_reloc_type_lookup): Likewise.
+
+ * sunos.c (sunos_read_dynamic_info): Remove unused locals dynsym
+ and buf.
+
+ * cisco-core.c (cisco_core_file_p): Only pass one argument to
+ bfd_zmalloc. Free a pointer, not a union.
+ (cisco_bfd_is_local_label): Correct cast from asection to asymbol.
+
+Sun Mar 20 09:24:36 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * bfd/som.c (som_begin_writing): Fix thinko (off by one error).
+
+ * som.c (bfd_section_from_som_symbol): Only to do the value
+ comparison for function symbols within executables.
+
+ * som.c (bfd_section_from_som_symbol): Renamed from
+ som_section_from_subspace_index. Pass in a native SOM symbol.
+ For executables, iterate through the sections to find out
+ which contains the symbol's address rather than using the
+ symbol_info field. (symbol_info has a different meaning for
+ dynamicly linked executables.)
+
+ * trad-core.c (trad_unix_core_file_p): Don't pass abfd to
+ bfd_zmalloc.
+
+ * som.c (som_begin_writing): Fix braino (one call to align
+ space/subspace data was done unconditionally rather than
+ just for executables.)
+
+ * som.c (som_begin_writing): Align text in all executables to
+ make HPUX kernel happy. Fixes strip/objcopy for shared
+ executables.
+
+Sat Mar 19 07:06:59 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (som_begin_writing): Account for alignment needs of
+ subspaces too when writing executables. Never request a negative
+ bss size. Fixes some problems with demand paged executables,
+ still having problems with pure executables and shared executables.
+
+Fri Mar 18 19:12:47 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * trad-core.c (trad_unix_core_file_p): Call bfd_zmalloc not
+ bfd_zalloc for rawptr, because later on we may call free, not
+ bfd_release, on it.
+
+ * bfd.c (struct _bfd): Add cisco_core_struct to tdata union.
+ * libbfd.c (bfd_read, bfd_seek): Add comments regarding errors.
+ * cisco-core.c: New file.
+ * Makefile.in: Change accordingly.
+ * configure.in: Recognize cisco_core_vec.
+ * config/m68k-aout.mt (SELECT_VECS): Add cisco_core_vec.
+ * targets.c: Add cisco_core_vec.
+ * bfd-in2.h: Rebuilt.
+
+Fri Mar 18 18:13:49 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.h (som_copyable_section_data_struct): New structure
+ containing all the private section information which needs
+ to be copied from input section to output section during
+ objcopy or strip.
+ (som_section_data_struct): Remove several fields now in
+ som_copyable_section_data_struct. Make the space and
+ subspace dictionaries be pointers (to save space when
+ only reading objects).
+
+ * som.c (bfd_som_set_section_attributes): Now returns a boolean;
+ some references changed. Allocate a copyable data stucture if
+ none exists. Store info into the copyable data structure.
+ (bfd_som_set_subsection_attributes): Likewise.
+ (som_is_space, som_is_subspace, som_is_container): New functions.
+ Use these instead of directly accessing private data.
+ (som_prep_headers): Allocate space and subspace headers here.
+ Fill in some fields in the space/subspace headers from the
+ copyable data.
+ (som_bfd_copy_private_section_data): Only copy the stuff
+ that we really need to make objcopy and strip work. Allocate
+ the copy_data structure for the output bfd before copying.
+
+ * som.h (struct som_exec_data): New structure to hold exec
+ info that must be preserved when running objcopy/strip.
+ (struct somdata): Add new "exec_data" field and accessor
+ macro. Add some comments on how the various fields are used.
+ (som_section_data_struct): Make is_space and is_subspace bitfields.
+ Delete unused subspace_index. All references now use the
+ target_index field within the section structure itself.
+
+ * som.c (make_unique_section): Delete unused declaration.
+ (som_bfd_copy_private_bfd_data): New function.
+ (som_object_setup): Allocate space for and save exec information
+ that needs to be copied during objcopy/strip.
+ (som_mkobject): Do not allocate space for a file header here.
+ It is not used when only reading SOM objects.
+ (som_prep_headers): Allocate space for and attach a file header
+ to the output bfd. For executables, use the saved system_id
+ value rather than trying to guess the right value. Do not abort
+ wwhen setting file_hdr->entry* for executables.
+ (som_begin_writing): For executables, set the exec_entry and
+ exec_flags fields.
+ (som_copy_private_backend_section_data): Always return a value.
+
+ * libhppa.h (PA_PAGESIZE): Define.
+
+ * som.c (SOM_ALIGN): Define.
+ (som_begin_writing): If writing an executable, initialize all
+ fields in the exec header to zero. Update fields in the exec
+ header as sizes of loadable subspaces are computed. Carefully
+ preserve alignments when building executables. Actually write the
+ exec after all the fields are filled in.
+
+ * Better long-filename handling. Reads SOM ABI compliant extended
+ names, but doesn't quite write compliant extended names yet.
+ * som.c (som_slurp_extended_name_table): Delete function. The
+ generic code will handle things correctly.
+ (som_slurp_armap): Seek to the beginning of the next member.
+ (normalize): New function.
+ (som_bfd_ar_write_symbol_stuff): Take the size of the extended
+ name table into account when computing the file offsets in the
+ SOM dictionary. Make sure to align to an even boundary.
+ (som_write_armap): Initialize the checksum to zero.
+ (ar_maxchars): Fix. Opps.
+
+Fri Mar 18 20:35:24 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * aoutx.h (reloc_type_lookup): Handle BFD_RELOC_CTOR on a 64-bit
+ machine. Handle BFD_RELOC_SPARC13 and BFD_RELOC_SPARC_BASE13.
+
+Thu Mar 17 18:26:46 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * bfd-in.h (BFD_VERSION): Use @VERSION@.
+ * Makefile.in (bfd.h): Replace it with contents of VERSION file.
+ * bfd-in2.h: Regenerated.
+
+ * trad-core.c (trad_unix_bfd_is_local_label): Fixed typo where
+ this was also named trad_unix_bfd_copy_private_bfd_data.
+
+Thu Mar 17 10:37:07 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * aoutx.h, elfcode.h, coff-alpha.c, bout.c, ecoff.c, ecofflink.c,
+ elf32-hppa.c, elf32-mips.c, linker.c, som.c, sunos.c: If malloc(0)
+ returns NULL, it is not an error. It's possible that some of
+ these checks are not necessary (because the size can never be
+ zero), but putting in the checks is the conservative thing to do
+ in light of the fact that some of these malloc calls replaced
+ unchecked alloca calls, in which a zero argument would work fine.
+
+Thu Mar 17 11:44:45 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * osf-core.c (osf_core_bfd_copy_private_bfd_data): Remove
+ duplicate definition.
+ (osf_core_bfd_is_local_label): Define.
+
+ * reloc.c (bfd_generic_get_relocated_section_contents): Don't fail
+ if malloc (0) fails. bfd_canonicalize_reloc returning 0 is not a
+ failure indication, it merely means there are no relocs.
+
+ * elfcode.h (NAME(bfd_elf,write_object_contents)): Don't use space
+ after NAME, since SunOS /bin/cc can't handle it.
+
+Wed Mar 16 16:43:33 1994 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * netbsd386.c (N_SET_FLAGS): Don't nuke the machine id field.
+ From sukes@glue.umd.edu (Tasuki Hirata).
+
+Wed Mar 16 07:55:54 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * aoutf1.h (4 places): Use a simple #if on ARCH_SIZE, rather than
+ all that convoluted stuff with NAME, CAT3, etc. The convoluted
+ stuff broke for SunOS4 /bin/cc (due to DEFUN elimination, I guess).
+
+Wed Mar 16 00:02:05 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (som_prep_for_fixups): Detect section symbols based
+ on either the lack of private data or the symbol flags. Do not
+ munge section symbol names anymore -- they no longer confuse GDB.
+ (som_begin_writing): Leave space for an exec header if writing
+ an executable.
+ (som_slurp_symbol_table): Recognize both forms of section symbol
+ names "L$0\002" and "$<FOO>$". Change the name of "L$0\002"
+ section symbols to be the name of the section they represent.
+ Debugging symbols begin with "L$0\001", not just "L$".
+
+Tue Mar 15 22:58:28 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * bfd-in2.h, libbfd.h, libcoff.h: Rebuilt.
+
+ * bfd-in.h (JUMP_TABLE): Add new entries to the jump table
+ for bfd_copy_private_section_data, bfd_copy_private_bfd_data,
+ and bfd_is_local_label.
+
+ * targets.c: Add new entries to the bfd_target structure.
+
+ * bfd.c (bfd_copy_private_bfd_data): New definition.
+
+ * section.c (bfd_copy_private_section_data): New definition.
+
+ * syms.c (bfd_is_local_label): New definition.
+
+ * libbfd-in.h (bfd_generic_is_local_label): Declare.
+
+ * libbfd.c (bfd_generic_is_local_label): New function.
+
+ * *-core.c: Provide default definitions for new functions in
+ the target vector which all point to bfd_false.
+
+ * aout-target.h, coffcode.h, elf32-target.h elf64-target.h, ieee.c
+ libaout.h, libecoff.h, nlm-target.h, oasys.c, srec.c, tekhex.c
+ Default new vectors for copying private backend data to bfd_true.
+ Default new vector for determining if a symbol is a local label
+ to bfd_generic_is_local_label.
+
+ * som.c (som_bfd_copy_private_section_data): New function.
+ (som_bfd_is_local_label): New function.
+ (som_bfd_copy_private_bfd_data): For now default to bfd_true.
+
+ * elf32-hppa.c (hppa_elf_is_local_label): New function.
+
+Tue Mar 15 23:55:47 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * cf-m68klynx.c (CALC_ADDEND): Use _bfd_m68klynx_howto_table.
+
+Tue Mar 15 04:41:13 1994 David J. Mackenzie (djm@rtl.cygnus.com)
+
+ * Most files:
+ Replace DEFUN and DEFUN_VOID with K&R-style function definition.
+ Indent some of them to GNU standards.
+
+ * aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
+ cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
+ elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
+ libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
+ Update copyright years.
+
+Mon Mar 14 11:41:23 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (som_prep_for_fixups): A relocation involving the section
+ symbol for the *ABS* section is really a relocation involving
+ no symbol.
+ (som_slurp_symbol_table): Do not set BSF_GLOBAL or BSF_EXPORT for
+ undefined symbols. Correctly distinguish between debugger symbols
+ and section symbols.
+
+ * som (setup_sections): Set SEC_DEBUGGING and the section attributes
+ for spaces and subspaces.
+
+ * som.c (som_bfd_count_ar_symbols): Fix typo.
+
+ * som.c (som_object_setup): Set EXEC_P, D_PAGED, WP_TEXT, and
+ HAS_RELOC based on the object's magic number.
+ (make_unique_section): Delete function. BFD and its users are
+ prepared to handle multiple sections with the same name.
+ (setup_sections): Allocate space on the BFD's obstack to hold
+ section names. Use bfd_make_setion_anyway rather than the
+ obsolete make_unique_section.
+ (som_prep_headers): Choose the correct SOM magic number based
+ on the BFD's flags.
+ (som_bfd_fill_in_ar_symbols): Return false, not NULL on error.
+
+Sat Mar 12 09:46:09 1994 Ian Lance Taylor (ian@cygnus.com)
+
+ * elf32-ppc.c: Renamed from elf32-powerpc.c.
+ * nlm32-ppc.c: Renamed from nlm32-powerpc.c.
+ * Makefile.in, configure.in: Corresponding changes.
+
+Fri Mar 11 22:27:19 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elf32-powerpc.c: Extensive changes to update to preliminary ABI.
+
+Fri Mar 11 00:34:59 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * sunos.c (sunos_read_dynamic_info): Assume that dynamic info
+ is always located at the start of the data section to allow
+ recovery of the dynamic info from a stripped executable.
+ * ecoff.c (ecoff_styp_to_sec_flags): Handle STYP_PDATA, STYP_XDATA
+ and STYP_COMMENT.
+
+Wed Mar 9 17:17:53 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * libbfd-in.h: Remove alloca cruft. It was missing some necessary
+ 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,
+ sunos.c: Replace alloca with malloc and appropriate error checking and
+ freeing.
+ * linker.c: Replace alloca with obstack_alloc.
+ * libbfd.h: Rebuilt.
+
+Tue Mar 8 12:10:38 1994 Ian Lance Taylor (ian@cygnus.com)
+
+ * coff-mips.c (mips_relocate_section): Handle MIPS_R_LITERAL like
+ MIPS_R_GPREL.
+
+Sat Mar 5 14:08:54 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * elf32-hppa.h, elfcode.h: Replace uses of Elf*_Half, Elf*_Word,
+ Elf*_Off typedefs by their expansion, the typedefs have been
+ removed from include/elf/internal.h.
+ * elfcode.h (bfd_section_from_shdr): Handle SHT_DYNAMIC section like
+ SHT_PROGBITS section.
+
+Thu Mar 3 20:03:39 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.h (_PA_RISC_ID): Treat HOST_HPPAOSF just like HOST_HPPABSD.
+
+Wed Mar 2 13:28:06 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * configure.host: Recognize i[34]86-sequent-*.
+
+ * trad-core.c (trad_unix_core_file_p): A non-zero, not zero,
+ return from bfd_seek indicates an error.
+ New macro TRAD_CORE_DSIZE_INCLUDES_TSIZE to replace
+ TRAD_CORE_STACK_OFFSET.
+ * hosts/symmetry.h: Define TRAD_CORE_DSIZE_INCLUDES_TSIZE and
+ TRAD_CORE_USER_OFFSET but not HOST_STACK_OFFSET.
+
+Wed Mar 2 11:57:03 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.[ch]: Do not include libhppa.h in som.c, instead include
+ it in som.h.
+
+ * elf32-hppa.[ch]: Do not include libhppa.h in elf32-hppa.c, instead
+ include it in elf32-hppa.h.
+
+ * som.c (log2): Return -1 on error rather than aborting.
+ (setup_sections): Bubble up an error from log2.
+
+ * Changes to make HP C compiler happy in both traditional
+ and ANSI mode.
+ * som.c (hppa_som_gen_reloc_type): Use correct enum type for
+ field parameter.
+ (bfd_som_set_section_attributes): Use unsigned int rather than
+ unsigned char to avoid GNU-C extensions.
+ (bfd_som_attach_aux_hdr): Return a boolean to indicate success
+ or failure rather than aborting on failure.
+
+ * som.h (bfd_som_set_section_attributes): Fix prototype to match
+ som.c changes.
+ (bfd_som_attach_aux_hdr): Add prototype.
+ (hppa_som-gen_reloc_type): Likewise.
+
+ * elf32-hppa.c: Add a couple casts to make HP compiler happy.
+ (hppa_look_for_stubs_in_section): Do not return false on failure
+ until rest of code is ready to handle it. Abort for now.
+
+Tue Mar 1 18:33:59 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * bfd-in2.h: Rebuilt.
+
+Tue Mar 1 13:06:53 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * i386os9k.c: use new functions bfd_set_error and bfd_get_error.
+ * Makefile.in: delete an extra blank.
+ * configure.in : Add i396os9k_vec.
+
+Mon Feb 28 15:41:01 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * config.bfd : Add i386-os9k.
+ * config/i386-os9k.mt : Newly add os9k target makefile.
+
+ * i386os9k.c : new file to handle os9k format bfd.
+ * Makefile.in : Handle new file i386os9k.c
+ * targets.c : Add bfd_target_os9k_flavour and i386os9k_vec.
+ * cache.c : Initialize cache_sentinel to 0.
+
+Sun Feb 27 16:30:55 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * elf32-hppa.c (mismatches, retval_mismatches): Fix mismatch
+ action in case where caller specified no argument relocation.
+ (hppa_elf_build_linker_stub): Try again to get the sym_ptr_ptr
+ right in the original relocation and the stub's relocation.
+
+ * elf32-hppa.h (hppa_look_for_stub_in_section): Fix typo. Delete
+ unused symbols argument.
+
+ * elf32-hppa.c (hppa_elf_stub_reloc): Accept asymbol ** rather
+ than asymbol * for original target symbol. All callers changed.
+ Set reloc->sym_ptr_ptr appropriately.
+ (hppa_elf_build_linker_stub): Set reloc->sym_ptr_ptr correctly.
+ (hppa_elf_look_for_stubs_in_section): No longer need symbols
+ argument. Use the output symbols when canonicalizing the relocs,
+ creating them if necessary.
+
+ * linker.c (_bfd_generic_link_output_symbols): Do not
+ rebuild/clobber the output symbols if they already exist.
+
+Sun Feb 27 15:22:36 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * targets.c (BFD_SEND, BFD_SEND_FMT): Add debugging versions that
+ check all the pointer dereferences. Enabled via DEBUG_BFD_SEND.
+ * bfd-in2.h: Rebuilt.
+
+ * srec.c (hex_value): Always set to a size of 256 bytes.
+ (srec_init): Cosmetic changes.
+
+Sun Feb 27 11:18:47 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * elf32-hppa.c: Second half of major cleanup. More comments,
+ PARAMize and staticize rest of functions. Delete unused
+ functions. Delete unused/unnecessary arguments to some functions.
+ Group static vars together. Abort for bad errors until we have
+ error code propogation working. Work on spacing and indention.
+ Add FIXMEs for unresolved problems. Use enums rather than
+ #defines for lots of things. Merge two functions which build
+ linker stubs into a single function (so they can easily share a
+ ton of common code).
+
+Sat Feb 26 10:00:45 1994 Ian Lance Taylor (ian@cygnus.com)
+
+ * reloc.c (_bfd_relocate_contents): Adjust handling of overflow to
+ avoid depending upon right shifts of signed numbers, and to
+ correct handling of src_mask with lower bits zero.
+
+ * aoutx.h, archive.c: Add casts to avoid warnings from SVR4 cc.
+ * ecoff.c, ecofflink.c, ecoffswap.h, srec.c: Likewise.
+ * elf32-i386.c: Likewise.
+ * elfcode.h (bfd_section_from_shdr): Make i unsigned; remove old
+ #if 0 code.
+ (elf_write_phdrs): Make i unsigned.
+ (map_program_segments): Make i and n_left unsigned.
+ (assign_file_positions_except_relocs): Make i unsigned.
+ (write_shdrs_and_ehdr): Make count unsigned.
+ (assign_file_positions_for_relocs): Make i unsigned.
+ (NAME(bfd,elf_write_object_contents)): Make count unsigned.
+ (section_from_elf_index): Make index argument unsigned.
+
+Fri Feb 25 21:34:58 1994 Ian Lance Taylor (ian@cygnus.com)
+
+ * elfcode.h: Don't include assert.h.
+ (swap_out_syms): Use BFD_ASSERT rather than assert.
+
+ * linker.c (_bfd_generic_link_write_global_symbol): Add missing
+ break in switch.
+
+ * hosts/i386v4.h (qsort, strtol): Remove incorrect and useless
+ declarations.
+
+Fri Feb 25 16:35:57 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * libhppa.h (hppa_rebuild_insn): Moved here from elf32-hppa.c.
+
+ * elf32-hppa.h (elf_hppa_tc_symbol): Add new arguments.
+ (elf_hppa_tc_make_sections): Likewise.
+ (elf_hppa_final_processing): Add extern decl.
+
+ * elf32-hppa.c: First half of major cleanup. Add/cleanup lots of
+ comments. PARAMize some static functions. Delete unused functions.
+ Delete unused/unnecessary arguments to many functions. Group
+ static vars together. Collapse common case statements together
+ in many places. Use default case when possible instead of listing
+ each case separately. Abort for bad errors until we get error
+ code propogation working. Work on spacing and indention problems.
+ Add FIXMEs for some unresolved problems. Delete hopelessly broken
+ COMPLEX relocation support (it's never used anyway).
+ (hppa_elf_rebuild_insn): Delete. Moved into libhppa.h.
+ (elf_hppa_tc_symbol): Accept and use new arguments (symext chains).
+ (elf_hppa_tc_make_sections): Likewise.
+
+ * format.c (bfd_check_format_matches): Initialize matching_vector
+ to keep gcc -Wall quiet.
+
+ * elfcode.h (elf_slurp_reloca_table): Fix typo.
+
+ * som.c (som_get_symtab_upper_bound): Use "sizeof (asymbol *)"
+ not "sizeof (som_symbol_type *)".
+
+ * elfcode.h (elf_get_symtab_upper_bound): Use "sizeof (asymbol *)"
+ not "sizeof (asymbol"). Opps.
+
+Fri Feb 25 13:19:04 1994 Ted Lemon (mellon@pepper.ncd.com)
+
+ * bfd.c (bfd_get_gp_size): Can't return gp value on an archive.
+ (bfd_set_gp_size): Can't set gp value on an archive.
+
+Fri Feb 25 12:57:00 1994 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * srec.c (pass_over): Don't skip too many characters when
+ end of line seen.
+
+Fri Feb 25 11:41:57 1994 Ian Lance Taylor (ian@cygnus.com)
+
+ * ecoff.c (ecoff_sizeof_headers): Align result to 16 byte
+ boundary.
+
+Thu Feb 24 07:13:22 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (som_bfd_derive_misc_symbol_info): Derive symbol_info
+ field for absolute symbols in the same manner as undefined
+ and common symbols.
+
+Thu Feb 24 04:29:19 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * elfcode.h (elf_core_file_p): Check for core file e_machine match
+ like in elf_object_p.
+
+Wed Feb 23 18:28:37 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * elfcode.h (alloca): Delete declaration.
+
+ * som.c (som_prep_headers): Use CPU_PA_RISC1_0 for magic
+ number rather than HP9000S800_ID. Note som.c is careful
+ to make sure CPU_PA_RISC1_0 is always defined.
+
+Mon Feb 21 10:12:02 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * Makefile.in (targets.o, archures.o): Use ALL_CFLAGS to supply
+ flags to explicit compile actions.
+
+Mon Feb 21 09:50:06 1994 Ian Lance Taylor (ian@lisa.cygnus.com)
+
+ * ecofflink.c (ecoff_write_symhdr): Set symhdr->magic here.
+ * ecoff.c (ecoff_write_object_contents): Make sure .bss section
+ ends on a page boundary if there is no symbol table.
+ (ecoff_bfd_final_link): Don't set symhdr->magic here.
+
+ * hosts/hp300.h: Include <stdlib.h>; don't declare free.
+
+ * som.c (som_bfd_count_ar_symbols): Use a pointer and alloca
+ rather than an array of variable size.
+ (som_bfd_fill_in_ar_symbols): Likewise.
+ (som_bfd_ar_write_symbol_stuff): Likewise.
+
+ * coff-alpha.c (alpha_relocate_section): Rewrite mask and shift
+ operation to avoid OSF 1.3 cc bug.
+ * ecoff.c (ecoff_write_object_contents): Make text_size, data_size
+ and bss_size bfd_size_type instead of unsigned long. Make
+ text_start and data_start bfd_vma instead of unsigned long.
+ * ecofflink.c (ecoff_add_string): Remove incorrect cast of return
+ value.
+
+Sun Feb 20 16:06:54 1994 Ian Lance Taylor (ian@lisa.cygnus.com)
+
+ * linker.c (_bfd_generic_link_add_archive_symbols): Consider
+ symbols in the order they appear in the archive map.
+
+Sat Feb 19 03:17:32 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * coff-alpha.c (reloc_nil): Add forward declaration, add missing
+ error_message argument.
+ * coff-sparc.c (bfd_coff_generic_reloc): Add forward declaration,
+ add missing error_message argument.
+ * mipsbsd.c (mips_fix_hi16_s): Add forward declaration, add missing
+ error_message argument.
+
+Fri Feb 18 11:41:58 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ Support for PowerPC NetWare.
+ * nlm32-powerpc.c: New file.
+ * config.bfd (powerpc-*-netware*): New target; use ppc-nlm.
+ * config/ppc-nlm.mt: New file.
+ * configure.in (nlm32_powerpc_vec): New target vector; use
+ nlm32-powerpc.o, nlm32.o, nlm.o.
+ * targets.c (nlm32_powerpc_vec): Declare.
+ * Makefile.in (BFD32_BACKENDS): Add nlm32-powerpc.o.
+ (CFILES): Add nlm32-powerpc.c.
+
+ Initial support for PowerPC ELF. Done without an ABI, and
+ probably to be changed when I get an ABI.
+ * config.bfd (powerpc-*-sysv4*): New target; use ppc-elf.
+ * config/ppc-elf.mt: New file.
+ * configure.in (bfd_elf32_powerpc_vec): New target vector; use
+ elf32-powerpc.o, elf32.o, elf.o.
+ * elf32-powerpc.c: New file.
+ * elfcode.h (prep_headers): Add bfd_arch_powerpc case.
+ (elf_set_arch_mach): Likewise.
+ * targets.c (bfd_elf32_powerpc_vec): Declare.
+ * Makefile.in (BFD32_BACKENDS): Add elf32-powerpc.o.
+ (CFILES): Add elf32-powerpc.c.
+ Rebuilt dependencies.
+
+Thu Feb 17 15:29:55 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * coffgen.c (coff_write_linenumbers): Always return a value.
+
+ * elfcode.h (elf_slurp_symbol_table): Handle zero symbols
+ reasonably. Allocate x_symp using alloca.
+
+ * elfcode.h (map_program_segments): ELF program header entries
+ must be sorted by load address. This used to generate the entries
+ in reverse order.
+
+ * section.c (SEC_IN_MEMORY): Define.
+ (asection): Rename unused field otheruserdata to contents, and
+ make it char *.
+ (bfd_make_section_anyway): Initialize contents field to NULL.
+ (bfd_get_section_contents): If SEC_IN_MEMORY is set, get section
+ contents from contents field rather than from file.
+ * bfd-in2.h: Rebuilt.
+
+Thu Feb 17 08:30:53 1994 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * bfd.c (bfd_get_error, bfd_set_error): New functions.
+ (bfd_error): Make static.
+ (bfd_error_type): Renamed from bfd_ec. Prepend "bfd_error_" to
+ all values.
+ * bfd-in2.h: Regenerated.
+ * aix386-core.c, aout-adobe.c, aout-encap.c, aout-target.h,
+ aoutf1.h, aoutx.h, archive.c, archures.c,
+ bfd.c, bout.c, cache.c, coff-alpha.c, coff-mips.c,
+ coff-rs6000.c, coffcode.h, coffgen.c, core.c, ctor.c,
+ ecoff.c, ecofflink.c, elf.c, elf32-hppa.c, elf32-mips.c,
+ elfcode.h, format.c, hash.c, hp300hpux.c, hppabsd-core.c,
+ i386lynx.c, ieee.c, libbfd.c, libelf.h, linker.c,
+ lynx-core.c, nlm.c, nlm32-alpha.c, nlm32-i386.c,
+ nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c,
+ ptrace-core.c, reloc16.c, rs6000-core.c, section.c, som.c,
+ srec.c, sunos.c, syms.c, targets.c, tekhex.c,
+ trad-core.c: Change callers.
+
+Tue Feb 15 22:27:27 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c: Remove FIXMEs for things which have been dealt with.
+
+Tue Feb 15 19:39:24 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * section.c (bfd_get_section_contents): Since this function reads
+ unrelocated contents, the section's raw size is always the one to
+ use for bounds checking.
+
+ * linker.c (default_indirect_link_order): In assertion, compare
+ link_order size field against cooked size, not raw size, of input
+ section.
+
+ * bout.c (b_out_get_reloc_upper_bound): For BSS section, just
+ return 0.
+ (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->addend falls between the current source offset and the
+ raw size of the input section.
+
+ * config.bfd: Support i960 vxworks versions > 5.0 with coff, not
+ bout. Default with no version number is still bout. Support
+ explicit i960-coff target too.
+
+ * bout.c: 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.
+
+Tue Feb 15 09:00:16 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (som_bfd_prep_for_ar_write): Iterate through the SOM
+ symbols, not the BFD symbols.
+ (som_bfd_ar_write_symbol_stuff): Likewise.
+
+Mon Feb 14 22:55:20 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (som_slurp_symbol_table): Do not die if a BFD doesn't
+ have any symbols.
+
+ * Finish basic read-write support for SOM archive libraries. Bugs
+ surely remain as this hasn't been tested all that much.
+ * som.c (SOM_LST_HASH_SIZE, SOM_LST_MODULE_LIMIT): Define.
+ (struct som_misc_symbol_info): New structure to hold info necessary
+ to build both normal and library symbol tables.
+ (som_derive_misc_symbol_info): New function to derive info necessary
+ to build both normal and library symbol tables.
+ (som_build_and_write_symbol_table): Use new function to derive misc
+ symbol information.
+ (som_slurp_symbol_table): Update backend private data for symbols
+ appropriately.
+ (som_bfd_prep_for_ar_write): New function.
+ (som_bfd_ar_symbol_hash): New function.
+ (som_bfd_ar_write_symbol_stuff): New function.
+ (som_write_armap): Flesh out.
+ (som_vec): Fix ar padding character.
+
+ * som.c: Consistently use memset rather than bzero.
+
+Mon Feb 14 17:02:28 1994 Stu Grossman (grossman at cygnus.com)
+
+ * coff-rs6000.c: Add Lynx core file support, use HOST_AIX, where
+ appropriate.
+ * rs6000-core.c: Use HOST_AIX instead of COREFILES_PLEASE.
+ * config/rs6000.mh: Remove defs of ARCHIVES_PLEASE and
+ COREFILES_PLEASE.
+ * config/rs6000lynx.mh: Turn on Lynx core file support.
+ * hosts/rs6000.h: #define HOST_AIX.
+ * hosts/rs6000lynx.h: Create this to enable Lynx host support.
+
+Sun Feb 13 14:30:00 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.h (som_symbol_data): Safely access backend private data
+ for BFD symbols. All callers changed.
+
+ * Read-only SOM archive support.
+ * som.c (som_bfd_count_ar_symbols): New helper function.
+ (som_bfd_fill_in_ar_symbols): New helper function.
+ (som_slurp_armap): New function to read a SOM LST.
+
+ * som.h: Include <lst.h> and <ar.h>.
+
+Sat Feb 12 22:34:14 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * elfcode.h (elf_map_symbols): Fix typo.
+ (write_object_contents): Check return values from prep_headers and
+ elf_compute_section_file_positions.
+ (set_section_contents): Likewise.
+
+Fri Feb 11 16:56:50 1994 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * archive.c (normalize) [VMS]: Call malloc, not bfd_xmalloc.
+ (bfd_construct_extended_name_table): Check result of normalize.
+
+Tue Feb 8 08:57:31 1994 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ Make all callers of malloc or realloc (including via obstacks)
+ check the result for NULL. Most set bfd_error to no_memory and
+ return in that case; a few are harder to fix, and are marked
+ with "FIXME <return type>".
+
+ * elf32-hppa.c (hppa_elf_build_arg_reloc_stub
+ hppa_elf_build_long_branch_stub): Check bfd_make_empty_symbol return.
+ * linker.c (_bfd_generic_link_output_symbols
+ _bfd_generic_link_write_global_symbol): Ditto
+ * section.c (bfd_make_section_anyway): Ditto.
+
+ * tekhex.c (find_chunk tekhex_mkobject): Check bfd_alloc.
+ (first_phase): Ditto. FIXME void
+ (tekhex_make_empty_symbol): Check bfd_zalloc.
+
+ * sunos.c (sunos_read_dynamic_info): Check bfd_zalloc.
+ (MY(read_dynamic_symbols) MY(read_dynamic_relocs)): Check bfd_alloc.
+
+ * stringhash.c (_bfd_stringtab_hash_newfunc): Check bfd_hash_allocate.
+
+ * srec.c: Indent.
+ (fillup_symbols): Check bfd_alloc. FIXME void
+ (srec_mkobject srec_get_section_contents
+ srec_set_section_contents): Check bfd_alloc.
+ (srec_make_empty_symbol): Check bfd_zalloc.
+
+ * som.c (hppa_som_gen_reloc_type): Check bfd_alloc_by_size_t.
+ (make_unique_section): Check bfd_alloc.
+ (som_new_section_hook): Check bfd_zalloc.
+ (bfd_som_attach_aux_hdr): Ditto. FIXME void
+
+ * rs6000-core.c (rs6000coff_core_p): Check bfd_zalloc.
+
+ * osf-core.c (osf_core_make_empty_symbol): Check bfd_zalloc.
+ (osf_core_core_file_p): Check bfd_alloc.
+
+ * oasys.c (oasys_slurp_symbol_table oasys_archive_p
+ oasys_mkobject oasys_object_p oasys_new_section_hook
+ oasys_set_section_contents): Check bfd_alloc.
+ (oasys_slurp_section_data): Check bfd_zalloc and bfd_alloc.
+ (oasys_make_empty_symbol): Check bfd_zalloc.
+
+ * nlmcode.h (nlm_make_empty_symbol): Check bfd_zalloc.
+ (nlm_slurp_symbol_table): Check bfd_zalloc and bfd_alloc.
+
+ * nlm32-sparc.c (nlm_sparc_read_import): Check bfd_alloc.
+
+ * nlm32-i386.c (nlm_i386_read_import): Check bfd_alloc.
+
+ * nlm32-alpha.c (nlm_alpha_read_import): Check bfd_alloc.
+
+ * linker.c (_bfd_link_hash_newfunc
+ (generic_link_hash_newfunc
+ (archive_hash_newfunc
+ (_bfd_generic_link_add_one_symbol): Check bfd_hash_allocate.
+ (_bfd_generic_final_link
+ (_bfd_generic_link_output_symbols
+ (default_indirect_link_order): Check bfd_alloc.
+ (bfd_new_link_order): Check bfd_alloc_by_size_t.
+
+ * irix-core.c (irix_core_make_empty_symbol): Check bfd_zalloc.
+
+ * ieee.c: Indent.
+ (read_id get_symbol get_section_entry ieee_archive_p ieee_object_p
+ ieee_slurp_section_data ieee_new_section_hook): Check bfd_alloc.
+ (do_one): Check bfd_alloc. Return a boolean.
+ (ieee_slurp_section_data): Check it.
+ (init_for_output): Check bfd_alloc. Return a boolean.
+ (ieee_set_section_contents): Check it.
+ (do_with_relocs): Check bfd_alloc. Return a boolean.
+ (ieee_bfd_debug_info_accumulate): Ditto. FIXME void.
+ (ieee_mkobject): Check bfd_zalloc.
+ (ieee_make_empty_symbol): Check bfd_zmalloc.
+
+ * hpux-core.c (hpux_core_make_empty_symbol): Check
+ bfd_zalloc.
+
+ * hppabsd-core.c (hppabsd_core_make_empty_symbol): Check
+ bfd_zalloc.
+ (hppabsd_core_core_file_p): Check bfd_zalloc.
+
+ * hp300hpux.c (MY(slurp_symbol_table)): Check bfd_alloc.
+
+ * elfcode.h (elf_new_section_hook): Check bfd_alloc.
+ (bfd_section_from_phdr): Ditto.
+ (write_relocs): Ditto. FIXME void
+ (elf_map_symbols assign_section_numbers map_program_segments):
+ Ditto. Return a boolean.
+ (swap_out_syms): Ditto. Check elf_map_symbols.
+ (elf_slurp_symbol_table): Check bfd_zalloc.
+ (elf_slurp_reloca_table): Check bfd_alloc.
+ (elf_slurp_reloc_table): Ditto.
+ (elf_compute_section_file_positions): Check assign_section_numbers.
+ (assign_file_positions_except_relocs): Return a boolean.
+ Check map_program_segments.
+ (elf_compute_section_file_positions): Check it.
+
+ * elf32-mips.c (mips_elf_final_link): Check bfd_alloc.
+
+ * elf32-hppa.c (hppa_elf_stub_branch_reloc): Check bfd_zmalloc and
+ realloc.
+ (hppa_elf_stub_reloc): Ditto.
+ (hppa_elf_build_arg_reloc_stub): Check bfd_zalloc.
+ (hppa_elf_build_long_branch_stub): Ditto.
+ (elf32_hppa_backend_symbol_table_processing): Ditto.
+
+ * ecoff.c (ecoff_set_symbol_info): Check bfd_alloc. Return a boolean.
+ (ecoff_slurp_symbol_table): Check it.
+ (ecoff_slurp_armap): Check bfd_alloc.
+ (ecoff_write_armap): Check bfd_zalloc.
+ (ecoff_link_hash_newfunc): Check bfd_hash_allocate and
+ _bfd_link_hash_newfunc.
+ (ecoff_link_add_externals): Check bfd_alloc.
+
+ * ctor.c (bfd_constructor_entry): Check bfd_alloc.
+
+ * coffgen.c (coff_real_object_p): Check bfd_alloc.
+ (coff_renumber_symbols): Check bfd_alloc_by_size_t. Return a boolean.
+ (coff_write_symbol): Check bfd_alloc. FIXME int
+ (coff_write_linenumbers): Check bfd_alloc. Return a boolean.
+ (coff_section_symbol): Check bfd_alloc_by_size_t.
+ (coff_get_normalized_symtab): Check bfd_alloc.
+ (coff_bfd_make_debug_symbol): Check bfd_zalloc.
+ * libcoff-in.h: Change decls of coff_renumber_symbols,
+ coff_write_linenumbers.
+ * libcoff.h: Rebuilt.
+ * coffcode.h (coff_write_object_contents): Check
+ coff_renumber_symbols, coff_write_linenumbers.
+
+ * coffcode.h: Indent.
+ (coff_add_missing_symbols): Check bfd_alloc_by_size_t. Return a
+ boolean.
+ (coff_write_object_contents): Check it.
+
+ * coff-alpha.c (alpha_relocate_section): Check bfd_alloc.
+ * coff-mips.c (mips_relocate_section): Ditto.
+
+ * archive.c (bfd_slurp_bsd_armap_f2): Check bfd_alloc value.
+ (do_slurp_bsd_armap): Ditto.
+ (compute_and_write_armap): Check bfd_realloc value.
+
+ * aoutx.h (translate_from_native_sym_flags): Check bfd_alloc
+ return value. Return boolean value.
+ (NAME(aout,make_empty_symbol)): Check bfd_zalloc return value.
+ (NAME(aout,slurp_symbol_table)): Check bf_alloc and bfd_zalloc
+ return value.
+ (add_to_stringtab): Ditto. FIXME void
+ (aout_link_hash_newfunc): Check bfd_hash_allocate return value.
+ (aout_link_add_symbols): Check bfd_alloc value.
+ (translate_symbol_table): Check translate_from_native_sym_flags.
+ * hp300hpux.c (MY(slurp_symbol_table)): Ditto.
+ * aoutx.h (aout_link_hash_newfunc): Check _bfd_link_hash_newfunc.
+
+ * opncls.c (bfd_zalloc bfd_realloc): Check result of bfd_alloc.
+
+ * opncls.c (obstack_chunk_alloc): Define as malloc, not
+ bfd_xmalloc_by_size_t.
+ (_bfd_new_bfd): Check obstack_begin for 0 return.
+
+ * ieee.c (obstack_chunk_alloc): Define as malloc, not
+ bfd_xmalloc_by_size_t.
+ (ieee_archive_p): Check obstack_begin for 0 return and
+ obstack_finish for NULL return.
+
+ * hash.c (obstack_chunk_alloc): Define as malloc, not
+ bfd_xmalloc_by_size_t.
+ (bfd_hash_table_init_n): Check obstack_begin for 0 return and
+ obstack_finish for NULL return.
+ (bfd_hash_lookup): Check obstack_alloc for NULL return.
+
+ * ecofflink.c (obstack_chunk_alloc): Define as malloc, not
+ bfd_xmalloc_by_size_t.
+ bfd_ecoff_debug_accumulate
+ bfd_ecoff_debug_accumulate_other): Check obstack_alloc.
+ (add_file_shuffle add_memory_shuffle): Check obstack_alloc for
+ NULL return. Return boolean, not void.
+ (bfd_ecoff_debug_init): Check obstack_begin for 0 return.
+ (bfd_ecoff_debug_accumulate): Check add_file_shuffle
+ and add_memory_shuffle return.
+ (string_hash_newfunc): Check bfd_hash_allocate and bfd_hash_newfunc.
+ (bfd_ecoff_debug_accumulate): Check bfd_alloc.
+ (ecoff_add_string): Check add_memory_shuffle return.
+
+ * libbfd-in.h (xmalloc, bfd_xmalloc, bfd_xmalloc_by_size_t):
+ Remove decls.
+ * libbfd.h: Rebuilt.
+
+Fri Feb 11 15:35:32 1994 Stu Grossman (grossman at cygnus.com)
+
+ * configure.host: Add Lynx/rs6000 support.
+ * config/i386-nlm.mt: Enable a.out file support.
+ * config/rs6000lynx.mh: Lynx/rs6000 host support.
+
+Fri Feb 11 17:25:58 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * archive.c (compute_and_write_armap): Rewrite somewhat to improve
+ memory usage.
+
+Fri Feb 11 13:10:42 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * archive.c: Change all references to '\n' in archive magic
+ to '\012', for greater portability.
+ * ecoff.c (ecoff_write_armap): Ditto.
+
+Thu Feb 10 12:58:48 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * aoutx.h (aout_link_write_other_symbol): Check strip settings to
+ see whether symbol should be output.
+ * genlink.h (struct generic_write_global_symbol_info): Added info
+ field.
+ * linker.c (_bfd_generic_final_link): Initialize wginfo.info.
+ (_bfd_generic_link_write_global_symbol): Check strip settings to
+ see whether symbol should be output.
+ * elf32-mips.c (mips_elf_final_link): Initialize wginfo.info.
+
+Wed Feb 9 21:34:58 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (som_reloc_queue_find): Do not examine a NULL queue entry.
+
+ * som.c: Cast return values from BFD memory allocation routines to
+ avoid warnings from the HP compiler.
+
+Wed Feb 9 12:55:02 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * coff-alpha.c (alpha_relocate_section): Accept a LITERAL
+ reloc on an "ldl" instruction too.
+
+ * archive.c (bfd_ar_hdr_from_filesystem): Cast status elements
+ when passing them to sprintf. Use %ld instead of %d.
+
+ * coff-rs6000.c (rs6000coff_mkarchive): Return false.
+ (rs6000_coff_snarf_ar_hdr): Don't declare errno; it's not used.
+ Also removed unused variable namelen.
+ (rs6000coff_write_armap): Declare orl_count and stridx parameters.
+
+Tue Feb 8 18:00:34 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * libbfd-in.h (xmalloc): Don't declare parameter type, to avoid
+ conflicts.
+ * libbfd.h: Rebuilt.
+
+Tue Feb 8 15:55:50 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * coff-alpha.c (reloc_nil): New function.
+ (alpha_howto_table): Use it as special_function to prevent certain
+ relocs from being adjusted by bfd_perform_relocation. IGNORE
+ reloc should be partial_inplace.
+ (alpha_ecoff_get_relocated_section_contents): Accept a LITERAL
+ reloc on an "ldl" instruction too.
+
+Tue Feb 8 00:32:28 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * elf32-hppa.c (CURRENT_STUB_OFFSET, hppa_elf_build_arg_reloc_stub,
+ hppa_elf_build_long_branch_stub): Cast to char * instead of int
+ before performing pointer arithmetic.
+
+Mon Feb 7 20:56:27 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * config.bfd (hppa*-*-osf*): Use bfd_name hppaosf for this
+ configuration.
+ (hppa*-*-*elf*): This configuration used hppa-elf now.
+
+ * som.c: This file is also used for HOST_HPPAOSF.
+
+ * targets.c (bfd_target_vector): Enable som_vec for HOST_HPPAOSF.
+
+ * hosts/hppaosf.h: New host configuration file.
+
+ * config/hppabsd.mt (SELECT_VECS): Add bfd_elf32_hppa_vec as
+ BSD handles both SOM and ELF object files.
+
+ * config/hppaosf.mh (HDEFINES): Delete. No longer needed.
+ (RANLIB): Doesn't do anything, define it to be "echo".
+
+ * config/hppaosf.mt: New target makefile fragment for a PA running
+ OSF1.
+
+Mon Feb 7 15:02:06 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * archures.c (enum bfd_architecture): Added bfd_arch_powerpc.
+ (archures_init_table): If SELECT_ARCHITECTURES is not defined,
+ added bfd_powerpc_arch.
+ * bfd-in2.h: Rebuilt.
+ * cpu-powerpc.c: New file.
+ * Makefile.in (ALL_MACHINES, CFILES): Added cpu-powerpc.c.
+ Rebuilt dependencies.
+
+ * elfcode.h (bfd_section_from_shdr): Get vma and alignment_power
+ of an SHT_STRTAB section from sh_addr and sh_addralign, rather
+ than just setting them to zero.
+
+Sun Feb 6 20:04:10 1994 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * elfcode.h (prep_headers, swap_out_syms): Check for NULL return
+ from bfd_new_strtab.
+ (elf_compute_section_file_positions): Check for false return from
+ swap_out_syms.
+
+ * linker.c (default_indirect_link_order): Check for NULL return
+ from bfd_get_relocated_section_contents.
+
+ * syms.c: Make example application in doc call xmalloc, not
+ bfd_xmalloc.
+
+ * aoutx.h (NAME(aout,slurp_symbol_table),
+ aout_link_get_symbols, NAME(aout,link_hash_table_create)):
+ * bout.c (b_out_slurp_reloc_table, b_out_squirt_out_relocs):
+ * ecoff.c (ecoff_bfd_link_hash_table_create):
+ * ecofflink.c (bfd_ecoff_debug_init):
+ * format.c (bfd_check_format_matches):
+ * linker.c (_bfd_generic_link_hash_table_create):
+ (_bfd_generic_final_link):
+ * reloc16.c (bfd_coff_reloc16_relax_section):
+ (bfd_coff_reloc16_get_relocated_section_contents):
+ * elf32-hppa.c (hppa_elf_build_arg_reloc_stub):
+ * elf32-mips.c (mips_elf_final_link):
+ * elfcode.h (bfd_new_strtab):
+ (bfd_add_2_to_strtab):
+ (elf_slurp_symbol_table):
+ (elf_corefile_note):
+ * libbfd.c (bfd_zmalloc):
+ Use malloc and check the result, instead of bfd_xmalloc.
+
+Sat Feb 5 12:39:28 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config.bfd: Put m68*-*-sysv* line after m68*-*-sysv4*.
+
+Sat Feb 5 05:32:44 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * srec.c (srec_write_record): Put CONST keyword for "src" before
+ "unsigned", some compilers don't like it after "unsigned".
+ * libcoff.h, libcoff-in.h (bfd_perform_slip): Rename "value" to
+ "val" in prototype declaration because some compilers don't like
+ arguments whose names are the same as types.
+
+Sat Feb 5 01:14:38 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * aoutx.h (aout_link_check_ar_symbols): Correct test for whether
+ object file defines symbol. Also, if skipping a symbol, skip the
+ second symbol of a N_WARNING or N_INDR symbol as well.
+
+Fri Feb 4 23:55:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ Add basic support for writing RS/6000 XCOFF files.
+ * coff-rs6000.c (dummy_reloc): Removed.
+ (rs6000coff_howto_table): Defined XCOFF relocs.
+ (RTYPE2HOWTO): Defined to use rs6000coff_rtype2howto.
+ (rs6000coff_rtype2howto): New function.
+ (coff_bfd_reloc_type_lookup): Defined to use
+ rs6000coff_reloc_type_lookup.
+ (rs6000coff_reloc_type_lookup): New function.
+ (SELECT_RELOC): Defined to set r_type and r_size fields.
+ (COFF_LONG_FILENAMES): Defined.
+ * coffcode.h (combined_entry_type): Changed fix_tag and fix_end
+ fields to bitfields. Added fields fix_value and fix_scnlen.
+ (sec_to_styp_flags): If STYP_DEBUG is defined, use it rather than
+ STYP_INFO for the type of a section named .debug.
+ (coff_add_missing_symbols): Don't define if RS6000COFF_C.
+ (coff_write_object_contents): If RS6000COFF_C, don't call
+ coff_add_missing_symbols.
+ (coff_slurp_symbol_table): If RS6000COFF_C, then if the last aux
+ entry has type STY_LD change the x_scnlen into a pointer to a
+ symbol and set fix_scnlen. Also, for a C_BSTAT symbol, change the
+ value into a pointer to a symbol and set fix_value.
+ * libcoff.h: Rebuilt.
+ * coffgen.c (coff_mangle_symbols): Reindent. If fix_value is set,
+ get the symbol offset. Likewise for fix_scnlen.
+ (string_size): Change type to bfd_size_type.
+ (debug_string_size, debug_string_section): New static variables.
+ (coff_fix_symbol_name): If bfd_coff_symname_in_debug returns true,
+ write the symbol name into the .debug section; assume that the
+ section has already been created with the right size.
+ (coff_write_symbols): Initialize debug_string_size to 0. If
+ bfd_coff_symname_in_debug returns true, don't put symbol name in
+ usual string table. After writing out all symbols, if
+ debug_string_size is not 0, check that it matches the size of the
+ .debug section.
+ (coff_get_normalized_symtab): Clear new fix_value and fix_scnlen
+ fields. If the string offset is 0, always use an empty string as
+ the name.
+ (coff_make_empty_symbol): Zero out the symbol structure.
+ * reloc.c (bfd_perform_relocation): Work around one gross hack
+ with another: actually look at the target name to avoid the broken
+ COFF check.
+ (bfd_reloc_code_real_type): Add BFD_RELOC_PPC_B26,
+ BFD_RELOC_PPC_BA26 and BFD_RELOC_PPC_TOC16.
+ * bfd-in2.h: Rebuilt.
+
+Fri Feb 4 17:28:32 1994 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * libbfd.c (bfd_zmalloc): Call bfd_xmalloc instead of malloc.
+ (bfd_xmalloc, bfd_xmalloc_by_size_t): Functions deleted.
+ * libbfd-in.h: Define them as macros calling xmalloc and declare
+ xmalloc.
+ * libbfd.h: Rebuilt.
+
+Thu Feb 3 16:49:35 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * ecofflink.c (bfd_ecoff_debug_externals): If a small undefined
+ symbol has a value in the ECOFF symbol but not in the BFD symbol,
+ keep the value in the ECOFF symbol. This helps gas.
+
+ * linker.c (_bfd_generic_link_output_symbols,
+ _bfd_generic_link_write_global_symbol): Don't require that all
+ references to a common symbol be themselves common symbols.
+
+ * aoutx.h (aout_reloc_index_to_section): Handle N_UNDF.
+
+Wed Feb 2 20:37:19 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * libbfd.c, bfd-in.h, hosts/alphaosf.h, hosts/sparc-ll.h, aoutf1.h,
+ sparclynx.c, Makefile.in: Change HOST_64_BIT to BFD_HOST_64_BIT.
+ * bfd-in2.h: Rebuilt.
+
+Wed Feb 2 12:30:13 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * coffswap.h (coff_swap_reloc_out): If RS6000COFF_C, handle type
+ and size correctly.
+ (coff_swap_aux_in): If RS6000COFF_C, change x_csect.x_scnlen to
+ x_csect.x_scnlen.l to match change in coff/internal.h.
+ (coff_swap_aux_out): Likewise.
+
+ * coff-mips.c (mips_ecoff_backend_data), coff-alpha.c
+ (alpha_ecoff_backend_data): Change casts of aux_in and aux_out
+ fields to match yesterday's changes.
+
+ * coffcode.h (coff_write_relocs): If SELECT_RELOC is defined, pass
+ in the internal_reloc itself, not the type.
+ * coff-apollo.c, coff-h8300.c, coff-h8500.c, coff-i386.c,
+ coff-m68k.c, coff-sh.c, coff-we32k.c, coff-z8k.c: Changed
+ definition of SELECT_RELOC accordingly.
+
+Tue Feb 1 12:05:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * coffcode.h (bfd_coff_backend_data): Added new arguments to
+ _bfd_coff_swap_aux_in and _bfd_coff_swap_aux_out: aux index number
+ and number of aux entries.
+ (bfd_coff_swap_aux_in, bfd_coff_swap_aux_out): Changed
+ accordingly.
+ * libcoff.h: Rebuilt.
+ * coffswap.h (coff_swap_aux_in, coff_swap_aux_out): Accept new
+ arguments. If RS6000COFF_C, only treat C_EXT and C_HIDEXT
+ specially if this is the last aux entry.
+ * coffgen.c (coff_write_symbol, coff_get_normalized_symtab): Pass
+ new arguments to swap_aux functions.
+
+Sun Jan 30 15:14:36 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * gen-aout.c (main): Set DEFAULT_ARCH based on preprocessor macros
+ (only testing for m68k and vax at the moment); do verify that the
+ preprocessor didn't trash the arch name inside the string version.
+ Don't print out "pagesize =" line that prevents output from
+ compiling. Derive BYTES_IN_WORD and ARCH values from sizeof
+ results.
+ * Makefile.in (aout-params.h): Pass gen-aout a dummy target name.
+ (check, installcheck): Identify directory in "no testsuites"
+ message.
+
+Sun Jan 30 13:25:28 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * aoutx.h (aout_link_write_symbols): Write out correct value for
+ object file symbol.
+
+Fri Jan 28 18:34:05 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * hosts/vaxbsd.h (HOST_STACK_END_ADDR): Vax BSD doesn't define
+ KERNBASE, so hard-code 0x80000000 instead.
+
+Thu Jan 27 13:54:08 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * linker.c (generic_link_add_symbol_list): If symbol is common,
+ set the BSF_OLD_COMMON flag.
+
+Wed Jan 26 13:47:15 1994 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * format.c (bfd_check_format_matches): Put the new entry in the
+ correct element of matching_vector.
+
+Tue Jan 25 11:43:28 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * som.c, som.h (bfd_som_set_section_attributes,
+ bfd_som_set_subsection_attributes): Change parameters from char
+ to int. Following a prototype with an old-style function definition
+ in the presence of widened parameters is a GCC-ism not supported
+ by the HP compiler in ANSI mode.
+
+Tue Jan 25 11:46:46 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * reloc.c (bfd_get_reloc_size): Size of type -2 is 4 bytes, not 2.
+
+ * hp300hpux.c (MY(write_object_contents)): Write out the symbols
+ before writing out the relocs, so that the right symbol indices
+ are used.
+
+ * archive.c (do_slurp_bsd_armap, bfd_slurp_bsd_armap_f2): Do not
+ try to overlay the internal carsyms on the external symdefs. That
+ can not work if the size of a host pointer is larger than 4 bytes.
+
+ * format.c (bfd_check_format_matches): Cast result of
+ bfd_xmalloc_by_size_t.
+ * opncls.c (_bfd_new_bfd): Avoid ANSI C prototype.
+
+ * archive.c: Reindented to GNU standards.
+
+Mon Jan 24 14:41:23 1994 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * opncls.c (_bfd_new_bfd, _bfd_new_bfd_contained_in): Add
+ "_bfd_" to function names.
+ * archive.c (_bfd_create_empty_archive_element_shell),
+ libbfd-in.h: Change callers.
+
+ * libbfd.c (bfd_zmalloc): Renamed from zalloc.
+ * libbfd.c (bfd_add_to_string_table),
+ trad-core.c (trad_unix_core_file_p),
+ targets.c (bfd_target_list),
+ ptrace-core.c (ptrace_unix_core_file_p),
+ opncls.c (new_bfd), libbfd-in.h,
+ ieee.c (ieee_make_empty_symbol),
+ elf32-hppa.c (hppa_elf_stub_branch_reloc),
+ (hppa_elf_stub_reloc): Change callers.
+ * libbfd.h: Regenerated.
+
+ * archive.c (_bfd_look_for_bfd_in_cache): Add "_bfd_" to name.
+ (_bfd_get_elt_at_filepos),
+ coff-rs6000.c (rs6000coff_get_elt_at_filepos), libbfd-in.h:
+ Change callers.
+
+ * format.c (bfd_check_format_matches), libbfd-in.h, targets.c,
+ elfcode.h (elf_object_p): Rename target_vector to bfd_target_vector
+ and default_vector to bfd_default_vector.
+ * libbfd.h: Regenerated.
+
+ * format.c (bfd_check_format_matches): New function.
+ (bfd_check_format): Call it.
+ (bfd_matching_formats): Function removed.
+ * targets.c: Replace the vector added on Jan 21 with a count of
+ entries in default_vector.
+ * bfd-in2.h: Regenerated.
+
+Mon Jan 24 12:38:54 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * coff-alpha.c (alpha_ecoff_object_p): New function. Set size of
+ .pdata section based on lnnoptr field, not section header.
+ (alpha_relocate_section): Don't bother to check if r_symndx >= 0,
+ since it is unsigned.
+ (ecoffalpha_little_vec): Use alpha_ecoff_object_p rather than
+ coff_object_p.
+ * ecoff.c (ecoff_new_section_hook): Set alignment_power field of
+ .pdata section to 3.
+ (ecoff_compute_section_file_positions): Save the size of the
+ .pdata section in the line_filepos field, and actually align the
+ .pdata section to an alignment power of 4.
+ (ecoff_compute_reloc_file_positions): Set output_has_begun after
+ calling ecoff_compute_section_file_positions.
+ (ecoff_write_object_contents): Set s_lnnoptr for the .pdata
+ section from the line_filepos field. Set vstamp for the optional
+ header from the vstamp of the symbolic header.
+ (ecoff_bfd_final_link): Set vstamp of the symbolic header to the
+ vstamp used by the first object file in the link.
+
+ * ecofflink.c (ecoff_align_debug): Align RFDs to debug_align.
+
+ * linker.c (generic_link_check_achive_element): Set SEC_ALLOC flag
+ for a created common section.
+ (_bfd_generic_link_add_one_symbol): Likewise.
+
+ * elfcode.h (swap_out_syms): Use elf_section_from_bfd_section to
+ get the index of a common section, rather than always using
+ SHN_COMMON (MIPS has multiple common sections).
+
+ * elf32-hppa.c (hppa_elf_gen_reloc_type): Typo (== for =).
+
+ * bfd/aoutx.h (aout_link_input_section_std,
+ aout_link_input_section_ext): Pass additional arguments to
+ reloc_overflow callback.
+ * coff-alpha.c (alpha_ecoff_get_relocated_section_contents,
+ alpha_relocat_section): Likewise.
+ * coff-h8300.c (h8300_reloc16_extra_cases): Likewise.
+ * coff-h8500.c (extra_case): Likewise.
+ * coff-mips.c (mips_relocate_section): Likewise.
+ * coff-z8k.c (extra_case): Likewise.
+ * elf32-hppa.c (hppa_elf_stub_finish): Likewise.
+ * reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
+
+ * bout.c (calljx_callback, callj_callback): Use get_value to get
+ 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.
+
+ * aoutx.h (translate_symbol_table): The string index 0 has a
+ special meaning for normal symbols, but not for dynamic symbols.
+
+Sat Jan 22 12:26:01 1994 Stu Grossman (grossman at cygnus.com)
+
+ * sparclynx.c: Setup appropriate macros to enable core file
+ support.
+
+Fri Jan 21 16:25:35 1994 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * targets.c: Add a vector of matching format names.
+ * format.c (bfd_matching_formats): New function to return it.
+ (bfd_check_format): Set it.
+ * bfd-in2.h: Regenerated.
+
+ * bfd-in.h: Remove decls of bfd_ec type and error printing functions.
+ Remove decl of type symclass; wasn't used.
+ * bfd.c: Document error handling, including code fragments
+ containing the error decls that were in bfd-in.h.
+ Remove DEFUNs.
+ * bfd-in2.h: Regenerated.
+
+Fri Jan 21 14:11:16 1994 Sean Fagan (sef@cygnus.com)
+
+ * nlmcode.h, liblnm.h, nlm32-alpha.c nlm32-i386.c nlm32-sparc.c:
+ The sparc (and possibly other?) NLM format requires a different
+ way to write exports, so add a write_export field to the backend
+ data (and set it to NULL for everything but the sparc).
+
+Fri Jan 21 14:11:16 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * sunos.c (MY(read_dynamic_relocs)): Compare info->dynrel with NULL,
+ not (struct external_nlist *) NULL. info->dynrel is a PTR, not
+ a struct external_nlist *.
+
+Fri Jan 21 09:29:01 1994 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * bfd.c: Remove error strings for errors removed below.
+ * aoutx.h (translate_to_native_sym_flags), bfd-in.h (bfd_ec),
+ oasys.c (oasys_write_sections): Rename
+ bfd_error_nonrepresentable_section to nonrepresentable_section.
+ None of the other bfd error names start with "bfd_error".
+ Remove errors symbol_not_found and no_relocation_info, which seem
+ to be unused.
+ * bfd-in2.h: Regenerated.
+
+Fri Jan 21 01:11:55 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * bfd.c (bfd_get_gp_size): Added support for ELF.
+
+ * syms.c (BSF_DYNAMIC): New symbol flag.
+ (bfd_print_symbol_vandf): Print it.
+ * bfd-in2.h: Rebuilt.
+ * libaout.h (struct aout_backend_data): New read_dynamic_symbols
+ and read_dynamic_relocs fields.
+ (struct aoutdata): New dynamic_info field.
+ (obj_aout_dynamic_info): New accessor macro.
+ * sunos.c (struct sunos_dynamic_info): New structure.
+ (sunos_read_dynamic_info, MY(read_dynamic_symbols),
+ MY(read_dynamic_relocs)): New functions to read dynamic symbols
+ and relocs.
+ * aoutx.h (NAME(aout,some_aout_object_p)): If the object is
+ dynamically linked, set SEC_RELOC for both the .text and .data
+ sections.
+ (translate_from_native_sym_flags): Don't set BSF_LOCAL for an
+ undefined symbol.
+ (translate_symbol_table): New function, split out of
+ slurp_symbol_table; set the BSF_DYNAMIC flag appropriately.
+ (NAME(aout,slurp_symbol_table)): Read dynamic symbols, if any.
+ (NAME(aout,slurp_reloc_table)): Read dynamic relocs, if any.
+ (NAME(aout,get_reloc_upper_bound)): Include dynamic reloc count in
+ return value.
+ * aoutf1.h (NAME(aout,sunos4_write_object_contents)): Don't write
+ out dynamic symbols or relocs against reloc symbols, since they
+ are already in the .text section and we wouldn't know where to
+ write them anyhow.
+ (sunos4_aout_backend): Initialize read_dynamic_symbols and
+ read_dynamic_relocs fields.
+ * aout-target.h (MY(backend_data)): Initialize
+ read_dynamic_symbols and read_dynamic_relocs fields.
+
+Thu Jan 20 20:57:27 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * hosts/alphaosf.h (uint64e_type, uint64_type, int64_type): Delete
+ typedefs, since HOST_64_BIT will take care of defining them in
+ bfd.h.
+
+Wed Jan 19 17:28:59 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * config/alphaosf.mh (HDEFINES): Don't define HOST_64_BIT here;
+ that's dealt with elsewhere.
+ * hosts/alphaosf.h (sprintf_vma, fprintf_vma): New macros.
+ (uint64_typeHIGH, uint64_typeLOW): Comment with HOST_64_BIT so
+ they get copied to bfd.h.
+
+ * reloc.c (enum bfd_reloc_code_real): Add some Alpha relocation
+ types. Reorganized some of the existing ones.
+ * coff-alpha.c (alpha_howto_table): Construct 64-bit negative one
+ values in case of compilation on a 32-bit machine. Fix pcrel
+ fields of some reloc types.
+ (alpha_bfd_reloc_type_lookup): Handle more relocation types.
+
+ * bfd-in.h (uint64_typeHIGH, uint64_typeLOW): Supply default
+ definitions when not defined, regardless of whether uint64_type is
+ a defined macro or not.
+ (fprintf_vma, sprintf_vma): Define only if fprintf_vma is not
+ already defined.
+
+Wed Jan 19 00:02:54 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * aoutx.h (translate_to_native_sym_flags): Set the type of a
+ BSF_WARNING symbol to N_WARNING.
+
+Tue Jan 18 16:43:19 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * aoutx.h (aout_link_add_symbols): Increment sym_hash as well as p
+ for an indirect or warning symbol.
+ (aout_link_write_symbols): Update sym_hash with the target of an
+ indirect or warning symbol. If an indirect symbol is defined,
+ output the calculated value and don't output the target symbol.
+
+Tue Jan 18 03:54:59 1994 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * aoutx.h (translate_from_native_sym_flags): Give warning symbols
+ an (unused) nonzero section value, needed for check below.
+
+Mon Jan 17 15:12:07 1994 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * aoutx.h (translate_from_native_sym_flags,
+ aout_link_add_symbols): Treat N_SET[ABDT] | N_EXT like
+ N_SET[ABDT].
+
+Fri Jan 14 16:45:43 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * elfcode.h (elf_object_p): If there is a SHT_DYNAMIC section, set
+ the DYNAMIC flag for the BFD.
+ (NAME(bfd_elf,write_object_contents)): Don't try to write out a
+ BFD with the DYNAMIC flag set, since we don't generate the program
+ header table correctly.
+
+Fri Jan 14 01:04:36 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * elfcode.h (elf_slurp_symbol_table): Free x_symp at the end
+ of the function to avoid storage leak.
+
+Thu Jan 13 23:07:32 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * ecoff.c (ecoff_link_write_external): An ifd can be -1.
+
+Thu Jan 13 12:33:27 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (som_set_reloc_info): Provide a default symbol for
+ relocations which don't actually have an associated symbol.
+
+ * som.c (hppa_som_reloc): Add new "error message" argument.
+
+Wed Jan 12 13:36:43 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ Enable gdb to write to core files on more core file readers.
+ * libbfd.c (bfd_generic_set_section_contents): Remove range check
+ for section size, it is already done in bfd_set_section_contents
+ with bfd_get_section_size_now.
+ * aix386-core.c, hppabsd-core.c, hpux-core.c, irix-core.c,
+ osf-core.c, ptrace-core.c, trad-core.c (*_set_section_contents):
+ Use bfd_generic_set_section_contents instead of bfd_false.
+
+Wed Jan 12 15:31:57 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * linker.c: Added initial documentation.
+
+ * linker.c (default_indirect_link_order): Don't expect space for
+ output relocations if there aren't any input relocations.
+
+Tue Jan 11 14:37:12 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * aoutx.h (NAME(aout,final_link)): Set a_entry before computing
+ file offsets.
+
+ * elfcode.h (swap_out_syms): A common symbol is STT_OBJECT, not
+ STT_NOTYPE.
+
+Tue Jan 11 09:10:56 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config.bfd: Use ELF, not COFF for m88*-*-dgux*.
+ Combine m88k-*-* and m88110-*-* cases into m88*-*-*.
+
+Tue Jan 11 00:07:19 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * ecofflink.c: Extensive changes to compress and merge debugging
+ information, and to write some of out directly rather than saving
+ it in memory. Several new functions and structures, and new
+ arguments to existing functions.
+ * ecoff.c (ecoff_compute_reloc_file_positions): Compute
+ sym_filepos as well.
+ (ecoff_get_extr): Use ifdmap instead of ifdbase.
+ (ecoff_write_object_contents): Don't compute sym_filepos here.
+ Only output symbols if outsymbols is not NULL.
+ (ecoff_bfd_final_link): Adjust for changes in ecoff_debug_info and
+ bfd_ecoff_debug functions. Write out debugging information here.
+ (ecoff_final_link_debug_accumulate): Adjust for changes in
+ bfd_ecoff_debug functions.
+ (ecoff_link_write_external): Use ifdmap rather than ifdbase.
+ * elf32-mips.c (mips_elf_read_ecoff_info): Read external symbols
+ first, to put them in the first memory buffer. Clear fdr field.
+ (mips_elf_get_extr): Use pointer to unswapped external symbol.
+ (mips_elf_final_link): Adjust for changes in bfd_ecoff functions.
+ Preserve .text, .data and .bss even if they are empty. Save
+ pointer to unswapped external symbol rather than copying it.
+ Don't free up the external symbols.
+ * libelf.h (elf_symbol_type): Change mips_extr to PTR.
+ * bfd-in.h (bfd_ecoff_debug_init, bfd_ecoff_debug_free): Declare.
+ (bfd_ecoff_debug_accumulate): Update declaration.
+ (bfd_ecoff_debug_accumulate_other): Rename declaration from
+ bfd_ecoff_debug_link_other and update.
+ (bfd_ecoff_write_accumulated_debug): Declare.
+ * bfd-in2.h: Rebuilt.
+ * Makefile.in: Rebuilt dependencies.
+
+Mon Jan 10 20:46:53 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (install): Remove "@" which follows a backslash. In
+ this position it just causes errors, not suppresses echoes.
+
+Mon Jan 10 09:06:21 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * som.c (hppa_som_gen_reloc_type): Fix handling of LT and RT
+ field selectors.
+
+Sun Jan 9 04:32:25 1994 Ken Raeburn (raeburn@kr-pc.cygnus.com)
+
+ * config/i386-netbsd.mt (SELECT_VECS): Include i386bsd_vec.
+
+Fri Jan 7 10:27:27 1994 David J. Mackenzie (djm@rtl.cygnus.com)
+
+ * aoutx.h (adjust_z_magic): Don't merge the start of bss with the
+ end of data if they are not contiguous.
+
+ * aoutf1.h (sunos4_aout_backend): Comment the fields' meanings.
+
+Fri Jan 7 15:40:16 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * ecoff.c (ecoff_mkobject_hook): Don't set SEC_SHARED_LIBRARY flag
+ for .reginfo section here.
+ (ecoff_new_section_hook): Set it here instead.
+
+Fri Jan 7 10:29:27 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * bfd-in.h: (bfd_boolean): Add workaround for systems that also
+ define true and false as enums.
+ (ALMOST_STDC): Add as alternative to __STDC__.
+ * bfd-in2.h: Rebuilt.
+ * syms.c (bfd_print_symbol_vandf): Convert a PTR to FILE*.
+
+Thu Jan 6 14:24:44 1994 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * aoutx.h (translate_to_native_sym_flags): Catch the case where
+ there is no output section.
+
+Thu Jan 6 14:37:42 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * nlmcode.h (nlm_object_p): If we can't read the fixed header,
+ count it as a wrong format error, not a system call error, since
+ the object file might simply be too small.
+
+ * targets.c (target_vector): Added nlm32_alpha_vec inside #ifdef
+ BFD64.
+ * Makefile.in (BFD32_BACKENDS): Remove nlm32-alpha.o.
+ (BFD64_BACKENDS): Add nlm32-alpha.o. It depends on 64 bit
+ support, even though it is for an Alpha in 32 bit mode.
+ * configure.in (nlm32_alpha_vec): Set target64 to true.
+
+ * nlm32-gen.c, nlm64-gen.c: Removed. All nlm targets are
+ different, so there is no point to providing a generic one.
+ * libnlm.h: Don't bother to check for nlm_backend(bfd) being NULL
+ in the backend accessor macros; that should no longer be possible.
+ * targets.c (target_vector): Removed nlm32_big_generic_vec,
+ nlm64_big_generic_vec, nlm64_little_generic_vec.
+ * configure.in (nlm32_big_generic_vec, nlm32_little_generic_vec,
+ nlm64_big_generic_vec, nlm64_little_generic_vec): Removed.
+ * Makefile.in: Rebuilt dependencies, and
+ (BFD32_BACKENDS): Removed nlm32-gen.o.
+ (BFD64_BACKENDS): Removed nlm64-gen.o.
+ (CFILES): Removed nlm32-gen.c and nlm64-gen.c.
+
+ * hp300hpux.c (ARCH_SIZE): Define before including aoutx.h.
+
+ * linker.c (_bfd_generic_link_add_one_symbol): Add constructor and
+ bitsize arguments. Changed all callers (aoutx.h).
+ * libbfd-in.h (_bfd_generic_link_add_one_symbol): Add constructor
+ and bitsize arguments to declaration.
+ * libbfd.h: Rebuilt.
+
+ * ecoff.c: First cut at new style of linker backend for
+ ECOFF--added a bunch of functions. Also:
+ (ecoff_sec_to_styp_flags): Set flags for .pdata and .xdata.
+ (ecoff_slurp_symbolic_header): New function.
+ (ecoff_slurp_symbolic_info): Call ecoff_slurp_symbolic_header.
+ (ecoff_compute_reloc_file_positions): New function.
+ (ecoff_set_section_contents): Get out quickly if count is zero.
+ Check errors better.
+ (ecoff_write_object_contents): Put .xdata section in data segment.
+ Call ecoff_compute_reloc_file_positions. Don't output relocs or
+ external symbols if outsymbols is NULL.
+ (ecoff_bfd_final_link): Completely rewritten.
+ * libecoff.h: Include bfdlink.h.
+ (struct ecoff_backend_data): Add relocate_section field.
+ (ecoff_data_type): Add sym_hashes and symndx_to_section fields.
+ (struct ecoff_link_hash_entry): Define.
+ (struct ecoff_link_hash_table): Define.
+ (ecoff_bfd_link_add_symbols): Declare as function, not macro.
+ (ecoff_bfd_link_hash_table_create): Likewise.
+ * ecofflink.c (bfd_ecoff_debug_one_external): New function.
+ (bfd_ecoff_debug_externals): Call bfd_ecoff_debug_one_external.
+ * bfd-in.h (bfd_ecoff_debug_one_external): Declare.
+ * bfd-in2.h: Rebuilt.
+ * coff-alpha.c (alpha_howto_table): Mark BRADDR as
+ partial_inplace, and set the src_mask to 0x1fffff.
+ (alpha_ecoff_get_relocated_section_contents): Remove unused
+ variable gp_warned.
+ (alpha_convert_external_reloc): New static function.
+ (alpha_relocate_section): New static function.
+ (alpha_ecoff_backend_data): Initialize relocate_section field.
+ * coff-mips.c (mips_relocate_refhi): New static function.
+ (mips_relocate_section): New static function.
+ (mips_ecoff_backend_data): Initialize relocate_section field.
+
+ * reloc.c (_bfd_relocate_contents): Corrected signed overflow
+ checking when there is an addend.
+
+ * aoutx.h (NAME(aout,final_link)): Don't abort when trying to link
+ a non a.out file, just pass it to _bfd_default_link_order.
+ (aout_link_input_section_std): When doing a final PC relative link
+ against a section symbol, subtract the VMA of the input section.
+ (aout_link_input_section_ext): Likewise.
+
+ * linker.c (default_indirect_link_order): Renamed from
+ _bfd_generic_indirect_link_order and made static.
+ (_bfd_generic_final_link): Don't switch on link_order type, just
+ call _bfd_default_link_order.
+ (_bfd_default_link_order): Handle bfd_indirect_link_order type.
+ * genlink.h: Removed declaration of
+ _bfd_generic_indirect_link_order.
+ * elf32-mips.c (mips_elf_final_link): Don't switch on link_order
+ type, just call _bfd_default_link_order.
+
+Tue Jan 4 21:23:37 1994 Ian Lance Taylor (ian@cygnus.com)
+
+ * linker.c (generic_link_check_archive_element): Base the name of
+ the created common section on the name of the section the symbol
+ came from.
+ (_bfd_generic_link_add_one_symbol): (case BIG): A common symbol
+ must have a section, so don't bother to create one.
+
+Mon Jan 3 15:32:16 1994 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * aout-target.h (MY(vec)): Add DYNAMIC to mask of object flags.
+ * aoutf1.h (NAME(aout,sunos4_write_object_contents)):
+ If the DYNAMIC flag is set, set it in the exec header.
+ * aoutx.h (NAME(aout,some_aout_object_p)): If the object is
+ dynamically linked, set the DYNAMIC flag in the BFD.
+ * libaout.h (N_SET_DYNAMIC): New macro.
+ (N_DYNAMIC): Add missing 0 in mask.
+
+Mon Jan 3 11:41:45 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * ecoff.c (ecoff_get_extr): Don't output section symbols as
+ external symbols.
+
+ * bfd-in.h, hash.c: Change bfd_hash_allocate argument from size_t
+ to unsigned int, because size_t may not be defined in bfd.h.
+ * bfd-in2.h: Rebuilt.
+
+ * bfd-in.h (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to
+ be a const pointer.
+ * bfd-in2.h: Rebuilt.
+ * libbfd.c (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to
+ be a const pointer.
+ * targets.c (bfd_target): Change swap function pointers
+ accordingly.
+ * archive.c (do_slurp_coff_armap): Change swap accordingly.
+ * aix386-core.c: Change NO_GET and NO_GETS accordingly.
+ * hppabsd-core.c, hpux-core.c, irix-core.c, osf-core.c,
+ ptrace-core.c, trad-core.c: Change NO_GET and NO_SIGNED_GET
+ accordingly.
+
+ * libbfd-in.h (struct artdata): Added tdata field.
+ (_bfd_add_bfd_to_archive_cache): Declare.
+ (_bfd_get_elt_at_filepos): Declare.
+ (_bfd_snarf_ar_hdr): Renamed from snarf_ar_hdr.
+ * libbfd.h: Rebuilt.
+ * archive.c: Cleaned up some more.
+ (_bfd_generic_mkarchive, bfd_generic_archive_p): Initialize
+ pointer elements of artdata.
+ (_bfd_add_bfd_to_archive_cache): Renamed from add_bfd_to_cache.
+ (_bfd_snarf_ar_hdr): Renamed from snarf_ar_hdr.
+ (_bfd_get_elt_at_filepos): Renamed from get_elt_at_filepos.
+ (get_extended_arelt_filename, bfd_construct_extended_name_table,
+ bfd_ar_hdr_from_filesystem, compute_and_write_armap): Made static.
+ * ecoff.c: Some comment changes.
+ (ecoff_slurp_armap): Handle rename of snarf_ar_hdr. Set
+ ardata->tdata to raw_armap.
+ (ecoff_archive_p): Initialize pointer elements of artdata.
+ * coff-rs6000.c (rs6000coff_get_elt_at_filepos): Handle rename of
+ add_bfd_to_cache.
+
+ * hash.c: Added some documentation.
+
+Mon Jan 3 11:09:28 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * aout-target.h, netbsd386.c: Replace NO_SWAP_MAGIC with SWAP_MAGIC,
+ and do the swapping here rather than calling ntohl from the N_*
+ macros. This cleans up assumptions about the size of a host long,
+ the existence to ntohl, etc.
+
+Sat Jan 1 13:50:05 1994 Rob Savoye (rob@darkstar.cygnus.com)
+
+ * config.bfd: Add support for VSTa micro-kernel. It currently uses
+ i386-aout.
+
+Sat Jan 1 10:18:54 1994 David J. Mackenzie (djm@thepub.cygnus.com)
+
+ * hosts/i386mach3.h (HOST_SEGMENT_SIZE): Fix value.
+ * i386mach3.c (SEGMENT_SIZE): Fix value.
+
+For older changes see ChangeLog-9193
+
+Local Variables:
+mode: change-log
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/contrib/binutils/bfd/ChangeLog-9697 b/contrib/binutils/bfd/ChangeLog-9697
new file mode 100644
index 000000000000..dc22c8c7c8ba
--- /dev/null
+++ b/contrib/binutils/bfd/ChangeLog-9697
@@ -0,0 +1,6711 @@
+Tue Dec 30 12:45:18 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-sparc.c (elf32_sparc_check_relocs): If -Bsymbolic, don't
+ allocate space for a PC relative reloc against a symbol which is
+ defined in a regular file.
+ (elf32_sparc_relocate_section): If -Bsymbolic, don't copy a PC
+ relative reloc against a symbol which is defined in a regular
+ file.
+
+Mon Dec 29 18:02:28 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ From Jonathan Stone <jonathan@DSG.Stanford.EDU>:
+ * config.bfd (mips-dec-netbsd*): Add ECOFF vectors to
+ targ_selvecs.
+ (mips*el-*-netbsd*): Like mips-dec-netbsd*.
+ (mips*-*-netbsd*): New target.
+
+Mon Dec 29 17:13:28 1997 H.J. Lu (hjl@gnu.org)
+
+ * elflink.h (elf_link_assign_sym_version): Change error message
+ from "undefined version name" to "undefined versioned symbol
+ name".
+
+Mon Dec 29 11:41:16 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c (coff_arm_relocate_section): Fix typo from previous
+ delta.
+
+Tue Dec 23 17:01:10 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Declare.
+ * libbfd.h: Rebuild.
+
+ * peicode.h (coff_swap_scnhdr_out): Set .reloc section to be
+ shared. Set stab* sections to be shared and read. Set .rsrc
+ section to be read and shared.
+
+Mon Dec 22 13:20:57 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am: Rebuild dependencies.
+ (ALL_MACHINES_CFILES): Add dwarf2.lo.
+ (ALL_MACHINES_CFILES): Add dwarf2.c.
+ * Makefile.in: Rebuild.
+
+ * coff-arm.c: Don't include obstack.h.
+
+Mon Dec 22 13:04:33 1997 Joel Sherrill <joel@oarcorp.com>
+
+ * config.bfd (i[3456]86*-go32-rtems*): Fix to be the same as
+ i[3456]86-go32.
+
+Thu Dec 18 16:01:25 1997 Doug Evans <devans@canuck.cygnus.com>
+
+ * configure: Regenerate to get @SHELL@ substituted.
+
+Wed Dec 17 09:45:09 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c (coff_arm_relocate_section): Only look at section
+ owner if there is one.
+
+ * elf.c (assign_file_positions_for_segments): Fail if there is not
+ enough room for the program headers.
+
+Tue Dec 16 08:09:56 1997 Gavin Koch <gavin@cygnus.com>
+
+ * elf.c (_bfd_elf_find_nearest_line): Call
+ _bfd_dwarf2_find_nearest_line first.
+ * elf32-mips.c (_bfd_mips_elf_find_nearest_line): Same.
+ * dwarf2.c: New file; implement _bfd_dwarf2_find_nearest_line.
+
+Mon Dec 15 16:08:52 1997 Nick Clifton <nickc@cygnus.com>
+
+ * archures.c: Add bfd_mach_m32r.
+
+Mon Dec 15 16:11:22 1997 Fred Fish <fnf@cygnus.com>
+
+ * coffcode.h (ALIGN_SECTIONS_IN_FILE): Define if I960 not defined.
+ (coff_compute_section_file_positions): Use ALIGN_SECTIONS_IN_FILE
+ to decide when to align the file sections for paging.
+ * coffcode.h (ALIGN_SECTIONS_IN_FILE): Undefine for TIC80COFF.
+
+Mon Dec 15 15:01:15 1997 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-m32r.c (m32r_elf_object_p): New Function.
+ (m32r_elf_final_write_processing): New Function.
+ (m32r_elf_set_private_flags): New Function.
+ (m32r_elf_copy_private_bfd_data): New Function.
+ (m32r_elf_merge_private_bfd_data): New Function.
+ (m32r_elf_print_private_bfd_data): New Function.
+ (elf_backend_object_p): Point to m32r_object_p.
+ (elf_backend_final_write_processing): Point to
+ m32r_elf_final_write_processing.
+ (bfd_elf32_bfd_copy_private_bfd_data): Point to
+ m32r_elf_copy_private_bfd_data.
+ (bfd_elf32_bfd_merge_private_bfd_data): Point to
+ m32r_elf_merge_private_bfd_data.
+ (bfd_elf32_bfd_set_private_flags): Point to
+ m32r_elf_set_private_bfd_data.
+ (bfd_elf32_bfd_print_private_bfd_data): Point to
+ m32r_elf_print_private_bfd_data.
+
+
+ * bfd-in2.h (bfd_mach_m32r): Add identifier for M32R architecture
+ machines.
+
+Fri Dec 12 11:30:28 1997 Brendan Kehoe <brendan@canuck.cygnus.com>
+
+ * configure: Only build libbfd shared if --enable-shared's value
+ was `yes', or was set to `*bfd*'.
+ * aclocal.m4: Likewise.
+ * NOTE: this really needs to be fixed in libtool/libtool.m4, the
+ original source of this bit of code. It's not clear what the best fix
+ would be, though.
+
+Thu Dec 11 17:48:11 1997 Richard Henderson <rth@cygnus.com>
+
+ * linker.c (generic_link_add_symbol_list): Always init udata.p so
+ that the generic relaxation code can function when input and output
+ file formats are mismatched.
+
+Thu Dec 11 01:02:18 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-sh.c (bfd_coff_small_swap_table): Initialize new fields.
+
+ * elf.c (assign_file_positions_for_segments): For a loadable
+ section, make sure that the load address is correct relative to
+ the load address of the segment plus the size of the segment so
+ far.
+
+ * coffcode.h (_coff_link_output_has_begun): Make static.
+ (_coff_final_link_postscript): Likewise.
+
+Wed Dec 10 23:37:11 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_input_bfd): Handle a relocateable link in
+ which a relocation refers to an indirect or warning symbol.
+
+Wed Dec 10 11:15:55 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c (bfd_arm_coff_final_link): Function deleted.
+ (coff_arm_final_link_postscript): New function.
+ (coff_arm_link_output_has_begun): New function.
+
+ * libcoff.h (struct bfd_coff_backend_data): Add new fields:
+ _bfd_coff_link_output_has_begun and
+ _bfd_coff_final_link_postscript. Add new macros:
+ bfd_coff_link_output_has_begun() and
+ bfd_coff_final_link_postscript().
+
+ * cofflink.c (_bfd_coff_final_link): Insert calls to
+ bfd_coff_link_output_has_begun() and
+ bfd_coff_final_link_postscript().
+
+ * coffcode.h: Add two new fields to bfd_coff_backend_data
+ structure: _bfd_coff_link_output_has_begun and
+ _bfd_coff_final_link_postscript. Add default initialisers for
+ these fields. Add overridable aliases for the coff swap functions
+ in the backend data structure.
+
+ * elf32-v850.c: Update with patches from the branch to fix
+ HI16_S/LO16 reloc pairs.
+
+Wed Dec 10 14:06:48 1997 Michael Meissner <meissner@cygnus.com>
+
+ * elf32-d30v.c (d30v_info_to_howto_rela): New function to support
+ RELA relocations.
+ (USE_REL): Don't define any more, switch to using RELA
+ relocations.
+ (elf_info_to_howto): Define as d30v_info_to_howto_rela.
+
+Tue Dec 9 11:37:53 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * archures.c (bfd_mach_mips*): Define.
+ (bfd_default_scan): For 3000 and 4000 replace magic constant with
+ macro.
+
+ * cpu-mips.c (N): Define.
+ (bfd_mips_arch, arch_info_struct): Re-write using macro N, replace
+ numbers with bfd_mach_mips* macros.
+
+Fri Dec 5 11:13:46 1997 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-v850.c (v850_elf_reloc, v850_elf_store_addend_in_insn,
+ v850_elf_relocate_section): Fix reloc addend handling.
+ (v850_elf_section_from_bfd_section, v850_elf_symbol_processing,
+ v850_elf_add_symbol_hook, v850_elf_link_output_symbol_hook,
+ v850_elf_section_from_shdr, v850_elf_fake_sections): New functions
+ to create and handle special common sections.
+ (v850_elf_final_link_relocate): Fix HI16 and HI16_S relocations
+ which have data stored in the instructions.
+
+Tue Dec 2 10:26:16 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c (TARGET_UNDERSCORE): Revert back to '_'
+ (USER_LABEL_PREFIX): Revert back to '_'
+
+ * config.bfd (targ_cpu): Add support for Thumb target.
+
+Mon Dec 1 20:24:18 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * coff-sh.c (sh_coff_howtos): Add R_SH_SWITCH8 entry.
+ (get_symbol_value): Handle R_SH_SWITCH8.
+ (sh_relax_delete_bytes): Likewise.
+
+Wed Nov 26 14:13:34 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c (TARGET_UNDERSCORE): Changed to match definition in
+ gcc/config/arm/semi.h
+
+ * coffcode.h (coff_slurp_symbol_table): Add ARM and Thumb symbol
+ classes.
+
+Sun Nov 23 16:02:58 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * freebsd.h (SWAP_MAGIC): Read magic number little and not big
+ endian.
+
+Wed Nov 26 09:30:37 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coffcode.h (coff_mkobject_hook): Only set private flags for non
+ PE ARM ports.
+
+Tue Nov 25 15:33:23 1997 Richard Henderson <rth@cygnus.com>
+
+ * binary.c (binary_set_section_contents): Also ignore NEVER_LOAD
+ sections.
+
+Tue Nov 25 10:55:36 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c (coff_arm_bfd_merge_private_bfd_data): Do not
+ complain if inout and output formats differ.
+
+Tue Nov 25 11:26:27 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (BFD32_BACKENDS): Remove tekhex.lo.
+ (BFD32_BACKENDS_CFILES): Remove tekhex.c.
+ * Makefile.in: Rebuild.
+ * aclocal.m4, configure, src/Makefile.in: Rebuild with current
+ automake and autoconf.
+
+ * coff-arm.c (arm_allocate_interworking_sections): Fix typo
+ (COFF_WITH_PR to COFF_WITH_PE).
+
+Mon Nov 24 15:47:49 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c: Make variables and some functions static, so that
+ this file can be included in multiple object files.
+ (coff_arm_bfd_final_link): Fix minor bug.
+
+Sat Nov 22 15:16:00 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c: Add support for PIC and APCS-FLOAT type binaries.
+
+ * coffcode.h: Add support for PIC and APCS-FLOAT type binaries.
+
+Sat Nov 22 16:06:56 1997 Klaus Kaempf <kkaempf@progis.de>
+
+ * evax-emh.c (_bfd_evax_write_emh): Use alloca instead of strdup.
+
+Sat Nov 22 12:29:30 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * sunos.c (sunos_add_one_symbol): When overriding a defined
+ symbol, set it to undefined, not new.
+
+ * elf32-sh.c (sh_elf_relax_delete_bytes): Don't kill LABEL
+ relocs.
+
+Fri Nov 21 14:14:22 1997 Richard Henderson <rth@cygnus.com>
+
+ * coff-sh.c (sh_relax_section): Force sign extention of USES r_offset.
+ (sh_relax_delete_bytes): Don't kill LABEL relocs.
+
+Mon Nov 17 15:08:38 1997 Jeffrey A Law (law@cygnus.com)
+
+ * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Fix typo.
+ (mn10300_elf_relax_section): Likewise.
+
+Sat Nov 15 15:36:07 1997 Fred Fish <fnf@cygnus.com>
+
+ * peicode.h (coff_swap_aouthdr_in): Cast second arg of
+ bfd_h_get_* calls to "bfd_byte *".
+
+Tue Nov 11 10:37:23 1997 Jeffrey A Law (law@cygnus.com)
+
+ * elf-m10300.c (elf32_mn10300_link_hash_entry): Add new field
+ "movm_stack_size".
+ (mn10300_elf_relax_section): Include stack space for register saves
+ in the imm8 field of a "call" instruction.
+ (compute_function_info): Determine how much stack is allocated by
+ the movm instruction. Fix typo.
+ (elf32_mn10300_link_hash_newfunc): Initialize movm_stack_size.
+
+Mon Nov 10 14:32:40 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Don't crash if
+ a version dependency could not be found.
+
+Tue Nov 4 12:05:56 1997 Klaus K"ampf <kkaempf@progis.de>
+
+ * configure.com: Get version info from configure.in
+
+Fri Oct 24 11:15:58 1997 Jakub Jelinek <jj@sunsite.mff.cuni.cz>
+
+ * elf64-sparc.c (sparc64_elf_merge_private_bfd_data):
+ New function. Avoid mixing US1 and HAL R1 code.
+ Set resulting memory ordering to the strongest one used.
+ (sparc64_elf_object_p): Set bfd_mach correctly.
+
+Thu Oct 23 14:09:33 1997 Richard Henderson <rth@cygnus.com>
+
+ * elf64-sparc.c (sparc64_elf_howto_table): Add UA64 & UA16.
+ (sparc64_elf_check_relocs): Handle them.
+ (sparc64_elf_relocate_section): Likewise. Before emitting a dyn reloc,
+ check alignment and transmute R_SPARC_x<->R_SPARC_UAx.
+
+Thu Oct 23 00:53:14 1997 Richard Henderson <rth@dot.cygnus.com>
+
+ * configure.in (sparc*-*-linux*): Use trad-core and ...
+ * hosts/sparclinux.h: New file.
+
+Thu Oct 23 00:25:29 1997 Richard Henderson <rth@dot.cygnus.com>
+
+ * config.bfd (sparc64-*-linux*): New target.
+
+ * elf-bfd.h (struct elf_backend_data): Add plt_alignment member.
+ * elflink.c (_bfd_elf_create_got_section): Set .got alignment based
+ on arch_size.
+ (_bfd_elf_create_dynamic_sections): Likewise for .rel* sections.
+ Set .plt alignment from new plt_alignment.
+ * elflink.h (elf_link_create_dynamic_sections): Set version section
+ alignment to LOG_FILE_ALIGN.
+ * elfxx-target.h (elf_backend_plt_alignment): Provide default.
+ (elfXX_bed): Init plt_alignment.
+
+ * elf64-sparc.c (sparc64_elf_check_relocs,
+ sparc64_elf_adjust_dynamic_symbol, sparc64_elf_size_dynamic_sections,
+ sparc64_elf_adjust_dynindx, sparc64_elf_finish_dynamic_symbol,
+ sparc64_elf_finish_dynamic_sections): New functions.
+ (sparc64_elf_howto_table): Fix a few name strings.
+ (ELF_DYNAMIC_INTERPRETER): New definition.
+ (sparc64_elf_relocate_section): Handle shared libraries.
+
+ * elf64-sparc.c (struct plt_template, plt_*_header, plt_*_entry,
+ sparc64_elf_build_plt_entry, sparc64_elf_finish_dynamic_symbol):
+ PLT definitions sparc64-linux originally choose. These will go
+ away soon in favour of the official abi definitions.
+
+Wed Oct 22 16:08:45 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-sh.c (coff_small_object_p): New static function.
+ (coff_small_new_section_hook): New static function.
+ (bfd_coff_small_swap_table): New static const structure.
+ (coff_small_close_and_cleanup): Define.
+ (coff_small_bfd_free_cached_info): Define.
+ (coff_small_get_section_contents): Define.
+ (coff_small_get_section_contents_in_window): Define.
+ (shcoff_small_vec): New static structure.
+ (shlcoff_small_vec): New static structure.
+ * targets.c (bfd_target_vector): Add shcoff_small_vec and
+ shlcoff_small_vec.
+ * config.bfd (sh-*-elf*): Add shcoff_small_vec and
+ shlcoff_small_vec to targ_selvecs.
+ (sh-*-*): Likewise.
+ * configure.in: Add shcoff_small_vec and shlcoff_small_vec cases.
+ * configure: Rebuild.
+
+Mon Oct 20 15:01:27 1997 Klaus K"ampf <kkaempf@progis.de>
+
+ * evax-egsd.c: Weak symbols are global.
+
+ * evax-emh.c: Use proper casts.
+
+ * evax-egsd.c (_bfd_evax_write_egsd): Remove unneeded uname.
+
+ * evax-egsd.c: Section names and symbols have different
+ length restrictions. Add length parameter to
+ _bfd_evax_length_hash_symbol.
+ * evax-etir.c: Likewise.
+ * evax-misc.c (_bfd_evax_length_hash_symbol): Add length
+ parameter.
+ * evax.h (EOBJ_S_C_SECSIZ): Define.
+
+ * evax-alpha.c: Remove duplicate test.
+
+ * evax-emh.c: SYS$ functions are upper-case.
+
+ * evax-egsd.c: Create separate sections for common symbols.
+ * evax-etir.c: Don't output common section.
+ * evax.h: Bump up section count.
+
+ * configure.com: Use 64bit integers with DEC C.
+
+ * evax-egsd.c: Make section flags dec c compatible.
+
+Mon Oct 20 09:38:31 1997 Jeffrey A Law (law@cygnus.com)
+
+ * som.c (normalize): Delete function.
+ (som_bfd_ar_write_symbol_stuff): New parameter elength. All callers
+ changed. Use passed in elength to determine size of the extended
+ name table instead of computing it again.
+
+Sun Oct 19 23:36:21 1997 Jim Wilson <wilson@cygnus.com>
+
+ * peicode.h (coff_swap_scnhdr_out): Use |= not = to set
+ IMAGE_SCN_MEM_READ for an unrecognized section.
+
+Sun Oct 19 21:04:56 1997 Jeffrey A Law (law@cygnus.com)
+
+ * som.c (som_bfd_ar_write_symbol_stuff): Account for trailing
+ '/' in the extended name table.
+
+Fri Oct 17 00:04:13 1997 Richard Henderson <rth@cygnus.com>
+
+ * elflink.h (elf_link_assign_sym_version): For explicitly versioned
+ symbols, check globals list before matching on locals.
+
+Thu Oct 16 08:17:06 1997 Michael Meissner <meissner@cygnus.com>
+
+ * peicode.h (coff_swap_scnhdr_out,pe_print_idata): Fix mangled
+ patch.
+
+Wed Oct 15 13:45:10 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * peicode.h (pe_mkobject_hook): Set DLL flag.
+ (pe_bfd_copy_private_bfd_data): Copy DLL flag.
+
+ * peicode.h (coff_swap_scnhdr_out): Set IMAGE_SCN_MEM_DISCARDABLE
+ for .stab* sections. Replace strlen of constant strings with
+ number.
+
+Tue Oct 14 15:42:45 1997 Richard Henderson <rth@cygnus.com>
+
+ * elf64-alpha.c (elf64_alpha_merge_ind_symbols): New function to
+ merge got and reloc entries from ind syms to their target.
+ (elf64_alpha_always_size_sections): Call it.
+ (elf64_alpha_check_relocs): Operate on the target of indirect symbols.
+ (elf64_alpha_can_merge_gots): Likewise.
+ (elf64_alpha_merge_gots): Likewise.
+
+ * elf64-alpha.c (elf64_alpha_relocate_section): Back out HJ's change,
+ as it is insufficient to handle the relocation changes as well.
+
+Mon Oct 13 23:10:08 1997 Richard Henderson <rth@cygnus.com>
+
+ * elf64-alpha.c (elf64_alpha_calc_dynrel_sizes): Allow for RELATIVE
+ relocs for symbols in shlibs that have been forced local.
+ (elf64_alpha_relocate_section): Output RELATIVEs in .got for same.
+
+Mon Oct 13 21:24:04 1997 Richard Henderson <rth@cygnus.com>
+
+ * elf64-alpha.c (elf64_alpha_relocate_section): Use the
+ got_enties of the default symbol for the default versioned
+ symbol. Patch from hjl@gnu.ai.mit.edu, modified not to use
+ alloca in the loop.
+
+Mon Oct 13 17:37:37 1997 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-v850.c (v850_elf_final_link_relocate): Only use the bottom
+ 24 bits of the PC when computing a PC relative relocation.
+
+Fri Oct 10 16:01:30 1997 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-v850.c (v850_elf_reloc, v850_elf_final_link_relocate):
+ Correct value for maximum positive 22 bit PC relative relocation.
+ (v850_elf_final_link_relocate): Prevent overflow from HI16_S and
+ HI_16 relocations. Correct bit adjustment in TDA offsets.
+
+Thu Oct 9 16:43:39 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * elf64-sparc.c (sparc_elf_{hix22,lox10}_reloc): New functions.
+ (sparc64_elf_howto_table): Use them for HIX22,LOX10 relocs.
+
+Wed Oct 8 11:38:45 1997 Richard Henderson <rth@cygnus.com>
+
+ * elfcore.h (bfd_prstatus): Pedanticly, alignment_power should
+ be LOG_FILE_ALIGN.
+
+Wed Oct 8 11:36:00 1997 Richard Henderson <rth@cygnus.com>
+
+ * config.bfd: Missed one alpha* change.
+
+Tue Oct 7 13:00:17 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * elf32-sparc.c (_bfd_sparc_elf_howto_table): Remove BFD64 support.
+ * elf64-sparc.c (SPARC64_OLD_RELOCS): Undef.
+ (MINUS_ONE): New macro.
+ (sparc_elf_notsup_reloc): New function.
+ (sparc64_elf_howto_table): Add entries for DISP64,PLT64,HIX22,LOX10,
+ H44,M44,L44,REGISTER.
+ (sparc_reloc_map): Likewise. Map BFD_RELOC_CTOR to R_SPARC_64.
+ (init_insn_reloc): New function.
+ (sparc_elf_wdisp16_reloc): Use it.
+ (sparc64_elf_relocate_section): Add entries for OLO10,HIX22,LOX10.
+
+Tue Oct 7 11:40:37 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * som.c (som_construct_extended_name_table): Remove static
+ function, and define as macro instead.
+
+Fri Oct 3 14:02:17 1997 Richard Henderson <rth@cygnus.com>
+
+ * config.bfd: Change alpha-*-* to alpha*-*-*; config.guess now
+ recognizes alphaev5 etc.
+ * configure.host: Likewise.
+
+Fri Oct 3 11:23:47 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ Make ld -s work on AIX:
+ * xcofflink.c (xcoff_link_add_symbols): Don't create the .debug
+ section if we are stripping.
+ (bfd_xcoff_size_dynamic_sections): Don't set the .debug section
+ size if we are stripping.
+ (_bfd_xcoff_bfd_final_link): Don't set SEC_RELOC or rel_filepos,
+ and don't write out relocs, if we are stripping.
+ (xcoff_link_input_bfd): Don't set up reloc if we are stripping.
+ (xcoff_write_global_symbol): Don't write out symbol or reloc if we
+ are stripping.
+
+ * configure.in: Don't include elf.lo again for ELF targets; it's
+ always in the library anyhow.
+ * configure: Rebuild.
+
+ * bfd-in2.h: Rebuild.
+
+ * elf32-sparc.c (sparc_elf_wdisp16_reloc): Cast to bfd_byte *, not
+ char *, when calling bfd_get_32 and bfd_put_32.
+ * sunos.c (sunos_scan_dynamic_symbol): Cast contents to char *
+ when calling strcpy.
+
+Thu Oct 2 16:15:50 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * reloc.c (bfd_check_overflow): New function.
+ (bfd_perform_relocation, bfd_install_relocation): Use it.
+ (BFD_RELOC_SPARC_{DISP64,PLT64}): New relocs.
+ (BFD_RELOC_SPARC_{HIX22,LOX10,H44,M44,L44,REGISTER}): New relocs.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
+
+Thu Oct 2 13:17:18 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * peicode.h (coff_swap_scnhdr_out): Set IMAGE_SCN_MEM_READ for an
+ unrecognized section. From Jon Thackray <jont@harlequin.co.uk>.
+
+Wed Oct 1 14:03:44 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am ($(BFD_H)): Change stmp-bfd.h to stmp-bfd-h.
+ (stmp-bfd-h): Rename from stmp-bfd.h.
+ (BFD_H_FILES, LIBBFD_H_FILES, LIBCOFF_H_FILES): New variables.
+ ($(srcdir)/bfd-in2.h): Just depend upon stmp-bin2-h.
+ (stmp-bin2-h): New target.
+ ($(srcdir)/libbfd.h): Just depend upon stmp-lbfd-h.
+ (stmp-lbfd-h): New target.
+ ($(srcdir)/libcoff.h): Just depend upon stmp-lcoff-h.
+ (stmp-lcoff-h): New target.
+ (CLEANFILES): Change stmp-bfd.h to stmp-bfd-h. Add stmp-bin2.h,
+ stmp-lbfd-h, and stmp-lcoff-h.
+ * Makefile.in: Rebuild.
+
+ * configure.in: Use a diversion to set enable_shared before the
+ arguments are parsed.
+ * configure: Rebuild.
+
+Tue Sep 30 14:18:32 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * elf32-sparc.c (_bfd_sparc_elf_howto_table): R_SPARC_GLOB_JMP
+ renamed to R_SPARC_UNUSED_42.
+ (sparc_reloc_map): Delete R_SPARC_GLOB_JMP entry.
+ * elf64-sparc.c (_bfd_sparc_elf_howto_table): R_SPARC_GLOB_JMP
+ renamed to R_SPARC_UNUSED_42.
+ (sparc_reloc_map): Delete R_SPARC_GLOB_JMP entry.
+ * reloc.c (BFD_RELOC_SPARC_GLOB_JMP): Delete.
+ * bfd-in2.h: Regenerated.
+ * libbfd.h: Regenerated.
+
+Thu Sep 25 12:15:02 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_merge_symbol): Don't check the hash creator until
+ after we have set *sym_hash.
+
+Wed Sep 24 16:52:28 1997 Joel Sherrill <joel@oarcorp.com>
+
+ * config.bfd (sh*-*-rtems*): New target, like sh-*-*elf*.
+
+Wed Sep 24 11:27:23 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (libbfd_a_SOURCES): Define.
+ * Makefile.in: Rebuild.
+
+ * configure.in: Call AC_CHECK_TOOL before AM_PROG_LIBTOOL.
+ * aclocal.m4: Rebuild with new libtool.
+ * configure: Rebuild.
+
+Tue Sep 23 19:03:13 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (map_sections_to_segments): Even if we are not demand
+ paged, don't put a loadable section after a nonloadable section.
+ (assign_file_positions_for_segments): Increment the file offset
+ for a section with contents, even if it is not loadable.
+
+Sun Sep 21 11:03:24 1997 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-v850.c (v850_elf_final_link_relocate): Add return code
+ indicating that __ctbp could not be found.
+
+Thu Sep 18 15:04:57 1997 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-v850.c (v850_elf_check_relocs): Improve error message.
+
+Wed Sep 17 09:54:51 1997 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-v850.c (v850_elf_final_link_relocate, v850_elf_reloc,
+ v850_elf_check_relocs, v850_elf_reloc_map, v850_elf_howto_table):
+ Add support for the CALLT relocs.
+
+ * reloc.c (COMMENT): Add BFD_RELOC_V850_CALLT_6_7_OFFSET and
+ BFD_RELOC_V850_CALLT_16_16_OFFSET.
+
+ * elf32-v850.c (v850_elf_final_link_relocate): Add checks to catch
+ relocations against non-existant symbols.
+
+Tue Sep 16 14:20:27 1997 Nick Clifton <nickc@cygnus.com>
+
+ * reloc.c: Add BFR_RELOC_V850_TDA_16_16_OFFSET.
+
+ * elf32-v850.c (v850_elf_reloc, v850_elf_final_link_relocate,
+ v850_elf_howto_table, v850_elf_reloc_map): Add support for a 16
+ bit reloc in the tiny data area.
+
+Mon Sep 15 11:27:36 1997 Ken Raeburn <raeburn@cygnus.com>
+
+ Merged changes from Martin Hunt:
+
+ * elf32-d30v.c (bfd_elf_d30v_reloc): Change pc-relative relocs
+ over 2^32 bytes to be absolute. Needed because D30V PC doesn't
+ necessarily wrap.
+
+ * reloc.c, elf32-d30v.c (BFD_RELOC_D30V_9_PCREL,
+ BFD_RELOC_D30V_9_PCREL_R): New relocs.
+
+ * elf32-d30v.c (bfd_elf_d30v_reloc_21): New function.
+ Do 15 and 21 bit pc-relative relocations.
+ * reloc.c (BFD_RELOC_D30V_15_PCREL_R, BFD_RELOC_D30V_21_PCREL_R):
+ New relocations.
+
+ * elf32-d30v.c (bfd_elf_d30v_reloc): Addend needs to be
+ added to the relocation, not or'd.
+
+Wed Sep 10 15:17:25 1997 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-v850.c (v850_elf_reloc): Remove spurious error message.
+
+Wed Sep 10 11:17:50 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * archures.c (bfd_default_scan): Use strcasecmp.
+ (bfd_default_scan): Test for match with arch_name + ":" +
+ printable_name.
+ (bfd_default_scan): Test for match with printable_name - ":".
+ (bfd_default_scan): Delete w65, h8300, h8500, z8k, i960 special
+ cases. Each implements their own scan function.
+ (bfd_default_scan): Delete 386, 2900, 860, mips 2000, mips 4400
+ special cases. Since info->mach == 0. The test mach == number
+ fails.
+ (bfd_arch_list): New function, return name of all the supported
+ architectures.
+
+Tue Sep 9 10:21:56 1997 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-v850.c (v850_elf_print_private_bfd_data): Break after
+ decoding architecture.
+ (v850_elf_reloc): Do not complain if a R_V850_LO16 reloc has bit
+ 15 set.
+
+Sun Sep 7 12:25:22 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
+
+ * bfd/elf64-alpha.c (reloc_howto_type): Fix the howto table.
+
+Thu Sep 4 09:44:10 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am: Rebuild dependencies.
+ (ALL_MACHINES_CFILES): Add cpu-v850.c.
+ (ALL_MACHINES_CFILES): Add elf32-v850.c.
+ * Makefile.in: Rebuild.
+
+ * reloc.c: Remove extraneous commas from relocation entries.
+ Remove BFD_RELOC_V850_16_PCREL.
+ * bfd-in2.h: Rebuild.
+
+ * xcofflink.c (xcoff_link_add_symbols): Put XTY_CM/XMC_TD symbols
+ in sections named .tocbss rather than .bss.
+
+Wed Sep 3 11:23:23 1997 Nick Clifton <nickc@cygnus.com>
+
+ * libbfd.h, bfd-in2.h, elf32-v850.c: Removed
+ BFD_RELOC_V850_16_PCREL.
+
+Tue Sep 2 20:44:10 1997 Fred Fish <fnf@cygnus.com>
+
+ * cofflink.c (coff_link_check_ar_symbols): Handle C_SYSTEM syms
+ the same as C_EXT syms.
+ (coff_link_add_symbols): Ditto.
+ (_bfd_coff_link_input_bfd): Ditto.
+ (_bfd_coff_write_task_globals): Add save_global_to_static. Use
+ it to preserve and restore state of global_to_static flag.
+
+Tue Sep 2 17:45:22 1997 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-v850.c (v850_elf_object_p): Set machine number based on
+ bits in e_flags field rather than magic numbers.
+ (v850_elf_final_write_processing, v850_elf_set_private_flags,
+ v850_elf_copy_private_bfd_data, v850_elf_merge_private_bfd_data,
+ v850_elf_print_private_bfd_data): New functions.
+
+Tue Sep 2 17:43:49 1997 Nick Clifton <nickc@cygnus.com>
+
+ * elf.c (prep_headers): Remove V850E magic number.
+ * elf.c (prep_headers): Remove V850EA magic number.
+
+Tue Sep 2 17:35:05 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * cpu-arc.c (arc_get_mach): Properly scan defined mach entries.
+
+Tue Sep 2 18:29:37 1997 Jeffrey A Law (law@cygnus.com)
+
+ * elf-m10200.c (mn10200_elf_final_link_relocate): PC relative
+ instructions are relative to the next instruction, not the
+ current instruction.
+ (mn10200_elf_relax_section): Similarly.
+
+Tue Sep 2 15:45:45 1997 Nick Clifton <nickc@cygnus.com>
+
+ * cpu-v850.c: Use a macro to construct bfd_arch_info_type
+ entries.
+
+ * reloc.c, libbfd.h, bfd-in2.h, elf32-v850.c: Replace
+ BFD_RELOC_V850_{SDA/TDA/ZDA}_OFFSET relocs with new bit pattern
+ specific versions: BFD_RELOC_V850_{area}_{bits}_OFFSET.
+
+Thu Aug 28 17:01:09 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * cpu-v850.c: Remove "plain" from v850 printable name.
+ (scan): Use strcasecmp.
+
+ * archures.c (bfd_mach_v850): Define.
+
+ * cpu-sh.c (scan_mach): Compare with table instead of hardwired to
+ just sh/SH, use strcasecmp.
+ (arch_info_struct): Add entries for sh3 et.al.
+
+ * archures.c (bfd_mach_sh, ...): Define.
+
+Wed Aug 27 17:33:07 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * archures.c (bfd_archures_list): Always NULL terminate the list.
+
+Tue Aug 26 17:26:51 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am: Rebuild dependencies.
+ (ALL_MACHINES_CFILES): Add cpu-arc.c.
+ (ALL_MACHINES_CFILES): Add elf32-arc.c.
+ (elf32-arc.lo): Remove explicit dependency.
+ * Makefile.in: Rebuild.
+
+ * acinclude.m4 (BFD_CC_FOR_BUILD): Set EXEEXT_FOR_BUILD.
+ * doc/Makefile.am (MKDOC): Use EXEEXT_FOR_BUILD, not EXEEXT.
+ * aclocal.m4, configure, Makefile.in, doc/Makefile.in: Rebuild.
+
+Mon Aug 25 16:14:34 1997 Christopher Provenzano <proven@cygnus.com>
+
+ * configure: Rebuild with latest devo autoconf for NT support
+
+Mon Aug 25 16:11:04 1997 Nick Clifton <nickc@cygnus.com>
+
+ * cpu-arm.c (compatible): If B is a default type, return A.
+
+Mon Aug 25 15:35:46 1997 Nick Clifton <nickc@cygnus.com>
+
+ * cpu-v850.c (scan): New function.
+ (arch_info_struct): New structure.
+ (bfd_v850_arch): Add link into arch_info_structure.
+
+ * config.bfd (targ_cpu): All v850 variants use the bfd_arch_v850
+ architecture.
+
+ * elf32-v850.c (v850_elf_object_p): New function.
+
+ * archures.c (bfd_mach_v850e): Machine value for v850e.
+
+ * bfd-in2.h (bfd_mach_v850e): Machine value for v850e.
+
+ * elf32-v850.c (ELF_MACHINE_CODE): Default to v850e machine
+ number.
+
+ * elf.c (prep_headers): Add support for v850e machine number.
+
+ * archures.c (bfd_mach_v850ea): Machine value for v850ea.
+
+ * bfd-in2.h (bfd_mach_v850ea): Machine value for v850ea.
+
+ * elf32-v850.c (ELF_MACHINE_CODE): Default to v850ea machine
+ number.
+
+ * elf.c (prep_headers): Add support for v850ea machine number.
+
+Mon Aug 25 14:07:33 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * syms.c (_bfd_stab_section_find_nearest_line): Clear the
+ cached_stab field if the offset prevents us from using the cache.
+
+Mon Aug 25 12:08:13 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * aout-target.h (MY(vec)): Add SEC_CODE and SEC_DATA to section
+ flags.
+ * aout-arm.c (aout_arm_little_vec): Likewise.
+ (aout_arm_big_vec): Likewise.
+ * bout.c (b_out_vec_big_host): Likewise.
+ (b_out_vec_little_host): Likewise.
+ * mipsbsd.c (aout_mips_little_vec): Likewise.
+ (aout_mips_big_vec): Likewise.
+
+Tue Aug 19 10:09:10 1997 Fred Fish <fnf@cygnus.com>
+
+ * coff-tic80.c (COFF_ALIGN_IN_SFLAGS): Define to 1.
+ * coffcode.h (styp_to_sec_flags): Ignore incoming STYP_INFO
+ bit in s_flags if COFF_ALIGN_IN_S_FLAGS is defined.
+
+Tue Aug 19 08:47:17 1997 Fred Fish <fnf@cygnus.com>
+
+ * coff-i960.c (COFF_ALIGN_IN_SECTION_HEADER): Define to 1.
+ (GET_SCNHDR_ALIGN, PUT_SCNHDR_ALIGN): Define.
+ * coff-m88k.c (GET_SCNHDR_NRELOC, GET_SCNHDR_NLNNO): Define.
+ * coffcode.h (coff_set_alignment_hook): Conditionally compile in if
+ COFF_ALIGN_IN_SECTION_HEADER is defined. Convert alignment to power
+ of two for I960 only.
+ * coffswap.h (GET_SCNHDR_NRELOC, PUT_SCNHDR_NRELOC, GET_SCNDHR_NLNNO,
+ PUT_SCNHDR_NLNNO, GET_SCNHDR_FLAGS, PUT_SCNHDR_FLAGS): Provide
+ default definitions.
+ (coff_swap_scnhdr_in): Use GET_SCNHDR_FLAGS, GET_SCNHDR_NRELOC,
+ GET_SCNHDR_NLNNO, and GET_SCNHDR_ALIGN.
+ (coff_swap_scnhdr_out): Use PUT_SCNHDR_FLAGS, PUT_SCNHDR_ALIGN.
+ * Makefile.in (coff-tic80.o): Depends upon coffswap.h.
+ * coff-tic80.c (COFF_ALIGN_IN_SECTION_HEADER): Define to 1.
+ (GET_SCNHDR_FLAGS, PUT_SCNHDR_FLAGS): Define
+ * coffcode.h (coff_write_object_contents): Set alignment field in
+ section header for TIC80COFF files.
+
+Mon Aug 18 11:36:19 1997 Nick Clifton <nickc@cygnus.com>
+
+ * elf32-v850.c (v850_elf_howto_table, v850_elf_reloc_map,
+ v850_elf_check_relocs, v850_elf_reloc,
+ v850_elf_final_link_relocate): Add support for
+ BFD_RELOC_V850_16_PCREL relocation.
+
+ * reloc.c (COMMENT): Add suuport for BFD_RELOC_V850_16_PCREL
+ relocation.
+
+ * libbfd.h: Add support for BFD_RELOC_V850_16_PCREL relocation.
+
+ * bfd-in2.h: Add support for BFD_RELOC_V850_16_PCREL relocation.
+
+Mon Aug 18 11:33:56 1997 Nick Clifton <nickc@cygnus.com>
+
+ * cpu-v850e: New file.
+
+ * elf.c (prep_headers): Add support for v850e target.
+
+ * bfd-in2.h (bfd_architecture): Add support for v850e target.
+
+ * config.bfd: Add support for v850e target.
+
+ * archures.c: Add support for v850e target.
+
+Mon Aug 18 11:33:56 1997 Nick Clifton <nickc@cygnus.com>
+
+ * cpu-v850ea: New file.
+
+ * elf.c (prep_headers): Add support for v850ea target.
+
+ * bfd-in2.h (bfd_architecture): Add support for v850ea target.
+
+ * config.bfd: Add support for v850ea target.
+
+ * archures.c: Add support for v850ea target.
+
+Fri Aug 15 12:01:28 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffgen.c (coff_find_nearest_line): Correctly handle the offset
+ argument as section relative, rather than an absolute address.
+ From Jan Hoogenraad <hoogenrd@natlab.research.philips.com>.
+
+Fri Aug 15 04:58:02 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * config.bfd (arc-*-elf*): Add.
+ * configure.in (bfd_elf32_{little,big}arc_vec): Add.
+ * configure: Rebuild.
+ * Makefile.am (ALL_MACHINES): Add cpu-arc.lo.
+ (BFD32_BACKENDS): Add elf32-arc.lo.
+ (cpu-arc.lo,elf32-arc.lo): Add rules for.
+ * Makefile.in: Rebuild.
+ * archures.c (architecture list): Add bfd_arch_arc.
+ (bfd_archures_list): Add bfd_arc_arch.
+ (bfd_mach_arc_base): Define.
+ * reloc.c (BFD_RELOC_ARC_B22_PCREL,BFD_RELOC_ARC_B26): Add.
+ * targets.c (bfd_elf32_{little,big}arc_vec): Declare.
+ (bfd_target_vect): Add them.
+ * bfd-in2.h, libbfd.h: Rebuild.
+ * cpu-arc.c, elf32-arc.c: New files.
+ * elf.c (pre_headers): Recognize bfd_arch_arc.
+
+Tue Aug 12 11:45:18 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * aoutx.h (NAME(aout,final_link)): If no symbols, make sure the
+ data section is correctly rounded to a page in the file.
+
+Mon Aug 11 12:45:43 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * aoutx.h (NAME(aout,final_link)): Don't emit the string table if
+ there are no symbols.
+
+Sun Aug 10 14:45:56 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-stgo32.c: Rename from coff-stubgo32.c to avoid old System V
+ file system 14 character limit.
+ * Makefile.am, configure.in: Corresponding changes.
+ * Makefile.in, configure: Rebuild.
+
+Fri Aug 8 18:34:36 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am: (ALL_MACHINES_CFILES): Add elf32-d10v.c.
+ Rebuild dependencies.
+ * Makefile.in: Rebuild.
+
+Wed Aug 6 18:56:51 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (docdir): Define.
+ * Makefile.in: Rebuild.
+
+Tue Aug 5 23:05:03 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure: Rebuild with autoconf 2.12.1.
+
+Mon Aug 4 12:00:35 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * aclocal.m4, configure: Rebuild with new automake patches.
+
+Sun Aug 3 08:15:12 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * rs6000-core.c (make_bfd_asection): New function to add a section
+ to the core file bfd.
+ (rs6000coff_core_p): Use make_bfd_asection to add the core file
+ sections.
+ Use BFD routines to seek, read and stat the core file.
+ Handle .data sections from loaded objects and anonymously mmapped
+ regions, these are available in AIX 4 core files.
+
+Fri Aug 1 12:58:32 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Set enable_shared before AM_PROG_LIBTOOL.
+ * acinclude.m4: Move acmacros.m4 in here. Remove AM_PROG_LIBTOOL
+ copy; use a patches libtool instead.
+ * acmacros.m4: Remove.
+ * Makefile.in, aclocal.m4, configure: Rebuild.
+
+Thu Jul 31 19:55:36 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am: New file, based on old Makefile.in.
+ * acmacros.m4: New file, copied from old aclocal.m4.
+ * acinclude.m4: New file.
+ * configure.in: Call AM_PROG_LIBTOOL. Remove shared library
+ handling; now handled by libtool. Replace AC_CONFIG_HEADER with
+ AM_CONFIG_HEADER. Replace AC_PROG_INSTALL with AM_PROG_INSTALL.
+ Call AM_MAINTAINER_MODE, AM_CYGWIN32, and AM_EXEEXT. Change all
+ .o files to .lo. Remove stamp-h handling in AC_OUTPUT.
+ * acconfig.h: Mention PACKAGE and VERSION.
+ * stamp-h.in: New file.
+ * dep-in.sed: Change .o to .lo.
+ * Makefile.in: Now built with automake.
+ * aclocal.m4: Now built with aclocal.
+ * config.in, configure: Rebuild.
+ * VERSION: Remove.
+
+Thu Jul 31 12:09:20 1997 Geoff Keating <geoffk@ozemail.com.au>
+
+ * elf32-ppc.c (ppc_elf_size_dynamic_sections): Don't set TEXTREL
+ if there is only a relocation to a read-only but not allocatable
+ section (like .stab).
+ * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise.
+ * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise.
+ * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
+ * elf32-mips.c (mips_elf_size_dynamic_sections): Likewise.
+ * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
+
+ * elf32-ppc.c (ppc_elf_howto_raw): Correct various comments.
+ (ppc_elf_create_linker_section): These sections are not
+ created by the linker (that is, they are created by the user
+ putting data in them). In particular, they can be the source
+ and target of relocations.
+ (ppc_elf_adjust_dynamic_symbol): Check postcondition of
+ bfd_elf32_link_record_dynamic_symbol. Align 16-byte common
+ objects (for instance, 'long double') to 16-byte boundaries.
+ (ppc_elf_size_dynamic_sections): Make the code that generates
+ section symbols exactly the same as for sparc, reducing the
+ number of section symbols output.
+ (ppc_elf_check_relocs): Check postcondition of
+ bfd_elf32_link_record_dynamic_symbol. Make default case the
+ same as corresponding code for sparc, fixing bug involving
+ .rela.stabs.
+ (ppc_elf_finish_dynamic_symbol): Fix case involving GOT symbols
+ forced to be local because of versioning (by replicating
+ corresponding change in sparc). Treat R_PPC_RELATIVE RELA relocs
+ as usual in ELF, not as pseudo-REL relocs (as the sparc linker
+ does).
+ (ppc_elf_relocate_section): Add handy debugging code for when
+ assertion fails. Add some more 'symbol made local because of
+ versioning' cases.
+
+ * elf32-ppc.c (ppc_elf_relocate_section): Cope with addend when
+ processing a GOT relocation as required by ABI.
+
+Wed Jul 30 21:30:35 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * elflink.h (NAME(bfd_elf,record_link_assignment)): Remove any
+ version info if this symbol came from a dynamic object.
+ (elf_link_add_object_symbols): Set the version info of a symbol
+ only if the object actually contains version definitions and
+ defines this symbol.
+
+Mon Jul 28 18:07:43 1997 Rob Savoye <rob@chinadoll.cygnus.com>
+
+ * aclocal.m4: Add CYGWIN and EXEEXT autoconf macros.
+ * configure.in: Use CYGWIN and EXEEXT autoconf macro to look for
+ win32 dependencies.
+ * configure: Regenerated with autoconf 2.12.
+ * doc/Makefile.in: Add $(EXEEXT) to chew executable.
+
+Mon Jul 28 02:50:29 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * rs6000-core.c (rs6000coff_core_p): If CORE_TRUNC is set, print
+ a warning rather than returning an error.
+
+Sun Jul 27 19:54:14 1997 Felix Lee <flee@cygnus.com>
+
+ * coffswap.h (coff_swap_aux_in): add semicolon to make MSVC happy.
+
+Fri Jul 25 14:50:08 1997 Felix Lee <flee@cygnus.com>
+
+ * cisco-core.c: define signals for wingdb.
+
+Fri Jul 25 16:27:07 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * ecofflink.c (bfd_ecoff_debug_accumulate): Only merge files with
+ the same number of aux entries.
+
+Fri Jul 25 08:22:15 1997 Jeffrey A Law (law@cygnus.com)
+
+ * som.c (hppa_som_gen_reloc_type): Use R_DATA_EXPR for the
+ difference of two symbols if the relocation size is 32 bits.
+ (som_write_fixups): Handle R_DATA_EXPR.
+
+Wed Jul 23 16:08:02 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-i386.c (coff_i386_reloc): Don't offset a common symbol by
+ its value if COFF_WITH_PE is defined.
+
+Tue Jul 22 17:19:45 1997 Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>
+
+ * coff-stubgo32.c: New file.
+ * go32stub.h: New file.
+ * coff-i386.c: If COFF_GO32_EXE, include coff/go32exe.h.
+ * coffswap.h (coff_swap_filehdr_in): Invoke
+ COFF_ADJUST_FILEHDR_IN_PRE and COFF_ADJUST_FILEHDR_IN_POST if they
+ are defined.
+ (coff_swap_filehdr_out): Invoke COFF_ADJUST_FILEHDR_OUT_PRE and
+ COFF_ADJUST_FILEHDR_OUT_POST if they are defined.
+ (coff_swap_aux_in): Invoke COFF_ADJUST_AUX_IN_PRE and
+ COFF_ADJUST_AUX_IN_POST if they are defined.
+ (coff_swap_aux_out): Invoke COFF_ADJUST_AUX_OUT_PRE and
+ COFF_ADJUST_AUX_OUT_POST if they are defined.
+ (coff_swap_scnhdr_in): Invoke COFF_ADJUST_SCNHDR_IN_PRE and
+ COFF_ADJUST_SCNHDR_IN_POST if they are defined.
+ (coff_swap_scnhdr_out): Invoke COFF_ADJUST_SCNHDR_OUT_PRE and
+ COFF_ADJUST_SCNHDR_OUT_POST if they are defined.
+ * targets.c (go32stubbedcoff_vec): Declare.
+ (bfd_target_vector): Add go32stubbedcoff_vec.
+ * configure.in (go32coff_vec): New target vector.
+ (go32stubbedcoff_vec): Likewise.
+ * config.bfd (i[3456]86-*-msdosdjgpp*): New target.
+ (i[3456]86-*-go32*): Change to be like new msdosdjgpp*.
+ * Makefile.in: Rebuild dependencies.
+ (BFD32_BACKENDS): Add coff-stubgo32.o.
+ (BFD32_BACKENDS_CFILES): Add coff-stubgo32.c.
+ (HFILES): Add go32stub.h.
+
+Tue Jul 22 15:09:12 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Check for fdopen.
+ * configure, config.in: Rebuild.
+ * opncls.c (bfd_fdopenr): Check HAVE_FDOPEN rather than VMS or
+ __GO32__. Reindent a bit.
+
+Sun Jul 20 20:05:20 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * sunos.c (sunos_create_dynamic_sections): Set SEC_LINKER_CREATED
+ flag for newly created sections.
+ (sunos_add_dynamic_symbols): Don't discard newly created sections
+ if shared library is dynobj.
+
+Mon Jul 14 15:33:55 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (map_sections_to_segments): When checking whether
+ including a section in a segment would force us to skip a page,
+ align the address of the next segment to avoid wraparound
+ problems.
+
+Tue Jul 8 12:11:29 1997 Fred Fish <fnf@cygnus.com>
+
+ * coffcode.h (coff_write_object_contents): Initialize
+ target id field to TIC80_TARGET_ID.
+ * coffswap.h (coff_swap_filehdr_out): Swap out target id field
+ if used.
+ (coff_swap_filehdr_in): Swap in target id field if used.
+
+Mon Jul 7 16:41:20 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-i386.c (coff_i386_is_local_label_name): New static function
+ if TARGET_UNDERSCORE.
+ (coff_bfd_is_local_label_name): Define if TARGET_UNDERSCORE.
+ (i386coff_vec): Add SEC_CODE and SEC_DATA to section_flags.
+
+Mon Jun 30 14:29:26 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-m68k.c (howto_table): Use complain_overflow_bitfield, not
+ complain_overflow_signed, for 32 bit PC relative relocations.
+
+Thu Jun 26 01:26:31 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_add_object_symbols): When a version
+ indirection symbol is overridden, make the original symbol point
+ at the real overriding symbol.
+
+ * elf.c (bfd_elf_string_from_elf_section): Check for an invalid
+ string index.
+
+ * elflink.h (elf_link_output_extsym): Use the right section for a
+ common symbol.
+ * elf32-mips.c (mips_elf_link_output_symbol_hook): If a common
+ symbol was in .scommon, mark it as SHN_MIPS_SCOMMON.
+
+Wed Jun 25 12:43:10 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * elflink.h (elf_merge_symbols): Resolve indirect and warning
+ symbols before checking for new symbols.
+
+ * elfcore.h (elf_corefile_note): Move out of HAVE_SYS_PROCFS_H.
+
+Tue Jun 24 11:20:43 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffgen.c (coff_object_p): Read the f_opthdr bytes from the
+ file, not aoutsz bytes (they are different in XCOFF .o files).
+
+ * xcofflink.c (xcoff_link_add_symbols): Permit symbols to be
+ redefined by objects included from archives.
+
+Mon Jun 23 18:03:27 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_merge_symbol): In the case of a new defined
+ symbol overriding an old defined symbol, return the hash table
+ entry which we modify, even if it is the target of an
+ indirection.
+ (elf_link_add_object_symbols): If the real name of the symbol gets
+ overridden, convert the versioned symbol into an indirect symbol
+ to the real symbol.
+
+ * elflink.h (elf_merge_symbol): New static function, broken out of
+ elf_link_add_object_symbols.
+ (elf_link_add_object_symbols): Call it.
+
+Sun Jun 22 19:40:57 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-i386.c (i3coff_object_p): If COFF_IMAGE_WITH_PE, hack to
+ handle case where COFF filehdr does not immediately follow PE
+ header.
+ * coffgen.c (coff_object_p): Remove useless seek to current
+ location.
+
+Wed Jun 18 19:03:38 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * linker.c (link_action): Change COMMON_ROW/indr to from CREF to
+ REFC.
+
+Tue Jun 17 11:55:02 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * cofflink.c (_bfd_coff_link_input_bfd): If stripping debugging
+ symbols, skip N_ABS symbols with debugging storage classes.
+
+Mon Jun 16 18:56:27 1997 Geoff Keating <geoffk@ozemail.com.au>
+
+ * elf32-ppc.c (ppc_elf_relocate_section): Don't emit R_PPC_REL*
+ relocs in shared libraries which refer to local symbols. Cope
+ with addend when processing a GOT relocation.
+
+ * elf32-ppc.c (ppc_elf_size_dynamic_sections): Only create symbols
+ for sections that the linker didn't create.
+ (ppc_elf_finish_dynamic_sections): Only try to write out a section
+ symbol if it was created in ppc_elf_size_dynamic_sections.
+ (ppc_elf_relocate_section): Complain if we have to generate a reloc
+ relative to a section for which we didn't output a symbol.
+
+ * elf32-ppc.c (ppc_elf_size_dynamic_sections): Clean up. PLT
+ relocs are 'rela' relocs, like everything else. .rela.plt is not
+ a read-only section, so we don't have to special-case it.
+
+ * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Entries in the
+ .rela.bss section are (of course) 'rela' relocs not 'rel' relocs.
+
+ * elf32-ppc.c (ppc_elf_check_relocs): Initialise srelgot.
+ (ppc_elf_relocate_section): @got offsets are 4 from start of the
+ actual .got section.
+ * elflink.c (_bfd_elf_create_got_section): The three reserved
+ words start from the symbol '_GLOBAL_OFFSET_TABLE_'.
+
+ * elf32-ppc.c (ppc_elf_size_dynamic_sections): '.rela' is 5
+ characters, not 4.
+
+ * elf32-ppc.c (ppc_elf_check_relocs): Use
+ _bfd_elf_create_got_section to create the GOT rather than
+ ppc_elf_create_linker_section. Create the '.rela.got' section
+ ourselves.
+ (ppc_elf_finish_dynamic_symbol): Set up GOT relocations when a
+ symbol has a GOT entry.
+ (ppc_elf_relocate_section): Record when a symbol is used through
+ the GOT, and allocate space in the GOT for each such symbol.
+ (ppc_elf_adjust_dynamic_symbol): Delete unused .got.plt stuff.
+ (ppc_elf_create_linker_section): Delete unused LINKER_SECTION_GOT
+ stuff.
+
+ * elf32-ppc.c (ppc_elf_howto_raw): GOT16_HA relocs should be
+ treated in a similar way to ADDR16_HA relocs.
+ (ppc_elf_relocate_section): PLTREL24 relocs do not get copied into
+ shared objects; the linker must deal with them.
+ (ppc_elf_create_linker_section): Stop setting
+ _GLOBAL_OFFSET_TABLE_ to the wrong value; delete unused
+ LINKER_SECTION_PLT stuff.
+ (ppc_elf_check_relocs): Delete unused LINKER_SECTION_PLT stuff.
+ (ppc_elf_finish_dynamic_sections): Use BFD calls to get GOT
+ section, not ELF-specific calls.
+ (elf_backend_plt_not_loaded): Set to 1.
+ (elf_backend_got_symbol_offset): Set to 4.
+ * elf-bfd.h (elf_backend_data): Add 'plt_not_loaded' member
+ for when ld.so fills in the PLT; and 'got_symbol_offset' member.
+ * elflink.c (_bfd_elf_create_dynamic_sections): Apply
+ plt_not_loaded member.
+ (_bfd_elf_create_got_section): Apply got_symbol_offset.
+ * elfxx-target.h (elf_backend_plt_not_loaded): Set default to
+ 'loaded'.
+ (elf_backend_G_O_T_offset): Set default to 0.
+ (elfNN_bed): Set added fields.
+
+ * elf32-ppc.c (ppc_elf_size_dynamic_sections): Was setting
+ DT_RELENT in shared objects; should be DT_RELAENT.
+
+ * elf32-ppc.c (ppc_elf_relocate_section): Propagate
+ R_PPC_ADDR16_HA relocs to shared objects. Cope with case where
+ such a reloc (in a non-shared object) refers to a symbol that's
+ not defined.
+
+Mon Jun 16 14:42:14 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * elfcode.h (put_signed_word): Define.
+ (get_signed_word): Define.
+ (elf_swap_reloca_in): Use get_signed_word for the r_addend field.
+ (elf_swap_reloca_out): Use put_signed_word for the r_addend
+ field.
+ * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): Use
+ bfd_get_signed_32 to set the r_addend field.
+ * elf64-mips.c (mips_elf64_swap_reloca_in): Use
+ bfd_h_get_signed_64 to set the r_addend field.
+
+Mon Jun 16 12:31:29 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-i386.c (elf_i386_relocate_section): When generating a
+ shared library, do the relocation if the input section is not
+ allocated in memory.
+
+ * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Call
+ elf_link_assign_sym_version before elf_adjust_dynamic_symbol.
+ (elf_fix_symbol_flags): New static function, broken out of
+ elf_adjust_dynamic_symbol.
+ (elf_adjust_dynamic_symbol): Call elf_fix_symbol_flags.
+ (elf_link_assign_sym_version): Likewise. Permit a symbol to be
+ forced local even if NEEDS_PLT is set. When forcing a symbol to
+ be local, clear NEEDS_PLT.
+ (elf_link_output_extsym): Remove unused local bed.
+
+Wed Jun 11 22:44:20 1997 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-mn10300.c (elf32_mn10300_link_hash_entry): New structure
+ for derived elf linker hash table entries. References to
+ elf_link_hash_entry changed appropriately.
+ (elf32_mn10300_link_hash_table): New structure for derived elf
+ linker hash table.
+ (elf32_mn10300_hash_table): Define.
+ (elf32_mn10300_link_hash_traverse): Likewise.
+ (elf32_mn10300_link_hash_newfunc): New function.
+ (elf32_mn10300_link_hash_table_create): Likewise.
+ (elf32_mn10300_finish_hash_table_entry): Likewise.
+ (mn10300_elf_relax_section): Handle "call" -> "calls", removal
+ of prologue code, and call:32->call:16 relaxing.
+ (compute_function_info: New function.
+ (bfd_elf32_bfd_ilink_hash_table_create): Define.
+
+Wed Jun 11 00:00:07 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_output_extsym): Call finish_dynamic_symbol
+ for a symbol which is being forced to be local.
+ * elf32-i386.c (elf_i386_relocate_section): Write out the
+ relocation value for a GOT reloc for a symbol which is turning
+ into a local symbol.
+ (elf_i386_finish_dynamic_symbol): If a symbol is turning into a
+ local symbol, write out a RELATIVE reloc rather than a GLOB_DAT
+ reloc.
+ * elf32-m68k.c, elf32-sparc.c: Corresponding changes.
+
+ * elf32-i386.c (elf_i386_relocate_section): Get the relocation
+ value if the symbol is turning into a local symbol.
+ * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+
+1997-06-10 22:58 Ulrich Drepper <drepper@cygnus.com>
+
+ * elflink.h (elf_link_add_object_symbols): Also read verneed
+ information by calling `_bfd_elf_slurp_version_tables'.
+ (elf_link_add_object_symbols): For undefined symbols look for
+ version information in the verneed records.
+ (elf_link_add_object_symbols): Use soname of shared object
+ for verneed record if it is available.
+
+Tue Jun 10 11:13:03 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * cpu-arm.c: Add prototypes for compatible and scan.
+ * cofflink.c: Add prototype for mark_relocs.
+
+ * archive.c (bfd_special_undocumented_glue): Change filename to
+ const pointer. Add prototype.
+
+Mon Jun 9 12:34:21 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * elflink.h (elf_link_add_object_symbols): Ignore relocations of
+ sections that will be discarded.
+
+1997-06-06 22:58 Ulrich Drepper <drepper@cygnus.com>
+
+ * elflink.h (elf_link_find_version_dependencies): When searching
+ for known version symbol skip non-matching verdef records, not
+ matching records.
+
+Thu Jun 5 15:52:45 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * cofflink.c (_bfd_coff_generic_relocate_section): Write a long,
+ not a bfd_vma, to the base file, to match how dlltool reads it.
+
+Tue Jun 3 16:57:45 1997 Nick Clifton <nickc@cygnus.com>
+
+ * reloc.c: Add thumb relocations.
+
+ * bfd-in2.h: Add Thumb relocations.
+
+ * libbfd.h: Add Thumb relocations.
+
+Mon Jun 2 10:41:52 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * cpu-m68k.c (arch_info_struct): Fix 68060 cpu name.
+
+Fri May 30 12:46:27 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Set dynindx
+ for a section even if it is not loaded.
+
+ * cofflink.c (coff_link_add_symbols): If PE file, don't subtract
+ section VMA.
+ (_bfd_coff_link_input_bfd): Separate section VMA handling for
+ input and output files.
+ (_bfd_coff_generic_relocate_section): Check whether input file,
+ not output file, is a PE file.
+
+Wed May 28 15:48:43 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c: (coff_arm_bfd_set_private_flags): Make static.
+
+Wed May 28 16:16:04 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-i386.c (coff_i386_reloc): Don't just exit if we see an
+ R_IMAGEBASE reloc.
+
+Wed May 28 09:48:43 1997 Nick Clifton <nickc@cygnus.com>
+
+ * cpu-arm.c (compatible): Add test for supersets of ARM
+ architectures.
+
+Tue May 27 19:42:03 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * cofflink.c (_bfd_coff_final_link): Initialize global_to_static
+ member.
+
+Tue May 27 14:34:08 1997 Nick Clifton <nickc@cygnus.com>
+
+ * coff-arm.c (coff_arm_bfd_set_private_flags): Make global. It is
+ called directly by gas/config/tc-arm.c.
+
+Tue May 27 15:58:53 1997 Richard Henderson <rth@tamu.edu>
+
+ * elf64-alpha.c (PLT_ENTRY_*): Use a new thread-safe format.
+ (elf64_alpha_finish_dynamic_symbol): Fill it in properly.
+
+Mon May 26 14:05:13 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-ppc.c (coff_ppc_relocate_section): If PE file, don't add
+ section VMA.
+
+Mon May 26 10:57:48 1997 Fred Fish <fnf@cygnus.com>
+
+ * peicode.h (coff_bfd_print_private_bfd_data): #undef before #define.
+ (coff_bfd_copy_private_bfd_data): Ditto.
+ * coff-arm.c (coff_arm_bfd_merge_private_bfd_data): Make static.
+ (coff_arm_bfd_print_private_bfd_data): Ditto.
+ (coff_arm_bfd_set_private_flags): Ditto.
+ (coff_arm_bfd_copy_private_bfd_data): Ditto.
+
+Fri May 23 15:14:58 1997 Fred Fish <fnf@cygnus.com>
+
+ * libcoff-in.h (struct coff_final_link_info): Add boolean
+ global_to_static member for support of task linking.
+ (_bfd_coff_write_task_globals): Add prototype.
+ * libcoff.h: Regenerate.
+ * coffcode.h (coff_write_object_contents): Use #ifdef to
+ check RS6000COFF_C, to be consistent with all other uses
+ in this file.
+ * cofflink.c (_bfd_coff_final_link): If doing task linking,
+ call _bfd_coff_write_task_globals.
+ (_bfd_coff_link_input_bfd): If doing task linking, convert
+ global functions to static.
+ (_bfd_coff_write_global_sym): If doing task linking, convert
+ global variables to static.
+ (_bfd_coff_write_task_globals): New function.
+ * coff-tic80.c (TIC80COFF): Define this instead of just TIC80.
+ (C_AUTOARG): #undef since it clashes with C_UEXT.
+ (C_LASTENT): #undef since it clashes with C_STATLAB.
+ * coffcode.h (coff_write_object_contents): Use TIC80COFF
+ rather than TIC80.
+ (coff_slurp_symbol_table): Use C_SYSTEM. Hide C_AUTOARG use
+ when TIC80COFF defined (clashes with C_UEXT). Explicitly
+ recognize C_UEXT, C_STATLAB, and C_EXTLAB as unsupported.
+
+Fri May 23 12:38:24 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-tic80.c (tic80_howto_table): Change overflow check for most
+ PP relocations to complain_overflow_dont.
+
+Thu May 22 20:22:14 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-tic80.c (tic80_howto_table): Add PP relocations. Change
+ name of R_RELLONG to "RELLONG". Set rightshift and complain for
+ M_PPCR.
+ (ppbase_reloc, glob15_reloc): New static functions.
+ (glob16_reloc, local16_reloc): New static functions.
+ (rtype2howto): Handle all relocation types.
+ (coff_tic80_relocate_section): New static function.
+ (coff_relocate_section): Define to coff_tic80_relocate_section.
+ * Makefile.in (coff-tic80.o): Depends upon include/coff/tic80.h.
+
+Wed May 21 17:15:50 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffcode.h (coff_slurp_symbol_table): If COFF_WITH_PE or
+ COFF_IMAGE_WITH_PE, don't subtract the section VMA from the symbol
+ value.
+ * coffgen.c (fixup_symbol_value): Add abfd parameter. Change all
+ callers. If PE file, don't add section VMA.
+ (coff_write_alien_symbol): If PE file, don't add section VMA.
+ * cofflink.c (_bfd_coff_link_input_bfd): Likewise.
+ (_bfd_coff_write_global_sym): Likewise.
+ (_bfd_coff_generic_relocate_section): Likewise.
+
+ * peicode.h: Add & 0xffffffff when using ImageBase in case bfd_vma
+ is 64 bits.
+
+Wed May 21 09:58:10 1997 Nick Clifton <nickc@cygnus.com>
+
+ * cofflink.c (mark_relocs): Add new function to mark symbols which
+ are used by relocations.
+ (_bfd_coff_link_input_bfd): Add call to mark_relocs() and code to
+ suppress the skipping of symbols that have thus been marked.
+
+Tue May 20 18:45:26 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-sh.c (sh_merge_private_data): New static function.
+ (coff_bfd_merge_private_bfd_data): Define.
+
+Mon May 19 14:46:00 1997 Mark Alexander <marka@cygnus.com>
+
+ * coff-tic80.c: Remove unnecessary #ifdefs.
+ * config.bfd: Set targ_underscore to yes for tic80.
+
+Mon May 19 14:26:36 1997 Mark Alexander <marka@cygnus.com>
+
+ * coff-tic80.c (NAMES_HAVE_UNDERSCORE): Define (fixes problem
+ with unresolved external symbols in GDB).
+
+Fri May 16 10:23:03 1997 Jeffrey A Law (law@cygnus.com)
+
+ * elf-m10300.c (elf32_mn10300_relax_section): Read in all
+ the symbols associated with each BFD.
+ (mn10300_elf_relax_delete_bytes): Don't adjust the same symbol
+ more than once.
+ * elf-m10200.c: Likewise.
+ * elf32-m32r.c: Likewise.
+ * elf32-sh.c: Likewise.
+
+Fri May 16 12:10:52 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_add_object_symbols): Don't decrease the
+ alignment of a common symbol. If two symbols that look like
+ common symbols are found in two shared libraries, and the size is
+ different, use the larger size, and warn if --warn-common. If a
+ common symbol overrides a definition in a shared library, set the
+ size to the larger size, and warn if --warn-common.
+
+Thu May 15 14:31:28 1997 Nick Clifton <nickc@cygnus.com>
+
+ * cpu-arm.c (compatible): Allow default machine to be polymorphed
+ into any other machine type.
+
+ * coffcode.h (coff_set_flags): Initialise flags variable to 0.
+
+ * coff-arm.c (coff_arm_bfd_merge_private_bfd_data): When merging
+ data into an unitialised destination set its machine type as well.
+
+Thu May 15 16:40:20 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_add_object_symbols): Force ELF symbol size
+ to common symbol size. Consistently treat uninitialized symbols
+ in shared objects as common symbols.
+
+Fri May 9 10:15:27 1997 Nick Clifton <nickc@cygnus.com>
+
+ * archures.c (constants): Added new constants to identify the
+ type of the ARM architecture: bfd_mach_arm_2, bfd_mach_arm_2a,
+ bfd_mach_arm_3, bfd_mach_arm_3M, bfd_mach_arm_4 and bfd_mach_arm_4T.
+
+ * bfd-in2.h (constants): Added new constants to identify
+ the type of the ARM architecture: bfd_mach_arm_2, bfd_mach_arm_2a,
+ bfd_mach_arm_3, bfd_mach_arm_3M, bfd_mach_arm_4 and
+ bfd_mach_arm_4T. This file is auto-magically generated from the
+ archures.c file. This update is just to save work.
+
+ * coff-arm.c (coff_arm_bfd_merge_private_bfd_data,
+ coff_arm_bfd_print_private_bfd_data,
+ coff_arm_bfd_set_private_flags,
+ coff_arm_bfd_copy_private_bfd_data): Added these new functions.
+ (global): Macro redefinitions set up to use these new functions.
+
+ * coffcode.h (coff_mkobject_hook): Added call to
+ coff_arm_bfd_set_private_flags().
+ (coff_set_arch_mach_hook): Added code to set machine type based on
+ bits stored in internal flags.
+ (coff_set_flags): Added code to set the new bits in the flags
+ field based on the machine number.
+ (function definition macros): Made all function definition macros
+ conditional so that they can be overridden by target specific
+ files.
+
+ * cpu-arm.c (compatible): Added this function. (arch_info_struct):
+ Structure extended to include new types, one each for ARMv2,
+ ARMv2a, ARMv3, ARMv3M, ARMv4 and ARMv4T.
+
+ * libcoff-in.h (struct coff_tdata): Added flags field.
+
+Fri May 9 17:40:02 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * config.bfd (i[3456]86-*-gnu*): Don't include Mach support.
+
+ * config.bfd: Change #if 0 around uses of host_aout_vec to #if
+ HAVE_host_aout_vec.
+
+Mon May 5 13:57:32 1997 Mike Meissner <meissner@cygnus.com>
+
+ * coffgen.c (coff_find_nearest_line): If there are no syments,
+ just return false.
+
+Mon May 5 18:18:45 1997 Philip Blundell <pjb27@cam.ac.uk>
+
+ * config.bfd: cope with '*-*-linux-gnuaout' targets.
+
+Thu May 1 11:31:12 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * targmatch.sed: Add explicit \n characters to work around bug in
+ HP/UX 10.20 sed program.
+
+Wed Apr 30 12:27:03 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (copy_private_bfd_data): Cast csecs to avoid sign
+ extension problems.
+
+Tue Apr 22 12:06:08 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (do_maintainer_clean): Don't remove bfd-in2.h.
+
+Mon Apr 21 11:21:31 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * elf32-m68k.c: Follow the last changes in elf32-i386.c:
+ (struct elf_m68k_pcrel_relocs_copied, struct
+ elf_m68k_link_hash_entry, struct elf_m68k_link_hash_table,
+ elf_m68k_link_hash_traverse, elf_m68k_hash_table,
+ elf_m68k_link_hash_newfunc, elf_m68k_link_hash_table_create,
+ elf_m68k_discard_copies, bfd_elf32_bfd_link_hash_table_create):
+ New definitions.
+ (elf_m68k_check_relocs): If linking with -Bsymbolic, don't copy
+ PC relative relocs for a global symbol defined in a regular
+ object, and count the number of PC relative relocs copied for any
+ global symbol.
+ (elf_m68k_size_dynamic_sections): If linking with -Bsymbolic,
+ traverse with elf_m68k_discard_copies.
+
+Sat Apr 19 22:50:14 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-i386.c (elf_i386_check_relocs): Only count PC relative
+ relocs. From Jamie Lokier <jamie@rebellion.co.uk>.
+
+ * coffcode.h (coff_compute_section_file_positions): Force the
+ potential last byte in the file to be written out when
+ COFF_IMAGE_WITH_PE.
+
+Thu Apr 17 13:46:56 1997 Per Fogelstrom <pefo@openbsd.org>
+
+ * configure.host (mips*-*-openbsd*): New host.
+
+Thu Apr 17 11:10:54 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_add_object_symbols): Only subtract the
+ section VMA from the symbol value if this is a fully linked file.
+
+ * elf32-i386.c (struct elf_i386_pcrel_relocs_copied): Define.
+ (struct elf_i386_link_hash_entry): Define.
+ (struct elf_i386_link_hash_table): Define.
+ (elf_i386_link_hash_traverse): Define.
+ (elf_i386_hash_table): Define.
+ (elf_i386_link_hash_newfunc): New static function.
+ (elf_i386_link_hash_table_create): New static function.
+ (elf_i386_check_relocs): If linking with -Bsymbolic, don't copy
+ PC relative relocs for a global symbol defined in a regular
+ object, and count the number of PC relative relocs copied for any
+ global symbol.
+ (elf_i386_size_dynamic_sections): If linking with -Bsymbolic,
+ traverse with elf_i386_discard_copies.
+ (elf_i386_discard_copies): New static function.
+ (bfd_elf32_bfd_link_hash_table_create): Define.
+
+ From Gordon W. Ross <gwr@mc.com>:
+ * aoutf1.h (MY_entry_is_text_address): Define if not defined.
+ (sunos4_aout_backend): Use MY_entry_is_text_address.
+
+Wed Apr 16 12:43:32 1997 Martin Hunt <hunt@cygnus.com>
+
+ * elf32-d30v.c (elf_d30v_howto_table): Changed size of
+ R_D30V_32_NORMAL to 2 (4 bytes).
+
+Wed Apr 16 14:02:29 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ From Gordon W. Ross <gwr@mc.com>:
+ * netbsd.h (N_SHARED_LIB): Define.
+ (SEGMENT_SIZE): Don't define.
+ * m68knetbsd.c (SEGMENT_SIZE): Don't define (revert change of
+ April 11).
+ * sparcnetbsd.c (TARGET_PAGE_SIZE): Define as 0x2000.
+ (SEGMENT_SIZE): Don't define.
+
+ * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Set .rela.bss size
+ to sizeof Rela structure, not sizeof Rel structure. From Gary
+ Thomas <g.thomas@opengroup.org>.
+
+Tue Apr 15 11:50:37 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * aout-target.h (MY(callback)): If entry_is_text_address, adjust
+ whenever entry is larger than text address, but only by whole
+ pages. From Gordon W. Ross <gwr@mc.com>.
+
+ * Makefile.in (install): Depend upon installdirs. Use
+ mkinstalldirs to build $(oldincludedir).
+ (installdirs): New target.
+
+ * elflink.h (elf_link_add_object_symbols): Don't call check_relocs
+ if this is a debugging section which we are stripping.
+
+Mon Apr 14 12:39:30 1997 Richard Henderson <rth@tamu.edu>
+
+ * elf64-alpha.c (elf64_alpha_object_p): Allocate the
+ alpha-specific target data struct.
+
+Mon Apr 14 11:45:46 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ From Thomas Graichen <graichen@rzpd.de>:
+ * Makefile.in: Always use $(SHELL) when running move-if-change.
+ * configure.in: Use ${CONFIG_SHELL} when running $ac_config_sub.
+ * configure: Rebuild.
+
+Fri Apr 11 15:43:24 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elfcode.h (elf_slurp_symbol_table): Only subtract the section
+ VMA if this is an executable file or a shared object.
+
+ * targets.c (netbsd_core_vec): Declare. From Gordon W. Ross
+ <gwr@mc.com>.
+
+ * libaout.h (struct aout_backend_data): Add entry_is_text_address
+ field.
+ * aout-target.h (SEGMENT_SIZE): Define to TARGET_PAGE_SIZE at the
+ start of the file. Remove uses later on which switch using
+ ifdef.
+ (MY(callback)): Handle entry_is_text_address.
+ (MY_entry_is_text_address): Define if not defined.
+ (MY(backend_data)): Initialize new field.
+ * aoutf1.h (sunos4_aout_backend): Likewise.
+ * i386aout.c (MY(backend_data)): Likewise.
+ * i386mach3.c (MY(backend_data)): Likewise.
+ * mipsbsd.c (MY(backend_data)): Likewise.
+ * sparclynx.c (sparclynx_aout_backend): Likewise.
+ * netbsd.h (SEGMENT_SIZE): Define if not defined.
+ (MY_entry_is_text_address): Define.
+ * m68knetbsd.c (SEGMENT_SIZE): Define as 0x20000.
+
+ * xcofflink.c (bfd_xcoff_import_symbol): Handle importing a symbol
+ whose name starts with `.'.
+
+Fri Apr 11 11:57:15 1997 Niklas Hallqvist <niklas@appli.se>
+
+ * config.bfd: (i[3456]86-*-openbsd*, m68*-*-openbsd*,
+ mips*el*-*-openbsd*, mips*-*-openbsd*, ns32k-*-openbsd*,
+ powerpc-*-*bsd*, sparc-*-openbsd*): New targets.
+ * configure.in (i[3456]86-*-openbsd*, mips*-*-openbsd*,
+ m68*-*-openbsd*, ns32k-*-openbsd*, powerpc-*-*bsd*,
+ sparc-*-openbsd*): New targets.
+ * configure: Rebuild.
+
+Tue Apr 8 18:09:29 1997 Jamie Lokier <jamie@rebellion.co.uk>
+
+ * stabs.c (struct stab_section_info): New field
+ `cumulative_skips'.
+ (_bfd_link_section_stabs): Fill the above array.
+ (_bfd_stab_section_offset): Use `cumulative_skips' to
+ speed up offset calculation.
+
+Tue Apr 8 00:01:31 1997 Jeffrey A Law (law@cygnus.com)
+
+ * elf-mn10300.c (mn10300_elf_relax_section): Don't forget the
+ addend for non pc-relative relocations.
+
+ * elf-m10300.c (bfd_elf32_mn10300_reloc): Remove prototype
+ for non-existent function.
+
+ * elf-m10300.c (mn10300_elf_relax_section): New function.
+ (mn10300_elf_relax_delete_bytes): Likewise.
+ (mn10300_elf_symbol_address_p): Likewise.
+ (mn10300_elf_get_relocated_section_contents): Likewise.
+ (bfd_elf32_bfd_relax_section): Define.
+ (bfd_elf32_bfd_get_relocated_section_contents): Likewise.
+
+Mon Apr 7 16:47:09 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.host: Set SHLIB_LIBS.
+ * configure.in: Substitute SHLIB_LIBS.
+ * configure: Rebuild.
+ * Makefile.in (SHLIB_LIBS): New variable.
+ ($(SHLIB)): Use $(SHLIB_LIBS).
+
+Mon Apr 7 10:53:52 1997 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * bfd-in.h bfd-in2.h: add bfd_section_lma macro to correspond
+ with bfd_section_vma.
+
+Fri Apr 4 11:37:15 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Update file names for bfd_elf32_mn10[23]00_vec.
+ Correct CPU file names for mn10[23]00.
+ * configure: Rebuild.
+
+ * bfd.c (bfd_record_phdr): Cast count to size_t before
+ subtraction.
+
+ * coff-ppc.c (dump_toc): Add cast to avoid warning from SunOS cc.
+ * coff-rs6000.c (xcoff_read_ar_hdr): Likewise.
+ (xcoff_write_archive_contents): LIkewise.
+ * elf32-mips.c (_bfd_mips_elf_set_section_contents): Likewise.
+ (mips_elf_create_procedure_table): Likewise.
+ * peicode.h (pe_print_idata): Likewise.
+ (pe_print_edata, pe_print_pdata, pe_print_reloc): Likewise.
+ * xcofflink.c (xcoff_get_section_contents): Likewise.
+ (_bfd_xcoff_canonicalize_dynamic_symtab): Likewise.
+ (xcoff_link_add_symbols): Likewise.
+ (xcoff_link_add_symbols): Likewise.
+
+ * ppcboot.c (ppcboot_set_arch_mach): Make static.
+ (ppcboot_bfd_print_private_bfd_data): Likewise.
+
+ * elf32-mips.c (elf_mips_ctor64_howto): Set complain_on_overflow
+ to complain_overflow_signed.
+
+Thu Apr 3 11:51:54 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * VERSION: Set to 2.8.1.
+
+ * Branched binutils 2.8.
+
+ * elf32-ppc.c (ppc_elf_check_relocs): Don't check SEC_ALLOC when
+ deciding whether to copy a reloc into a shared object.
+ (ppc_elf_relocate_section): Likewise. Relocate R_PPC_RELATIVE
+ relocs in unallocated sections.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Relocate
+ R_SPARC_RELATIVE relocs in unallocated sections.
+
+Wed Apr 2 16:19:41 1997 Mike Meissner <meissner@cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_check_relocs): Undo March 26 change and
+ always create got section so that the _GLOBAL_OFFSET_TABLE_ label
+ is always created.
+
+Wed Apr 2 10:49:07 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_add_object_symbols): Let a common symbol
+ override an uninitialized symbol from a shared library with a
+ smaller size.
+
+ * elf-m10200.c: Rename from elf32-mn10200.c.
+ * elf-m10300.c: Rename from elf32-mn10300.c.
+ * cpu-m10200.c: Rename from cpu-mn10200.c
+ * cpu-m10300.c: Rename from cpu-mn10300.c
+ * Makefile.in: Update accordingly.
+
+ * elf32-mips.c (elf_mips_ctor64_howto): New static variable.
+ (elf_mips_isa): Move to earlier in file.
+ (mips_reloc_map): Remove BFD_RELOC_CTOR entry.
+ (bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_CTOR
+ specially.
+
+ * elf32-mips.c (mips16_jump_reloc): Print a warning rather than
+ calling abort.
+
+Tue Apr 1 16:18:05 1997 Klaus Kaempf <kkaempf@progis.de>
+
+ * configure.com: New file.
+ * config.h-vms: Remove file.
+ * makefile.vms: Update for new configure scheme.
+
+Mon Mar 31 23:28:39 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * libcoff-in.h (ppc_allocate_toc_section): Declare.
+ (ppc_process_before_allocation): Declare.
+ * libcoff.h: Rebuild.
+
+ * coffcode.h (coff_mkobject_hook): Declare if not a macro.
+
+Mon Mar 31 16:29:50 1997 Joel Sherrill <joel@oarcorp.com>
+
+ * config.bfd (hppa*-*-rtems*): New target, like hppa-*-*elf*.
+
+Mon Mar 31 16:11:35 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-a29k.c (coff_a29k_relocate_section): Don't use symndx as a
+ symbol index for a R_IHCONST reloc.
+
+Mon Mar 31 15:40:59 1997 Philippe De Muyter <phdm@info.ucl.ac.be>
+
+ * targmatch.sed: Do not use \(\) recursively.
+
+Fri Mar 28 14:44:08 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * m68klinux.c (MACHTYPE_OK): Define.
+ * i386linux.c (MACHTYPE_OK): Define.
+
+Fri Mar 28 11:56:15 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ From David S. Miller <davem@caip.rutgers.edu> and H.J. Lu
+ <hjl@gnu.ai.mit.edu>:
+ * sparclinux.c: New file.
+ * bfd-in.h (bfd_sparclinux_size_dynamic_sections): Declare.
+ * bfd-in2.h: Rebuild.
+ * config.bfd (sparc-*-linuxaout*, sparc-*-linux*): New targets.
+ * configure.in (sparclinux_vec): Add to list of vectors.
+ * configure: Rebuild.
+ * targets.c (sparclinux_vec): Declare.
+ (bfd_target_vector): Add sparclinux_vec.
+ * Makefile.in: Rebuild dependencies.
+ (BFD32_BACKENDS): Add sparclinux.o.
+ (BFD32_BACKENDS_CFILES): Add sparclinux.c.
+
+ * coff-mips.c (mips_ecoff_backend_data): Initialize new
+ bfd_coff_backend_data field.
+ * coff-alpha.c (alpha_ecoff_backend_data): Likewise.
+
+ * config.bfd: Add bfd_elf64_{big,little}mips_vec to targ_selvecs
+ for mips*el*-*-linux* and mips*-*-linux*. From H.J. Lu
+ <hjl@lucon.org> and Ralf Baechle <ralf@gnu.ai.mit.edu>.
+
+ * bfd.c: Include "libiberty.h".
+ (strerror): Don't declare.
+ (bfd_errmsg): Call xstrerror rather than strerror.
+
+Thu Mar 27 12:55:42 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Generate a COPY
+ reloc even if the symbol is in the .bss section.
+ * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
+ * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise.
+ * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
+
+ * coffcode.h (bfd_coff_backend_data): Add new field
+ _bfd_coff_default_section_alignment_power.
+ (bfd_coff_default_section_alignment_power): Define.
+ (bfd_coff_std_swap_table): Initialize new field.
+ * libcoff.h: Rebuild.
+ * cofflink.c (coff_link_add_symbols): Limit alignment of a common
+ symbol to the default section alignment.
+
+ * COPYING: Update FSF address.
+
+Thu Mar 27 00:45:57 1997 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * elf32-d30v.c (elf_d30v_howto_table): Fix a typo in the
+ 21-bit absolute that made it act as a relative.
+
+Wed Mar 26 14:50:20 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.c (_bfd_elf_create_linker_section): Don't set
+ bss_section and rel_section from existing sections.
+
+ * elf32-ppc.c (ppc_elf_check_relocs): Only create the got section
+ if it is needed.
+
+Tue Mar 25 22:26:56 1997 Stu Grossman (grossman@critters.cygnus.com)
+
+ * aoutx.h (some_aout_object_p): Change executable test to fix
+ problems with embedded a.out systems.
+
+Tue Mar 25 14:35:37 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * stabs.c (_bfd_stab_section_offset): New function.
+ * libbfd-in.h (_bfd_stab_section_offset): Declare.
+ * libbfd.h: Rebuild.
+ * elf32-i386.c (elf_i386_relocate_section): Adjust the offset of a
+ stab reloc.
+ * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
+ * elf32-mips.c (mips_elf_relocate_section): Likewise.
+ * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+ * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
+
+ * stabs.c (_bfd_link_section_stabs): Copy over the first header
+ symbol. Check for memory allocation failure of *psinfo.
+ (_bfd_write_section_stabs): Add psinfo parameter. Change all
+ callers. Set the value of the header symbol.
+ * libbfd-in.h (_bfd_write_section_stabs): Update declaration.
+ * libbfd.h: Rebuild.
+
+Mon Mar 24 20:07:29 1997 Fred Fish <fnf@cygnus.com>
+
+ * coff-tic80.c (tic80_howto_table): Add R_ABS entry.
+ (rtype2howto): Handle R_ABS reloc type. Also abort on unhandled
+ reloc types, rather than silently failing to generate an output file.
+
+Mon Mar 24 13:41:00 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * targmatch.sed: Use the hold space to put the #ifdef around the
+ the string constant.
+ * targets.c (UNSUPPORTED_TARGET): Don't define.
+ (find_target): Don't check for UNSUPPORTED_TARGET.
+ (bfd_set_default_target): Don't try to optimize by checking for
+ default.
+
+ * Makefile.in: Rebuild dependencies.
+ (ALL_MACHINES_CFILES): Add cpu-m32r.c.
+ (BFD32_BACKENDS_CFILES): Add elf32-m32r.c.
+ (elf32-m32r.o): Remove explicit target.
+
+ * config.bfd: Don't set targ_underscore for i[3456]86-*-gnu* or
+ i[3456]86-*-linux*.
+
+ * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Don't
+ count section symbols for sections that were created by the
+ linker, or are not allocatable or not loadable.
+ (elf32_sparc_finish_dynamic_sections): Output output section
+ symbols for section for which we made space for them.
+
+Fri Mar 21 13:08:26 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-sparc.c (elf32_sparc_size_dynamic_sections): If there is
+ no .rela.plt section, don't output a DT_PLTGOT dynamic entry.
+
+Fri Mar 21 12:36:46 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * elf32-m32r.c (m32r_elf_howto_table): Use special function for LO16.
+ (m32r_hi16_list): New static local.
+ (m32r_elf_hi16_reloc): Don't perform reloc, just queue it up.
+ (m32r_elf_do_hi16_reloc): Delete.
+ (m32r_elf_relocate_hi16): New function.
+ (m32r_elf_lo16_reloc): New function.
+ (m32r_elf_relocate_section): For HI16 relocs, scan for corresponding
+ LO16 reloc.
+
+ Mon Mar 10 16:03:31 1997 Doug Evans <dje@seba.cygnus.com>
+
+ * elf32-m32r.c (m32r_elf_create_linker_section): Delete.
+ (m32r_elf_add_symbol_hook): Rewrite _SDA_BASE_ support.
+ (m32r_elf_final_sda_base): New function.
+ (m32r_elf_relocate_section): Rewrite sdata support.
+ (m32r_elf_finish_dynamic_sections): Delete.
+
+Thu Mar 20 12:39:02 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ Based on patches from Philippe De Muyter <phdm@info.ucl.ac.be>.
+ * coff-svm68k.c: New file. Just defines some macros and includes
+ coff-m68k.c.
+ * coff-m68k.c: Add functions to handle common addends, moved in
+ from cf-m68klynx.c. Control them using COFF_COMMON_ADDEND macro.
+ Control whether relocs are visible using STATIC_RELOCS.
+ * cf-m68klynx.c: Simplify greatly: just define macros to control
+ coff-m68k.c.
+ * coff-aux.c: Likewise. Just leave add_one_symbol routine.
+ * targets. (m68ksysvcoff_vec): Declare.
+ (bfd_target_vector): Add m68ksysvcoff_vec.
+ * config.bfd (m68*-motorola-sysv*): New target.
+ * configure.in (m68ksysvcoff_vec): New vector.
+ * configure: Rebuild.
+ * Makefile.in: Rebuild dependencies.
+ (BFD32_BACKENDS): Add coff-svm68k.o.
+ (BFD32_BACKENDS_CFILES): Add coff-svm68k.c.
+
+ * binary.c (binary_set_section_contents): Don't get misled if the
+ first section is not loadable. From Matthew L. Martin
+ <mlm@xedia.com>.
+
+ * elflink.h (elf_bfd_final_link): Set the value of a section
+ symbol to the section address unless doing a relocateable link.
+
+Tue Mar 18 23:03:17 1997 Richard Henderson <rth@tamu.edu>
+
+ * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't create
+ .plt entry if we've taken the function's address.
+ (elf64_alpha_merge_gots): Merge collected flags info as well.
+
+Tue Mar 18 22:40:09 1997 H.J. Lu <hjl@lucon.org>
+
+ * Many files: Add function prototypes.
+ * cpu-m68k.c (bfd_default_scan_num_mach): Don't declare.
+ * ecofflink.c: Include "libcoff.h" and "libecoff.h".
+ * elf32-ppc.c (ppc_elf_fake_sections): Make static.
+ * opncls.c (bfd_openstreamr): Change stream parameter to PTR.
+ * peicode.h: Change several void * parameters to PTR.
+ * srec.c (srec_get_symbol_info): Make static.
+ * syms.c (bfd_symbol_is_absolute): Remove.
+ * Makefile.in: Rebuild dependencies.
+
+Tue Mar 18 12:58:08 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-m32r.c (m32r_elf_is_local_label_name): Remove.
+ (bfd_elf32_bfd_is_local_label): Don't define.
+
+ * xcofflink.c (_bfd_xcoff_bfd_final_link): Call bfd_malloc rather
+ than malloc.
+
+Mon Mar 17 11:32:53 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * bfd-in.h: Don't include obstack.h.
+ (struct bfd_hash_table): Change memory field to PTR.
+ * bfd.c (struct _bfd): Change memory field to PTR.
+ * bfd-in2.h: Rebuild.
+ * libbfd-in.h (bfd_release): Declare as function, don't define as
+ macro.
+ * libbfd.h: Rebuild.
+ * opncls.c: Include "objalloc.h" rather than "obstack.h". Use
+ objalloc routines rather than obstack routines.
+ (obstack_chunk_alloc, obstack_chunk_free): Don't define.
+ (getpagesize): Don't define.
+ (_bfd_new_bfd): Don't set _bfd_chunksize.
+ (bfd_openr): Free new bfd and objalloc on failure.
+ (bfd_fdopenr, bfd_openstreamr, bfd_openw): Likewise.
+ (bfd_alloc_size): Remove.
+ (bfd_release): New function.
+ * hash.c: Include "objalloc.h" rather than "obstack.h". Use
+ objalloc routines rather than obstack routines.
+ (obstack_chunk_alloc, obstack_chunk_free): Don't define.
+ * ecofflink.c: Include "objalloc.h" rather than "obstack.h". Use
+ objalloc routines rather than obstack routines.
+ (obstack_chunk_alloc, obstack_chunk_free): Don't define.
+ (struct accumulate): Change memory to struct objalloc *.
+ * liboasys.h (oasys_data_type): Remove oasys_obstack field.
+ * dep-in.sed: Don't remove obstack.h from dependency list.
+ * Makefile.in: Rebuild dependencies.
+ (BFD_H_DEPS): Remove obstack.h.
+ (install): Don't install obstack.h.
+ * Many files: Don't include "obstack.h".
+ * VERSION: Bump.
+
+ * opncls.c (bfd_alloc_grow, bfd_alloc_finish): Remove.
+ * libbfd-in.h (bfd_alloc_grow, bfd_alloc_finish): Don't declare.
+ * libbfd.h: Rebuild.
+ * ieee.c (ieee_archive_p): Rewrite to not use bfd_alloc_grow.
+ * sunos.c (sunos_add_dynamic_symbols): Likewise.
+ * srec.c (srec_scan): Rewrite to not use obstack_1grow.
+
+ * opncls.c (bfd_alloc): Rename from bfd_alloc_by_size_t. Remove
+ old version of bfd_alloc.
+ * libbfd-in.h (bfd_alloc_by_size_t): Don't declare.
+ * libbfd.h: Rebuild.
+ * Several files: Call bfd_alloc rather than bfd_alloc_by_size_t.
+
+Sat Mar 15 15:24:18 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-mips.c (mips_elf_is_local_label_name): Accept the generic
+ ELF local label syntax as well.
+
+Sat Mar 15 10:16:42 1997 Fred Fish <fnf@cygnus.com>
+
+ * config.bfd (powerpc-*-beos*): New target.
+ * configure.in (powerpc-*-beos*): Add case that explicitly
+ does not set COREFILE for now. A future BeOS version is
+ expected to support core files.
+ * configure: Regenerate with autoconf.
+
+Fri Mar 14 16:43:22 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-mips.c (mips_elf_check_relocs): Give an error if CALL16 is
+ seen with a local symbol, rather than crashing.
+
+ * elfcode.h (elf_slurp_symbol_table): Don't try to read the
+ version symbols if there aren't any.
+
+Thu Mar 13 16:38:30 1997 Fred Fish <fnf@cygnus.com>
+
+ * coff-tic80.c (coff_rtype_to_howto): Define
+ (coff_tic80_rtype_to_howto): Clone generic coff version and
+ add code to handle the funky TI "internal relocations".
+
+Thu Mar 13 14:08:53 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_add_object_symbols): Don't warn about type
+ or size changes because of a weak symbol.
+
+ * cisco-core.c (SIGEMT): Define if not defined.
+
+Wed Mar 12 21:36:05 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_add_object_symbols): Use extsymoff when
+ setting ever. Sanity check the version number. Sort out copying
+ flags and other information when adding an indirect symbol.
+ (NAME(bfd_elf,size_dynamic_sections)): Preserve any dynamic
+ symbols added by the backend. Clear the entire contents of the
+ versym section.
+ (elf_export_symbol): Ignore indirect symbols.
+ (elf_link_output_extsym): Accept a section without an owner in an
+ assert.
+ * elfcode.h (elf_slurp_symbol_table): Add a sanity check on the
+ version count. Correct the allocation of x_versymp.
+
+ * elf32-mips.c (mips_elf_add_symbol_hook): Don't set the owner of
+ the magic sections used for SHN_MIPS_TEXT and SHN_MIPS_DATA.
+ Don't return bfd_und_section_ptr when info->shared.
+ (mips_elf_final_link): Set the alignment of .rtproc to 4, not 12.
+ (mips_elf_create_dynamic_sections): Correct type: ^= for &=.
+ (mips_elf_check_relocs): Resolve an indirect symbol in
+ sym_hashes.
+ (mips_elf_finish_dynamic_symbol): Don't change SHN_ABS into
+ SHN_MIPS_TEXT or SHN_MIPS_DATA.
+
+ * elf.c (bfd_elf_print_symbol): Tweak version output slightly.
+
+Tue Mar 11 01:38:36 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ From Eric Youngdale <eric@andante.jic.com>:
+ * elf-bfd.h (ELF_LINK_FORCED_LOCAL): Define.
+ * elf.c (bfd_elf_print_symbol): Correct errors in last change.
+ * elflink.h (elf_link_add_object_symbols): Handle cases in which a
+ versioned symbol appears in both a regular and a shared object.
+ (elf_link_assign_sym_version): Set ELF_LINK_FORCED_LOCAL when
+ appropriate. Improve error message.
+ (struct elf_outext_info): Rename from elf_finfo_failed. Change
+ all uses. Add localsyms field.
+ (elf_bfd_final_link): When generating a shared library, call
+ elf_link_output_extsym to output all local symbols.
+ (elf_link_output_extsym): Handle symbols which were forced to
+ become local.
+
+Sun Mar 9 23:08:49 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ From Eric Youngdale <eric@andante.jic.com>:
+ * elf-bfd.h (elf_symbol_type): Add version field.
+ * elfcode.h (elf_slurp_symbol_table): Set version field.
+ * elflink.h (elf_link_add_object_symbols): When creating an
+ indirect symbol for a default version symbol, set DEF_DYNAMIC if
+ appropriate. Set up an indirection from the nondefault version of
+ the symbol as well.
+ (NAME(bfd_elf,size_dynamic_sections)): Call
+ elf_link_assign_sym_version before checking whether there are any
+ versions. Always record the version name as a dynamic symbol.
+ Initialize counters.
+ (elf_link_assign_sym_version): After finding a version, see if a
+ symbol should be forced to local scope. Create a new version
+ definition if appropriate.
+ (elf_link_output_extsym): Correct indirect symbol handling.
+ * elf.c (bfd_elf_print_symbol): Print version information.
+ (bfd_section_from_shdr): Turn version sections into BFD sections.
+ (elf_fake_sections): Only copy cverdefs and cverrefs into sh_info
+ if sh_info is not already set.
+ (_bfd_elf_copy_private_section_data): Copy sh_info for version
+ sections.
+ * elflink.c (_bfd_elf_link_record_dynamic_symbol): Tell
+ _bfd_stringtab_add to copy the name into permanent memory if
+ appropriate.
+
+Fri Mar 7 11:55:31 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
+
+ * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Fully parenthesize.
+
+Fri Mar 7 10:37:30 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffcode.h (bfd_coff_backend_data): Change
+ _bfd_coff_compute_section_file_positions to return a boolean
+ value. Change all callers.
+ (coff_compute_section_file_positions): Change return type to
+ boolean. If the size of the last section changed, then output a
+ zero byte at the end of the file.
+ * libcoff.h: Rebuild.
+
+ * xcofflink.c (_bfd_xcoff_bfd_final_link): Always allocate space
+ for at least 6 output symbols.
+ (xcoff_write_global_symbol): When emitting TOC entry relocs, also
+ emit a TC csect to represent the space they take up. For an XO
+ symbol, just emit a reference, not a csect.
+
+ * Makefile.in ($(SHLINK)): Just use ln -s, not ln -sf, since
+ Solaris doesn't like the combined options, and the -f is
+ unnecessary.
+ (stamp-tshlink, install): Likewise.
+
+ * elf32-mips.c (mips_elf_relocate_section): Correct R_MIPS16_26
+ handling when little endian.
+
+Thu Mar 6 13:51:51 1997 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-mn10300.c (mn10300_elf_final_link_relocate): New function.
+ (mn10300_elf_relocate_section): Likewise.
+ (elf_backend_relocate_section): Define.
+
+ * elf32-mn10300.c (reloc_type): Remove PCREL{8,16,32}_{1,2}BYTE
+ relocs. Replace them with generic PCREL_{8,16,32} relocs.
+ (elf32_mn10300_howto_table): Likewise.
+ (elf32_mn10300_reloc_map): Likewise.
+ (bfd_elf32_mn10300_reloc): Delete unused function.
+
+Thu Mar 6 12:19:59 1997 Fred Fish <fnf@cygnus.com>
+
+ * coff-tic80.c (rtype2howto): If passed a relocation type we don't
+ understand, just set the howto field to NULL, and the caller will
+ print an appropriate error message.
+ * coffcode.h (coff_slurp_reloc_table): Pull duplicate declarations and
+ code fragment out of both legs of #ifdef RELOC_PROCESSING ... #endif
+ block. Use NULL for initializations of "ptr" rather than bare 0.
+ * coff-h8300.c: Fix typo in comment.
+ * coff-h8500.c: Ditto.
+ * coff-w65.c: Ditto
+ * coff-z8k.c: Ditto.
+
+Wed Mar 5 13:59:09 1997 Doug Evans <dje@seba.cygnus.com>
+
+ * elf32-m32r.c (m32r_elf_do_10_pcrel_reloc): Fix overflow calc.
+ (m32r_elf_relax_section, m32r_elf_relax_delete_bytes,
+ m32r_elf_get_relocated_section_contents): First pass at relax support.
+
+Mon Mar 3 13:27:09 1997 Ulrich Drepper <drepper@rtl.cygnus.com>
+
+ * elflink.h (elf_link_add_object_symbols): Use correct sh_size
+ entry for reading verdef records.
+ Use correct braces for computing increments of extverdaux and
+ exteverdef record pointers.
+
+Sun Mar 2 22:47:54 1997 Fred Fish <fnf@cygnus.com>
+
+ * coff-tic80.c (COFF_DEFAULT_SECTION_ALIGNMENT_POWER): Set this to 2
+ instead of 4.
+
+Sun Mar 2 16:25:35 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_find_version_dependencies): Check that
+ DEF_REGULAR is not set as well as checking that DEF_DYNAMIC is
+ set.
+
+Fri Feb 28 16:52:40 1997 Fred Fish <fnf@cygnus.com>
+
+ * coffcode.h (coff_set_flags): Add case for TIC80_ARCH_MAGIC.
+
+Fri Feb 28 15:06:45 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * targets.c (bfd_default_vector): Make non-const.
+ (find_target): New static function, broken out of
+ bfd_find_target.
+ (bfd_set_default_target): New function.
+ (bfd_find_target): Call find_target. When defaulting, use
+ bfd_default_vector[0] if it is not NULL.
+ * libbfd-in.h (bfd_default_vector): Adjust declaration.
+ * bfd-in2.h, libbfd.h: Rebuild.
+
+ * syms.c (bfd_is_local_label): Return false if the symbol has no
+ name.
+ * coff-i960.c (coff_i960_is_local_label_name): New function.
+ (coff_bfd_is_local_label_name): Define.
+ * coff-m68k.c (m68k_coff_is_local_label_name): New function.
+ (coff_bfd_is_local_label_name): Define.
+ * coff-rs6000.c (xcoff_is_local_label_name): New function.
+ (coff_bfd_is_local_label_name): Define.
+ * elf.c (_bfd_elf_is_local_label_name): Treat symbols beginning
+ with .. or _.L_ as local.
+ * elf32-i386.c (elf_i386_is_local_label_name): New function.
+ (bfd_elf32_bfd_is_local_label_name): Define.
+ * evax-alpha.c (evax_bfd_is_local_label_name): Treat symbols
+ beginning with $ as local.
+
+Thu Feb 27 18:36:23 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * aoutx.h (aout_link_write_symbols): Use bfd_is_local_label_name
+ rather than comparing against info->lprefix.
+ * cofflink.c (_bfd_coff_link_input_bfd): Likewise.
+ * elflink.h (elf_link_input_bfd): Likewise.
+ * linker.c (_bfd_generic_link_output_symbols): Likewise.
+ * xcofflink.c (xcoff_link_input_bfd): Likewise.
+
+ * elfxx-target.h (bfd_elfNN_bfd_is_local_label_name): Define as
+ _bfd_elf_is_local_label_name if not already defined.
+ * elf.c (_bfd_elf_is_local_label_name): New function.
+ * elf-bfd.h (_bfd_elf_is_local_label_name): Declare.
+
+ * coff-m88k.c (coff_bfd_is_local_label_name): Define.
+ (m88k_is_local_label_name): New static function.
+
+ * coffcode.h (coff_bfd_is_local_label_name): Define as
+ _bfd_coff_is_local_label_name if not already defined.
+ * coffgen.c (_bfd_coff_is_local_label_name): New function.
+ * libcoff-in.h (_bfd_coff_is_local_label_name): Declare.
+ * libcoff.h: Rebuild.
+
+ * targets.c (BFD_JUMP_TABLE_SYMBOLS): Change _bfd_is_local_label
+ to _bfd_is_local_label_name.
+ (bfd_target): Likewise.
+ * syms.c (bfd_is_local_label): Define as function, not macro.
+ (bfd_is_local_name): Define.
+ * libbfd.c (bfd_generic_is_local_label_name): Rename from
+ bfd_generic_is_local_label, and take a string rather than a
+ symbol.
+ * libbfd-in.h (_bfd_nosymbols_bfd_is_local_label): Don't define.
+ (_bfd_nosymbols_bfd_is_local_label_name): Define.
+ (bfd_generic_is_local_label): Don't declare.
+ (bfd_generic_is_local_label_name): Declare.
+ * bfd-in2.h, libbfd.h: Rebuild.
+ * All backends: Change local_label to local_label_name.
+
+ * elf32-mips.c (struct mips_got_info): Add assigned_gotno field.
+ (mips_elf_relocate_got_local): Change return type to boolean.
+ Don't assume that the first zero entry is unassigned; instead, use
+ assigned_gotno.
+ (mips_elf_relocate_section): Check return value of
+ mips_elf_relocate_got_local.
+ (mips_elf_create_got_section): Initialize assigned_gotno field.
+
+Wed Feb 26 15:19:51 1997 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * elf32-d30v.c (bfd_elf_d30v_reloc): Add code to do 32-bit
+ relocations.
+
+Wed Feb 26 13:33:03 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_input_bfd): Don't skip symbols from sections
+ that have no contents merely because linker_mark is not set.
+
+Tue Feb 25 18:51:35 1997 Stan Shebs <shebs@andros.cygnus.com>
+
+ * config.bfd (mips*-*-lnews*): New target.
+ * coff-mips.c (mips_relocate_section): Make assert compare
+ content byteorder instead of header byteorder.
+ (ecoff_biglittle_vec): New BFD, big-endian headers, little-endian
+ data.
+ * targets.c (bfd_target_vector): Add ecoff_biglittle_vec.
+ * configure.in (ecoff_biglittle_vec): Add case.
+ * configure: Update.
+
+Tue Feb 25 00:32:49 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (elf_fake_sections): Use SHT_NOTE for any section whose
+ name begins with ".note".
+ (map_sections_to_segments): Add a PT_NOTE segment for any loadable
+ section whose name begins with ".note".
+ (get_program_header_size): Corresponding change.
+
+ * elf32-mips.c (mips_elf_relocate_section): Check for misaligned
+ jal and for jal overflow.
+
+Mon Feb 24 17:53:14 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ From Eric Youngdale <eric@andante.jic.com>:
+ * elflink.h (elf_link_add_archive_symbols): If a default symbol is
+ not found, try looking it up again without the version name.
+ (elf_link_add_object_symbols): Always link against the dynamic
+ symbol table of a dynamic object. When linking against a dynamic
+ object, include version strings in symbol names, and set up
+ version information. Add indirect symbols for default versions.
+ (elf_link_create_dynamic_sections): Add special version sections.
+ (struct elf_assign_sym_version_info): Define.
+ (struct elf_find_verdep_info): Define.
+ (NAME(bfd_elf,size_dynamic_sections)): Add verdefs parameter. Set
+ up version sections.
+ (elf_adjust_dynamic_symbol): Ignore indirect symbols.
+ (elf_link_find_version_dependencies): New static function.
+ (elf_link_assign_sym_version): New static function.
+ (elf_link_renumber_dynsyms): New static function.
+ (struct elf_final_link_info): Add symver_sec field.
+ (elf_bfd_final_link): Initialize finfo.symver_sec. Don't count
+ local symbols of a dynamic object. Handle DT_VER* constants.
+ (elf_link_output_extsym): Simplify BFD_ASSERT checking for a
+ dynamic object. Skip indirect symbols from ELF objects. Remove
+ the version name before choosing a hash bucket. Write out the
+ version information if appropriate.
+ (elf_link_input_bfd): Check for DYNAMIC, not ET_DYN.
+ * bfd-in.h (bfd_elf32_size_dynamic_sections): Update declaration.
+ (bfd_elf64_size_dynamic_sections): Likewise.
+ * bfd-in2.h: Rebuild.
+ * elf-bfd.h (struct elf_link_hash_entry): Add verinfo field.
+ Change elf_link_hash_flags to unsigned short.
+ (ELF_LINK_HIDDEN): Define.
+ (struct elf_obj_tdata): Add fields dynversym_hdr, dynverref_hdr,
+ dynverdef_hdr, dynversym_section, dynverdef_section,
+ dynverref_section, cverdefs, cverrefs, verdef, verref.
+ (elf_dynversym, elf_dynverdef, elf_dynverref): Define.
+ (_bfd_elf_swap_verdef_in, _bfd_elf_swap_verdef_out): Declare.
+ (_bfd_elf_swap_verdaux_in, _bfd_elf_swap_verdaux_out): Declare.
+ (_bfd_elf_swap_verneed_in, _bfd_elf_swap_verneed_out): Declare.
+ (_bfd_elf_swap_vernaux_in, _bfd_elf_swap_vernaux_out): Declare.
+ (_bfd_elf_swap_versym_in, _bfd_elf_swap_versym_out): Declare.
+ (_bfd_elf_slurp_version_tables): Declare.
+ * elf.c (_bfd_elf_swap_verdef_in): New function.
+ (_bfd_elf_swap_verdef_out): Likewise.
+ (_bfd_elf_swap_verdaux_in, _bfd_elf_swap_verdaux_out): Likewise.
+ (_bfd_elf_swap_verneed_in, _bfd_elf_swap_verneed_out): Likewise.
+ (_bfd_elf_swap_vernaux_in, _bfd_elf_swap_vernaux_out): Likewise.
+ (_bfd_elf_swap_versym_in, _bfd_elf_swap_versym_out): Likewise.
+ (_bfd_elf_print_private_bfd_data): Add DT_VER* constants. Print
+ version information if there is any.
+ (_bfd_elf_link_hash_newfunc): Initialize verinfo field.
+ (bfd_section_from_shdr): Handle SHT_GNU_ver* section types.
+ (elf_fake_sections): Handle .gnu.version* section names.
+ (assign_section_numbers): Handle SHT_GNU_ver* section types.
+ (_bfd_elf_slurp_version_tables): New function.
+ * elflink.c (_bfd_elf_link_record_dynamic_symbol): Don't include
+ version name in string entered in dynamic hash table.
+ * elfcode.h: Include fnmatch.h.
+ * elf32-i386.c (elf_i386_relocate_section): Handle a dynamic
+ symbol which was forced to become local.
+ * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
+ * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+ * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise.
+
+Fri Feb 21 16:15:18 1997 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-mn10200.c (mn10200_elf_final_link_relocate): Simplify
+ somewhat.
+ (mn10200_elf_relax_section): Correctly compute a symbol's value
+ when the symbol is local, but not in the same section as we are
+ relaxing. Implement abs24 -> abs16, imm24 -> imm16 and d24 -> d16
+ relaxing.
+
+Fri Feb 21 13:55:14 1997 Doug Evans <dje@seba.cygnus.com>
+
+ * elf32-m32r.c: Rewrite to use ELF backend linker.
+ Store lower 16 bits of addend in R_M32R_HI16_[SU]LO insns.
+ Add small data area support (R_M32R_SDA16).
+ * reloc.c: Document BFD_RELOC_M32R_SDA16.
+ * bfd-in2.h,libbfd.h: Regenerated.
+
+Thu Feb 20 23:50:31 1997 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-mn10200.c (mn10200_elf_relax_section): New function.
+ (mn10200_elf_relax_delete_bytes): Likewise.
+ (mn10200_elf_symbol_address_p): Likewise.
+ (mn10200_elf_get_relocated_section_contents): Likewise.
+ (bfd_elf32_bfd_relax_section): Define.
+ (bfd_elf32_bfd_get_relocated_section_contents): Likewise.
+
+ * elf32-mn10200.c (mn10200_elf_final_link_relocate): New function.
+ (mn10200_elf_relocate_section): Likewise.
+ (elf_backend_relocate_section): Define.
+
+Tue Feb 18 17:22:59 1997 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * Makefile.in, archures.c, config.bfd, configure.in, elf.c,
+ reloc.c, targets.c: New target, elf-*-D30V.
+
+ * bfd-in2.h, configure, libbfd.h: Rebuilt.
+
+ * cpu-d30v.c, elf32-d30v.c: New files.
+
+Tue Feb 18 15:31:48 1997 Fred Fish <fnf@cygnus.com>
+
+ * reloc.c (struct reloc_howto_struct): Fix typo in comment.
+ * bfd-in2.h: Regenerated.
+ * coff-tic80.c (RTYPE2HOWTO): Replace abort with real function.
+ (rtype2howto): Add function.
+ (tic80_howto_table): Add.
+
+Tue Feb 18 11:41:00 1997 Dawn Perchik <dawn@cygnus.com>
+
+ * sysdep.h: Don't define errno in MSVC if error.h is included.
+
+Tue Feb 18 10:04:13 1997 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-v850.c (v850_elf_relocate_section): Make sure r_symndx
+ is initialized before it is used.
+
+Mon Feb 17 11:28:40 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * hp300hpux.c (convert_sym_type): Don't convert a secondary common
+ symbol into a weak undefined symbol; leave it as a common symbol.
+
+Fri Feb 14 19:08:03 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_add_object_symbols): Don't issue a warning
+ about a symbol defined in a dynamic object if it has already been
+ defined in a regular object.
+
+Thu Feb 13 20:53:22 1997 Klaus Kaempf (kkaempf@progis.de)
+
+ * makefile.vms: Add gcc flags to allow compiling with current gcc
+ snapshot
+ (targmatch.h): New dependency.
+
+ * reloc.c (BFD_RELOC_ALPHA_CODEADDR): New relocation for
+ openVMS/Alpha.
+ * evax.h (ALPHA_R_CODEADDR): New relocation.
+ * evax-alpha.c (ALPHA_R_CODEADDR): 64 bit procedure relocation for
+ openVMS/Alpha.
+ * evax-etir.c (ALPHA_R_CODEADDR): Output object code for this
+ relocation.
+ * bfd-in2.h, libbfd.h: Rebuild.
+
+ Restrict symbol length to 64 bytes, case preserving:
+ * evax-emh.c (_bfd_evax_write_emh): Remove case hacking.
+ * evax-misc.c (_bfd_evax_case_hack_symbol): Remove.
+ (_bfd_evax_length_hash_symbol): Added.
+ * evax-etir.c (_bfd_evax_write_etir): Call
+ _bfd_evax_length_hash_symbol before output of symbol.
+ * evax-egsd.c (_bfd_evax_write_egsd): Likewise.
+ * evax.h (flag_hash_long_names, flag_show_after_trunc): Remove.
+
+ * evax-emh.c: Output filename to object file without path.
+
+ * evax-egsd.c: New sections for local and global commons.
+
+ * evax-alpha.c, evax-emh.c, evax-egsd.c, evax-etir.c,
+ evax-misc.c, evax.h: Remove 8 bit characters from copyright
+ notices. Replace AXP with Alpha.
+
+Wed Feb 12 18:10:30 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * sunos.c (sunos_create_dynamic_sections): We need the dynamic
+ sections if we are creating a shared library.
+
+Tue Feb 11 15:45:43 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * configure.host (i386-windows): Don't set host64=true.
+
+Tue Feb 11 15:27:32 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-mips.c (reloc_type): Add R_MIPS16_GPREL.
+ (elf_mips16_gprel_howto): New static variable.
+ (mips16_gprel_reloc): New static function.
+ (bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS16_GPREL.
+ (mips_info_to_howto_rel): Handle R_MIPS16_GPREL.
+ (mips_elf_relocate_section): Handle R_MIPS16_GPREL.
+ * reloc.c (BFD_RELOC_MIPS16_GPREL): Define.
+ * bfd-in2.h, libbfd.h: Rebuild.
+
+Mon Feb 10 23:25:00 1997 Doug Evans <dje@seba.cygnus.com>
+
+ * elf32-m32r.c (elf_m32r_howto_table): Change partial_inplace to true
+ for R_M32R_{16,32,24,HI16_ULO,HI16_SLO,LO16}.
+
+Fri Feb 7 12:39:11 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_input_bfd): If we've discarded a section,
+ the output section will be the absolute section; don't print an
+ assertion message for that case when doing a relocateable link.
+
+Thu Feb 6 16:55:43 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-mips.c (FN_STUB, CALL_STUB, CALL_FP_STUB): Define.
+ (struct mips_elf_link_hash_entry): Add new fields fn_stub,
+ need_fn_sub, call_stub, and call_fp_stub.
+ (struct mips_elf_link_hash_table): Add field mips16_stubs_seen.
+ (mips_elf_link_hash_newfunc): Initialize new fields.
+ (mips_elf_link_hash_table_create): Likewise.
+ (mips_elf_relocate_section): Redirect relocations to use mips16
+ stubs when appropriate.
+ (mips_elf_check_relocs): Attach stub sections to the appropriate
+ symbol. Set need_fn_stub when appropriate.
+ (mips_elf_always_size_sections): New static function.
+ (mips_elf_check_mips16_stubs): New static function.
+ (elf_backend_always_size_sections): Define.
+ * elf-bfd.h (struct elf_obj_tdata): Add local_stubs field.
+
+ * elflink.h (elf_link_input_bfd): Discard local symbols that are
+ attached to sections which are not being included in the link.
+
+Wed Feb 5 13:20:17 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * cofflink.c (_bfd_coff_generic_relocate_section): Ignore the
+ symbol value when computing the addend for a pc_relative
+ pcrel_offset reloc.
+
+Mon Feb 3 11:54:06 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * cofflink.c (_bfd_coff_generic_relocate_section): If doing a
+ relocateable link, just skip pc_relative pcrel_offset relocs.
+ * coff-arm.c (coff_arm_rtype_to_howto): Return a different howto
+ structure for an ARM26 reloc which can be resolved.
+ (coff_arm_adjust_symndx): Only convert ARM26 to ARM26D if the
+ reloc can be resolved.
+
+ * coff-h8300.c (h8300_reloc16_extra_cases): Correct off by one
+ error in overflow check for R_RELBYTE.
+
+Fri Jan 31 14:07:27 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * ieee.c (ieee_slurp_section_data): Pick up the start address.
+ From Mark Rasin <mark.rasin@telrad.co.il>.
+
+ * aoutx.h (aout_link_write_symbols): Don't apply discard_l to
+ debugging symbols.
+
+Wed Jan 29 00:00:49 1997 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-mn10200.c (reloc_type): Add 16bit pc-relative reloc.
+ (elf_mn10200_howto_table): Likewise.
+ (mn10200_reloc_map): Likewise.
+
+Mon Jan 27 12:07:35 1997 Doug Evans <dje@seba.cygnus.com>
+
+ * reloc.c: Add relocs BFD_RELOC_M32R_{HI16_[US]LO,LO16}.
+ * bfd-in2.h, libbfd.h: Regenerated.
+ * elf32-m32r.c: Add support for them.
+
+Mon Jan 27 12:25:02 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * aout-arm.c (MY_swap_std_reloc_in): Remove unused r_length.
+ * elf32-ppc.c (ppc_elf_check_relocs): Remove unused plt.
+ * elf32-v850.c (v850_elf_final_link_relocate): Remove used
+ r_format and r_pcrel. Always return a value.
+ * riscix.c (MY_final_link_callback): Define to dummy value.
+
+ * elf32-i386.c (elf_i386_size_dynamic_sections): When checking for
+ relocations against the text segment, look up the output name of
+ the reloc section.
+ * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise.
+ * elf32-mips.c (mips_elf_size_dynamic_sections): Likewise.
+ * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
+ * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise.
+ * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Likewise.
+
+Wed Jan 22 15:40:28 1997 Fred Fish <fnf@cygnus.com>
+
+ * coff-tic80.c (tic80coff_vec): Use correct data put/get
+ routines for little endian data.
+ * coffcode.h (coff_write_object_contents): Set magic to
+ TIC80_ARCH_MAGIC for TIc80.
+
+Tue Jan 21 12:32:43 1997 Fred Fish <fnf@cygnus.com>
+
+ * coff-tic80.c (tic80coff_vec): Change to little endian data
+ as the default.
+
+Thu Jan 16 17:45:57 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Change type of
+ auxiliary_filters parameter to be const char * const *. Accept a
+ NULL terminated array.
+ * bfd-in.h (bfd_elf32_size_dynamic_sections): Update declaration.
+ (bfd_elf32_size_dynamic_sections): Update declaration.
+ * bfd-in2.h: Rebuild.
+
+Wed Jan 15 11:21:32 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Treat a
+ NOTYPE symbol in a text section as a FUNC symbol.
+
+ * coffcode.h (coff_compute_section_file_positions): Force
+ relocbase to be aligned to COFF_DEFAULT_SECTION_ALIGNMENT_POWER.
+
+Tue Jan 14 08:46:33 1997 Doug Evans <dje@canuck.cygnus.com>
+
+ * libaout.h (machine_type): Reserve several values for sparclet.
+
+Mon Jan 13 22:39:08 1997 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * config.bfd (tic80-*-*): Don't require 'coff'.
+
+Mon Jan 13 19:36:25 1997 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-v850.c (v850_elf_howto_table): Set the special_function
+ table to v850_elf_reloc for all non-standard relocations.
+ (v850_elf_check_relocs): Add check for h being non-null.
+ (v850_elf_reloc): Add R_V850_ZDA_OFFSET support. Use switch
+ statement instead of multiple ifs.
+ (v850_elf_relocate_section): Fix up error message, don't just call
+ abort.
+
+Mon Jan 6 13:28:35 1997 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-mn10200.c (elf_mn10200_howto): Don't ever set partial-inplace.
+ Use bfd_elf_generic_reloc as special function for all relocs.
+ (bfd_elf32_mn10200_reloc): Remove unnecessary function.
+
+ * elf32-mn10200.c (elf_mn10200_howto): Set pcrel_offset for
+ 24bit pc-relative reloc.
+
+Fri Jan 3 16:33:00 1997 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (coff-tic80.o): Add coffcode.h to dependency list.
+ * coff-tic80.c (tic80coff_vec): Data byte order is big endian and
+ header byte order is little endian. Use correct bfd_get and
+ bfd_put routines for little endian headers.
+ * coffcode.h (coff_set_arch_mach_hook): Set arch to
+ bfd_arch_tic80 for TIC80_ARCH_MAGIC number.
+
+Fri Jan 3 16:54:08 1997 Jeffrey A Law (law@cygnus.com)
+
+ * reloc.c: Add BFD_RELOC_24.
+ * elf32-mn10200.c (enum reloc_type): Add 24bit and pcrel relocs.
+ (elf_mn10200_howto, mn10200_reloc_map): Corresponding changes.
+ * bfd-in2.h, libbfd.h: Rebuilt.
+
+Fri Jan 3 16:58:31 1997 Richard Henderson <rth@tamu.edu>
+
+ elf64-alpha multiple .got rewrite:
+
+ * elf-bfd.h (struct elf_backend_data): Add always_size_sections entry.
+ (bfd_elf*_mkobject): Don't define here ...
+ * elfxx-target.h: ... but rather here. Default always_size_sections
+ hook to NULL.
+ * elf.c (elf_mkobject): Rename to bfd_elf_mkobject, since that was
+ what the #defines in elf-bfd.h transmuted it to anyway.
+
+ * section.c: Add SEC_LINKER_CREATED flag.
+ * bfd-in2.h: Rebuild.
+ * elf32-i386.c (elf_i386_check_relocs): Add SEC_LINKER_CREATED to
+ relocation section flags.
+ (elf_i386_size_dynamic_sections): Use SEC_LINKER_CREATED instead of
+ SEC_IN_MEMORY to recognize generated bits.
+ * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_size_dynamic_sections):
+ Likewise.
+ * elf32-mips.c (mips_elf_final_link, mips_elf_create_dynamic_sections,
+ mips_elf_create_compact_rel_section, mips_elf_create_got_section,
+ mips_elf_check_relocs, mips_elf_size_dynamic_sections): Likewise.
+ * elf32-ppc.c (ppc_elf_create_linker_section,
+ ppc_elf_size_dynamic_sections): Likewise.
+ * elf32-sparc.c (elf32_sparc_check_relocs,
+ elf32_sparc_size_dynamic_sections): Likewise.
+ * elflink.c (_bfd_elf_create_got_section): Add SEC_LINKER_CREATED to
+ section flags.
+ (_bfd_elf_create_dynamic_sections): Likewise.
+ (_bfd_elf_make_linker_section_rela): Likewise.
+ * elflink.h (elf_link_create_dynamic_sections): Likewise.
+ (bfd_elf,size_dynamic_sections): Call the always_size_sections hook.
+ (elf_bfd_final_link): Use SEC_LINKER_CREATED instead of SEC_IN_MEMORY
+ to identify generated bits.
+ (elf_link_input_bfd): Likewise.
+
+ * elf64-alpha.c: Rewrite everything touching relocations.
+
+Fri Jan 3 11:42:53 1997 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-v850.c (all functions and static variables): Go through
+ and regularize names to be of the form v850_elf_<xxx>.
+ (toplevel): Include <elf/v850.h>.
+ (enum reloc_type): Move to include/elf/v850.h.
+ (v850_elf_check_relocs): For common variables, if the variable is
+ referenced by a R_V850_{SDA,ZDA,TDA} relocation, put the variable
+ into the appropriate section.
+ (elf_backend_check_relocs): Define.
+
+Tue Dec 31 15:15:28 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-v850.c (elf_v850_howto_table): Fix some spacing.
+
+Tue Dec 31 14:44:50 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config.bfd (mips*el-*-linux*): New target.
+ (mips*-*-linux*): New target.
+
+ * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Clean up.
+ Return a useful value.
+
+ * Makefile.in (ALL_CFLAGS): Add -D_GNU_SOURCE.
+
+ * configure.in: Check ac_cv_func_mmap_fixed_mapped, not
+ ac_cv_func_mmap.
+ * configure: Rebuild.
+ * configure.host: Use ac_cv_func_mmap_fixed_mapped instead of
+ ac_cv_func_mmap in bfd/configure.host.
+
+ * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Add
+ filter_shlib and auxiliary_filter_shlib parameters.
+ * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_AUXILIARY and
+ DT_FILTER.
+ * bfd-in.h (bfd_elf32_size_dynamic_sections): Update declaration.
+ (bfd_elf64_size_dynamic_sections): Likewise.
+ * bfd-in2.h: Rebuild.
+
+Mon Dec 30 18:48:52 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (xcoff_build_ldsyms): When exporting all defined
+ symbols, don't export a symbol which is defined by an object in an
+ archive which contains shared objects.
+
+Mon Dec 30 16:12:58 1996 Fred Fish <fnf@cygnus.com>
+
+ * archures.c (enum bfd_architecture): Add bfd_arch_tic80
+ for TI TMS320c80 (MVP).
+ (bfd_archures_list): Add bfd_tic80_arch.
+ * bfd-in2.h: Regenerate by running "make headers".
+
+Sun Dec 29 16:18:52 1996 Fred Fish <fnf@cygnus.com>
+
+ * cpu-tic80.c (bfd_tic80_arch): Add struct.
+ * configure.in (case $vec): Correct typo, "tb" not "tp".
+ Also add cofflink.o for tic80coff_vec.
+ * configure: Regenerate with autoconf.
+
+Mon Dec 30 11:54:56 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * libbfd.c: Patch up the mmap code so that it is only built if BFD
+ is configured with --with-mmap.
+
+Sun Dec 29 10:48:57 1996 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (BFD32_BACKENDS): Add coff-tic80.o
+ (ALL_MACHINES): Add cpu-tic80.o
+ (cpu-tic80.o, coff-tic80.o): Add dependencies.
+ * coff-tic80.c: Add skeleton, cloned from another coff config.
+ * coffcode.h (coff_write_object_contents): Set magic to TIC80MAGIC
+ for TIc80.
+
+Fri Dec 27 20:56:41 1996 Fred Fish <fnf@cygnus.com>
+
+ * TODO: Correct a misspelling.
+ * coff-tic80.c: New file for TI TMS320C80 (MVP).
+ * cpu-tic80.c: New file for TI TMS320C80 (MVP).
+ * configure.in (case $vec): Add tic80coff_vec entry.
+ * configure: Regenerate with autoconf.
+ * archures.c (bfd_tic80_arch): Declare.
+ * bfd-in2.h (enum bfd_architecture): Add bfd_arch_tic80.
+ * config.bfd (case ${targ}): Add tic80*-*-coff* target.
+ * targets.c (tic80coff_vec): Add decl as extern bfd_target.
+ (bfd_target_vector): Add tic80coff_vec entry.
+
+Fri Dec 27 11:48:12 1996 H.J. Lu <hjl@lucon.org>
+
+ * elflink.h (elf_buckets): Add some more values for larger
+ binaries.
+
+Thu Dec 26 18:36:54 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (install): Move subdir_do out of conditional. From
+ Fred Fish <fnf@cygnus.com>.
+
+Wed Dec 18 10:04:30 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-mn10200.c (enum reloc_type): Enable basic 8, 16, and
+ 32 bit relocs.
+ (elf_mn10200_howto_table): Likewise.
+ (mn10200_reloc_map): Likewise.
+
+Tue Dec 17 11:09:36 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-mips.c (mips_elf_add_symbol_hook): Add 1 to the value of a
+ mips16 symbol during the link.
+ (mips_elf_finish_dynamic_symbol): Subtract 1 from the value of a
+ mips16 symbol.
+ (mips_elf_link_output_symbol_hook): New static function.
+ (elf_backend_link_output_symbol_hook): Define.
+
+ * elf.c (bfd_elf_print_symbol): Print the st_other field if it is
+ not zero.
+
+Mon Dec 16 14:38:39 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (bfd_section_from_shdr): Don't check for reloc sections
+ against SEC_DEBUGGING sections here (revert patch of December 5).
+ * elfcode.h (elf_object_p): Check for them here, instead.
+
+Sun Dec 15 14:46:06 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elfcode.h (elf_slurp_reloc_table): Add dynamic parameter.
+ * elf.c (_bfd_elf_canonicalize_reloc): Pass new argument to
+ slurp_reloc_table.
+ (_bfd_elf_get_dynamic_reloc_upper_bound): New function.
+ (_bfd_elf_canonicalize_dynamic_reloc): New function.
+ * elf-bfd.h (struct elf_size_info): Update declaration of
+ slurp_reloc_table.
+ (_bfd_elf_get_dynamic_reloc_upper_bound): Declare.
+ (_bfd_elf_canonicalize_dynamic_reloc): Declare.
+ * elfxx-target.h: Use new dynamic reloc routines by default.
+ * elf64-mips.c (mips_elf64_slurp_reloc_table): Add dynamic
+ parameter.
+
+Fri Dec 13 13:18:49 1996 Dan Wilder <dan@gasboy.com>
+
+ * coffcode.h (coff_set_flags): Use MC68KBCSMAGIC for bfd_arch_m68k
+ if NAMES_HAVE_UNDERSCORE is defined.
+
+Fri Dec 13 11:13:23 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * libaout.h (enum machine_type): Change M_SPARCLET from 142 to 131.
+
+Thu Dec 12 15:07:20 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_check_relocs): Move R_PPC_PLTREL24 into the
+ supported relocs.
+
+Thu Dec 12 14:55:41 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_add_object_symbols): Only add a weak
+ symbol if the real definition is in the dynamic symbol table.
+ After finding the real definition, then, if it is dynamic, add the
+ weak symbol to the dynamic symbol table.
+
+ * coff-aux.c (coff_m68k_aux_link_add_one_symbol): Make static.
+
+ * ppcboot.c (ppcboot_set_arch_mach): Don't define; it's a
+ function.
+ (ppcboot_bfd_print_private_bfd_data): Don't take the address of an
+ array.
+
+Tue Dec 10 23:23:52 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-mn10300.c (reloc_type): Remove big endian mn10300 reloc
+ variants.
+ (elf32_mn10300_howto_table, mn10300_reloc_map): Likewise.
+ (bfd_elf32_mn10300_reloc): Write data in little endian format.
+ * reloc.c: Remove mn10300 big endian relocs.
+ * bfd-in2.h, libbfd.h: Rebuilt.
+
+ * elf32-mn10200.c: Update from elf32-mn10300.c.
+
+Fri Dec 6 15:18:05 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-mn10300.c (elf_symbol_leading_char): Define.
+
+ * elf32-mn10300.c: Add some comments.
+
+Fri Dec 6 17:16:43 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ihex.c (ihex_scan): Always initialize buf before jumping to
+ error_return.
+ (ihex_read_section): Likewise.
+
+Thu Dec 5 22:29:18 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-mn10300.c (elf_mn10300_howto_table): Don't set partial-
+ inplace for most relocs.
+
+Thu Dec 5 13:24:46 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_add_object_symbols): Calling check_relocs
+ even if SEC_ALLOC is not set.
+ * elf32-i386.c (elf_i386_check_relocs): Don't check SEC_ALLOC
+ when deciding whether to copy a reloc into a shared object.
+ (elf_i386_relocate_section): Likewise.
+ * elf32-sparc.c (elf32_sparc_check_relocs): Likewise.
+ (elf32_sparc_relocate_section): Likewise.
+ * elf32-i386.c (elf_i386_check_relocs): Don't set SEC_ALLOC in a
+ reloc section if it is not set in the source section.
+ * elf32-sparc.c (elf32_sparc_check_relocs): Likewise.
+ * elf.c (bfd_section_from_shdr): Mark a reloc section associated
+ with a SEC_DEBUGGING section as SEC_DEBUGGING.
+
+Wed Dec 4 14:18:13 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): #if 0 code that
+ expects a .got.plt until we actually create it.
+
+Mon Dec 2 12:13:51 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * cofflink.c (_bfd_coff_generic_relocate_section): Print an error
+ message for bfd_reloc_outofrange, rather than aborting. From
+ Philippe De Muyter <phdm@info.ucl.ac.be>.
+
+ * cofflink.c (_bfd_coff_final_link): If there aren't any relocs in
+ a relocateable link, don't try to process them. From Heinz Wrobel
+ <wrobel@lpr.e-technik.tu-muenchen.de>.
+
+Mon Dec 2 00:39:24 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-mn10300.c (mn10300_info_howto): Renamed from
+ mn10300_info_howto_rel. Tweak reloc argument to be an
+ Elf32_Internal_Rela.
+ (USE_RELA): Define instead of USE_REL.
+ (elf_info_to_howto, elf_info_howto_rel): Corresponding changes.
+
+Sun Dec 1 00:18:59 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * configure.in, configure: Handle mips*-sgi-irix6*.
+ * irix-core.c (irix_core_core_file_p): Accept CORE_MAGICN32
+ core files.
+
+Wed Nov 27 12:10:25 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-i386.c (elf_i386_relocate_section): Warn about a
+ relocation against a symbol defined in a section with no output
+ section.
+
+Tue Nov 26 11:07:31 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * aclocal.m4 (BFD_CC_FOR_BUILD): Don't require AC_C_CROSS.
+ * configure, config.in: Rebuild with autoconf 2.12.
+
+ * elf-bfd.h (struct elf_link_hash_entry): Add other field.
+ * elf.c (_bfd_elf_link_hash_newfunc): Initialize other field.
+ (swap_out_syms): Set st_other from existing st_other field.
+ * elflink.h (elf_link_add_object_symbols): Store st_other in hash
+ table other field.
+ (elf_link_output_extsym): Set the other field from the global hash
+ table entry.
+ * elf32-mips.c (enum reloc_type): Add R_MIPS16_26.
+ (elf_mips16_jump_howto): New static variable.
+ (mips16_jump_reloc): New static function.
+ (bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS16_JMP.
+ (mips_info_to_howto_rel): Handle R_MIPS16_26.
+ (mips_elf_relocate_section): Handle R_MIPS16_26. Handle R_MIPS_26
+ to a mips16 symbol.
+ * reloc.c (BFD_RELOC_MIPS16_JMP): Add to list of relocs.
+ * bfd-in2.h, libbfd.h: Rebuild.
+ * cpu-mips.c (arch_info_struct): Add mips:16 entry.
+
+Mon Nov 25 11:23:32 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.host: Use long long for mips-sgi-irix6*.
+
+ * coffswap.h (coff_swap_scnhdr_out): Make line number overflow
+ only a warning. From Philippe De Muyter <phdemuyt@ulb.ac.be>.
+
+Mon Nov 25 08:52:29 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-mn10300.c (bfd_elf32_mn10300_reloc): New function.
+ (enum reloc_type): Add more reloc types.
+ (elf32_mn10300_howto_table): Update for new reloc types.
+ (elf32_mn10300_reloc_map): Update for new reloc types.
+ * reloc.c: Add some new relocs for the mn10300 series.
+ * bfd-in2.h, libbfd.h: Rebuilt.
+
+Sat Nov 23 13:26:18 1996 Jeffrey A Law (law@cygnus.com)
+
+ * som.c (setup_sections): Don't lose for a space which has
+ no data, but some symbols.
+
+Fri Nov 22 11:32:13 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * sunos.c (struct sunos_link_hash_table): Add got_needed field.
+ (sunos_link_hash_table_create): Initialize got_needed.
+ (sunos_create_dynamic_sections): Only set .got section size if it
+ is not already set. Set got_needed.
+ (bfd_sunos_size_dynamic_sections): Check got_needed. Only set
+ sdynptr, and only handle dynamic sections, if dynamic sections are
+ needed.
+ (sunos_scan_std_relocs): Pass false to create_dynamic_sections.
+ Initialize .got section.
+ (sunos_scan_ext_relocs): Likewise.
+ (sunos_write_dynamic_symbol): Set up PLT entry even if this is not
+ a dynamic symbol.
+ (sunos_finish_dynamic_link): Check got_needed. Only set up
+ dynamic linking information if needed.
+
+Thu Nov 21 10:31:31 1996 Rob Savoye (rob@cygnus.com)
+
+ * config.bfd: Added VersaDOS format to the Ericsson configuration.
+
+Wed Nov 20 16:31:31 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-mn10300.c: Rough cut at relocs for the mn10300.
+
+Wed Nov 13 08:12:38 1996 Jeffrey A Law (law@cygnus.com)
+
+ * Makefile.in (elf32-d10v.o): Don't depend on elf/d10v.h
+ anymore.
+
+Tue Nov 12 13:30:00 1996 Dawn Perchik <dawn@cygnus.com>
+
+ * filemode.c: Include sysdep.h.
+ * ihex.c: Add casts to eliminate compiler warnings.
+ * sunos.c: Add casts to eliminate compiler warnings.
+
+Mon Nov 11 10:37:02 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Create .got.plt
+ section.
+ (ppc_elf_check_relocs): Add support for R_PPC_LOCAL24PC. Make
+ appropriate relocations in the .so file if shared.
+ (ppc_elf_relocate_section): Ditto.
+
+Tue Oct 29 15:03:02 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * elf32-m32r.c (elf_m32r_howto_table, R_M32R_24): Use
+ complain_overflow_unsigned.
+
+Tue Oct 29 12:53:46 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * elf32-d10v.c (elf_d10v_howto_table): Don't complain on
+ overflows for R_D10V_16 and R_D10V_18.
+
+Tue Oct 29 13:23:53 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ieee.c (ieee_write_section_part): Use LMA rather than VMA.
+ (do_with_relocs): Likewise.
+ (do_as_repeat): Likewise.
+ (copy_expression): Likewise.
+
+Fri Oct 25 16:56:40 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ieee.c (ieee_write_external_part): Correctly record whether
+ there is an external part.
+
+Thu Oct 24 14:32:52 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-v850.c (elf32_v850_bfd_final_link_relocate): Correctly
+ handle tda offsets for sld.w and sst.w instructions.
+ Fix alignment check in sld.w and sst.w tda reloc handling.
+
+Thu Oct 24 09:08:47 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * aclocal.m4, configure: Set USE_BINARY_FOPEN for *-*-windows.
+
+Wed Oct 23 00:53:16 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-v850.c: Add comments about assumptions about
+ char, short & long sizes.
+ (elf32_v850_bfd_final_link_relocate): Fix sign extension
+ problems for several relocs.
+
+ * elf32-v850.c (elf32_v850_howto_table): Fix typo in
+ R_V850_SDA_OFFSET entry.
+
+Wed Oct 23 00:20:34 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (bfd_xcoff_import_symbol): Don't allocate ldsym.
+ Store import file index in ldindx.
+ (xcoff_build_ldsyms): Assume that ldsym was not previously
+ allocated. For an imported symbol, copy ldindx into l_ifile.
+
+Tue Oct 22 19:20:38 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-v850.c (elf_v850_howto_table): Fix ordering of
+ R_V850_ZDA_OFFSET and R_V850_TDA_OFFSET. Fix various
+ fields in R_V850_TDA_OFFSET.
+ (elf32_v850_bfd_final_link_relocate): Tweak pc-relative
+ relocs to work more like other relocs. Handle R_V850_TDA_OFFSET
+ relocations.
+
+ * elf32-v850.c: Include bfdlink.h.
+ (bfd_elf32_v850_reloc): Return an error if we get a reloc
+ we can't handle.
+ (elf32_v850_bfd_final_link_relocate): New function.
+ (v850_elf_relocation_section): Likewise.
+ (elf_backend_relocate_section): Define.
+
+Tue Oct 22 17:22:43 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * binary.c (binary_set_section_contents): Ignore sections which
+ don't have SEC_LOAD and SEC_ALLOC set.
+
+Mon Oct 21 12:13:05 1996 Jeffrey A Law (law@cygnus.com)
+
+ * linker.c (_bfd_generic_final_link): Avoid losing static
+ symbols in the .bss section.
+
+Mon Oct 21 10:54:58 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-mips.c (elf_mips_howto_table): Describe R_MIPS_64.
+ (mips32_64bit_reloc): New static function.
+ (mips_reloc_map): Add entry for BFD_RELOC_64.
+ (mips_elf_relocate_section): Handle R_MIPS_64.
+
+ * linker.c (default_indirect_link_order): Print an error message
+ when attempting to do a relocateable link with different object
+ file formats, rather than calling abort.
+
+Thu Oct 17 10:43:29 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * reloc.c (m32r relocs): Rename them.
+ * bfd-in2.h, libbfd.h: Regenerated.
+ * elf32-m32r.c: Update.
+ (m32r_elf_10_pcrel_reloc): New function.
+ (elf_m32r_howto_table, R_M32R_10_PCREL entry): Use it.
+ (elf_m32r_howto_table, R_M32R_24 entry): Fix {src,dst}_masks.
+
+Wed Oct 16 11:24:35 1996 Jeffrey A Law (law@cygnus.com)
+
+ * linker.c (_bfd_generic_final_link): Set "linker_mark" for
+ all sections that will be included in the output file.
+ (_bfd_generic_link_output_symbols): Discard symbols in sections
+ which are being discarded.
+ * elf32-v850.c (enum reloc_type): Add R_V850_SDA_OFFSET,
+ R_V850_TDA_OFFSET and R_V850_ZDA_OFFSET.
+ (elf_v850_howto_table): Corresponding changes.
+ (elf_v850_reloc_map): Corresponding changes.
+ * reloc.c: Add additional V850 relocations.
+ * bfd-in2.h, libbfd.h: Rebuilt.
+
+ * elf32-v850.c (bfd_elf32_v850_reloc): Mask out bits we
+ no longer want in pc-relative relocs.
+
+Tue Oct 15 22:17:37 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-v850.c (bfd_elf32_v850_reloc): Don't silently
+ accept a reloc against an undefined sybmol!
+
+Tue Oct 15 16:17:28 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * elf32-v850.c: Define elf_symbol_leading_char to be '_'.
+
+Tue Oct 15 12:40:41 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * VERSION: Bump for new relocation.
+
+ * hosts/i386bsd.h: If NBPG is not defined, define it as
+ PAGE_SIZE, for recent versions of FreeBSD.
+
+Mon Oct 14 12:37:26 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.host: Use `long long' as the 64 bit type on a Solaris
+ host, since both gcc and the SunPRO compilers support it.
+
+Mon Oct 14 11:17:24 1996 Richard Henderson <rth@tamu.edu>
+
+ * reloc.c: Create a new BFD_RELOC_ALPHA_ELF_LITERAL. It was a
+ mistake to have reused the ECOFF LITERAL for ELF since they have
+ different semantics.
+ * elf64-alpha.c (elf_reloc_map): Map from ELF_LITERAL.
+ * bfd-in2.h, libbfd.h: Rebuild.
+
+ * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Trap .got
+ section overflow.
+
+ * elf64-alpha.c (elf64_alpha_relocate_section): Do not emit a
+ dynamic relocation for an undefweak symbol when we are building
+ a static executable.
+
+Thu Oct 10 11:15:06 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-make.sed (config.bfd, targmatch.sed): Edit references to
+ point explicitly to srcdir.
+ (targmatch.h): Edit references to point explicitly to objdir.
+
+Thu Oct 10 14:14:23 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config.bfd: When setting targ_cpu, don't get confused by
+ linux-gnu.
+
+Tue Oct 8 08:51:19 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * configure.host: Add support for windows host (a build done
+ under the Microsoft build environment).
+
+Tue Oct 8 11:40:16 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_add_object_symbols): If a symbol is a weak
+ definition in a dynamic object, add it to the dynamic symbol table
+ if any dynamic object mentions it. Reverts part of last patch.
+
+ * sunos.c (struct sunos_link_hash_table): Add got_base field.
+ (sunos_link_hash_table_create): Initialize got_base.
+ (bfd_sunos_size_dynamic_sections): If the .got section is more
+ than 0x1000 bytes, set __GLOBAL_OFFSET_TABLE_ and got_base to
+ 0x1000.
+ (sunos_check_dynamic_reloc): Subtract got_base from a base
+ relative relocation.
+
+ * elf32-mips.c (elf_mips_isa): New static function.
+ (_bfd_mips_elf_merge_private_bfd_data): Don't warn about linking
+ -mips1 and -mips2 code together, or -mips3 and -mips4 code.
+
+Mon Oct 7 11:44:17 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * archive.c (do_slurp_coff_armap): Only treat archive as little
+ endian for i960 COFF.
+
+Fri Oct 4 13:49:01 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffcode.h (coff_compute_section_file_positions): Adjust sofar
+ by the change in size of the section when EXEC_P is not set.
+
+ * coff-m68k.c (coff_rtype_to_howto): Define if not defined.
+ (m68kcoff_rtype_to_howto): New static function.
+ * cf-m68klynx.c (coff_m68k_lynx_rtype_to_howto): Add the section
+ VMA to the addend for a PC relative reloc.
+
+ * dep-in.sed: Rework backslash loop a bit to avoid bug in sed on
+ HP/UX 10.20.
+ * Makefile.in: Rebuild dependencies.
+
+ * dep-in.sed: Remove ../bfd/sysdep.h, since it will appear when
+ som.h is included.
+
+Fri Oct 4 11:41:39 1996 Jeffrey A Law (law@cygnus.com)
+
+ * Makefile.in: Remove explicit dependencies for mn10200 and
+ mn10300 files.
+ (ALL_MACHINE_CFILES): Add cpu-mn10200.c and cpu-mn10300.c.
+ (BFD32_BACKENDS_CFILES): Add elf32-mn10200.c and elf32-mn10300.c
+ (dependencies): Rebuilt.
+
+Thu Oct 3 16:57:51 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * cofflink.c (coff_link_add_symbols): Set obj_coff_keep_syms
+ during this function.
+
+ * elflink.c (_bfd_elf_create_linker_section): Only use an existing
+ section if the flags are compatible.
+
+ * configure.in: Add havevecs, and put it in tdefaults.
+ * mpw-config.in: Likewise.
+ * configure: Rebuild.
+ * targmatch.sed: New file; a sed script to build targmatch.h from
+ config.bfd.
+ * config.bfd: Add #if, #endif, and comments for targmatch.h.
+ * targets.c: Include "fnmatch.h".
+ (struct targmatch): Define.
+ (bfd_target_match): Define by including targmatch.h.
+ (bfd_find_target): If the target is not found by name, search for
+ it as a configuration triplet.
+ * Makefile.in: Rebuild dependencies.
+ (BFD32_BACKENDS): Add aout-arm.o, aout-sparcle.o, hp300bsd.o,
+ i386dynix.o, m68k4knetbsd.o, and riscix.o.
+ (BFD32_BACKENDS_CFILES): Add aout-arm.c, aout-sparcle.c,
+ hp300bsd.c, i386dynix.c, m68k4knetbsd.c, and riscix.c.
+ (HFILES): Add targmatch.h. Also, alphabetize and reindent.
+ (CFILES): Remove i386dynix.c and hp300bsd.c.
+ (targmatch.h): New target.
+ (do_clean): Remove targmatch.h.
+
+ * configure.in: Add BFD_NEED_DECLARATION(getenv).
+ * acconfig.h: Add NEED_DECLARATION_GETENV.
+ * configure, config.in: Rebuild.
+ * sysdep.h: If NEED_DECLARATION_GETENV, declare getenv.
+ * aout-adobe.c (aout_adobe_object_p): Don't declare getenv.
+
+Thu Oct 3 09:29:09 1996 Jeffrey A Law (law@cygnus.com)
+
+ * cpu-mn10x00.c, elf32-mn10x00: Removed.
+ * cpu-mn10200.c, cpu-mn10300.c: New files.
+ * elf32-mn10200.c, elf32-mn10300.c: New files.
+ * Makefile.in: Break mn10x00 support into two separate
+ configurations, mn10200 and mn10300.
+ * archures.c, config.bfd, configure.in, elf.c, targets.c: Likewise.
+ * bfd-in2.h, configure: Rebuilt.
+
+Thu Oct 3 15:38:19 1996 Jason Molenda (crash@godzilla.cygnus.co.jp)
+
+ * Makefile.in (do_clean): Move config.log to do_distclean.
+
+Wed Oct 2 21:40:55 1996 Jeffrey A Law (law@cygnus.com)
+
+ * cpu-mn10x00.c, elf32-mn10x00.c: New files.
+ * Makefile.in (ALL_MACHINES): Add cpu-mn10x00.o.
+ (BFD32_BACKENDS): Similarly for elf32-mn10x00.o.
+ (elf32-mn10x00.o): Add dependencies.
+ * archures.c (enum bfd_architecture): Add bfd_arch_mn10x00.
+ (bfd_mn10x00_arch): Declare.
+ (bfd_archures_list): Add bfd_mn10x00_arch.
+ * config.bfd: Add mn10x00-*-*.
+ * configure.in: Add bfd_elf32_mn10x00_vec.
+ * elf.c (prep_headers): Handle bfd_arch_mn10x00.
+ * targets.c (bfd_elf32_mn10x00_vec): Declare.
+ (bfd_target_vector): Add bfd_elf32_mn10x00_vec.
+ * bfd-in2.h, configure: Rebuilt.
+
+Wed Oct 2 15:46:45 1996 Klaus Kaempf <kkaempf@progis.de>
+
+ openVMS/Alpha: Provide filename and case_hack flags via
+ symbol table from gas.
+ Add case_hack code for symbol output from vax/vms.
+ * evax-alpha.c (evax_initialize): Remove filename handling,
+ filename is provided via symbol table.
+ (evax_get_symtab): Use local symbol count when setting up table.
+ * evax-egsd.c (_bfd_evax_slurp_egsd): Print correct name when
+ debugging.
+ (_bfd_evax_write_egsd): Skip file name symbol.
+ * evax-emh.c (get_vms_time_string): Local function now.
+ (_bfd_evax_write_emh): Extract source filename and case_hack flags
+ from symbol table.
+ * evax_write_etir (_bfd_evax_write_etir): Pass all symbol names
+ through _bfd_evax_case_hack_symbol.
+ * evax-misc.c (hash_string, _bfd_evax_case_hack_symbol): New
+ functions.
+ (_bfd_evax_basename): Removed.
+ (_bfd_get_vms_time_string): Moved to evax-emh.c.
+ * evax.h (evax_private_data_struct): Remove filename.
+ (flag_hash_long_names, flag_show_after_trunc,
+ flag_no_hash_mixed_case, vms_name_mapping): New flags for
+ vms_case_hack.
+
+Wed Oct 2 12:02:02 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * freebsd.h (N_GET_MAGIC_NET): Don't use ntohl.
+ (N_GETMID_NET, N_GETFLAG_NET): Likewise.
+ (NO_SWAP_MAGIC): Don't define.
+ (SWAP_MAGIC): Define.
+
+ * cofflink.c (_bfd_coff_link_input_bfd): Don't crash if there is
+ no hash table entry for a global symbol.
+
+Tue Oct 1 16:14:22 1996 Joel Sherrill <joel@oarcorp.com>
+
+ * config.bfd (mips*-*-rtems*): New target, like mips*-*-elf*.
+
+Tue Oct 1 12:31:39 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * cofflink.c (coff_link_add_symbols): Don't override a meaningful
+ symbol type with T_NULL. Warn if symbol type changes. Based on
+ patch from Philippe De Muyter <phdm@info.ucl.ac.be>.
+
+ * elflink.h (elf_link_add_object_symbols): Only put a symbol from
+ a dynamic object in the dynamic symbol table if it is referenced
+ or defined by a regular object.
+
+Fri Sep 27 18:41:07 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * elf32-v850.c (bfd_elf32_v850_is_local_label): New function to
+ remove dwarf local labels. Shrinks binaries by a factor of 3!
+
+Mon Sep 23 13:33:00 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_add_symbol_hook): Create the .sbss section
+ by hand, rather than by calling bfd_make_section.
+
+Mon Sep 23 09:23:41 1996 Doug Evans <dje@seba.cygnus.com>
+
+ * reloc.c: Rename m32r relocs.
+ * bfd-in2.h, libbfd.h: Rebuilt.
+ * elf32-m32r.c: Update.
+
+Fri Sep 20 11:43:43 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * aoutx.h (aout_link_input_section_ext): When doing a relocateable
+ link, adjust the symbol index of a base relative reloc. Don't
+ change the addend of a PC relative reloc if pcrel_offset is set.
+ * sunos.c (bfd_sunos_size_dynamic_sections): Don't do anything for
+ a relocateable link.
+
+ * reloc.c (bfd_perform_relocation): Apply the relocation even if
+ it is zero, in case src_mask matters.
+ (bfd_install_relocation): Likewise.
+
+Thu Sep 19 11:03:06 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (xcoff_link_add_symbols): Always initialize
+ keep_syms.
+ (_bfd_xcoff_bfd_final_link): Don't set target_index
+ to an uninitialized value.
+
+Tue Sep 17 14:18:31 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffcode.h (coff_slurp_line_table): Warn about illegal symbol
+ indices, rather than crashing.
+ (coff_slurp_reloc_table): Likewise. Check whether the howto field
+ is NULL.
+ * coff-sh.c (sh_relocate_section): Check for an illegal symbol
+ index.
+
+Mon Sep 16 12:39:36 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-arm.c (aoutarm_std_reloc_howto): Change dst_mask for ARM26D
+ reloc to 0.
+ (coff_arm_adjust_symndx): New static function.
+ (coff_adjust_symndx): Define.
+
+ * srec.c (srec_scan): Accept multiple symbols on a single line.
+ From Pascal Martin <pmartin@alsys.com>.
+
+ * README: New file.
+
+Fri Sep 13 14:32:42 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * aoutf1.h (MY_bfd_merge_private_bfd_data): Define.
+ (sunos_merge_private_bfd_data): New function.
+
+Fri Sep 13 15:50:57 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * bfd.c (bfd_copy_private_bfd_data): Switch on output BFD rather
+ than input BFD.
+ (bfd_merge_private_bfd_data): Likewise.
+ * section.c (bfd_copy_private_section_data): Likewise.
+ * syms.c (bfd_copy_private_symbol_data): Likewise.
+ * bfd-in2.h: Rebuild.
+ * aout-target.h (MY_bfd_copy_private_section_data): Check that
+ both BFD's are the right flavour.
+ * ecoff.c (_bfd_ecoff_bfd_copy_private_bfd_data): Likewise.
+ * elf.c (_bfd_elf_copy_private_symbol_data): Likewise.
+ * elf32-mips.c (_bfd_mips_elf_copy_private_bfd_data): Likewise.
+ (_bfd_mips_elf_merge_private_bfd_data): Likewise.
+ * elf32-ppc.c (ppc_elf_copy_private_bfd_data): Likewise.
+ (ppc_elf_merge_private_bfd_data): Likewise.
+ * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Likewise.
+ * peicode.h (pe_bfd_copy_private_section_data): Likewise.
+
+ * elf32-hppa.c (elf_hppa_howto_table): Fill in some fields for
+ R_PARISC_DIR32, so that _bfd_stab_section_find_nearest_line passes
+ its sanity check.
+
+Thu Sep 12 11:45:57 1996 Doug Evans <dje@seba.cygnus.com>
+
+ * reloc.c: Add m32r relocs.
+ * bfd-in2.h, libbfd.h: Rebuilt.
+ * cpu-m32r.c,elf32-m32r.c: New files.
+
+Thu Sep 12 11:10:05 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ieee.c (ieee_vec): Set symbol_leading_char field to '_'.
+
+Wed Sep 11 11:57:56 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * tekhex.c (first_phase): Change type parameter from char to int.
+ (out): Likewise.
+ (pass_over): Change func to expect int, not char.
+
+ * elf.c (assign_file_positions_for_segments): Test SEC_ALLOC
+ rather than SEC_LOAD when aligning the file offset for the first
+ section in a segment.
+
+Tue Sep 10 16:18:30 1996 Fred Fish <fnf@cygnus.com>
+
+ * syms.c (coff_section_type): Make arg const.
+ * irix-core.c (irix_core_core_file_p): Remove extraneous extra arg
+ to make_bfd_asection().
+ * elf-bfd.h (bfd_section_from_phdr): Add prototype.
+ * elfcode.h (bfd_section_from_phdr): Remove prototype.
+ (_bfd_elf_stringtab_init): Remove prototype.
+
+ * netbsd-core.c (swap_abort): Add prototype.
+ * aix386-core.c (swap_abort): Ditto & make static
+ * hpux-core.c (swap_abort): Ditto & make static.
+ * irix-core.c (swap_abort): Ditto & make static.
+ * ptrace-core.c (swap_abort): Ditto & make static.
+ * trad-core.c (swap_abort): Ditto & make static.
+ * coffswap.h (coff_swap_reloc_in): Ditto.
+ (coff_swap_reloc_out): Ditto.
+ (coff_swap_filehdr_in): Ditto.
+ (coff_swap_filehdr_out): Ditto.
+ (coff_swap_sym_in): Ditto.
+ (coff_swap_sym_out): Ditto.
+ (coff_swap_aux_in): Ditto.
+ (coff_swap_aux_out): Ditto.
+ (coff_swap_lineno_in): Ditto.
+ (coff_swap_lineno_out): Ditto.
+ (coff_swap_aouthdr_in): Ditto.
+ (coff_swap_aouthdr_out): Ditto.
+ (coff_swap_scnhdr_in): Ditto.
+ (coff_swap_scnhdr_out): Ditto.
+ * ihex.c (ihex_sizeof_headers): Ditto.
+ * tekhex.c (getsym): Ditto.
+ (find_chunk): Ditto & make static.
+ (insert_byte): Ditto.
+ (first_phase): Ditto.
+ (pass_over): Ditto.
+ (tekhex_get_symtab): Ditto & make static.
+ (tekhex_get_symtab_upper_bound): Ditto & make static.
+ (tekhex_mkobject): Ditto.
+ (tekhex_object_p): Ditto.
+ (move_section_contents): Ditto.
+ (tekhex_get_section_contents): Ditto.
+ (tekhex_set_arch_mach): Ditto & make static.
+ (tekhex_set_section_contents): Ditto.
+ (writevalue): Ditto.
+ (writesym): Ditto.
+ (out): Ditto.
+ (tekhex_write_object_contents): Ditto.
+ (tekhex_sizeof_headers): Ditto.
+ (tekhex_make_empty_symbol): Ditto.
+ (tekhex_get_symbol_info): Ditto.
+ (tekhex_print_symbol): Ditto.
+ * irix-core.c (make_bfd_asection): Ditto.
+ (irix_core_core_file_p): Ditto.
+ (irix_core_core_file_failing_command): Ditto.
+ (irix_core_core_file_failing_signal): Ditto.
+ (irix_core_core_file_matches_executable_p): Ditto.
+ (irix_core_make_empty_symbol): Ditto.
+ * coff-mips.c (mips_bfd_reloc_type_lookup): Ditto.
+ * srec.c (srec_new_symbol): Ditto.
+ (srec_get_section_contents): Ditto.
+ (srec_set_arch_mach): Ditto.
+ (srec_set_section_contents): Ditto.
+ (internal_srec_write_object_contents): Ditto.
+ (srec_write_object_contents): Ditto.
+ (symbolsrec_write_object_contents): Ditto.
+ (srec_sizeof_headers): Ditto.
+ (srec_make_empty_symbol): Ditto.
+ (srec_get_symtab_upper_bound): Ditto.
+ (srec_get_symtab): Ditto.
+ (srec_print_symbol): Ditto and make static.
+ * elf.c (elf_read): Ditto
+ (assign_section_numbers): Ditto.
+ (elf_fake_sections): Ditto.
+ (sym_is_global): Ditto.
+ (elf_map_symbols): Ditto.
+ (get_program_header_size): Ditto.
+ * coffgen.c (make_a_section_from_file): Ditto.
+ (coff_real_object_p): Ditto.
+ (fixup_symbol_value): Ditto.
+ (build_debug_section): Ditto.
+ (copy_name): Ditto.
+ * syms.c (coff_section_type): Ditto.
+
+Mon Sep 9 22:36:01 1996 Jeffrey A Law (law@cygnus.com)
+
+ * bfd-in2.h: Rebuilt after m32r changes.
+
+Mon Sep 9 12:31:22 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * config.bfd,configure.in,configure: Add m32r support.
+ * Makefile.in,archures.c,elf.c,targets.c: Likewise.
+ * config.bfd: Keep target list alphabetically sorted.
+
+Mon Sep 9 11:48:41 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-v850.c (bfd_elf32_v850_reloc, case R_V850_HI16): Don't forget
+ to add in the constant part found in the instruction itself.
+ (case R_V850_HI16_S): Likewise.
+
+Fri Sep 6 17:04:39 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * elf32-d10v.c (elf_d10v_howto_table): Modify the size of R_D10V_16
+ and R_D10V_18 to be 1 (word).
+
+Thu Sep 5 15:23:08 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * stabs.c (_bfd_link_section_stabs): If the output_section field
+ of either section is bfd_abs_section, then the linker is
+ discarding the section and we should not optimize it.
+
+Tue Sep 3 12:16:20 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * Makefile.in (aout-sparcle.o): New target.
+ * aoutf1.h (TARGET_IS_BIG_ENDIAN_P): Don't define if little endian.
+ * config.bfd (sparclet-*-aout*): Add case.
+ * configure.in (sparcle_aout_vec): Add case.
+ * configure: Regenerated.
+ * targets.c (sparcle_aout_vec): Declare.
+ (bfd_target_vector): Add sparcle_aout_vec.
+ * aout-sparcle.c: New file.
+
+Tue Sep 3 00:57:02 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-v850.c (bfd_elf32_v850_reloc): Fix handling of
+ low order sign bit propogation for R_V850_HI16_S.
+
+ * elf32-v850.c (bfd_elf32_v850_reloc): New function for
+ handling V850 specific relocs.
+ (elf_v850_howto_table): Use the new function for some
+ relocations. Twiddle masks & shifts for some relocs.
+ Set partial_inplace where needed.
+
+Mon Sep 2 12:12:34 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * cpu-mips.c: Add an explicit mips:3000 entry, and change the
+ default architecture to a machine number of 0.
+ * elf32-mips.c (_bfd_mips_elf_object_p): Set the machine number
+ for E_MIPS_ARCH_1.
+ (_bfd_mips_elf_merge_private_bfd_data): If the machine number of
+ the output BFD is the default, set it from the first input BFD.
+
+Sun Sep 1 18:38:01 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-v850.c (elf_v850_howto_table): All the 16bit relocs
+ insert at bitpos zero. The HI16 relocs are shifted right
+ by 16 bits. Fix src_mask for all relocs.
+ (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Define. The V850 is
+ little endian!
+ (TARGET_BIG_SYM, TARGET_BIG_NAME): Remove. The V850 is little
+ endian!
+
+Sun Sep 1 15:41:08 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * rs6000-core.c (rs6000coff_core_file_matches_executable_p):
+ Rewrite to use BFD file read routines and to avoid using a fixed
+ length for the file name.
+
+Sat Aug 31 10:22:25 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-v850.c (enum reloc_type): Add R_V850_{32,16,8}.
+ (elf_v850_howto_table): Add support for R_V850_{32,16,8}.
+ (v850_reloc_map): Add translation from BFD_RELOC_{32,16,8}
+ to R_V850_{32,16,8}.
+
+Fri Aug 30 18:06:04 1996 J.T. Conklin <jtc@hippo.cygnus.com>
+
+ * elf32-v850.c (reloc_type): Add R_V850_HI16_S.
+ (elf_v850_howto_table): Add info for HI16_S reloc.
+ (v850_reloc_map): Add HI_16_S reloc.
+ * reloc.c: Define BFD_RELOC_V850_* relocs.
+
+Fri Aug 30 11:49:19 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ Add SH ELF support.
+ * elf32-sh.c: New file.
+ * elf.c (prep_headers): Handle bfd_arch_sh.
+ * elfcode.h (write_relocs): Handle absolute symbol.
+ * elf-bfd.h (_bfd_elf32_link_read_relocs): Declare.
+ (_bfd_elf64_link_read_relocs): Declare.
+ * elflink.h (NAME(_bfd_elf,link_read_relocs)): Rename from
+ elf_link_read_relocs. Make globally visible. Change all
+ callers.
+ (elf_link_input_bfd): Get external symbols from cache in
+ symtab_hdr->contents. Get contents from cache in
+ elf_section_data.
+ * elfxx-target.h (bfD_elfNN_bfd_relax_section): Only define if not
+ already defined.
+ * reloc.c: Define BFD_RELOC_SH_* relocs.
+ * libbfd-in.h (_bfd_sh_align_load_span): Declare.
+ * coff-sh.c (sh_insns_conflict): Fix a return value.
+ (_bfd_sh_align_load_span): New globally visible function, broken
+ out of sh_align_load.
+ (sh_align_load): Call _bfd_sh_align_load_span.
+ (sh_swap_insns): Change relocs parameter to PTR.
+ * bfd-in2.h, libbfd.h: Rebuild.
+ * targets.c (bfd_elf32_sh_vec): Declare.
+ (bfd_elf32_shl_vec): Declare.
+ * config.bfd (sh-*-elf*): New target.
+ * configure.in (bfd_elf32_sh_vec): New target vector.
+ (bfd_elf32_shl_vec): New target vector.
+ * configure: Rebuild.
+ * Makefile.in: Rebuild dependencies.
+ (BFD32_BACKENDS): Add elf32-sh.o.
+ (BFD32_BACKENDS_CFILES): Add elf32-sh.c.
+
+ * elf.c (map_sections_to_segments): Check that LMA does not skip a
+ page before checking D_PAGED.
+
+ * ihex.c (ihex_scan): Removed unnecessary extbase variable.
+ (ihex_write_object_contents): Remove extbase; always use segbase
+ instead.
+
+Thu Aug 29 16:52:17 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * configure.in (i[345]86-*-*): Recognize i686 for pentium pro.
+ * configure.host (i[345]86-*-*): Ditto.
+ * config.bfd (i[345]86-*-*): Ditto.
+ * configure: Regenerate.
+
+ * config.bfd (i[3456]86-*-dgux*): Recognize as a synonym for x86
+ elf.
+
+Tue Aug 27 09:18:18 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-hppa.c (hppa_elf_gen_reloc_type): Add new argument.
+ * elf32-hppa.h (hppa_elf_gen_reloc_type): Update prototype.
+ * som.c (hppa_som_gen_reloc_type): Add new argument. If
+ we encounter an R_DATA_ONE_SYMBOL reloc against a symbol that
+ will have an ST_CODE type, change the symbol's type to ST_DATA.
+ * som.c (hppa_som_gen_reloc_type): Update prototype.
+
+Tue Aug 27 00:12:22 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-mips.c (mips_elf_check_relocs): Set dynobj if needed for
+ R_MIPS_32 and R_MIPS_REL32. Set sgot and g as soon as possible.
+ (mips_elf_size_dynamic_sections): Don't require .got to exist.
+ (mips_elf_finish_dynamic_sections): Likewise.
+
+Thu Aug 22 10:54:38 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.host (HLDENV): New variable to set. Set it for
+ *-*-sysv4*, since those linkers may not support -R but they always
+ support LD_RUN_PATH.
+
+ * libieee.h (NSECTIONS): Don't define.
+ (ieee_data_struct): Change section_table to asection **. Add
+ section_table_size.
+ * ieee.c (get_section_entry): If the table isn't big enough, make
+ it bigger.
+ (ieee_slurp_sections): Remove assertion about number of sections.
+ (ieee_object_p): Adjust initialization of ieee to match changes to
+ the structure.
+
+ * xcofflink.c (xcoff_mark): Don't copy relocs for undefined
+ symbols merely because we are generating a shared library.
+ (xcoff_build_ldsyms): Don't set up global linkage code for an
+ undefined symbol merely because we are generating a shared
+ library.
+
+Tue Aug 20 15:06:05 1996 J.T. Conklin <jtc@hippo.cygnus.com>
+
+ * Makefile.in (ALL_MACHINES): Add cpu-v850.o.
+ (BFD32_BACKENDS) Add elf32-v850.o.
+ * archures.c: Add bfd_v850_arch.
+ * bfd-in2.h: Add bfd_v850_arch.
+ * config.bfd (v850-*-*): New target.
+ * configure: (bfd_elf32_v850_vec) New vector.
+ * configure.in: (bfd_elf32_v850_vec) New vector.
+ * cpu-v850.c: New file.
+ * elf.c (prep_headers): Added case bfd_arch_v850.
+ * elf32-v850.c: New file.
+ * targets.c (bfd_elf32_v850_vec): New vector.
+
+Fri Aug 16 16:25:35 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (xcoff_link_add_dynamic_symbols): Create and define
+ a function code symbol for an XMC_XO symbol.
+
+Thu Aug 15 12:33:29 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-config.in: Update editing of autoconf vars to reflect
+ Jul 18 configure.in change.
+ * mpw-make.sed: Update editing of include pathnames to be
+ more general, add @DASH_C_FLAG@ to explicit compile rule edit.
+
+Thu Aug 15 10:35:13 1996 Richard Henderson <rth@tamu.edu>
+
+ * elf64-alpha.c (elf64_alpha_output_extsym): The section from
+ which to offset to get the .plt entry address is ".plt".
+
+Thu Aug 15 16:40:30 1996 James G. Smith <jsmith@cygnus.co.uk>
+
+ * reloc.c: (BFD_RELOC_ARM_THUMB_ADD, BFD_RELOC_ARM_THUMB_IMM,
+ BFD_RELOC_ARM_THUMB_SHIFT, BFD_RELOC_ARM_THUMB_OFFSET):
+ Added, for internal use by the ARM gas.
+ * libbfd.h: Rebuilt
+ * bfd-in2.h: Rebuilt
+
+Wed Aug 14 17:02:09 1996 Richard Henderson <rth@tamu.edu>
+
+ * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Correct typo
+ in section dynidx start.
+
+Tue Aug 13 14:35:38 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (_bfd_elf_make_section_from_shdr): Treat sections whose
+ name begins with .gnu.linkonce as SEC_LINK_ONCE. This is an
+ optimization for g++.
+
+Tue Aug 13 17:04:40 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_merge_private_bfd_data): If one module has
+ the -mrelocatable-lib bit set and the other doesn't, clear the
+ -mrelocatable-lib bit in the header.
+
+Sat Aug 10 22:59:17 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_link_add_object_symbols): Do not resolve a common
+ symbol against a STT_FUNC symbol in a shared library.
+
+Fri Aug 9 12:44:57 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (xcoff_link_add_dynamic_symbols): If a descriptor
+ symbol is found, automatically define the corresponding function
+ code.
+
+ * cofflink.c (coff_link_add_symbols): Only set (*sym_hash)->numaux
+ if sym.n_numaux is not zero.
+ (_bfd_coff_link_input_bfd): Permit the symbol and the hash table
+ entry to disagree about the number of aux entries if the symbol
+ has zero.
+
+ * elf32-mips.c (mips_elf_check_relocs): Create the .rel.dyn
+ section if it might be needed, not just if info->shared.
+ (mips_elf_adjust_dynamic_symbol): Make room for a null element at
+ the start of .rel.dyn if we are going to use it.
+ (mips_elf_finish_dynamic_sections): Only clear the first element
+ of .rel.dyn if the size is greater than zero.
+
+Thu Aug 8 16:24:55 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (xcoff_link_input_bfd): If we already called the
+ undefined_symbol callback for a symbol, then don't issue any more
+ warnings about loader relocs.
+ (_bfd_ppc_xcoff_relocate_section): Don't do any further processing
+ after calling the undefined_symbol callback.
+
+ * xcofflink.c (XCOFF_MULTIPLY_DEFINED): Define.
+ (xcoff_link_add_symbols): Permit multiple definitions of a symbol
+ as the AIX linker seems to do.
+
+Thu Aug 8 12:21:56 1996 Klaus Kaempf <kkaempf@progis.de>
+
+ * evax-alpha.c (evax_alpha_vec): Corrected flags, cleanup.
+ (evax_initialize): Remove evax_reloc_table.
+ (evax_close_and_cleanup): Ditto.
+ (reloc_nil): Ditto.
+ (alpha_howto_table): Remove ALPHA_R_SWREL32 and ALPHA_R_SWREL64
+ entries.
+ (evax_bfd_reloc_type_lookup): Ditto.
+ * evax-egsd.c (_bfd_evax_slurp_egsd): Add a few casts; set
+ cooked_size == raw_size.
+ * evax-emh.c (_bfd_evax_register_filename): Remove.
+ * evax-etir.c (etir_stc): Allow ETIR_S_C_STC_xx commands.
+ * evax-misc.c (add_new_contents): Malloc section at full size.
+ (_bfd_save_evax_section): Memcpy section contents directly.
+ * evax.h (ALPHA_R_SWREL32, ALPHA_R_SWREL64): Remove.
+ (evax_reloc_table): Remove.
+
+ * hosts/alphavms.h (O_ACCMODE): Define if needed.
+
+ * makefile.vms: Add better support for DEC C compilation
+ Add evax.h dependencies
+
+ * reloc.c (bfd_get_reloc_size): Add case for 16 byte reloc.
+ (BFD_RELOC_SWREL32,BFD_RELOC_SWREL64): Remove.
+ (BFD_RELOC_ALPHA_BASEREG): Remove.
+ * bfd-in2.h, libbfd.h: Rebuild.
+
+Thu Aug 8 08:17:32 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * archive.c (bsd_write_armap): Ifdef around calls to getuid and
+ getgid if _WIN32 is defined.
+ * opncls.c (bfd_fdopenr): Remove unnecessary WINGDB ifdef.
+
+Wed Aug 7 23:19:00 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * aoutx.h bfd-in.h bfd-in2.h opncls.c riscix.c som.c targets.c:
+ Change NO_FLAGS to BFD_NO_FLAGS to avoid conflict with an HPUX
+ include file.
+ * libbfd.c: Create dummy getpagesize() macro if HAVE_GETPAGESIZE
+ isn't defined.
+
+Wed Aug 7 14:11:44 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
+
+ * configure.in: Call BFD_NEEDED_DECLARATION on strstr and
+ realloc.
+ * acconfig.h (NEED_DECLARATION_STRSTR): New macro.
+ (NEED_DECLARATION_REALLOC): New macro.
+ * configure, config.in: Rebuild.
+ * sysdep.h (strstr): Declare if NEED_DECLARATION_STRSTR.
+ (realloc): Declare if NEED_DECLARATION_REALLOC.
+
+ * aclocal.m4 (BFD_NEED_DECLARATION): Include <string.h> or
+ <strings.h> if they exist.
+
+ * ieee.c (ieee_set_section_contents): Cast bfd_alloc return.
+
+Wed Aug 7 12:12:03 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * cpu-i386.c (i8086_arch): Architecture info for the i8086.
+
+ Based on patches from Eric Valette <valette@crf.canon.fr>:
+ * elf32-i386.c (enum reloc_type): Add FIRST_INVALID_RELOC,
+ LAST_INVALID_RELOC, R_386_16, R_386_PC16, R_386_8, R_386_PC8.
+ (elf_howto_table): Add entries for new relocs.
+ (elf_i386_reloc_type_lookup): Handle new relocs.
+ (elf_i386_info_to_howto): Just call abort.
+ (elf_i386_info_to_howto_rel): Check that the reloc type is valid.
+ (elf_i386_relocate_section): Likewise.
+
+Tue Aug 6 12:54:56 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * elf32-d10v.c (elf_d10v_howto_table): Added R_D10V_32.
+
+Mon Aug 5 13:42:41 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (_bfd_elf_make_section_from_shdr): For a loadable section,
+ only get the LMA from the phdr if they are in the same part of the
+ file.
+
+ * elf.c (map_sections_to_segments): Rewrite tests for starting a
+ new segment to make them more comprehensible. If the relationship
+ between the LMA and the VMA changed, start a new segment. Don't
+ check dynsec when deciding whether to start a new segment for a
+ writeable section; -N will now handle this.
+
+Thu Aug 1 22:43:08 1996 Jeffrey A Law (law@cygnus.com)
+
+ * libhppa.h: Remove "esel" changes. Not the right approach.
+ * som.c: Corresponding changes.
+ (som_bfd_derive_misc_symbol_info): Use ST_DATA for symbols
+ which don't have a SOM symbol type associated with them.
+ Reverses a 1994 change.
+
+Wed Jul 31 15:50:55 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ Make ld -N more reasonable for ELF:
+ * elf.c (map_sections_to_segments): If D_PAGED is not set, set
+ phdr_in_section to false, and always use a single load segment.
+ (elf_sort_sections): Sort sections by LMA after VMA.
+ (assign_file_positions_for_segments): If D_PAGED is not set, don't
+ align to maxpagesize.
+ (assign_file_positions_except_relocs): Likewise.
+ * elfcode.h (elf_object_p): If a section is loaded but not page
+ aligned, clear D_PAGED.
+
+Wed Jul 31 15:00:12 1996 James G. Smith <jsmith@cygnus.co.uk>
+
+ * reloc.c: (BFD_RELOC_ARM_OFFSETIMM8, BFD_RELOC_ARM_HWLITERAL):
+ Added, for internal use by the ARM gas.
+ * libbfd.h: Rebuilt
+ * bfd-in2.h: Rebuilt
+
+Tue Jul 30 14:14:57 1996 Jeffrey A Law (law@cygnus.com)
+
+ * libhppa.h (R_HPPA_ESEL): New field selector.
+ (e_esel): Similarly.
+ * som.c (hppa_som_gen_reloc_type): If we encounter an e_esel,
+ then generate R_COMP2 (PUSH_SYM), R_DATA_EXPR fixup stream.
+ (som_write_fixups): Handle R_DATA_EXPR just like R_CODE_EXPR.
+
+Tue Jul 30 13:31:27 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (_bfd_xcoff_bfd_link_add_symbols): Do the regular
+ archive search before looking for stripped dynamic objects.
+
+Fri Jul 26 17:51:39 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (xcoff_build_ldsyms): Make exporting an undefined
+ symbol a warning rather than an error.
+
+Wed Jul 24 12:02:53 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (assign_file_positions_for_segments): Track the virtual
+ memory position separately from the file position, and use it to
+ compute the alignment adjustment.
+
+Tue Jul 23 10:43:31 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * elf32-d10v.c (elf_d10v_howto_table): Changed all relocs to "long"
+ and fixed mask on R_D10V_10_PCREL_L.
+
+Mon Jul 22 15:30:30 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf64-mips.c: Include "aout/ar.h".
+ (mips_elf64_slurp_armap): New static function.
+ (mips_elf64_write_armap): New static function.
+ (bfd_elf64_archive_*): Define.
+ * elfxx-target.h (bfd_elfNN_archive_p): Define if not defined.
+ Use instead of bfd_generic_archive_p.
+ (bfd_elfNN_write_archive_contents): Define if not defined. Use
+ instead of _bfd_write_archive_contents.
+ (bfd_elfNN_mkdarchive): Define if not defined. Use instead of
+ _bfd_generic_mkarchive.
+ (TARGET_BIG_SYM): If bfd_elfNN_archive_functions is defined, use
+ bfd_elfNN_archive in BFD_JUMP_TABLE_ARCHIVE rather than
+ _bfd_archive_coff.
+ (TARGET_LITTLE_SYM): Likewise.
+ * archive.c (bfd_slurp_armap): Check for and reject an archive map
+ name of /SYM64/.
+ * Makefile.in: Rebuild dependencies.
+
+ * elf32-mips.c (_bfd_mips_elf_final_write_processing): Handle
+ SHT_MIPS_LIBLIST, SHT_MIPS_CONTENT, SHT_MIPS_SYMBOL_LIB, and
+ SHT_MIPS_EVENTS sections.
+ (_bfd_mips_elf_section_from_shdr): Handle SHT_MIPS_IFACE,
+ SHT_MIPS_CONTENT, SHT_MIPS_SYMBOL_LIB, and SHT_MIPS_EVENTS
+ sections.
+ (_bfd_mips_elf_fake_sections): Likewise.
+
+ * libecoff.h (ecoff_data_type): Add rdata_in_text field.
+ * ecoff.c (ecoff_compute_section_file_positions): Copy
+ rdata_in_text from backend info to tdata. Clear it if any data
+ section comes before .rdata.
+ (_bfd_ecoff_write_object_contents): Use rdata_in_text field in
+ tdata rather than backend info.
+
+Fri Jul 19 18:15:51 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Fix test for whether a compiler has a 64 bit
+ type. From Jim Wilson <wilson@cygnus.com>.
+
+Thu Jul 18 15:39:10 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.host (mips-sgi-irix6*): New host.
+
+ * configure.in: Set and substitute VERSION, BFD_HOST_64BIT_LONG
+ (replacing HOST_64BITLONG), BFD_HOST_64_BIT_DEFINED,
+ BFD_HOST_64_BIT, and BFD_HOST_U_64_BIT. Add bfd-in2.h:bfd-in2.h
+ to AC_OUTPUT call.
+ * configure: Rebuild.
+ * bfd-in.h (BFD_ARCH_SIZE): Define as @wordsize@, not @WORDSIZE@.
+ (BFD_HOST_64_BIT): Define conditionally.
+ (BFD_HOST_U_64_BIT): Define when BFD_HOST_64_BIT is defined.
+ (bfd_vma): Typedef as BFD_HOST_U_64_BIT.
+ (symvalue, bfd_size_type): Likewise.
+ * bfd-in2.h: Rebuild.
+ * Makefile.in (do_clean): Remove bfd-tmp.h.
+ (do_distclean): Remove bfd-in3.h.
+ (stmp-bfd.h): Just do copy-if-change bfd-in3.h bfd.h.
+ (bfd-in3.h): New target.
+
+ * config.bfd (sparc-*-sysv4*): Don't build sunos_big_vec. From
+ Andrew Gierth <ANDREWG@microlise.co.uk>.
+
+ * configure.host: Set INSTALL_SHLIB.
+ * configure.in: Call AC_SUBST (INSTALL_SHLIB).
+ * configure: Rebuild.
+ * Makefile.in (install): Use @INSTALL_SHLIB@.
+
+ * config.bfd (mips*-*-irix6*): New target.
+ * configure.host: Handle Irix 6 shared library like Irix 5.
+
+ * xcofflink.c (xcoff_link_add_symbols): Don't check an XMC_TD
+ symbol for a magic name.
+ (xcoff_link_input_bfd): Don't change the reloc symbol for an
+ XMC_TD symbol.
+ (_bfd_ppc_xcoff_relocate_section): Don't get the TOC offset for an
+ XMC_TD symbol.
+
+Thu Jul 18 11:36:31 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-config.in: Add ELF support to mips config, create the
+ elf32-target.h file in the object dir.
+ * mpw-make.sed: Edit elfXX-target.h refs at beginnings of lines.
+
+Wed Jul 17 18:02:32 1996 Kim Knuttila <krk@cygnus.com>
+
+ * coff-ppc.c: Redid debug scheme - numerous fprintf's gone.
+ Also removed most abort calls, in favor of using bfd reporting.
+
+Wed Jul 17 14:51:52 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
+
+ * Makefile.in (ALL_MACHINES): Add cpu-d10v.o.
+ (BFD32_BACKENDS) Add elf32-d10v.o.
+ * archures.c: Add bfd_d10v_arch.
+ * bfd-in2.h: Add bfd_d10v_arch.
+ * config.bfd (d10v-*-*): New target.
+ * configure: (bfd_elf32_d10v_vec) New vector.
+ * configure.in: (bfd_elf32_d10v_vec) New vector.
+ * cpu-d10v.c: New file.
+ * elf.c (prep_headers): Added case bfd_arch_d10v.
+ * elf32-d10v.c: New file.
+ * libbfd.h: Rebuild.
+ * reloc.c (BFD_RELOC_D10V_10_PCREL_R, BFD_RELOC_D10V_10_PCREL_L,
+ BFD_RELOC_D10V_18, BFD_RELOC_D10V_18_PCREL): Define.
+ * targets.c (bfd_elf32_d10v_vec): New vector.
+
+Wed Jul 17 10:58:55 1996 Kim Knuttila <krk@cygnus.com>
+
+ * coff-ppc.c (coff_ppc_relocate_section): Removed bogus fprintf
+
+Tue Jul 16 23:49:02 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * archures.c bfd-in2.h: Add bfd_mach_i386_i386 and
+ bfd_mach_i386_i8086 machine types.
+
+Wed Jul 10 12:42:56 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ecoff.c (_bfd_ecoff_new_section_hook): Set SEC_CODE for _INIT
+ and _FINI sections.
+
+Wed Jul 10 11:18:21 1996 Richard Henderson <rth@tamu.edu>
+
+ * coffcode.h (coff_set_section_contents): A/UX does not require
+ special handling of the _LIB section.
+
+Tue Jul 9 15:52:20 1996 Jeffrey A Law (law@cygnus.com)
+
+ * coff-h8300.c (h8300_reloc16_extra_cases): Use the correct
+ value for R_RELBYTE.
+
+ * reloc16.c (bfd_coff_reloc16_relax_section): Only "shrinks"
+ array if one was allocated.
+
+Tue Jul 9 12:21:54 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ From Kazumoto Kojima <kkojima@kk.info.kanagawa-u.ac.jp>:
+ * elf32-mips.c (struct mips_elf_link_hash_table): Add new fields
+ use_rld_obj_head and rld_value.
+ (mips_elf_link_hash_table_create): Initialize new fields.
+ (mips_elf_add_symbol_hook): Mark __rld_obj_head symbol as
+ dynamic.
+ (mips_elf_create_dynamic_sections): Create .rld_map section. If
+ __rld_obj_head symbol not seen, create an __rld_map symbol.
+ (mips_elf_size_dynamic_sections): Make space in .rld_map section.
+ Create a DT_MIPS_RLD_MAP entry rather than a DT_DEBUG entry.
+ (mips_elf_finish_dynamic_symbol): Save value of __rld_map or
+ __rld_obj_head symbol.
+ (mips_elf_finish_dynamic_sections): Handle DT_MIPS_RLD_MAP.
+
+Mon Jul 8 16:18:03 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-mips.c (mips_reloc_map): Remove BFD_RELOC_32_PCREL entry.
+
+ * elf32-ppc.c (ppc_elf_howto_raw): For R_PPC_ADDR16_HA, use
+ ppc_elf_addr16_ha_reloc.
+ (ppc_elf_addr16_ha_reloc): New static function.
+
+ * coff-mips.c (struct mips_hi): Define.
+ (mips_refhi_list): New static variable.
+ (mips_refhi_addr, mips_refhi_addend): Remove.
+ (mips_refhi_reloc): Maintain a list of unmatched REFHI relocs.
+ (mips_reflo_reloc): Process mips_refhi_list.
+ (mips_relhi_list): New static variable.
+ (mips_relhi_addr, mips_relhi_addend): Remove.
+ (mips_relhi_reloc): Maintain a list of unmatched RELHI relocs.
+ (mips_rello_reloc): Process mips_relhi_list.
+ (mips_relocate_section): Permit an arbitrary number of REFHI or
+ RELHI relocs before the associated REFLO or RELLO reloc.
+
+Fri Jul 5 19:27:49 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * aout-target.h (MY(callback)): Set reloc_count fields.
+
+Thu Jul 4 12:00:37 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * sunos.c (sunos_add_dynamic_symbols): Don't create dynamic
+ sections unless this is a SunOS link.
+
+ * VERSION: Set to 2.7.1.
+
+ * Released binutils 2.7.
+
+Wed Jul 3 14:59:47 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * i386aout.c: Include "aout/aout64.h".
+ (i386aout_write_object_contents): New static function.
+ (MY_write_object_contents): Define.
+
+ * netbsd.h (MY(write_object_contents)): Make sure that
+ adjust_sizes_and_vmas is called before fiddling with the magic
+ number.
+
+Tue Jul 2 23:30:39 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * stabs.c (_bfd_link_section_stabs): Fix casts of psinfo.
+
+Sun Jun 30 13:34:33 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * libbfd-in.h (itos, stoi): Don't define.
+ * libbfd.h: Rebuild.
+ * i386lynx.c (KEEPIT): Define as udata.i.
+ (NAME(lynx,swap_std_reloc_out)): Don't use stoi.
+ (NAME(lynx,swap_ext_reloc_out)): Likewise.
+ * riscix.c (riscix_swap_std_reloc_out): Use udata.i rather than
+ flags. Don't use stoi.
+
+ * elf32-mips.c (ELF_MAGPAGESIZE): Change definition to 0x1000.
+
+ * elf.c (map_sections_to_segments): Don't start a new segment for
+ a writable section if it's on the same page as the previous
+ segment. Reset the writable variable for a readonly section.
+
+Sat Jun 29 16:18:51 1996 Kim Knuttila <krk@cygnus.com>
+
+ * peicode.h (coff_swap_aouthdr_in): Missing initializations of
+ first_thunk_address, thunk_size, and import_table_size.
+ * peicode.h: Improved some diagnostics regarding edata sections.
+
+ * coff-ppc.c (coff_ppc_relocate_section): Earlier error check
+ on IMGLUE relocs.
+ (coff_ppc_relocate_section): Improved diagnostic for large TOCDEFN's.
+ (TARGET_LITTLE_SYM): Added missing D_PAGED.
+
+Fri Jun 28 13:48:45 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (xcoff_link_check_ar_symbols): An undefined symbol
+ with XCOFF_DEF_DYNAMIC set is really defined.
+ (xcoff_link_check_dynamic_ar_symbols): Likewise.
+ (xcoff_link_add_symbols): Only create special sections if using an
+ XCOFF hash table.
+
+ * reloc.c (bfd_perform_relocation): Handle xcoff-powermac like
+ aixcoff-rs6000.
+ (bfd_install_relocation): Likewise.
+
+Fri Jun 28 11:17:00 1996 Richard Henderson <rth@tamu.edu>
+
+ * elf64-alpha.c (struct alpha_elf_link_hash_entry): Add flags
+ field.
+ (ALPHA_ELF_LINK_HASH_LU_ADDR): Define.
+ (ALPHA_ELF_LINK_HASH_LU_MEM): Define.
+ (ALPHA_ELF_LINK_HASH_LU_FUNC): Define.
+ (elf64_alpha_link_hash_newfunc): Initialize flags field.
+ (elf64_alpha_check_relocs): Record types of LITUSE entries that
+ are found for LITERAL relocs.
+ (elf64_alpha_adjust_dynamic_symbol): If a symbol has its address
+ taken, we cannot generate a .plt entry for the symbol.
+
+Thu Jun 27 11:24:29 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Add AC_ISC_POSIX, and check for setitimer and
+ sysconf functions (for gprof).
+ * configure, config.in: Rebuild.
+
+Wed Jun 26 16:29:02 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ecoff.c (_bfd_ecoff_archive_p): Check the first object file in
+ an archive if it has a map. If the object file has the wrong
+ xvec, reject it.
+
+ * coff-alpha.c (alpha_adjust_reloc_in): Set the addend for a
+ BRADDR, SREL16, SREL32, or SREL64 reloc against an external
+ symbol.
+ (alpha_relocate_section): Likewise.
+
+ * coffswap.h (coff_swap_reloc_out): Use RELSZ, not sizeof.
+ (coff_swap_filehdr_out): Use FILHSZ, not sizeof.
+ (coff_swap_sym_out): Use SYMESZ, not sizeof.
+ (coff_swap_aux_out): Use AUXESZ, not sizeof.
+ (coff_swap_lineno_out): Use LINESZ, not sizeof.
+ (coff_swap_aouthdr_out): Use AOUTSZ, not sizeof.
+ (coff_swap_scnhdr_out): Use SCNHSZ, not sizeof.
+ * peicode.h: Corresponding changes.
+
+Tue Jun 25 15:28:34 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elflink.h (elf_create_pointer_linker_section): Comment out code
+ dealing with making GOT pointers negative of the GOT symbol for
+ now.
+
+Tue Jun 25 11:41:24 1996 Richard Henderson <rth@tamu.edu>
+
+ * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't
+ increment the .rela.plt size until after we're done creating the
+ .plt entry.
+ (elf64_alpha_finish_dynamic_symbol): Change .plt entry to load the
+ .rela.plt offset directly rather than calculating it.
+
+Mon Jun 24 17:15:10 1996 Jason Molenda (crash@godzilla.cygnus.co.jp)
+
+ * Makefile.in, (bindir, libdir, datadir, mandir, infodir, includedir):
+ Use autoconf-set values.
+ * doc/Makefile.in (bindir, libdir, datadir, mandir, infodir,
+ includedir, INSTALL, INSTALL_PROGRAM, INSTALL_DATA): Use autoconf-set
+ values.
+ (docdir): Deleted.
+ * configure.in (AC_PREREQ): autoconf v2.5 or higher.
+ * configure: Rebuilt.
+
+Mon Jun 24 22:50:35 1996 Jeffrey A Law (law@cygnus.com)
+
+ * som.c (som_write_fixups): Fix typo in R_END_TRY for exception
+ handling code > 1k away.
+
+Mon Jun 24 18:41:06 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elflink.h (elf_create_pointer_linker_section): If DEBUG is
+ defined, output whenever the symbol is updated.
+
+Mon Jun 24 17:58:12 1996 Jouke Numan <jnuman@bazis.nl>
+
+ * elf.c (elf_fake_sections): Don't set sh_addr of a non SEC_ALLOC
+ section to 0 if user_set_vma is set.
+ * elflink.h (elf_bfd_final_link): Likewise.
+
+Sun Jun 23 20:42:51 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ Partially undo patch of Jun 20.
+ * coffcode.h (coff_set_alignment_hook): Use COFF_IMAGE_WITH_PE.
+ (coff_compute_section_file_positions): Likewise.
+ (coff_write_object_contents): Likewise. Re-add deleted code, but
+ use #ifdef COFF_WITH_PE, not COFF_OBJ_WITH_PE.
+ * peicode.h (pe_bfd_copy_private_bfd_data): Re-add #ifdef.
+
+Fri Jun 21 17:38:15 1996 Joel Sherrill <joel@merlin.gcs.redstone.army.mil>
+
+ * config.bfd: Add support for *-*-rtems* configurations.
+
+Fri Jun 21 15:19:59 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (prep_headers): Add bfd_arch_alpha case.
+
+Fri Jun 21 12:35:27 1996 Richard Henderson <rth@tamu.edu>
+
+ * elf64-alpha.c: New file.
+ * config.bfd (alpha-*-linuxecoff*): New target.
+ (alpha-*-linux*, alpha-*-elf*): New targets.
+ * configure.in (bfd_elf64_alpha_vec): New vector.
+ * configure: Rebuild.
+ * targets.c (bfd_elf64_alpha_vec): Declare.
+ (bfd_target_vector): Add bfd_elf64_alpha_vec if BFD64.
+ * reloc.c (BFD_RELOC_ALPHA_GPDISP): Define.
+ * bfd-in2.h, libbfd.h: Rebuild.
+ * Makefile.in: Rebuild dependencies.
+ (BFD64_BACKENDS): Add elf64-alpha.o.
+ (BFD64_BACKENDS_CFILES): Add elf64-alpha.c.
+
+Thu Jun 20 18:14:25 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ecoff.c (ecoff_armap_hash): If hlog is 0, just return 0, rather
+ than relying on a right shift of 32.
+
+Thu Jun 20 11:00:57 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * coffcode.h (coff_set_alignment_hook): Change COFF_IMAGE_WITH_PE
+ ifdef to COFF_WITH_PE.
+ (coff_compute_section_file_positions): Likewise.
+ (coff_write_object_contents): Likewise. Delete COFF_OBJ_WITH_PE.
+ * pe-{arm,i386,ppc}.c (COFF_OBJ_WITH_PE): Delete.
+ * peicode.h (pe_bfd_copy_private_bfd_data): Delete ifdef
+ COFF_IMAGE_WITH_PE, always include.
+
+ * peicode.h (coff_swap_scnhdr_out): ".drectve" doesn't have trailing 0.
+
+Wed Jun 19 11:37:52 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (map_sections_to_segments): Fix up the test for -Ttext to
+ approximate the correct answer if SIZEOF_HEADERS was not used.
+
+ * binary.c (binary_set_section_contents): Set section file
+ position based on LMA rather than VMA.
+
+Wed Jun 19 11:19:25 1996 Manfred Hollstein KS/EIC5 60/3/142 #40283 <manfred@lts.sel.alcatel.de>
+
+ * linker.c (_bfd_generic_link_output_symbols): Don't output any
+ symbols if info->strip == strip_all.
+
+Tue Jun 18 15:17:36 1996 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * coff-h8300.c: Remove #if 0 code.
+ (compatable): Don't allow mixing/matching of different architectures.
+
+ * archures.c (bfd_mach_h8300s): Add.
+ * bfd-in2.h: Rebuilt.
+ * coff-h8300.c (funcvec_hash_newfunc): Handle H8/S too.
+ (BADMAG): Likewise.
+ (h8300_reloc16_estimate): Likewise.
+ (h8300_reloc16_extra_cases): Likewise.
+ (h8300_bfd_link_add_symbols): Likewise.
+ * coffcode.h (coff_set_arch_mach_hook): Likewise.
+ (coff_set_flags): Likewise.
+ * cpu-h8300.c (h8300_scan): Likewise.
+ Add H8/S to bfd_h8300_arch list.
+
+Tue Jun 18 14:42:58 1996 Klaus Kaempf <kkaempf@progis.de>
+
+ Added support for Alpha OpenVMS:
+ * evax.h, evax-alpha.c, evax-egsd.c, evax-emh.c: New files.
+ * evax-etir.c, evax-misc.c, hosts/alphavms.h: New files.
+ * config.h-vms, makefile.vms: New files.
+ * config.bfd (alpha-*-*vms*): New target.
+ * configure.in (evax_alpha_vec): New target vector.
+ * configure: Rebuild.
+ * reloc.c (BFD_RELOC_SWREL32, BFD_RELOC_SWREL64): Define.
+ (BFD_RELOC_ALPHA_LINKAGE, BFD_RELOC_ALPHA_BASEREG): Define.
+ * targets.c (bfd_target_evax_flavour): Define.
+ (evax_alpha_vec): Declare.
+ (bfd_target_vector): Add ecoffalpha_little_vec and evax_alpha_vec
+ if BFD64 is defined.
+ * bfd-in2.h, libbfd.h: Rebuild.
+ * Makefile.in: Rebuild dependencies.
+ (BFD64_BACKENDS): Add evax-alpha.o, evax-egsd.o, evax-etir.o,
+ evax-emh.o, and evax-misc.o.
+ (BFD64_BACKENDS_CFILES): Add evax-alpha.c, evax-egsd.c,
+ evax-etir.c, evax-emh.c, and evax-misc.c.
+ (HFILES): Add evax.h.
+
+Tue Jun 18 13:54:18 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-h8300.c (h8300_reloc16_extra_cases): Make name a const
+ pointer.
+ (h8300_bfd_link_add_symbols): Likewise.
+
+Mon Jun 17 10:06:50 1996 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * som.h (R_HPPA_BEGIN_TRY, R_HPPA_END_TRY): Define.
+ * som.c (som_write_fixups): Handle R_BEGIN_TRY and R_END_TRY.
+
+Mon Jun 17 12:49:11 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-mips.c (mips_elf_relocate_section): Don't create a reloc
+ for R_MIPS_REL32 and R_MIPS_32 relocs if no dynamic sections were
+ created.
+ (mips_elf_check_relocs): Only create .rel.dyn for R_MIPS_REL32 and
+ R_MIPS_32 relocs if creating a shared library.
+
+Thu Jun 13 20:14:51 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * peicode.h (add_data_entry): Use pei_section_data rather than
+ _cooked_size. Corresponds to May 13 change in coffcode.h.
+
+Thu Jun 13 10:23:40 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * cofflink.c (_bfd_coff_final_link): Handle long section names.
+ * coffcode.h (coff_write_object_contents): If there are long
+ section names, always set the f_symptr field, even if there are no
+ symbols.
+ * peicode.h (coff_swap_filehdr_in): Don't clear the f_symptr field
+ if there are no symbols.
+
+ * coffgen.c (make_a_section_from_file): Check return value of
+ _bfd_coff_read_string_table.
+ (coff_real_object_p): Check return value of
+ make_a_section_from_file.
+ (_bfd_coff_read_string_table): Check that there are some symbols
+ before trying to read the string table size.
+
+Wed Jun 12 11:16:37 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (xcoff_link_add_symbols): When considering whether
+ to replace a symbol in a dynamic object with a symbol from another
+ dynamic object, do the replacement if the existing symbol is
+ global linkage code.
+
+ * xcofflink.c (_bfd_ppc_xcoff_relocate_section): Check explicitly
+ for _ptrgl, and treat it as global linkage code.
+
+ * aoutx.h (NAME(aout,find_nearest_line)): Notice if we find a
+ filename or N_SO symbol past the offset, and use it to indicate
+ that there is no line number or function when appropriate.
+
+Tue Jun 11 15:24:48 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (xcoff_build_ldsyms): Set XCOFF_DEF_REGULAR for a
+ common symbol defined by the linker. Don't export function code
+ even if export_defineds is set.
+
+Mon Jun 10 11:57:27 1996 Jeffrey A Law (law@cygnus.com)
+
+ * coff-h8300.c (howto_table): Add new entries for R_BCC_INV
+ and R_JMP_DEL.
+ (rtype2howto): Handle R_BCC_INV and R_JMP_DEL.
+ (h8300_symbol_address_p): New function.
+ (h8300_reloc16_estimate): Eliminate jumps made unnecessary by
+ relaxing.
+
+Sun Jun 9 16:30:20 1996 Jeffrey A Law (law@cygnus.com)
+
+ * coff-h8300.c (h8300_reloc16_estimate): Fix many minor spacing
+ problems.
+ (h8300_reloc16_estimate, cases R_JMP1, R_JMP2): Adjust "dot"
+ correctly for the two variants. Allow relaxing if the target
+ is 128 bytes away since after relaxation it'll be 126 bytes away.
+ (h8300_reloc16_estimate, case R_PCRWORD): Correctly adjust
+ "dot" and "value". Allow relaxing if the target is 128 bytes
+ away since after relaxation it'll be 126 bytes away.
+ * reloc16.c (bfd_coff_reloc16_relax_section): Keep relaxing
+ the given section until nothing changes.
+
+Thu Jun 6 15:24:45 1996 Richard Henderson <rth@tamu.edu>
+
+ * ecoff.c (_bfd_ecoff_new_section_hook): Remove the _PDATA
+ alignment hack--we can get the lnnoptr info another way without
+ suddenly increasing the alignment requirements. Set the flags for
+ the _PDATA section.
+ (ecoff_compute_section_file_positions): Do so.
+
+Thu Jun 6 11:24:37 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ieee.c (ieee_write_object_contents): Put a timestamp in the file
+ to keep the HP emulator database happy.
+
+ * config.bfd: Recognize powerpc-*-linux* and powerpcle-*-linux*.
+ From Kevin Buettner <kev@primenet.com>.
+
+Wed Jun 5 15:16:04 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * aoutx.h (translate_to_native_sym_flags): Don't try to print the
+ name of a NULL section.
+
+Tue Jun 4 18:53:58 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * linker.c (_bfd_generic_link_add_one_symbol): If notice_all is
+ set, always call the notice callback.
+
+ * VERSION: Increment for bfdlink.h change.
+
+Mon Jun 3 11:01:53 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-sh.c (COFF_DEFAULT_SECTION_ALIGNMENT_POWER): Set to 4.
+ (sh_relax_delete_bytes): Correct handling of differently sized
+ trailing alignment reloc.
+
+ * bfd-in.h: Use #error if BFD_HOST_64_BIT can not be defined.
+ * bfd-in2.h: Rebuild.
+ * configure.in: Warn if there is no known 64 bit type.
+ * configure: Rebuild.
+
+ * Makefile.in: Rebuild dependencies.
+ (BFD32_BACKENDS): Add ppcboot.o.
+ (BFD32_BACKENDS_CFILES): Add ppcboot.c.
+
+ * elf32-mips.c (mips_elf_size_dynamic_sections): Initialize c.
+ From Per Fogelstrom <per.fogelstrom@mailbox200.swipnet.se>.
+
+Sat Jun 1 21:49:58 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf64-mips.c (bfd_mips_elf64_swap_reginfo_in)
+ (bfd_mips_elf64_swap_reginfo_out): Move from here...
+ * elf32-mips.c (bfd_mips_elf64_swap_reginfo_in)
+ (bfd_mips_elf64_swap_reginfo_out): ...to here.
+
+Fri May 31 13:51:28 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf64-mips.c: Improve reloc special_functions and handling of
+ SHT_MIPS_OPTIONS section.
+ * elf32-mips.c (_bfd_mips_elf_hi16_reloc): Rename from
+ mips_elf_hi16_reloc and make globally visible.
+ (_bfd_mips_elf_lo16_reloc): Rename from mips_elf_lo16_reloc and
+ make globally visible.
+ (_bfd_mips_elf_got16_reloc): Rename from mips_elf_got16_reloc and
+ make globally visible.
+ (_bfd_mips_elf_gprel16_reloc): Rename from mips_elf_gprel16_reloc
+ and make globally visible.
+ (gprel16_with_gp): Check howto->src_mask before using value in
+ insn.
+ (_bfd_mips_elf_gprel32_reloc): Rename from mips_elf_gprel32_reloc
+ and make globally visible.
+ (gprel32_with_gp): Check howto->src_mask before fetching value.
+ (bfd_mips_elf_swap_options_in): New function.
+ (bfd_mips_elf_swap_options_out): New function.
+ (_bfd_mips_elf_set_private_flags): Rename from
+ mips_elf_set_private_flags and make globally visible.
+ (_bfd_mips_elf_copy_private_bfd_data): Rename from
+ mips_elf_copy_private_bfd_data and make globally visible.
+ (_bfd_mips_elf_merge_private_bfd_data): Rename from
+ mips_elf_merge_private_bfd_data and make globally visible.
+ (_bfd_mips_elf_section_from_shdr): Accept .MIPS.options as a name
+ for a SHT_MIPS_OPTIONS section.
+ (mips_elf32_section_from_shdr): Handle SHT_MIPS_OPTIONS section.
+ (_bfd_mips_elf_fake_sections): Consider .MIPS.options to be the
+ name of a SHT_MIPS_OPTIONS section.
+ (_bfd_mips_elf_set_section_contents): New function.
+ (mips_elf32_section_processing): Set the GP value in a
+ SHT_MIPS_OPTIONS section.
+ (_bfd_mips_elf_find_nearest_line): Rename from
+ mips_elf_find_nearest_line and make globally visible.
+ (bfd_elf32_set_section_contents): Define.
+ * elf-bfd.h (_bfd_mips_elf_hi16_reloc): Declare.
+ (_bfd_mips_elf_lo16_reloc): Declare.
+ (_bfd_mips_elf_gprel16_reloc): Declare.
+ (_bfd_mips_elf_got16_reloc): Declare.
+ (_bfd_mips_elf_gprel32_reloc): Declare.
+ (_bfd_mips_elf_set_private_flags): Declare.
+ (_bfd_mips_elf_copy_private_bfd_data): Declare.
+ (_bfd_mips_elf_merge_private_bfd_data): Declare.
+ (_bfd_mips_elf_find_nearest_line): Declare.
+ (_bfd_mips_elf_set_section_contents): Declare.
+
+ * elf32-hppa.c (elf32_hppa_info_to_howto): Rename from
+ elf_info_to_howto.
+ (elf_info_to_howto): Define.
+ * elf32-sparc.c (elf32_sparc_info_to_howto): Rename from
+ elf_info_to_howto.
+ (elf_info_to_howto): Define.
+ * elf64-sparc.c (sparc64_elf_info_to_howto): Rename from
+ elf_info_to_howto.
+ (elf_info_to_howto): Define.
+
+ * coff-w65.c (h8300_reloc16_estimate): Rename R_MOVB[12] to
+ R_MOV16B[12], to match change in coff/internal.h.
+
+Thu May 30 12:38:49 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf64-mips.c: Extensive additions to provide better support for
+ writing files and for gas.
+ * elf32-mips.c (_bfd_mips_elf_object_p): New function, broken out
+ of mips_elf_object_p.
+ (mips_elf32_object_p): Rename from mips_elf_object_p; call
+ _bfd_mips_elf_object_p.
+ (_bfd_mips_elf_final_write_processing): Rename from
+ mips_elf_final_write_processing and make globally visible.
+ (_bfd_mips_elf_fake_sections): Rename from
+ mips_elf_fake_sections and make globally visible.
+ (_bfd_mips_elf_section_from_bfd_section): Rename from
+ mips_elf_section_from_bfd_section and make globally visible.
+ (_bfd_mips_elf_section_processing): New function, broken out of
+ mips_elf_section_processing.
+ (mips_elf32_section_processing): Rename from
+ mips_elf_section_processing; call
+ _bfd_mips_elf_section_processing.
+ (_bfd_mips_elf_symbol_processing): Rename from
+ mips_elf_symbol_processing and make globally visible.
+ (_bfd_mips_elf_read_ecoff_info): Rename from
+ mips_elf_read_ecoff_info and make globally visible.
+ (mips_elf32_ecoff_debug_swap): Rename from
+ mips_elf_ecoff_debug_swap.
+ * elf.c (_bfd_elf_symbol_from_bfd_symbol): Use asymbol rather than
+ struct symbol_cache_entry.
+ (_bfd_elf_validate_reloc): New function, moved in from
+ elfcode.h:validate_reloc.
+ * elfcode.h (validate_reloc): Remove; moved into elf.c and renamed
+ to _bfd_elf_validate_reloc. Change all callers.
+ * elf-bfd.h (bfd_section_from_shdr): Declare.
+ (_bfd_elf_symbol_from_bfd_symbol): Declare.
+ (_bfd_elf_validate_reloc): Declare.
+ (_bfd_mips_elf_object_p): Declare.
+ (_bfd_mips_elf_fake_sections): Declare.
+ (_bfd_mips_elf_section_from_bfd_section): Declare.
+ (_bfd_mips_elf_section_processing): Declare.
+ (_bfd_mips_elf_symbol_processing): Declare.
+ (_bfd_mips_elf_read_ecoff_info): Declare.
+ (_bfd_mips_elf_final_write_processing): Declare.
+ * elfxx-target.h (bfd_elfNN_get_reloc_upper_bound): Don't define
+ if already defined.
+
+ * elf32-mips.c (mips_elf_object_p): Handle E_MIPS_ARCH_4.
+ (mips_elf_final_write_processing): Likewise.
+
+Wed May 29 16:15:29 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ 64-bit MIPS ELF ABI objdump support:
+ * elf64-mips.c: New file.
+ * Makefile.in: Rebuild dependencies.
+ (BFD64_BACKENDS): Add elf64-mips.o.
+ (BFD64_BACKENDS_CFILES): Add elf64-mips.c.
+ * config.bfd (mips*el-*-elf*) Add bfd_elf64_bigmips_vec and
+ bfd_elf64_littlemips_vec to targ_selvecs.
+ (mips*-*-elf*): Likewise.
+ * confingure.in: Add bfd_elf64_bigmips_vec and
+ bfd_elf64_littlemips_vec to vector switch.
+ * configure: Rebuild.
+ * elf32-mips.c (_bfd_mips_elf_section_from_shdr): New function,
+ broken out of mips_elf_section_from_shdr.
+ (mips_elf32_section_from_shdr): Rename from
+ mips_elf_section_from_shdr. Call new function.
+ (elf_backend_section_from_shdr): Update name of renamed function.
+ * elf-bfd.h (struct elf_size_info): Change second parameter of
+ write_out_phdrs to be const. Likewise for second parameter of
+ swap_symbol_out.
+ (struct bfd_elf_section_data): Add rel_hdr2 field.
+ (bfd_elf32_swap_symbol_in): Change second parameter to be const.
+ (bfd_elf32_swap_symbol_out): Likewise.
+ (bfd_elf32_swap_reloc_in): Likewise.
+ (bfd_elf32_swap_reloc_out): Likewise.
+ (bfd_elf32_swap_reloca_in): Likewise.
+ (bfd_elf32_swap_reloca_out): Likewise.
+ (bfd_elf32_swap_phdr_in): Likewise.
+ (bfd_elf32_swap_phdr_out): Likewise.
+ (bfd_elf32_swap_dyn_in): Likewise.
+ (bfd_elf32_swap_dyn_out): Likewise.
+ (bfd_elf32_slurp_symbol_table): Declare.
+ (bfd_elf32_write_shdrs_and_ehdr): Declare.
+ (bfd_elf32_write_out_phdrs): Declare.
+ (bfd_elf64_swap_symbol_in): Change second parameter to be const.
+ (bfd_elf64_swap_symbol_out): Likewise.
+ (bfd_elf64_swap_reloc_in): Likewise.
+ (bfd_elf64_swap_reloc_out): Likewise.
+ (bfd_elf64_swap_reloca_in): Likewise.
+ (bfd_elf64_swap_reloca_out): Likewise.
+ (bfd_elf64_swap_phdr_in): Likewise.
+ (bfd_elf64_swap_phdr_out): Likewise.
+ (bfd_elf64_swap_dyn_in): Likewise.
+ (bfd_elf64_swap_dyn_out): Likewise.
+ (bfd_elf64_slurp_symbol_table): Declare.
+ (bfd_elf64_write_shdrs_and_ehdr): Declare.
+ (bfd_elf64_write_out_phdrs): Declare.
+ (_bfd_mips_elf_section_from_shdr): Declare.
+ * elf.c (bfd_section_from_shdr): Remove assertion requiring
+ SHT_REL/SHT_RELA to match use_rela_p. If there is already a reloc
+ section for the section, add the new one to rel_hdr2. Increment
+ reloc_count rather than setting it.
+ * elfcode.h (elf_slurp_symbol_table): Define name as macro.
+ Remove static declaration.
+ (elf_write_shdrs_and_ehdr): Define name as macro.
+ (elf_write_out_phdrs): Likewise.
+ (elf_swap_ehdr_in, elf_swap_ehdr_out): Declare.
+ (elf_swap_shdr_in, elf_swap_shdr_out): Declare.
+ (elf_swap_symbol_in): Change second parameter to be const.
+ (elf_swap_symbol_out): Likewise.
+ (elf_swap_ehdr_in, elf_swap_ehdr_out): Likewise.
+ (elf_swap_shdr_in, elf_swap_shdr_out): Likewise.
+ (elf_swap_phdr_in, elf_swap_phdr_out): Likewise.
+ (elf_swap_reloc_in, elf_swap_reloc_out): Likewise.
+ (elf_swap_reloca_in, elf_swap_reloca_out): Likewise.
+ (elf_write_out_phdrs): Rename from write_out_phdrs. Change second
+ parameter to be const. Make non-static.
+ (elf_write_shdrs_and_ehdr): Rename from write_shdrs_and_ehdr.
+ Make non-static.
+ (elf_slurp_symbol_table): Make non-static.
+ (NAME(_bfd_elf,size_info)): Update names of renamed functions.
+ * elfxx-target.h (elf_info_to_howto): Define if not defined.
+ (elf_backend_size_info): Likewise.
+ (elfNN_bed): Use elf_backend_size_info.
+ * targets.c (bfd_elf64_bigmips_vec): Declare.
+ (bfd_elf64_littlemips_vec): Declare.
+ (bfd_target_vector): Add bfd_elf64_bigmips_vec and
+ bfd_elf64_littlemips_vec if BFD64 is defined.
+
+ * libbfd.c (bfd_get_file_window): Add cast to fprintf argument.
+
+Tue May 28 11:42:08 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-sh.c (sh_relax_delete_bytes): Insert nop instructions, not
+ zeroes, in alignment holes.
+
+ * configure: Rebuild with autoconf 2.10.
+
+ * aoutx.h (NAME(aout,find_nearest_line)): Make room for the
+ potential leading underscore in the allocated buffer.
+
+Fri May 24 14:28:38 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_add_symbol_hook): Do not put small common
+ symbols into .sbss if this is a relocatable link.
+
+Thu May 23 12:26:24 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (_bfd_ppc_xcoff_relocate_section): Warn about
+ undefined symbols when creating a shared library.
+
+Fri May 17 13:54:15 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-sh.c: Add a bunch of new code and static const arrays to
+ support aligning loads and stores on four byte memory boundaries.
+ Also:
+ (sh_coff_howtos): Add entries for R_SH_CODE, R_SH_DATA and
+ R_SH_LABEL.
+ (sh_relax_section): Look for R_SH_CODE relocs. If we find one,
+ call sh_align_loads.
+ (sh_relax_delete_bytes): Don't mark R_SH_CODE or R_SH_DATA relocs
+ as unused.
+
+Thu May 16 16:34:13 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * cache.c (bfd_open_file): Unlink the file before opening it for
+ write. From Marty Leisner <leisner@sdsp.mc.xerox.com>.
+
+ * opncls.c (bfd_fdopenr): Set opened_once.
+
+Tue May 14 12:35:32 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * som.c (som_slurp_reloc_table): Clear external_relocs cache after
+ freeing it.
+
+ * libbfd.c: Remove #ifdef FILE_OFFSET_IS_CHAR_INDEX, and compile
+ the code unconditionally.
+
+Mon May 13 19:51:37 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * libcoff-in.h (struct pei_section_tdata): Define structure.
+ (pei_section_data): Define macro.
+ * libcoff.h: Rebuild.
+ * coffcode.h (coff_set_alignment_hook): If COFF_IMAGE_WITH_PE,
+ store s_paddr field in pei_section_data.
+ (coff_compute_section_file_positions): Use pei_section_data rather
+ than _cooked_size, and don't overwrite an existing value.
+ (coff_write_object_contents): If COFF_OBJ_WITH_PE, set s_paddr to
+ 0. If COFF_IMAGE_WITH_PE, set s_paddr to pei_section_data.
+ * peicode.h (coff_bfd_copy_private_section_data): Define if
+ COFF_IMAGE_WITH_PE.
+ (pe_bfd_copy_private_section_data): New static function if
+ COFF_IMAGE_WITH_PE.
+
+Wed May 8 16:10:38 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * srec.c (srec_set_arch_mach): Write as a function rather than a
+ macro definition.
+
+ * xcofflink.c (_bfd_xcoff_bfd_link_add_symbols): If an archive has
+ no map, just check each member in turn to see whether it is
+ required.
+
+Wed May 8 09:17:34 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * ppcboot.c (ppcboot_object_p): Check for type 0x41 in partition
+ table. Call BFD_ASSERT to validate header size, instead of
+ calling fatal.
+ (ppcboot_bfd_print_private_bfd_data): Put quotes around partition
+ name.
+
+Tue May 7 16:10:19 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * ppcboot.c: New target for looking at PPCbug boot records.
+
+ * config{ure.in,.bfd}: Add support for ppcboot target.
+ * targets.c: Ditto.
+ * configure: Regenerate.
+
+Tue May 7 11:15:19 1996 Jeffrey A Law (law@cygnus.com)
+
+ * coff-h8300.c (howto_table): Update names to match recent
+ changes to include/coff/internal.h. Fix minor errors in the
+ existing relocs. Add R_MOVL1 and R_MOVL2.
+ (rtype2howto): Similarly.
+ (h8300_reloc16_estimate): Rewrite to simplify, fix bugs in the
+ existing relaxing code and peform more relaxing.
+ (h8300_reloc16_extra_cases): Likewise.
+
+Mon May 6 18:24:09 1996 Jeffrey A Law (law@cygnus.com)
+
+ * reloc16.c (bfd_coff_reloc16_get_value): Handle common
+ symbols correctly.
+
+Sat May 4 05:08:45 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * elfcode.h (elf_object_p): Reject generic ELF target if
+ e_machine matches an alternate machine code in a specific backend.
+
+ * netbsd-core.c (netbsd_core_vec): Remove initializer for
+ obsolete align_power_min field.
+
+Fri May 3 13:07:35 1996 Jeffrey A Law (law@cygnus.com)
+
+ * coff-h8300.c (reloc_howto_type): Add howto entry for
+ R_PCRWORD_B.
+ (rtype2howto): Handle R_PCRWORD_B.
+ (h8300_reloc16_extra_cases): Handle R_PCRWORD_B.
+ (h8300_reloc_16_estimate): Likewise. Try to turn a 16bit
+ pc-relative branch (R_PCRWORD) into an 8bit pc-relative
+ branch (R_PCWORD_B).
+
+Fri May 3 10:47:41 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * aoutx.h (translate_from_native_sym_flags): Set the section for
+ BSF_CONSTRUCTOR symbols.
+
+ * cofflink.c (_bfd_coff_link_input_bfd): Correct setting of
+ last_bf_index.
+
+Wed May 1 18:39:32 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * coffcode.h (coff_write_object_contents): In comdat section lookup,
+ stop looking when section is found.
+
+Wed May 1 14:17:57 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffcode.h (STRING_SIZE_SIZE): Define.
+ (styp_to_sec_flags): Handle long symbol names when looking for the
+ section symbol.
+ (bfd_coff_backend_data): Add _bfd_coff_long_section_names field.
+ (bfd_coff_long_section_names): Define.
+ (coff_write_object_contents): Handle long section names.
+ (bfd_coff_std_swap_table): Initialize new field.
+ * libcoff.h: Rebuild.
+ * coffgen.c (make_a_section_from_file): Handle long section
+ names.
+ (coff_write_symbols): Handle long section names.
+ * coff-alpha.c (alpha_ecoff_backend_data): Initialize new field.
+ * coff-mips.c (mips_ecoff_backend_data): Likewise.
+ * pe-arm.c (COFF_LONG_SECTION_NAMES): Define.
+ * pei-arm.c (COFF_LONG_SECTION_NAMES): Define.
+ * pe-i386.c (COFF_LONG_SECTION_NAMES): Define.
+ * pei-i386.c (COFF_LONG_SECTION_NAMES): Define.
+ * pe-ppc.c (COFF_LONG_SECTION_NAMES): Define.
+ * pei-ppc.c (COFF_LONG_SECTION_NAMES): Define.
+
+ * bout.c (b_out_callback): Set lma of sections.
+ (b_out_bfd_get_relocated_section_contents): Rename in_abfd
+ parameter to output_bfd. Used input_bfd instead of output_bfd in
+ several places.
+
+Tue Apr 30 17:56:39 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * aoutx.h (translate_from_native_sym_flags): Don't create
+ SEC_CONSTRUCTOR sections.
+ * ecoff.c (ecoff_set_symbol_info): Likewise.
+
+ * elf32-mips.c (mips_elf_copy_private_bfd_data): Copy elf_gp.
+ From Don Bowman <bowman@waterloo.hp.com>.
+
+Tue Apr 30 17:06:32 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * coff-arm.c (armcoff_little_vec): If COFF_WITH_PE is defined, add
+ SEC_LINK_ONCE and SEC_LINK_DUPLICATES to section_flags.
+
+Mon Apr 29 13:15:17 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-mips.c (struct mips_elf_link_hash_entry): Add
+ mips_32_relocs field.
+ (mips_elf_link_hash_newfunc): Initialize mips_32_relocs field.
+ (mips_elf_relocate_section): Copy R_MIPS_REL32 and R_MIPS_32
+ relocs against a global symbol which is not defined in a regular
+ file.
+ (mips_elf_check_relocs): For a R_MIPS_REL32 or R_MIPS_32 reloc
+ against a global symbol, increment mips_32_relocs.
+ (mips_elf_adjust_dynamic_symbol): If mips_32_relocs is set, and
+ the symbol is not defined in a regular file, make room in the
+ .rel.dyn section.
+
+Fri Apr 26 18:00:37 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ecoff.c (ecoff_compute_section_file_positions): Track the real
+ file position and the virtual file position separately. Set
+ filepos information bsaed on the real file position.
+ (_bfd_ecoff_set_section_contents): Handle .lib sections like the
+ Jan 23 change to coffcode.h.
+
+ * som.c (som_slurp_symbol_table): Set the symbol count to the
+ number of BFD symbols created.
+
+Fri Apr 26 12:34:29 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_check_relocs): Forward relocations to the
+ output file if linking shared objects. Loop to check all relocs,
+ rather than returning false on first error.
+
+Thu Apr 25 13:25:12 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_create_linker_section): Add PLT case.
+ (ppc_elf_additional_program_headers): If .interp section, bump #
+ of program headers by 1.
+ (ppc_elf_adjust_dynamic_symbol): Flesh out support.
+ (ppc_elf_size_dynamic_sections): Add support for .plt section.
+ (ppc_elf_check_relocs): Print out filename in debug code. Enable
+ PLT support.
+ (ppc_elf_finish_dynamic_symbol): Add support for PLT's, beef up
+ debug output.
+ (ppc_elf_relocate_section): If the output section isn't defined,
+ don't abort, just give an error message.
+
+ * elflink.c (_bfd_elf_create_dynamic_sections): If the section
+ being created is .sdata or .sdata2, don't make the symbol dynamic.
+
+Wed Apr 24 14:04:07 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (_bfd_xcoff_bfd_link_add_symbols): Look through the
+ members of an archive for dynamic objects with no symbols, and
+ pass them directly to check_archive_element.
+ (xcoff_link_check_ar_symbols): Pass dynamic objects to
+ xcoff_link_check_dynamic_ar_symbols.
+ (xcoff_link_check_dynamic_ar_symbols): New static function.
+
+ * coff-rs6000.c (rs6000coff_vec): Change BFD_JUMP_TABLE_DYNAMIC
+ from _bfd_nodynamic to _bfd_xcoff.
+ * libcoff-in.h (_bfd_xcoff_get_dynamic_symtab_upper_bound):
+ Declare.
+ (_bfd_xcoff_canonicalize_dynamic_symtab): Declare.
+ (_bfd_xcoff_get_dynamic_reloc_upper_bound): Declare.
+ (_bfd_xcoff_canonicalize_dynamic_reloc): Declare.
+ * libcoff.h: Rebuild.
+ * xcofflink.c (xcoff_swap_ldrel_in): New static function.
+ (xcoff_get_section_contents): New static function.
+ (_bfd_xcoff_get_dynamic_symtab_upper_bound): New function.
+ (_bfd_xcoff_canonicalize_dynamic_symtab): New function.
+ (_bfd_xcoff_get_dynamic_reloc_upper_bound): New function.
+ (xcoff_dynamic_reloc): New static variable.
+ (_bfd_xcoff_canonicalize_dynamic_reloc): New function.
+ (xcoff_link_add_dynamic_symbols): Use xcoff_get_section_contents.
+
+Tue Apr 23 12:48:42 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-sparc.c (bfd_coff_generic_reloc): Return bfd_reloc_ok even
+ if reloc_entry->addend is not 0.
+ (CALC_ADDEND): Just set the addend to reloc.r_offset.
+
+Mon Apr 22 18:29:01 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * elf32-sparc.c (_bfd_sparc_elf_howto_table): Fix spelling of
+ R_SPARC_GLOB_JMP.
+ * elf64-sparc.c (sparc64_elf_howto_table): Likewise.
+ Add entries for R_SPARC_[56].
+ (sparc_reloc_map): Add entries for R_SPARC_[56].
+
+Mon Apr 22 15:07:24 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ Optimize linking of stabs in sections as used in ELF and COFF.
+ * stabs.c: New file.
+ * libbfd-in.h (_bfd_link_section_stabs): Declare.
+ (_bfd_write_section_stabs): Declare.
+ (_bfd_write_stab_strings): Declare.
+ * libbfd.h: Rebuild.
+ * libcoff-in.h (struct coff_section_tdata): Add stab_info field.
+ (struct coff_link_hash_table): Add stab_info field.
+ * libcoff.h: Rebuild.
+ * cofflink.c (_bfd_coff_link_hash_table_init): Initialize
+ stab_info field.
+ (coff_link_add_symbols): Call _bfd_link_section_stabs if
+ appropriate.
+ (_bfd_coff_final_link): Write out stab strings hash table.
+ (_bfd_coff_link_input_bfd): Handle optimized stabs sections.
+ * coff-ppc.c (ppc_bfd_coff_final_link): Write out stab strings
+ hash table.
+ * elf-bfd.h (struct elf_link_hash_table): Add stab_info field.
+ (struct bfd_elf_section_data): Add stab_info field.
+ * elf.c (_bfd_elf_link_hash_table_init): Initialize stab_info
+ field.
+ * elflink.h (elf_link_add_object_symbols): If appropriate, call
+ _bfd_link_section_stabs.
+ (elf_bfd_final_link): Write out stab strings hash table.
+ (elf_link_input_bfd): Handle optimized stabs sections.
+ * reloc.c (_bfd_final_link_relocate): Check address against
+ _raw_size rather than _cooked_size.
+ * Makefile.in: Rebuild dependencies.
+ (BFD_LIBS): Add stabs.o
+ (BFD_LIBS_CFILES): Add stabs.c.
+
+ * VERSION: Increment for bfdlink.h change.
+
+ * coffgen.c (coff_renumber_symbols): Correct handling of
+ BSF_NOT_AT_END common symbols.
+
+Fri Apr 19 19:21:56 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-ppc.c (record_toc): Add cast to avoid warning.
+ (ppc_allocate_toc_section): Likewise.
+ (coff_ppc_relocate_section): Remove ANSI C string concatenation.
+ (ppc_coff_reloc_type_lookup): Remove unreached code.
+ * coffcode.h (coff_write_object_contents): Don't take the address
+ of an array.
+ * peicode.h (pe_print_idata): Add casts to avoid warning.
+ (pe_print_edata): Likewise.
+ (pe_print_reloc): Remove ANSI C string concatenation.
+
+Thu Apr 18 18:51:18 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * libcoff-in.h (struct coff_final_link_info): Add last_bf_index
+ and last_bf fields.
+ * libcoff.h: Rebuild.
+ * coffswap.h (coff_swap_aux_in): Swap endndx field for C_FCN
+ symbols.
+ (coff_swap_aux_out): Likewise.
+ * peicode.h (coff_swap_aux_in): Likewise.
+ (coff_swap_aux_out): Likewise.
+ * coffgen.c (coff_pointerize_aux): Check endndx field for C_FCN
+ symbols.
+ * cofflink.c (_bfd_coff_final_link): Initialize last_bf_index
+ field.
+ (_bfd_coff_link_input_bfd): Check endndx field for C_FCN symbols.
+ Fix up .bf endndx link fields.
+ * coff-ppc.c (ppc_bfd_coff_final_link): Initialize last_bf_index
+ field.
+ * xcofflink.c (xcoff_link_input_bfd): Check endndx field for C_FCN
+ symbols.
+
+Wed Apr 17 12:08:24 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * pe{,i}-ppc.c (PPC_PE): Define instead of PPC, so that compiling
+ on Solaris PowerPC systems doesn't get confused.
+
+ * ccffcode.h (coff_write_object_contents): Use #ifdef PPC_PE, not
+ #ifdef PPC.
+
+ * elfcore.h (bfd_prstatus, bfd_fpregset): Add thread argument.
+ (elf_corefile_note): If HAVE_SYS_PROCFS_H is not defined, don't
+ update did_reg and did_reg2.
+
+Wed Apr 17 13:07:37 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (xcoff_link_input_bfd): Check for TOC overflow.
+
+ * linker.c (_bfd_generic_link_add_one_symbol): When calling the
+ callback routines, pass h->root.string rather than name, in case
+ copy is true and name is transient.
+
+Tue Apr 16 16:36:38 1996 Stu Grossman (grossman@lisa.cygnus.com)
+
+ * elfcore.h: Add support for core files with multiple threads.
+ (Primarily for Solaris.)
+
+Tue Apr 16 13:44:08 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * aoutx.h (NAME(aout,squirt_out_relocs)): Don't do anything if
+ section->orelocation is NULL.
+
+ * coffgen.c (bfd_coff_get_syment): New function.
+ (bfd_coff_get_auxent): New function.
+ * bfd-in.h (bfd_coff_get_syment): Declare.
+ (bfd_coff_get_auxent): Declare.
+ * bfd-in2.h: Rebuild.
+
+Mon Apr 15 19:06:59 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-mips.c (struct mips_hi16): Define.
+ (mips_hi16_addr, mips_hi16_addend): Remove.
+ (mips_hi16_list): New static variable.
+ (mips_elf_hi16_reloc): Maintain a list of unmatched HI16 relocs.
+ (mips_elf_lo16_reloc): Process mips_hi16_list.
+ (mips_elf_relocate_section): Permit an arbitrary number of HI16
+ relocs before the associated LO16 reloc.
+
+Wed Apr 10 00:23:53 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * versados.c (versados_scan): Check bfd_alloc return value.
+ (versados_object_p): Check all bfd_read return values. Require
+ that lang field be less than 10, to avoid confusion with Intel Hex
+ files.
+
+ * libaout.h (WRITE_HEADERS): Write out the relocs even if there
+ aren't any symbols.
+ * aoutx.h (NAME(aout,swap_std_reloc_out)): Set r_index to N_ABS,
+ not 0, for an absolute symbol.
+ (NAME(aout,swap_ext_reloc_out)): Likewise.
+
+ * ihex.c (ihex_scan): Accept a length of 4 for record type 5.
+ (ihex_write_object_contents): For a large start address, output
+ the full 32 bit address in record type 5.
+
+ * ieee.c (ieee_write_byte): Change second parameter from bfd_byte
+ to int to avoid promotion problems in prototype.
+
+Tue Apr 9 11:44:21 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.host: Use ${srcdir} when looking for picfrag.
+
+ * configure.host: Switch on ${libdir}, not $(libdir). From
+ alan@spri.levels.unisa.edu.au (Alan Modra).
+
+ * aoutx.h (aout_link_add_symbols): Always call add_dynamic_symbols
+ entry point, not just for DYNAMIC objects.
+ * sunos.c (sunos_add_dynamic_symbols): Always call
+ sunos_create_dynamic_sections. If called with a non DYNAMIC
+ object, don't do anything else.
+ (sunos_add_one_symbol): Don't call sunos_create_dynamic_sections.
+
+Mon Apr 8 12:09:36 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Permit --enable-shared to specify a list of
+ directories.
+ * configure: Rebuild.
+
+ * configure.host: Set HLDFLAGS and SHLIB_CFLAGS for *-dec-osf*
+ host when configuring with --enable-shard.
+
+Fri Apr 5 12:24:13 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config.bfd: Add i[345]86-*-freebsdelf* target; from John Polstra
+ <jdp@polstra.com>.
+
+ * linker.c (link_action): For WARN_ROW/warn, use MWARN, not CYCLE,
+ to avoid crashing in bfd_hash_replace.
+
+ * sysdep.h: Use #ifdef, not #if.
+
+Thu Apr 4 23:32:23 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * config.in: Rebuild.
+
+Thu Apr 4 18:49:09 1996 Fred Fish <fnf@cygnus.com>
+
+ * configure.in (mips-sony-bsd*): Fix typo in AC_DEFINE.
+ (AC_CHECK_HEADERS): Check for sys/time.h
+ (AC_HEADER_TIME): Add macro.
+ * configure: Rebuild.
+ * sysdep.h: Use TIME_WITH_SYS_TIME and HAVE_SYS_TIME_H
+ to control what combination of <time> and <sys/time.h>
+ get included.
+
+Tue Apr 2 13:11:53 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * aoutf1.h (sunos_32_set_arch_mach): Handle M_SPARCLET.
+ (aout_32_sunos4_write_object_contents): Likewise.
+ * aoutx.h (NAME(aout,machine_type)): Handle
+ bfd_mach_sparc_{sparclet,sparclite}.
+ * archures.c (bfd_mach_sparc_{sparclet,sparclite}): Define.
+ (bfd_mach_sparc_v9_p): Update.
+ * cpu-sparc.c (arch_info_struct): Add entries for sparclet,sparclite.
+ * libaout.h (enum machine_type): Add M_SPARCLET.
+ * sunos.c (MACHTYPE_OK): Define.
+ * bfd-in2.h: Regenerated.
+
+Tue Apr 2 00:33:18 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf-bfd.h (struct elf_link_hash_table): Add hgot field.
+ * elf.c (_bfd_elf_link_hash_table_init): Initialize hgot field.
+ * elflink.c (_bfd_elf_create_got_section): Store the
+ _GLOBAL_OFFSET_TABLE_ hash table entry in the hgot field.
+ * elf32-sparc.c (elf32_sparc_check_relocs): If the size of the
+ global offset table goes over 0x1000, set the value of
+ _GLOBAL_OFFSET_TABLE_ to 0x1000 into the section.
+ (elf32_sparc_relocate_section): Subtract the offset of
+ _GLOBAL_OFFSET_TABLE_ when handling GOT relocations.
+
+ * elfcode.h: Don't include <string.h>.
+
+Mon Apr 1 10:39:24 1996 Jeffrey A Law (law@cygnus.com)
+
+ * linker.c (_bfd_generic_link_hash_newfunc): Renamed from
+ generic_link_hash_newfunc. All references changed.
+ * genlink.h (_bfd_generic_link_hash_newfunc): Declaration
+ moved here from libbfd-in.h.
+ * libbfd-in.h: Corresponding changes.
+ * libbfd.h: Regenerated.
+
+Mon Apr 1 12:35:36 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * aoutx.h (aout_link_input_section_std): When reporting an
+ overflow error, use the name of the symbol in the hash table if
+ available.
+ (aout_link_input_section_ext): Likewise.
+
+ * elflink.h (elf_adjust_dynamic_symbol): If a common symbol got
+ defined in a regular file, set ELF_LINK_HASH_DEF_REGULAR.
+
+Sun Mar 31 01:58:41 1996 steve chamberlain <sac@slash.cygnus.com>
+
+ * peicode.h (coff_swap_aouthdr_out): Delete test for .junk.
+ * coffcode.h (coff_compute_section_file_positions): Likewise.
+ (coff_write_object_contents): Likewise.
+
+Fri Mar 29 12:44:36 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * section.c (SEC_LINK_ONCE): Define.
+ (SEC_LINK_DUPLICATES): Define.
+ (SEC_LINK_DUPLICATES_DISCARD): Define.
+ (SEC_LINK_DUPLICATES_ONE_ONLY): Define.
+ (SEC_LINK_DUPLICATES_SAME_SIZE): Define.
+ (SEC_LINK_DUPLICATES_SAME_CONTENTS): Define.
+ * bfd-in2.h: Rebuild.
+ * coffcode.h (sec_to_styp_flags): If COFF_WITH_PE, turn
+ SEC_LINK_ONCE into IMAGE_SCN_LNK_COMDAT.
+ (styp_to_sec_flags): If COFF_WITH_PE, turn IMAGE_SCN_LNK_REMOVE
+ into SEC_EXCLUDE. If IMAGE_SCN_LNK_COMDAT is set, set
+ SEC_LINK_ONCE, and look through the symbol table for the setting
+ for SEC_LINK_DUPLICATES.
+ (coff_write_object_contents): If COFF_WITH_PE, if SEC_LINK_ONCE is
+ set for a section, find the section symbol in the symbol table,
+ and set the aux entry based on SEC_LINK_DUPLICATES.
+ * coffgen.c (coff_print_symbol): Add a space before "checksum".
+ * coff-arm.c (armcoff_big_vec): If COFF_WITH_PE is defined, add
+ SEC_LINK_ONCE and SEC_LINK_DUPLICATES to section_flags.
+ * coff-i386.c (i386coff_vec): Likewise.
+ * coff-ppc.c (TARGET_LITTLE_SYM, TARGET_BIG_SYM): Likewise.
+
+ * VERSION: Bump to 2.6.1.
+ * Makefile.in (stamp-h): Depend upon VERSION.
+
+Thu Mar 28 23:48:49 1996 Jeffrey A Law (law@cygnus.com)
+
+ * libbfd-in.h (generic_link_hash_newfunc): Add declaration.
+ * libbfd.h: Rebuilt.
+ * linker.c (generic_link_hash_newfunc): No longer static.
+ * coffcode.h (coff_bfd_link_hash_create): Allow specific targets
+ to override.
+ * coff-h8300.c: Add two derived hash tables and their associated
+ funtions and #defines for use by the h8300 linker.
+ (h8300_reloc16_extra_cases, case R_MEM_INDIRECT): Create entries in
+ the function vector as needed. Place the address of the function
+ vector entry in the location specified by the R_MEM_INDIRECT reloc.
+ Rewrite the vectors section contents as necessary.
+ (h8300_bfd_link_add_symbols): New function for the h8300 linker.
+ (coff_bfd_link_add_symbols): Define to use h8300 specific version.
+ (coff_bfd_link_hash_table_create): Likewise.
+
+Thu Mar 28 17:44:08 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * libhppa.h: If gcc 2.7 or higher, declare all the functions with
+ __attribute__ ((__unused__)) so that -Wall doesn't warn about
+ them.
+ (hppa_rebuild_insn): Pass pointer to correct type to
+ low_sign_unext and dis_assemble_21.
+
+Thu Mar 28 11:00:36 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * config.bfd (sparc64-{sysv4*,solaris2*}): Delete.
+ Stick with sparc-*-{sysv4*,solaris2*}.
+
+Wed Mar 27 10:43:34 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * peicode.h (coff_swap_aux_in): Swap in extra PE x_scn fields.
+ (coff_swap_aux_out): Swap out extra PE x_scn fields.
+ * coffswap.h (coff_swap_aux_in): Zero out extra PE x_scn fields.
+ * coffgen.c (coff_print_symbol): If any of the extra PE x_scn
+ fields is non-zero, print them.
+
+ * coff-ppc.c (ppc_record_toc_entry): Put inside COFF_IMAGE_WITH_PE
+ ifdef. Remove unused variables.
+ (ppc_record_data_in_toc_entry): Ifdef out. Removed unused
+ variables.
+ (ppc_mark_symbol_as_glue): Put inside COFF_IMAGE_WITH_PE ifdef.
+ (get_symbol_value): Ifdef out.
+ (pe_ppc_reloc): Ifdef out. Remove unused variables.
+ (coff_ppc_relocate_section): Remove unused variables. Make
+ fprintf strings and argument types correspond. Put before_addr in
+ DEBUG_RELOC ifdef.
+ (dump_toc): Make fprintf strings and argument types correspond.
+ (ppc_process_before_allocation): Remove unused variables. Always
+ return a value.
+ (ppc_reflo_reloc): Ifdef out.
+ (ppc_addr32nb_reloc): Ifdef out.
+ (ppc_coff_rtype2howto): Make fprintf strings and argument types
+ correspond.
+ (coff_ppc_rtype_to_howto): Likewise.
+ (ppc_coff_swap_sym_in_hook): Remove unused variables.
+
+ * peicode.h (pe_print_idata): Move otherwise unused variables into
+ the #ifdef where they are used. Always return a value.
+ (pe_print_edata): Make fprintf strings and argument types
+ correspond. Always return a value.
+ (pe_print_pdata): Removed unused variable addr_value. Always
+ return a value.
+ (pe_print_reloc): Remove unused variable onaline. Make fprintf
+ strings and argument types correspond. Always return a value.
+
+ * elf32-ppc.c (ppc_elf_fake_sections): Return true.
+ (ppc_elf_finish_dynamic_symbol): Move definition of unused
+ variable rela inside #if 0 section where it is used.
+
+ * ns32k.h: New file.
+ * cpu-ns32k.h: Include ns32k.h. Rename externally visible
+ functions to start with _bfd_.
+ * aout-ns32k.c: Include ns32k.h. Change references to renamed
+ functions in cpu-ns32k.h.
+ * Makefile.in: Rebuild dependencies.
+ (HFILES): Add ns32k.h.
+
+ * section.c (struct sec): Add linker_mark field. Change
+ user_set_vma and reloc_done to be single bit fields.
+ (STD_SECTION): Update accordingly.
+ * bfd-in2.h: Rebuild.
+ * aoutx.h (NAME(aout,final_link)): Mark sections included in the
+ link.
+ (aout_link_input_bfd): Don't link unmarked sections.
+ * cofflink.c (_bfd_coff_final_link): Mark sections included in the
+ link.
+ (_bfd_coff_link_input_bfd): Don't link unmarked sections.
+ * coff-ppc.c (ppc_bfd_coff_final_link): Mark sections included in
+ the link.
+ * elflink.h (elf_bfd_final_link): Mark sections included in the
+ link.
+ (elf_link_input_bfd): Don't link unmarked sections.
+ * xcofflink.c (_bfd_xcoff_bfd_final_link): Mark sections included
+ in the link.
+ (xcoff_link_input_bfd): Don't link unmarked sections.
+
+ * coffswap.h (coff_swap_scnhdr_out): Include section name in
+ overflow error messages.
+
+Tue Mar 26 15:46:18 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * bfd.c (_bfd_default_error_handler): If _bfd_error_program_name
+ is not set, print "BFD: " before the error message.
+
+ * configure.in: Use AC_CHECK_TOOL to find ar and ranlib. From
+ Miles Bader <miles@gnu.ai.mit.edu>.
+ * configure: Rebuild.
+
+Fri Mar 22 12:17:00 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (xcoff_link_input_bfd): Fix scan for C_BINCL/C_EINCL
+ symbols.
+
+ * config.bfd: Add ieee_vec to targ_selvecs for i960 targets and
+ m68k-aout, m68k-coff, and m68k-elf targets.
+
+Fri Mar 22 11:33:44 1996 Martin Anantharaman <martin@goofy.imech.uni-duisburg.de>
+
+ * ieee.c: Changed #ifdef KEEPMINUSPCININST to #if KEEPMINUSPCININST.
+ (ieee_generic_stat_arch_elt): Restructured to prevent
+ ieee_object_p from being called repeatedly.
+
+Thu Mar 21 11:00:47 1996 steve chamberlain <sac@slash.cygnus.com>
+
+ * coffcode.h (coff_write_object_contents): Allocate
+ buffers large enough for any FILEHDR or AOUTHDR.
+
+Thu Mar 21 16:28:17 1996 David Mosberger-Tang <davidm@azstarnet.com>
+
+ * ecofflink.c (lookup_line): New static function, renamed and
+ slighly changed from old _bfd_ecoff_locate_line.
+ (_bfd_ecoff_locate_line): Cache line number information. Use
+ lookup_line for actual lookup.
+
+Thu Mar 21 14:59:11 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * peicode.h (pe_print_pdata): Warn if the .pdata section is not a
+ multiple of 20 bytes.
+
+Thu Mar 21 13:54:40 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ecoff.c (_bfd_ecoff_find_nearest_line): Use bfd_zalloc to
+ allocate ecoff_find_line, and don't initialize by hand.
+ * elf32-mips.c (mips_elf_find_nearest_line): Use bfd_zalloc for
+ mips_elf_find_line, and don't call memset.
+
+ * coffcode.h (coff_compute_section_file_positions): If not
+ producing a final executable, don't consider sofar when aligning
+ the section to the correct size.
+
+Wed Mar 20 16:53:12 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffcode.h (coff_add_missing_symbols): Ifdef out.
+ (coff_write_object_contents): Don't call coff_add_missing_symbols.
+ * coffgen.c (coff_section_symbol): Ifdef out.
+
+Mon Mar 18 12:54:41 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf32-mips.c (mips_elf_gprel32_reloc): Initialize gp if
+ output_bfd is not NULL.
+
+Thu Mar 14 17:12:06 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * coffgen.c (coff_get_normalized_symtab): Call bfd_zalloc instead
+ of bfd_alloc (fixes fix_line not being initialized).
+ Delete zeroing of fix_{value,tag,end,scnlen} fields.
+
+Thu Mar 14 16:06:06 1996 Jeffrey A Law (law@cygnus.com)
+
+ * coffcode.h: Allow specific backends to override the
+ bfd_link_add_symbols routine.
+
+ * coff-h8300.c: Include genlink.h.
+ (howto_table): Add R_MEM_INDIRECT.
+ (rtype2howto): Support R_MEM_INDIRECT.
+ (h8300_reloc16_extra_cases): Handle R_MEM_INDIRECT like R_RELBYTE
+ for now.
+
+Tue Mar 12 12:41:17 1996 David Mosberger-Tang <davidm@koala.azstarnet.com>
+
+ * coff-alpha.c (alpha_relocate_section): Use
+ info->callbacks_warning, rather than _bfd_error_handler, for
+ "multiple gp" warning.
+
+Tue Mar 12 12:10:55 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * linker.c (bfd_wrapped_link_hash_lookup): New function.
+ (_bfd_generic_link_add_one_symbol): Remove BFD_ASSERT on hash
+ table string. Use bfd_wrapped_link_hash_lookup.
+ (_bfd_generic_link_write_global_symbol): Remove BFD_ASSERT on hash
+ table string.
+ * aoutx.h (aout_link_write_symbols): Use the name from the hash
+ table, if any, when writing out symbols.
+ (aout_link_input_section_std): Use the name from the hash table,
+ if any, when reporting undefined symbols.
+ (aout_link_input_section_ext): Likewise.
+ (aout_link_reloc_link_order): Use bfd_wrapped_link_hash_lookup.
+ * bout.c (get_value): Likewise.
+ * cofflink.c (_bfd_coff_reloc_link_order): Likewise.
+ * ecoff.c (ecoff_reloc_link_order): Likewise.
+ * elflink.h (elf_link_add_object_symbols): Likewise.
+ (elf_reloc_link_order): Likewise.
+ * linker.c (_bfd_generic_link_output_symbols): Likewise.
+ (_bfd_generic_reloc_link_order): Likewise.
+ (default_indirect_link_order): Likewise.
+ * reloc16.c (bfd_coff_reloc16_get_value): Likewise.
+ * sunos.c (sunos_add_one_symbol): Likewise.
+ * xcofflink.c (xcoff_link_add_symbols): Likewise.
+ (bfd_xcoff_link_count_reloc): Likewise.
+ (xcoff_reloc_link_order): Likewise.
+
+ * ecoffswap.h (ecoff_swap_fdr_in): If ECOFF_64, turn 0xffffffff
+ into -1 for intern->rss.
+
+ * configure: Rebuild with autoconf 2.8.
+
+Mon Mar 11 12:28:31 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * stab-syms.c (__define_stab_duplicate): Define.
+ (bfd_get_stab_name): Rename from aout_stab_name. Rewrite to use a
+ switch.
+ * bfd-in.h (bfd_get_stab_name): Declare.
+ * bfd-in2.h: Rebuild.
+ * Makefile.in: Rebuild dependencies.
+ (BFD_LIBS): Add stab-syms.o.
+ (BFD_LIBS_CFILES): Add stab-syms.c.
+ (BFD32_BACKENDS): Remove stab-syms.o.
+ (BFD32_BACKENDS_CFILES): Remove stab-syms.c.
+ * configure.in: Don't list stab-syms.o in bfd_backends.
+ * configure: Rebuild.
+ * libaout.h (aout_stab_name): Don't declare.
+ * aoutx.h (NAME(aout,get_symbol_info)): Call bfd_get_stab_name,
+ not aout_stab_name.
+
+Fri Mar 8 11:26:20 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (assign_file_positions_for_segments): Adjust file offset
+ for section alignment even if SEC_LOAD is not set.
+
+Tue Mar 5 12:02:23 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Don't set SHLIB or SHLINK to an empty string,
+ since they appear as targets in Makefile.in.
+ * configure: Rebuild.
+
+ * sunos.c (sunos_scan_ext_relocs): If not making a shared library,
+ don't fiddle with a symbol which is not defined anywhere.
+
+Mon Mar 4 12:49:16 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (xcoff_mark): Treat undefined imported symbols as
+ though they are defined in a shared library.
+ (xcoff_build_ldsyms): Likewise.
+
+ * coffgen.c (coff_find_nearest_line): Don't look at the line
+ numbers for the section if section->lineno is NULL.
+
+ * elf.c (_bfd_elf_symbol_from_bfd_symbol): Print a useful error
+ message rather than calling BFD_ASSERT.
+ * elfcode.h (write_relocs): Check return value of
+ _bfd_elf_symbol_from_bfd_symbol.
+
+Fri Mar 1 09:42:59 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_add_symbol_hook): Don't set SEC_LOAD flag
+ for .sbss section.
+
+Wed Feb 28 11:25:47 1996 Jeffrey A Law (law@cygnus.com)
+
+ * libhppa.h (hppa_reloc_field_selector_type): Add R_HPPA_NLSEL
+ and R_HPPA_NLRSEL.
+ (e_nsel, e_nlsel, e_nlrsel): Undefine. Add to
+ hppa_reloc_field_selector_type_alt.
+ (hppa_field_adjust): Handle e_nlsel, e_nlrsel. Fix e_nsel handling.
+ * som.c (hppa_som_gen_reloc_type): Handle N', NL' NLR' field
+ selectors.
+ (som_write_fixups): Finish handling of R_N0SEL and R_N1SEL.
+
+Wed Feb 28 11:00:24 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (assign_file_positions_for_segments): Adjust the segment
+ memory size for the alignment of a SEC_ALLOC section, not just a
+ SEC_LOAD section.
+
+Tue Feb 27 14:17:31 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * m68klinux.c: New file.
+ * hosts/m68klinux.h: New file.
+ * config.bfd (m68*-*-linuxaout*, m68*-*-linux*): New targets.
+ * configure.in (m68*-*-linux*): New native host.
+ (m68klinux_vec): New vector.
+ * configure: Rebuild.
+ * targets.c (m68klinux_vec): Declare.
+ * i386linux.c (bfd_i386linux_size_dynamic_sections): Renamed from
+ bfd_linux_size_dynmic_sections to avoid clash with m68klinux.c.
+ * bfd-in.h (bfd_i386linux_size_dynamic_sections): Rename
+ declaration from bfd_linux_size_dynamic_sections.
+ (bfd_m68klinux_size_dynamic_sections): Declare.
+ * bfd-in2.h: Rebuild.
+ * Makefile.in: Rebuild dependencies.
+ (BFD32_BACKENDS): Add m68klinux.o.
+ (BFD32_BACKENDS_CFILES): Add m68klinux.c.
+
+Tue Feb 27 11:31:34 1996 Jeffrey A Law (law@cygnus.com)
+
+ * libhppa.h (pa_arch): Add pa20.
+ (hppa_reloc_field_selector_type): Add R_HPPA_NSEL.
+ (e_nsel): Undefine. Add to hppa_reloc_field_selector_type_alt.
+ (hppa_field_adjust): Handle e_nsel.
+ * som.c: Provide default definitions for many new relocs found only
+ in hpux10 include files.
+ (som_fixup_formats): Add several new relocs from hpux10.
+ (som_hppa_howto_table): Add hpux10 relocs.
+ (som_write_fixups): Handle R_N0SEL and R_N1SEL hpux10 relocs.
+
+Mon Feb 26 12:52:48 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * mpw-make.sed: Edit out recent shared library support, and
+ rules to rebuild .h files using doc/chew.
+
+Mon Feb 26 14:48:39 1996 David Mosberger-Tang <davidm@AZStarNet.com>
+
+ * ecoff.c (ecoff_compute_section_file_positions): Adjust the file
+ size even of sections with no contents.
+
+Mon Feb 26 14:01:13 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * cofflink.c (_bfd_coff_link_input_bfd): When merging, skip names
+ starting with '$' the way we skip names starting with '.'. When
+ updating x_endndx, don't be fooled by an index which has been
+ merged.
+
+ * cofflink.c (_bfd_coff_link_input_bfd): Don't try to optimize a
+ struct/union/enum type with no elements.
+
+Sat Feb 24 11:38:58 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * bfd.c (bfd_errmsg): Handle a NULL return from strerror.
+
+ * archive.c (bfd_generic_archive_p): If the first file in the
+ archive can not be recognized as an object, don't assume that this
+ is the wrong format.
+
+ * elf.c (bfd_elf_set_dt_needed_name): Don't do anything if the
+ format is not bfd_object.
+ (bfd_elf_get_dt_soname): Likewise.
+
+Wed Feb 21 13:58:04 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-sh.c (sh_relax_delete_bytes): Correct range of R_SH_USES
+ reloc.
+
+Tue Feb 20 16:22:44 1996 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * bfd.c (tdata): Add netbsd_core_data.
+ * bfd-in2.h: Regenerated.
+
+Tue Feb 20 16:50:02 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * sunos.c (SUNOS_CONSTRUCTOR): Define.
+ (sunos_add_one_symbol): Don't let a symbol from a dynamic object
+ override a constructor symbol. Set SUNOS_CONSTRUCTOR when
+ appropriate.
+
+ * bout.c (b_out_squirt_out_relocs): Use udata.i rather than flags
+ to get the symbol index, matching 14 Jul 95 change.
+
+Tue Feb 20 08:26:27 1996 Fred Fish <fnf@phydeaux.cygnus.com>
+
+ * coff-alpha.c (alpha_ecoff_get_relocated_section_contents):
+ Remove duplicate definition of gp.
+
+Mon Feb 19 12:37:41 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Don't
+ assume that we can set the GP value and then get the same value,
+ since it won't be true if the output file is neither ELF nor
+ ECOFF.
+ * coff-mips.c (mips_adjust_reloc_in): Don't bother to use
+ _bfd_get_gp_value here.
+ (mips_gprel_reloc): Don't assume we can set and get the GP value.
+ * elf32-mips.c (mips_elf_hi16_reloc): Get gp value from
+ mips_elf_final_gp.
+ (mips_elf_lo16_reloc): Likewise.
+ (mips_elf_final_gp): Add pgp parameter. Set it to the GP value.
+ Don't require that the BFD be ELF.
+ (mips_elf_gprel16_reloc): Get gp value from mips_elf_final_gp.
+ (mips_elf_gprel32_reloc): Likewise.
+ (mips_elf_relocate_section): Don't assume we can set and get the
+ GP value.
+ (mips_elf_finish_dynamic_symbol): Don't bother to use
+ _bfd_get_gp_value here.
+
+ * elf32-mips.c (mips_elf_create_procedure_table): Initialize sv.
+ Don't change epdr between malloc and free. Be careful not to free
+ NULL pointers. Zero out the first RPDR.
+
+ * configure.host: On Linux, only pass -rpath option if $(libdir)
+ is neither /lib nor /usr/lib. From Alan Modra
+ <alan@mullet.Levels.UniSA.Edu.Au>.
+
+ * elf-bfd.h (struct elf_obj_tdata): Rename dt_needed_name to
+ dt_name.
+ (elf_dt_name): Rename from elf_dt_needed_name.
+ * elf.c (bfd_elf_set_dt_needed_name): Use elf_dt_name, not
+ elf_dt_needed_name.
+ (bfd_elf_get_dt_soname): New function.
+ * elflink.h (elf_link_add_object_symbols): Use elf_dt_name, not
+ elf_dt_needed_name. Save the SONAME back in elf_dt_name.
+ * bfd-in.h (bfd_elf_get_dt_soname): Declare.
+ * bfd-in2.h: Rebuild.
+
+Mon Feb 19 02:50:23 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * elf32-sparc.c (elf32_sparc_reloc_type_lookup): Renamed from
+ _bfd_sparc_elf_reloc_type_lookup.
+ (bfd_elf32_bfd_reloc_type_lookup): Update.
+ * elf64-sparc.c (SPARC64_OLD_RELOCS): Define.
+ (sparc64_elf_howto_table): Define.
+ (sparc_reloc_map): Define.
+ (sparc64_elf_reloc_type_lookup): New function.
+ (sparc_elf_wdisp16_reloc): New function.
+ (elf_info_to_howto): Use sparc64_elf_howto_table.
+ (sparc64_elf_relocate_section): Likewise.
+ (bfd_elf64_bfd_reloc_type_lookup): Update.
+
+Sun Feb 18 15:02:25 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.host: Check for 'do not mix' from native linker before
+ trying to use -rpath.
+
+Fri Feb 16 12:46:18 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * bfd.c (_bfd_get_gp_value): New function.
+ (_bfd_set_gp_value): New function.
+ * libbfd-in.h (_bfd_get_gp_value): Declare.
+ (_bfd_set_gp_value): Declare.
+ * libbfd.h: Rebuild.
+ * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Use
+ _bfd_get_gp_value and _bfd_set_gp_value rather than referring
+ directly to the fields in the tdata information.
+ (alpha_relocate_section): Likewise.
+ * coff-mips.c (mips_adjust_reloc_in): Likewise.
+ (mips_gprel_reloc): Likewise.
+ (mips_relocate_section): Likewise.
+ * elf32-mips.c (mips_elf_hi16_reloc): Likewise.
+ (mips_elf_lo16_reloc): Likewise.
+ (mips_elf_final_gp): Likewise.
+ (mips_elf_gprel16_reloc): Likewise.
+ (mips_elf_gprel32_reloc): Likewise.
+ (mips_elf_relocate_section): Likewise.
+ (mips_elf_finish_dynamic_symbol): Likewise.
+
+ * bout.c (b_out_set_arch_mach): Recognize bfd_mach_i960_jx.
+
+Thu Feb 15 11:29:13 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Call AC_PROG_CC before configure.host.
+ * configure: Rebuild.
+ * configure.host: Don't set information which autoconf should
+ figure out, namely CC, CFLAGS, LDFLAGS, AR, and RANLIB.
+
+ * configure.host: Remove go32 and win32 host information, since it
+ should no longer be needed.
+
+ * elf.c (map_sections_to_segments): If we have a .dynamic section,
+ then start a new segment rather than put a writable section in a
+ readonly segment.
+
+ * configure.host: Set RPATH_ENVVAR.
+
+ * Makefile.in: Rebuild dependencies.
+
+ * elflink.c (_bfd_elf_create_linker_section): Remove unused
+ zero_section variable.
+
+Thu Feb 15 10:39:17 1996 H.J. Lu <hjl@zoom.com>
+
+ * Makefile.in ($(srcdir)/bfd-in2.h): Rename target from bfd-in2.h.
+ ($(srcdir)/libbfd.h): Rename from libbfd.h.
+ ($(srcdir)/libcoff.h): Rename from libcoff.h.
+
+Wed Feb 14 16:29:07 1996 Martin Anantharaman <martin@mail.imech.uni-duisburg.de>
+
+ * ieee.c (ieee_write_expression): Only use an R variable for a
+ local symbol. Don't output a zero offset. Handle a zero address.
+ (SRC_MASK, PCREL_OFFSET): Define based on KEEPMINUSPCININST.
+ (rel32_howto, rel16_howto, rel8_howto): Use SRC_MASK and
+ PCREL_OFFSET.
+ (parse_expression): Don't try to handle multiple occurrences of a
+ P variable. Handle I variables differently from X variables. Fix
+ the order of minus expressions.
+ (ieee_slurp_external_symbols): Generate an I variable for an NN
+ record. Fix handling of ATI and ATX records.
+ (ieee_slurp_sections): Only set minimal section attributes.
+ Adjust them later, based on the section contents.
+ (ieee_object_p): Read in the file until just after the ME record.
+ Call ieee_slurp_section_data to set the section flags.
+ (do_one): Add iterations parameter. Only repeat the first load
+ item. Set the section and file reloc flags.
+ (ieee_slurp_section_data): Set section flags. Pass iterations to
+ do_one.
+ (ieee_canonicalize_reloc): Handle I variables.
+ (do_with_relocs): Only emit relocation size when necessary.
+ Increase MAXRUN to 127. Change ov to be assigned, and take
+ src_mask and pcrel_offset into account.
+ (ieee_write_data_part): Skip sections that are not loaded.
+ (ieee_write_external_part): Don't output optional last entry of WX
+ records.
+ (ieee_write_me_part): Make setting of me_record neater.
+ (ieee_generic_stat_arch_elt): Get the size of an archive element.
+
+ * syms.c (stt): Add entries for zerovars, vars, and code.
+
+ * elfcode.h (validate_reloc): New static function.
+ (write_relocs): Call validate_reloc for non ELF relocs.
+
+ * elfxx-target.h (elf_symbol_leading_char): Define if not defined.
+ (TARGET_BIG_SYM): Use elf_symbol_leading_char.
+ (TARGET_LITTLE_SYM): Likewise.
+
+ * config.bfd (m68*-*-psos*): New target.
+
+Tue Feb 13 15:56:22 1996 Bryan Ford <baford@snake.cs.utah.edu>
+
+ * i386msdos.c: Remove some #if 0 code.
+ (msdos_write_object_contents): Don't include empty sections in the
+ size computation, regardless of their address.
+
+Tue Feb 13 15:36:37 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_relocate_section): Don't segfault if dynboj
+ is NULL, ie, the -r switch is used.
+
+Tue Feb 13 14:35:15 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * reloc.c (BFD_RELOC_MIPS_GOT_HI16): Define.
+ (BFD_RELOC_MIPS_GOT_LO16): Define.
+ (BFD_RELOC_MIPS_CALL_HI16, BFD_RELOC_MIPS_CALL_LO16): Define.
+ * bfd-in2.h, libbfd.h: Rebuild.
+ * elf32-mips.c (mips_reloc_map): Map new relocs.
+
+ * configure.host: Set HDLFLAGS for *-*-hpux with --enable-shared.
+
+ * Makefile.in ($(SHLINK)): Check ts against $(SHLIB), not
+ $(SHLINK).
+
+ * ieee.c (get_symbol): Set the section to bfd_abs_section.
+ (do_with_relocs): If EXEC_P is set and there are no relocs, use a
+ simple number for the section address, rather than an expression.
+ Limit the number of bytes between relocs to MAXRUN.
+ (ieee_write_me_part): Set me_record to the file offset after the
+ start address.
+ (ieee_write_processor): New static function.
+ (ieee_write_object_contents): Use ieee_write_processor.
+
+Fri Feb 9 10:53:00 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.host: Use ${CC-gcc} when testing for -rpath on SunOS.
+
+ * coff-aux.c: Change include of aux.h to aux-coff.h.
+
+Thu Feb 8 14:01:03 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * elf32-m68k.c (elf_m68k_relocate_section): For a R_68K_RELATIVE
+ relocation put the addend both in the reloc entry and the data.
+ (elf_m68k_finish_dynamic_symbol): Likewise. Mask out marker in
+ GOT offset value.
+
+ * elf32-m68k.c (elf_m68k_relocate_section): If -Bsymbolic, resolve
+ a R_68K_PCxx reloc against a defined global symbol directly.
+ (elf_m68k_check_relocs): Don't count such a reloc.
+
+ * elf32-m68k.c (elf_m68k_check_relocs): Don't record a symbol with
+ a PLTxx reloc as dynamic. Disallow PLTxxO reloc against a local
+ symbol for now, otherwise always record the symbol as dynamic.
+ (elf_m68k_adjust_dynamic_symbol): If a symbol with a PLTxx reloc
+ is not referenced by a dynamic object, and we are not making a
+ shared object, then don't make a PLT entry. If we do make a PLT
+ entry, make sure the symbol has been recorded as dynamic.
+
+Wed Feb 7 13:56:06 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.host: When making a shared library, set HLDFLAGS to
+ pass an appropriate -rpath option. Use the make variable SONAME
+ as the shared library soname, rather than computing it here. On
+ SunOS, build stamp-tshlink in place of $(SHLINK).
+ * Makefile.in (SONAME): New variable.
+ ($(SHLINK)): Make a link to the transformed name, as well.
+ (stamp-tshlink): New target.
+ (install): Skip stamp-tshlink during install.
+
+Wed Feb 7 13:37:39 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_add_symbol_hook): Do not assume that the
+ linker sections have been set up yet.
+
+ * elf.c (make_mapping): Add an additional argument to suppress
+ making the first section include the program headers.
+ (map_sections_to_segments): If the user used -Ttext such that the
+ program headers are on a different page, do not set the flags
+ saying that this section includes the program headers.
+
+Tue Feb 6 14:04:49 1996 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * configure.in (*-*-netbsd*): Set COREFILE to netbsd-core.c.
+ don't define TRAD_HEADER.
+ * configure: Rebuild.
+
+ * netbsd-core.c: New file, support for NetBSD core files.
+ * hosts/*nbsd.h: Removed.
+
+Tue Feb 6 11:47:49 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * reloc.c (BFD_RELOC_SPARC_[567]): New reloc types.
+ (BFD_RELOC_SPARC_LO7 reloc type): Deleted.
+ * libbfd.h, bfd-in2.h: Regenerated.
+ * elf32-sparc.c (_bfd_sparc_elf_reloc_type_lookup): Renamed from
+ bfd_elf32_bfd_reloc_type_lookup.
+ (reloc_type{,_names}): Deleted.
+ (_bfd_sparc_elf_howto_table): Renamed from elf_sparc_howto_table.
+ Add sparc64 relocs.
+ (sparc_reloc_map): Add sparc64 relocs.
+ (sparc_elf_notsupported_reloc): New static function.
+ (sparc_elf_wdisp16_reloc): New static function.
+ (elf32_sparc_check_relocs): Handle R_SPARC_WDISP{16,19}.
+ (elf32_sparc_relocate_section): Likewise.
+ (bfd_elf32_bfd_reloc_type_lookup): Define.
+ * elf64-sparc.c (sparc64_elf_wdisp16_reloc): Deleted.
+ (reloc_type{,_names}): Deleted.
+ (elf_sparc_howto_table): Deleted.
+ (sparc_reloc_map): Deleted.
+ (_bfd_sparc_elf_howto_table): Renamed from elf_sparc_howto_table.
+ (bfd_elf64_bfd_reloc_type_lookup): Change from function to #define.
+
+Tue Feb 6 12:12:22 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.host: Make SHLIB_CFLAGS include $(PICFLAG) on a
+ *-*-hpux* host.
+
+ * Makefile.in (program_transform_name): New variable.
+ (install): Transform library name before installing it.
+
+Mon Feb 5 10:38:27 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * archures.c (bfd_mach_i960_hx): Define.
+ * bfd-in2.h: Rebuild.
+ * cpu-i960.c (scan_960_mach): Accept machine "hx".
+ (MATRIX): Expand entries for HX.
+ (arch_info_struct): Add i960:hx entry.
+ * bout.c (b_out_set_arch_mach): Handle bfd_mach_i960_hx.
+ * coffcode.h (coff_set_arch_mach_hook): Handle F_I960HX.
+ (coff_set_flags): Handle bfd_mach_i960_hx.
+
+ Support for building as a shared library, based on patches from
+ Alan Modra <alan@spri.levels.unisa.edu.au>:
+ * configure.in: Add AC_ARG_ENABLE for shared and commonbfdlib.
+ New substitutions: ALLLIBS, PICFLAG, SHLIB, SHLIB_CC,
+ SHLIB_CFLAGS, COMMON_SHLIB, PICLIST, SHLINK.
+ * configure: Rebuild.
+ * configure.host: If --enable-shared, adjust shared library stuff
+ based on the host. If the host is SunOS, and the linker supports
+ -rpath, set HLDFLAGS to use it.
+ * Makefile.in (ALLLIBS): New variable.
+ (PICFLAG, SHLIB, SHLIB_CC, SHLIB_CFLAGS): New variables.
+ (COMMON_SHLIB, SHLINK): New variables.
+ (.c.o): If PICFLAG is set, compile twice, once PIC, once normal.
+ (STAGESTUFF): Remove variable.
+ (all): Depend upon $(ALLLIBS) and @PICLIST@ rather than
+ $(TARGETLIB).
+ (stamp-ofiles): New target, like old ofiles target, but build
+ using a temporary file and move-if-change, and touch stamp-ofiles
+ when done.
+ (ofiles): Just depend upon stamp-ofiles.
+ (stamp-piclist, piclist): New targets.
+ ($(SHLIB), $(SHLINK)): New targets.
+ (targets.o, archures.o): Build twice if PICFLAG is set.
+ (do_mostlyclean): Remove pic/*.o.
+ (do_clean): Remove stamp-ofiles, $(SHLIB), $(SHLINK), piclist, and
+ stamp-piclist.
+ (do_distclean): Remove pic and stamp-picdir.
+ (install): Install shared libraries.
+ ($(OFILES)): Depend upon stamp-picdir.
+ (stamp-picdir): New target.
+
+ * libcoff-in.h: Add comment reminding people that libcoff.h is a
+ generated file.
+ * libcoff.h: Rebuild.
+
+ * elflink.h (elf_adjust_dynamic_symbol): Don't try to get the
+ flavour of a section with no owner.
+
+ * elf32-mips.c (mips_elf_create_dynamic_sections): Clear
+ ELF_LINK_NON_ELF flag.
+ (mips_elf_create_got_section): Likewise.
+
+ * elf.c: Revert last change, since it breaks dynamic linking.
+ * elf-bfd.h (struct elf_backend_data): Remove want_hdr_in_seg
+ field.
+ * elf32-mips.c (elf_backend_want_hdr_in_seg): Don't define.
+ * elfxx-target.h (elf_backend_want_hdr_in_seg): Don't define.
+ (elfNN_bed): Don't initialize want_hdr_in_seg field.
+
+Sun Feb 4 20:45:13 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf.c (assign_file_positions_for_segments): If the backend does
+ not want the elf header or the program headers in the address
+ space, do not include them in the calculations.
+
+ * elf32-ppc.c (ppc_elf_additional_program_headers): New hook
+ function to determine if we need additional program headers.
+ (ppc_elf_modify_segment_map): Define as a NOP function for now.
+ (ppc_elf_create_linker_section): .sdata2 is a read-only section.
+
+Sat Feb 3 23:00:03 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffcode.h: Move today's libcoff.h change into coffcode.h.
+
+Sat Feb 3 15:43:44 1996 Fred Fish <fnf@cygnus.com>
+
+ * libcoff.h (bfd_coff_link_add_one_symbol): Combine macro args
+ back into one line. Some compilers (sunos 4.1.3 for example)
+ won't accept args split across more than one line.
+
+Fri Feb 2 11:42:15 1996 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * aclocal.m4 (BFD_BINARY_FOPEN): Understand cygwin32.
+ * configure: Regenerate.
+
+Fri Feb 2 12:12:16 1996 Jeffrey A Law (law@cygnus.com)
+
+ * elf32-hppa.c (elf32_hppa_backend_symbol_table_processing): Don't
+ try to do arithmetic on a void *, cast it to a unsigned char * first.
+
+Thu Feb 1 16:04:06 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf-bfd.h (ELF_LINK_NON_ELF): Define.
+ * elf.c (_bfd_elf_link_hash_newfunc): Set elf_link_hash_flags to
+ ELF_LINK_NON_ELF.
+ * elflink.h (elf_link_add_object_symbols): Reset ELF_LINK_NON_ELF
+ flag for a newly defined symbol.
+ (NAME(bfd_elf,record_link_assignment)): Likewise.
+ (elf_adjust_dynamic_symbol): If ELF_LINK_NON_ELF is set, try to
+ set the DEF or REF_REGULAR flags correctly.
+
+ * Makefile.in (bfd-in2.h): Make bfd.h, not protos, in docdir.
+ (libbfd.h, libcoff.h): Corresponding change.
+
+ * elf32-i386.c (elf_i386_check_relocs): Don't record a symbol with
+ a PLT32 reloc as dynamic.
+ (elf_i386_adjust_dynamic_symbol): If a symbol with a PLT32 reloc
+ is not referenced by a dynamic object, and we are not making a
+ shared object, then don't make a PLT entry. If we do make a PLT
+ entry, make sure the symbol has been recorded as dynamic.
+
+Wed Jan 31 17:23:32 1996 Steve Chamberlain <sac@slash.cygnus.com>
+
+ * coff-i386.c (coff_i386_reloc_type_lookup): Add BFD_RELOC_32_PCREL.
+ * config.bfd (i[345]86-*-win32): Becomes i[345]86-*-cygwin32.
+ (powerpcle-*-cygwin32): New.
+ * peicode.h (add_data_entry): Get address from vma.
+
+Wed Jan 31 16:23:57 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elflink.c (_bfd_elf_create_linker_section): If the symbol
+ attached to the section has already been created as an undefined
+ symbol, treat it as if it hasn't been created yet.
+
+Wed Jan 31 16:16:53 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elflink.h (elf_bfd_final_link): Don't output initial dummy
+ symbol or section symbols if stripping all symbols and this is not
+ a relocateable link. Don't output the symbol string table if
+ there are no symbols.
+ (elf_link_flush_output_syms): Don't do anything if there are no
+ symbols to flush.
+
+Wed Jan 31 12:55:49 1996 Richard Henderson <rth@tamu.edu>
+
+ * coff-aux.c: New file.
+ * hosts/m68kaux.h: New file.
+ * config.bfd (m68*-apple-aux*): New target.
+ * configure.in (m68*-apple-aux*): New native host.
+ (m68kaux_coff_vec): New vector.
+ * configure: Rebuild.
+ * targets.c (m68kaux_coff_vec): Declare.
+ * coffcode.h (bfd_coff_backend_data): Add field
+ _bfd_coff_link_add_one_symbol.
+ (bfd_coff_link_add_one_symbol): Define.
+ (compare_arelent_ptr): New static function if TARG_AUX.
+ (coff_write_relocs): If TARG_AUX, sort the relocs.
+ (coff_write_object_contents): Set A/UX aouthdr magic number.
+ (coff_link_add_one_symbol): Define if not defined.
+ (bfd_coff_std_swap_table): Initialize new field.
+ * libcoff.h: Rebuild.
+ * cofflink.c (coff_link_add_symbols): Call
+ bfd_coff_link_add_one_symbol rather than
+ _bfd_generic_link_add_one_symbol.
+ * coff-m68k.c (COFF_PAGE_SIZE): Don't define if already defined.
+ * coff-alpha.c (alpha_ecoff_backend_data): Initialize new field.
+ * coff-mips.c (mips_ecoff_backend_data): Likewise.
+ * Makefile.in: Rebuild dependencies.
+ (BFD32_BACKENDS): Add coff-aux.o.
+ (BFD32_BACKENDS_CFILES): Add coff-aux.c.
+
+Wed Jan 31 11:37:46 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * elf32-m68k.c (elf_m68k_relocate_section): Fix R_68K_GOT*
+ relocation; ignore addend with R_68K_{GOT,PLT}*O relocation.
+
+Tue Jan 30 12:09:04 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (do_maintainer_clean): Remove $(srcdir)/bfd-in2.h,
+ $(srcdir)/libbfd.h and $(srcdir)/libcoff.h.
+ (maintainer-clean): Warn about deleting special files.
+ (bfd-in2.h, libbfd.h, libcoff.h): New targets.
+
+ * elf32-hppa.c (elf32_hppa_relocate_section): Handle indirect and
+ warning symbols correctly.
+ * elf32-i386.c (elf_i386_relocate_section): Likewise.
+ * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
+ * elf32-mips.c (mips_elf_relocate_section): Likewise.
+ * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+ * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
+
+ * syms.c (_bfd_stab_section_find_nearest_line): Add casts to avoid
+ warnings.
+
+Mon Jan 29 14:27:24 1996 Kim Knuttila <krk@cygnus.com>
+
+ * libcoff-in.h: aligned newly exported names with bfd naming
+ conventions. Removed an erroneous define of POWERPC_LE_PE.
+ * libcoff.h: Rebuild.
+ * cofflink.c, coff-ppc.c: the above function name changes
+
+Mon Jan 29 13:06:28 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ From Basim Kadhim <kadhim@spock.cs.colorado.edu>:
+ * ecoff.c (struct extsym_info): Define.
+ (_bfd_ecoff_bfd_final_link): Pass a pointer to struct extsym_info
+ to ecoff_link_write_external.
+ (ecoff_link_write_external): Accept a struct extsym_info pointer.
+ Strip symbols when appropriate.
+
+ Based on patches from Ronald F. Guilmette <rfg@monkeys.com>:
+ * syms.c (BSF_OBJECT): Define.
+ (bfd_print_symbol_vandf): Print 'O' for BSF_OBJECT.
+ * bfd-in2.h: Rebuild.
+ * elfcode.h (elf_slurp_symbol_table): Set BSF_OBJECT for an
+ STT_OBJECT symbol.
+ * elf.c (swap_out_syms): Only set type to STT_OBJECT if BSF_OBJECT
+ is set.
+
+ * elf32-i386.c (elf_i386_relocate_section): If -Bsymbolic, when
+ copying relocs into a shared object, treat a defined global symbol
+ as a local symbol.
+ * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
+ * elf32-mips.c (mips_elf_relocate_section): Likewise.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+
+ * elflink.h (elf_link_add_object_symbols): Only set weakdef to a
+ real defined symbol, not to a weak defined symbol.
+
+Mon Jan 29 11:34:36 1996 Kim Knuttila <krk@cygnus.com>
+
+ * cofflink.c: removed the POWERPC_LE_PE hack, promoted some types
+ and made a few static functions externs.
+
+ * coff-ppc.c (ppc_bfd_coff_final_link): new function, replaces the
+ POWERPC_LE_PE hack in cofflink.
+
+ * libcoff-in.h: promoted the following from cofflink.c to allow
+ _bfd_coff_final_link to be overridden - STRING_SIZE_SIZE,
+ coff_debug_merge_element, struct coff_debug_merge_type,
+ coff_debug_merge_hash_entry, coff_debug_merge_hash_table,
+ coff_debug_merge_hash_table_init, coff_debug_merge_hash_table_free,
+ coff_debug_merge_hash_lookup, coff_link_section_info,
+ coff_final_link_info, coff_debug_merge_hash_newfunc,
+ coff_write_global_sym, coff_link_input_bfd, coff_reloc_link_order.
+
+ * libcoff.h: re-gen'd
+
+Fri Jan 26 18:33:35 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * syms.c: Include "bfdlink.h".
+ (struct stab_find_info): Define.
+ (_bfd_stab_section_find_nearest_line): New function.
+ * libbfd-in.h (_bfd_stab_section_find_nearest_line): Declare.
+ * libbfd.h: Rebuild.
+ * elf-bfd.h (struct elf_obj_tdata): Add line_info field.
+ * elf.c (_bfd_elf_find_nearest_line): Try calling
+ _bfd_stab_section_find_nearest_line before searching the ELF
+ symbol table. Find the closest STT_FUNC symbol, not the last one.
+ * libcoff-in.h (coff_data_type): Add line_info field.
+ * libcoff.h: Rebuild.
+ * coffgen.c (coff_find_nearest_line): Try calling
+ _bfd_stab_section_find_nearest_line before searching the COFF
+ symbol table.
+ * Makefile.in: Rebuild dependencies.
+
+Fri Jan 26 16:11:19 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (R_PPC_EMB_SDA21 relocations): Make relocation size
+ 4 bytes, so we get the correct value when updating the register
+ field in little endian mode.
+
+Thu Jan 25 12:14:16 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * libcoff-in.h (struct xcoff_tdata): Remove toc_section and
+ entry_section fields. Add sntoc and snentry fields.
+ * libcoff.h: Rebuild.
+ * coffcode.h (coff_mkobject_hook): Initialize sntoc and snentry,
+ not toc_section and entry_section (the COFF file does not have any
+ sections at this point).
+ (coff_write_object_contents): Set o_snentry and o_sntoc from
+ snentry and sntoc rather than entry_section and toc_section.
+ * coff-rs6000.c (xcoff_copy_private_bfd_data): Copy sntoc and
+ snentry, not toc_section and entry_section.
+ * xcofflink.c (bfd_xcoff_size_dynamic_sections): Don't set
+ entry_section from hentry.
+ (xcoff_link_input_bfd): If a defined symbol has XCOFF_ENTRY set,
+ set snenty.
+ (xcoff_link_input_bfd): Set sntoc, not toc_section.
+ (xcoff_write_global_symbol): Get toc_section from sntoc, rather
+ than using toc_section directly.
+
+ * archures.c: Add missing `.' in enum bfd_architecture.
+ * bfd-in2.h: Rebuild.
+
+ * config.bfd (i[345]86-*-sco*elf*): Use bfd_elf32_i386_vec. From
+ Robert Lipe <robertl@arnet.com>.
+
+Thu Jan 25 12:08:51 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_size_dynamic_sections): Add .rela.sdata{,2}
+ to sections we allocate. Use bfd_zalloc to allocate initialial
+ sections, not bfd_alloc.
+ (ppc_elf_check_relocs): Remove BFD_ASSERTs for !shared from
+ SDA{,2}I16 relocations.
+ (ppc_elf_add_symbol_hook): Use the value of -G nn to determine
+ whether to put something in .sbss or not.
+ (ppc_elf_relocate_section): Add support for more relocations. Add
+ in sec->output_offset where appropriate. Make error messages
+ include the symbol name.
+
+ * elflink.c (_bfd_elf_create_linker_section): Lookup symbol before
+ trying to add it to the symbol table, so _GLOBAL_OFFSET_TABLE_
+ doesn't get redefined messages if -shared.
+
+ * elflink.h (elf_create_pointer_linker_section) Only bump RELA
+ section if the rel_section field has been set up.
+
+Wed Jan 24 20:40:26 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_relocate_section): Fix typo in eabi
+ relocations.
+
+Wed Jan 24 10:38:34 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Delete checking
+ of flags, only flags used are controlled by mach number. Bump up
+ output file mach number to highest of input file mach numbers.
+ (elf32_sparc_object_p): Watch for EF_SPARC_SUN_US1.
+ (elf32_sparc_final_write_processing): Set EF_SPARC_SUN_US1 if v8plusa.
+
+ * config.bfd (sparc64-*-{sysv4*,solaris2*}): Comment out
+ bfd_elf64_sparc_vec support.
+
+Tue Jan 23 14:33:05 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_copy_private_bfd_data): Don't complain if
+ the embedded bit is set on some objects and not on others. Just
+ or it together.
+ (ppc_elf_relocate_section): Implement R_PPC_EMB_{SDA21,RELSDA}
+ relocations.
+
+Tue Jan 23 14:22:45 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffcode.h (coff_new_section_hook): Don't try to align the
+ .stabstr section.
+
+ * coffcode.h (coff_set_section_contents): Fix the handling of the
+ .lib section to work even if the entire section contents are
+ written at once. From Gvran Uddeborg <gvran@uddeborg.pp.se> and
+ Robert Lipe <robertl@arnet.com>.
+
+Mon Jan 22 18:45:51 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elflink.h (elf_finish_pointer_linker_section): Don't allocate
+ memory here for contents.
+
+ * elf32-ppc.c (ppc_elf_relocate_section): Bump up _SDA_BASE_ and
+ _SDA2_BASE_ by 32768.
+ (ppc_elf_size_dynamic_sections): #if out PLT code which we haven't
+ started using. Allocate contents for .sdata and .sdata2 sections
+ also.
+ (ppc_elf_check_relocs): Use bfd_get_section_name in debug message,
+ rather than _name.
+ (ppc_elf_finish_dynamic_symbol): Remove code that attempted to
+ size _SDA{,2}_BASE_.
+ (ppc_elf_relocate_section): Change how sdata{,2} relocations are
+ done.
+
+Mon Jan 22 08:52:04 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * elflink.h (elf_finish_pointer_linker_section): Fix typo.
+
+ * archures.c (bfd_mach_sparc_v9): Renamed from bfd_mach_sparc64.
+ (bfd_mach_sparc_{v8plus,v8plusa}): Define.
+ (bfd_mach_sparc_v9a): Define.
+ (bfd_mach_sparc_v9_p): Define.
+ * bfd-in2.h: Regenerated.
+ * aoutx.h (aout,machine_type): bfd_mach_sparc64 renamed to
+ bfd_mach_sparc_v9.
+ * elf64-sparc.c (sparc64_elf_object_p): Likewise.
+ * config.bfd (sparc64-*-sysv4*,sparc64-*-solaris2*): Set targ_defvec
+ to bfd_elf32_sparc_vec.
+ * cpu-sparc.c (arch_info_struct): Renamed from sparc_arch_info.
+ Add v8plus{,a} support.
+ Add v9a support.
+ (sparc_compatible): New function.
+ * elf32-sparc.h: #include "elf/sparc.h".
+ (elf32_sparc_merge_private_bfd_data, elf32_sparc_object_p,
+ elf32_sparc_final_write_processing): New functions.
+ (bfd_elf32_bfd_merge_private_bfd_data, elf_backend_object_p,
+ elf_backend_final_write_processing): Define.
+
+Mon Jan 22 11:21:51 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf-bfd.h (struct elf_link_hash_entry): Add
+ linker_section_pointer field.
+ (enum elf_linker_section_enum): Enumeration for new way of
+ creating linker dynamic sections and symbols.
+ (elf_linker_section{,_pointers}): New structures for creating
+ dynamic sections and symbols.
+ (elf_obj_tdata): Add linker_section_pointers and linker_section
+ fields.
+ (elf_local_ptr_offsets,elf_linker_section): New accessor macros.
+ (_bfd_elf_create_linker_section): New declarations.
+ (_bfd_elf_find_pointer_linker_section): Ditto.
+ (bfd_elf{32,64}_{create,finish}_pointer_linker_section): Ditto.
+ (_bfd_elf_make_linker_section_rela): Ditto.
+
+ * elf.c (_bfd_elf_link_hash_newfunc): Initialize new fields.
+
+ * elf32-ppc.c (ppc_elf_create_dynamic_sections): Delete.
+ (ppc_elf_create_linker_section): New function to create the
+ sections .got, .sdata, and .sdata2.
+ (ppc_elf_size_dynamic_sections): Zap .rela.{sdata,sdata2} if
+ needed.
+ (ppc_elf_check_relocs): Support more of the eabi relocations.
+ (ppc_elf_relocate_section): Ditto.
+ (ppc_elf_finish_dynamic_symbols): Adjust _SDA{,2}_BASE_ by 32768
+ if the .sdata{,2} + .sbss{,2} section size is > 32k.
+
+ * elflink.h (elf_create_pointer_linker_section): New function to
+ create initialized pointers in dynamic linker sections.
+ (elf_finish_pointer_linker_section): Actually intialize the
+ pointers created above.
+
+ * elfcode.h (bfd_elf{32,64}_create_pointer_linker_section): New
+ macros to provide both 32 and 64 bit versions of
+ elf_create_pointer_linker_section.
+ (bfd_elf{32,64}_finish_pointer_linker_section): New macros to
+ provide both 32 and 64 bit versions of
+ elf_finish_pointer_linker_section.
+
+ * elflink.c (_bfd_elf_create_linker_section): New function to
+ create a linker section.
+ (_bfd_elf_find_pointer_linker_section): Find a unique pointer to a
+ given address in the linker pointer offsets created for a given
+ symbol.
+ (_bfd_elf_make_linker_section_rela): Make a RELA section
+ corresponding to the generated linker section.
+
+Sat Jan 20 08:36:10 1996 Doug Evans <dje@canuck.cygnus.com>
+
+ * elf32-sparc.c (ELF_MACHINE_ALT1): Define.
+
+Thu Jan 18 18:25:34 1996 Kim Knuttila <krk@cygnus.com>
+
+ * coff-ppc.c (coff_ppc_relocate_section): changed TOCDEFN relocs.
+ (coff_ppc_relocate_section): Handle special values for gcc built dlls.
+ (dump_toc): fix diagnosing code to identify out-of-toc-bounds entries.
+ Also begin the toc at 4 as an eye catcher ('31313131' marks the first
+ toc entry in an objdump) for now.
+ (ppc_do_last, ppc_get_last): New function - needed to save processing
+ the toc owner to the end.
+ (ppc_coff_swap_sym_in_hook): Removed an incorrect hack for doing the
+ toc owner last.
+
+ * cofflink.c (_bfd_coff_final_link): Added a new hack to keep the
+ toc owner from being done till last. Must define POWERPC_LE_PC
+ to enable it.
+
+ * coffcode.h (coff_set_alignment_hook): alignment setting for .stab
+
+ * peicode.h (coff_swap_scnhdr_out): set section flags for stab/str
+ to INFO.
+ (coff_swap_aouthdr_out): Removed a non-working hack for computing the
+ SizeOfImage for PowerPC. Ignore the size of the .junk section.
+
+Thu Jan 18 17:42:12 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elfcore.h: Include <signal.h> before <sys/procfs.h>.
+
+Wed Jan 17 12:40:14 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * cpu-powerpc.c (arch_info_struct): Change last entry to not point
+ back to first.
+ (bfd_powerpc_arch): Point at first entry in arch_info_struct.
+
+Tue Jan 16 15:10:49 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (assign_file_positions_for_segments): Don't increment file
+ offset for a segment which contains no loadable sections.
+
+Mon Jan 15 17:46:27 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * reloc.c: Add new PowerPC relocations.
+ * {bfd-in2,libbfd}.h: Regenerate.
+
+ * elf32-ppc.c (ppc_elf_howto_raw): Add more PPC relocations.
+ (ppc_elf_reloc_type_lookup): Lookup new relocations.
+
+Mon Jan 15 14:29:44 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * aoutx.h (howto_table_ext): Fix RELOC_BASE10 and RELOC_BASE22
+ entries.
+
+ * sunos.c (sunos_scan_ext_relocs): Don't fail assert if
+ info->shared.
+
+ * coffgen.c (coff_find_nearest_line): Don't try to cache
+ information in sections that are not owned by a BFD. From Richard
+ Henderson <richard@atheist.tamu.edu>.
+
+ * elf32-mips.c: Numerous changes to dynamic linking code, mostly
+ from Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>.
+ * elflink.h (elf_link_output_extsym): Remove special check for
+ _rld_new_interface.
+
+ * ecoffswap.h: Add prototypes for static functions.
+
+Sun Jan 14 21:36:08 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_{unsupported,std}_reloc): Remove functions.
+ (ppc_elf_howto_raw): Remove ppc_elf_{unsupported,std}_reloc
+ references.
+ (ppc_elf_relocate_section): No longer allow .sdata/.sbss sections
+ to satisfy a TOC16 relocation. Rewrite unsupported relocation
+ support. Begin support for R_PPC_SDA{2,}REL.
+
+Sat Jan 13 09:36:52 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_create_dynamic_sections): New function to
+ create the .got and .got.neg sections.
+ (ppc_elf_size_dynamic_sections): Call it.
+ (ppc_elf_check_relocs): Call it.
+ (ppc_elf_size_dynamic_sections): Support .got.neg, just like .got.
+ (ppc_elf_check_relocs): Add error messages for relocations we
+ don't yet support. Do not include R_PPC_SDAREL16 like a GOT
+ relocation.
+
+Fri Jan 12 15:27:59 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf32-ppc.c (ppc_elf_fake_sections): Define, and handle the new
+ section flags for V.4 and eabi.
+
+Fri Jan 12 13:59:16 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (assign_file_positions_for_segments): If a segment
+ contains no sections, don't mark it as readable.
+
+ * elf-bfd.h (_bfd_elf_section_from_bfd_section): Declare.
+ * elfcode.h (_bfd_elf_section_from_bfd_section): Don't declare.
+
+ * elf.c (_bfd_elf_print_private_bfd_data): Dump contents of
+ dynamic section, if there is one.
+ * elf-bfd.h (struct elf_size_info): Add swap_dyn_in field.
+ (bfd_elf32_swap_dyn_in): Change type of second parameter to PTR.
+ (bfd_elf64_swap_dyn_in): Likewise.
+ * elfcode.h (elf_swap_dyn_in): Change type of second parameter to
+ PTR.
+ (NAME(_bfd_elf,size_info)): Initialize swap_dyn_in field.
+
+ * elf32-i386.c (elf_i386_size_dynamic_sections): Don't create a
+ DT_TEXTREL entry because of .rel.plt. From Martin Pirker
+ <pirker@eiunix.tuwien.ac.at>.
+
+Thu Jan 11 17:06:14 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * section.c (SEC_{EXCLUDE,SORT_ENTRIES}): New section flags for
+ PowerPC V.4 and eabi.
+ * bfd-in2.h: Regenerate.
+ * libfd.h: Regenerate.
+
+ * elfxx-target.h (TARGET_{BIG,LITTLE}_SYM): Add new flags.
+
+ * elf32-ppc.c (ppc_elf_section_from_shdr): Support SHT_ORDERED
+ section type and SHF_EXCLUDE section flag, turning them into the
+ appropriate bfd section flag.
+
+Thu Jan 11 11:23:30 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * xcofflink.c (xcoff_link_add_symbols): Create the special
+ sections if we see a DYNAMIC object, in case that is the only
+ XCOFF input object we see.
+
+ * elf32-mips.c: Extensive changes for a start at dynamic linking
+ support, from Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>.
+
+ * elf-bfd.h (struct elf_backend_data): Add type_change_ok field.
+ (struct elf_backend_data): Remove
+ elf_backend_create_program_headers field. Add
+ elf_backend_additional_program_headers and
+ elf_backend_modify_segment_map fields.
+ * elfxx-target.h (elf_backend_type_change_ok): Define if not
+ defined.
+ (elf_backend_additional_program_headers): Likewise.
+ (elf_backend_modify_segment_map): Likewise.
+ (elf_backend_create_program_headers): Don't define.
+ (elfNN_bed): Change to account for field changes.
+ * elf.c (assign_file_positions_for_segments): Call new
+ modify_segment_map backend function. Don't call old
+ create_program_headers backend function.
+ (get_program_header_size): Call additional_program_headers rather
+ than create_program_headers.
+ * elflink.h (elf_link_add_object_symbols): Initialize
+ type_change_ok from new backend field.
+ (elf_link_output_extsym): Don't warn if _rld_new_interface is
+ defined.
+ (elf_reloc_link_order): Treat a reloc against a defined symbol as
+ a reloc against the appropriate section.
+
+ * elf-bfd.h (struct bfd_elf_section_data): Add tdata field.
+ (struct elf_obj_tdata): Rename ppc_flags_init field to flags_init.
+ (elf_flags_init): Rename from elf_ppc_flags_init.
+ * elf32-ppc.c (ppc_elf_set_private_flags): Use elf_flags_init, not
+ elf_ppc_flags_init.
+ (ppc_elf_copy_private_bfd_data): Likewise.
+ (ppc_elf_merge_private_bfd_data): Likewise.
+
+ * elf32-m68k.c (howto_table): Change src_mask to 0 for all
+ relocation entries.
+
+Tue Jan 9 15:22:53 1996 David Mosberger-Tang <davidm@azstarnet.com>
+
+ * coff-alpha.c (alpha_relocate_section): During final link, allow
+ output .lita section to be bigger than 64k by adjusting gp value
+ on a per-input section basis.
+ * libecoff.h (struct ecoff_tdata): Add issued_multiple_gp_warning
+ field.
+ (struct ecoff_section_tdata): Add gp field.
+
+Tue Jan 9 12:00:36 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ Handle Alpha ECOFF changes in OSF/1 3.2.
+ * libecoff.h (struct ecoff_backend_data): Add get_elt_at_filepos
+ field.
+ * coff-alpha.c: Include "aout/ar.h".
+ (alpha_ecoff_get_relocated_section_contents): Don't require an
+ ALPHA_R_IGNORE reloc after an ALPHA_R_GPDISP reloc, since OSF/1
+ 3.2 doesn't generate one.
+ (alpha_relocate_section): Likewise.
+ (alpha_ecoff_slurp_armap): Define.
+ (alpha_ecoff_slurp_extended_name_table): Define.
+ (alpha_ecoff_construct_extended_name_table): Define.
+ (alpha_ecoff_truncate_arname): Define.
+ (alpha_ecoff_write_armap): Define.
+ (alpha_ecoff_generic_stat_arch_elt): Define.
+ (alpha_ecoff_update_armap_timestamp): Define.
+ (ARFZMAG): Define.
+ (alpha_ecoff_read_ar_hdr): New static function.
+ (alpha_ecoff_get_elt_at_filepos): New static function.
+ (alpha_ecoff_openr_next_archived_file): New static function.
+ (alpha_ecoff_get_elt_at_index): New static function.
+ (alpha_ecoff_backend_data): Initialize get_elt_at_filepos field.
+ (ecoffalpha_little_vec): Change BFD_JUMP_TABLE_ARCHIVE from
+ _bfd_ecoff to alpha_ecoff.
+ * ecoff.c (ecoff_link_add_archive_symbols): Use get_elt_at_filepos
+ field from backend structure, rather than always calling
+ _bfd_get_elt_at_filepos.
+ * coff-mips.c (mips_ecoff_backend_data): Initialize
+ get_elt_at_filepos field.
+ * archive.c (_bfd_generic_read_ar_hdr_mag): New function, copied
+ from _bfd_generic_read_ar_hdr with minor changes.
+ (_bfd_generic_read_ar_hdr): Use _bfd_generic_read_ar_hdr_mag.
+ * libbfd-in.h (_bfd_generic_read_ar_hdr_mag): Declare.
+ * libbfd.h: Rebuild.
+
+ * bfd-in.h (BFD_IN_MEMORY): Define.
+ * libbfd-in.h (struct bfd_in_memory): Define.
+ * libbfd.c (bfd_read): Handle BFD_IN_MEMORY flag.
+ (bfd_get_file_window): Don't try to map a BFD_IN_MEMORY file.
+ (bfd_write, bfd_stat): Abort if BFD_IN_MEMORY is set.
+ (bfd_tell, bfd_flush, bfd_seek): Handle BFD_IN_MEMORY flag.
+ * bfd.c (struct _bfd): Change iostream field from char * to PTR.
+ (bfd_get_size): Handle BFD_IN_MEMORY flag.
+ * cache.c (bfd_cache_close): Ignore BFD_IN_MEMORY files.
+ (bfd_open_file): Cast to PTR, not char *, when setting iostream.
+ (bfd_cache_lookup_worker): Abort if BFD_IN_MEMORY is set.
+ * opncls.c (bfd_fdopenr): Cast to PTR, not char *, when setting
+ iostream.
+ (bfd_openstreamr): Likewise.
+ * aoutx.h (NAME(aout,some_aout_object_p)): Only fstat iostream if
+ BFD_IN_MEMORY is not set.
+ * riscix.c (riscix_some_aout_object_p): Likewise.
+ * bfd-in2.h, libbfd.h: Rebuild.
+
+ * targets.c (bfd_target): Add _bfd_get_elt_at_index field.
+ (BFD_JUMP_TABLE_ARCHIVE): Add _get_elt_at_index.
+ (bfd_get_elt_at_index): Define.
+ * archive.c (_bfd_generic_get_elt_at_index): Rename from
+ bfd_get_elt_at_index. Change index parameter from int to
+ symindex.
+ * libbfd-in.h (_bfd_generic_get_elt_at_index): Declare.
+ (_bfd_noarchive_get_elt_at_index): Define.
+ (_bfd_archive_bsd_get_elt_at_index): Define.
+ (_bfd_archive_coff_get_elt_at_index): Define.
+ * bfd-in2.h, libbfd.h: Rebuild.
+ * aout-target.h (MY_get_elt_at_index): Define if not defined.
+ * coff-rs6000.c (xcoff_get_elt_at_index): Define.
+ * ieee.c (ieee_get_elt_at_index): Define.
+ * libecoff.h (_bfd_ecoff_get_elt_at_index): Define.
+ * oasys.c (oasys_get_elt_at_index): Define.
+ * som.c (som_get_elt_at_index): Define.
+
+ * ecoff.c (_bfd_ecoff_find_nearest_line): Don't restrict line
+ numbers to the .text section.
+
+Mon Jan 8 17:00:57 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ieee.c (ieee_write_debug_part): Change return type to boolean.
+ If there is a SEC_DEBUGGING section, get the contents of the debug
+ information part from it.
+ (ieee_set_section_contents): Store the contents of a SEC_DEBUGGING
+ section in memory.
+ (ieee_write_object_contents): Check ieee_write_debug_part return.
+
+Thu Jan 4 17:12:37 1996 Fred Fish <fnf@cygnus.com>
+
+ * config.bfd (i[345]86-*-freebsd*): Add target.
+ * configure.in (i386freebsd_vec): Add vec.
+ * configure: Regenerate.
+ * Makefile.in (BFD32_BACKENDS): Add i386freebsd.o.
+ (BFD32_BACKENDS_CFILES): Add i386freebsd.c.
+ Rebuild dependencies..
+ * freebsd.h: New file.
+ * i386freebsd.c: New file.
+ * targets.c (i386freebsd_vec): Declare.
+ (bfd_target_vector): Add i386freebsd_vec.
+ * i386linux.c (SEGMENT_SIZE): Define as TARGET_PAGE_SIZE
+ * i386netbsd.c (SEGMENT_SIZE): Define as TARGET_PAGE_SIZE
+
+Thu Jan 4 16:27:46 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * ieee.c (ieee_slurp_debug): New static function.
+ (ieee_object_p): Call it.
+ (ieee_slurp_section_data): Skip debugging sections.
+ (ieee_get_reloc_upper_bound): Likewise.
+ (ieee_get_section_contents): Likewise.
+ (ieee_canonicalize_reloc): Likewise.
+ (ieee_write_section_part): Likewise.
+ (ieee_write_debug_part): Likewise.
+ (ieee_write_data_part): Likewise.
+ (init_for_output): Likewise.
+
+Wed Jan 3 19:42:47 1996 Michael Meissner <meissner@wogglebug.tiac.net>
+
+ * elf32-ppc.c (ppc_elf_relocate_section): Make @GOT relocations
+ work.
+ (ppc_elf_howto_raw): Just use bfd_elf_generic_reloc for all howto
+ relocs, since ppc_elf_relocate_section handles the linker case.
+ (ppc_elf_{addr16_ha,got16,toc16,brtaken}_reloc): Delete, no longer
+ used.
+ (ppc_elf_{addr16_ha,got16,toc16,brtaken}_inner): Merge these into
+ ppc_elf_relocate_section since that is now the only caller.
+ (ppc_elf_relocate_section): Ditto.
+
+Wed Jan 3 15:11:30 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * coffcode.h (coff_write_object_contents): If we don't know the
+ section of the entry point for an XCOFF executable, always set the
+ entry address to -1.
+
+Tue Jan 2 14:17:15 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * elf.c (bfd_section_from_shdr): Add support for note sections.
+
+Tue Jan 2 13:10:25 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * bfd-in.h (struct _symbol_info): Add stab_type field.
+ * bfd-in2.h: Rebuild.
+ * aoutx.h (NAME(aout,get_symbol_info)): Set stab_type.
+
+ * elf32-ppc.c: Remove trailing newline from calls to
+ _bfd_error_handler.
+ (ppc_elf_merge_private_bfd_data): Only warn about endianness
+ difference if target endianness is known.
+
+For older changes see ChangeLog-9495
+
+Local Variables:
+mode: change-log
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/contrib/binutils/bfd/Makefile.am b/contrib/binutils/bfd/Makefile.am
index b8e55446437f..2d389596e549 100644
--- a/contrib/binutils/bfd/Makefile.am
+++ b/contrib/binutils/bfd/Makefile.am
@@ -4,9 +4,9 @@ AUTOMAKE_OPTIONS = cygnus
INCDIR = $(srcdir)/../include
CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
-DEP = mkdep
+MKDEP = gcc -MM
-SUBDIRS = doc
+SUBDIRS = doc po
docdir = doc
@@ -41,25 +41,32 @@ ALL_MACHINES = \
cpu-alpha.lo \
cpu-arc.lo \
cpu-arm.lo \
+ cpu-avr.lo \
cpu-d10v.lo \
+ cpu-d30v.lo \
+ cpu-fr30.lo \
cpu-h8300.lo \
cpu-h8500.lo \
cpu-hppa.lo \
+ cpu-i370.lo \
cpu-i386.lo \
cpu-i860.lo \
cpu-i960.lo \
cpu-m32r.lo \
cpu-m68k.lo \
cpu-m88k.lo \
- cpu-mips.lo \
cpu-m10200.lo \
cpu-m10300.lo \
+ cpu-mcore.lo \
+ cpu-mips.lo \
cpu-ns32k.lo \
+ cpu-pj.lo \
cpu-powerpc.lo \
cpu-rs6000.lo \
cpu-sh.lo \
cpu-sparc.lo \
cpu-tic30.lo \
+ cpu-tic80.lo \
cpu-v850.lo \
cpu-vax.lo \
cpu-we32k.lo \
@@ -71,24 +78,32 @@ ALL_MACHINES_CFILES = \
cpu-alpha.c \
cpu-arc.c \
cpu-arm.c \
+ cpu-avr.c \
+ cpu-d10v.c \
+ cpu-d30v.c \
+ cpu-fr30.c \
cpu-h8300.c \
cpu-h8500.c \
cpu-hppa.c \
+ cpu-i370.c \
cpu-i386.c \
cpu-i860.c \
cpu-i960.c \
cpu-m32r.c \
cpu-m68k.c \
cpu-m88k.c \
- cpu-mips.c \
cpu-m10200.c \
cpu-m10300.c \
+ cpu-mcore.c \
+ cpu-mips.c \
cpu-ns32k.c \
+ cpu-pj.c \
cpu-powerpc.c \
cpu-rs6000.c \
cpu-sh.c \
cpu-sparc.c \
cpu-tic30.c \
+ cpu-tic80.c \
cpu-v850.c \
cpu-vax.c \
cpu-we32k.c \
@@ -105,6 +120,7 @@ BFD32_BACKENDS = \
aout-tic30.lo \
aout0.lo \
aout32.lo \
+ armnetbsd.lo \
bout.lo \
cf-i386lynx.lo \
cf-m68klynx.lo \
@@ -129,33 +145,45 @@ BFD32_BACKENDS = \
coff-stgo32.lo \
coff-svm68k.lo \
coff-tic30.lo \
+ coff-tic80.lo \
coff-u68k.lo \
coff-we32k.lo \
coff-w65.lo \
coff-z8k.lo \
cofflink.lo \
+ dwarf1.lo \
dwarf2.lo \
ecoff.lo \
ecofflink.lo \
elf.lo \
elf32-arc.lo \
+ elfarm-oabi.lo \
+ elfarm-nabi.lo \
+ elf32-avr.lo \
elf32-d10v.lo \
+ elf32-d30v.lo \
+ elf32-fr30.lo \
elf32-gen.lo \
- elf32-hppa.lo \
+ elf32-i370.lo \
elf32-i386.lo \
elf32-i860.lo \
+ elf32-i960.lo \
elf32-m32r.lo \
elf32-m68k.lo \
elf32-m88k.lo \
- elf32-mips.lo \
elf-m10200.lo \
elf-m10300.lo \
+ elf32-mcore.lo \
+ elf32-mips.lo \
+ elf32-pj.lo \
elf32-ppc.lo \
elf32-sh.lo \
elf32-sparc.lo \
elf32-v850.lo \
elf32.lo \
elflink.lo \
+ epoc-pe-arm.lo \
+ epoc-pei-arm.lo \
hp300bsd.lo \
hp300hpux.lo \
som.lo \
@@ -189,8 +217,15 @@ BFD32_BACKENDS = \
pei-arm.lo \
pe-i386.lo \
pei-i386.lo \
+ pe-mcore.lo \
+ pei-mcore.lo \
pe-ppc.lo \
pei-ppc.lo \
+ pe-sh.lo \
+ pei-sh.lo \
+ pe-mips.lo \
+ pei-mips.lo \
+ peigen.lo \
ppcboot.lo \
reloc16.lo \
riscix.lo \
@@ -200,6 +235,11 @@ BFD32_BACKENDS = \
sunos.lo \
vaxnetbsd.lo \
versados.lo \
+ vms.lo \
+ vms-gsd.lo \
+ vms-hdr.lo \
+ vms-misc.lo \
+ vms-tir.lo \
xcofflink.lo
BFD32_BACKENDS_CFILES = \
@@ -210,6 +250,7 @@ BFD32_BACKENDS_CFILES = \
aout-tic30.c \
aout0.c \
aout32.c \
+ armnetbsd.c \
bout.c \
cf-i386lynx.c \
cf-m68klynx.c \
@@ -234,33 +275,45 @@ BFD32_BACKENDS_CFILES = \
coff-stgo32.c \
coff-svm68k.c \
coff-tic30.c \
+ coff-tic80.c \
coff-u68k.c \
coff-we32k.c \
coff-w65.c \
coff-z8k.c \
cofflink.c \
+ dwarf1.c \
dwarf2.c \
ecoff.c \
ecofflink.c \
elf.c \
elf32-arc.c \
+ elfarm-oabi.c \
+ elfarm-nabi.c \
+ elf32-avr.c \
elf32-d10v.c \
+ elf32-d30v.c \
+ elf32-fr30.c \
elf32-gen.c \
- elf32-hppa.c \
+ elf32-i370.c \
elf32-i386.c \
elf32-i860.c \
+ elf32-i960.c \
elf32-m32r.c \
elf32-m68k.c \
elf32-m88k.c \
- elf32-mips.c \
elf-m10200.c \
elf-m10300.c \
+ elf32-mcore.c \
+ elf32-mips.c \
+ elf32-pj.c \
elf32-ppc.c \
elf32-sh.c \
elf32-sparc.c \
elf32-v850.c \
elf32.c \
elflink.c \
+ epoc-pe-arm.c \
+ epoc-pei-arm.c \
hp300bsd.c \
hp300hpux.c \
som.c \
@@ -294,8 +347,15 @@ BFD32_BACKENDS_CFILES = \
pei-arm.c \
pe-i386.c \
pei-i386.c \
+ pe-mcore.c \
+ pei-mcore.c \
pe-ppc.c \
pei-ppc.c \
+ pe-sh.c \
+ pei-sh.c \
+ pe-mips.c \
+ pei-mips.c \
+ peigen.c \
ppcboot.c \
reloc16.c \
riscix.c \
@@ -305,6 +365,11 @@ BFD32_BACKENDS_CFILES = \
sunos.c \
vaxnetbsd.c \
versados.c \
+ vms.c \
+ vms-gsd.c \
+ vms-hdr.c \
+ vms-misc.c \
+ vms-tir.c \
xcofflink.c
# The .o files needed by all of the 64 bit vectors that are configured into
@@ -319,11 +384,6 @@ BFD64_BACKENDS = \
elf64-mips.lo \
elf64-sparc.lo \
elf64.lo \
- evax-alpha.lo \
- evax-egsd.lo \
- evax-etir.lo \
- evax-emh.lo \
- evax-misc.lo \
nlm32-alpha.lo \
nlm64.lo
@@ -336,11 +396,6 @@ BFD64_BACKENDS_CFILES = \
elf64-mips.c \
elf64-sparc.c \
elf64.c \
- evax-alpha.c \
- evax-egsd.c \
- evax-etir.c \
- evax-emh.c \
- evax-misc.c \
nlm32-alpha.c \
nlm64.c
@@ -350,6 +405,7 @@ OPTIONAL_BACKENDS = \
irix-core.lo \
lynx-core.lo \
osf-core.lo \
+ sco5-core.lo \
trad-core.lo \
cisco-core.lo
@@ -359,6 +415,7 @@ OPTIONAL_BACKENDS_CFILES = \
irix-core.c \
lynx-core.c \
osf-core.c \
+ sco5-core.c \
trad-core.c \
cisco-core.c
@@ -369,7 +426,7 @@ BFD_BACKENDS = @bfd_backends@
BFD_MACHINES = @bfd_machines@
TDEFAULTS = @tdefaults@
-INCLUDES = -D_GNU_SOURCE @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES)
+INCLUDES = -D_GNU_SOURCE @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) -I$(srcdir)/../intl -I../intl
# C source files that correspond to .o's.
CFILES = \
@@ -379,13 +436,24 @@ CFILES = \
$(BFD64_BACKENDS_CFILES) \
$(OPTIONAL_BACKENDS_CFILES)
-HFILES = \
+## This is a list of all .h files which are in the source tree.
+SOURCE_HFILES = \
aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h \
- ecoffswap.h elf32-hppa.h elf32-target.h elf64-target.h \
- elfcode.h evax.h genlink.h go32stub.h hppa_stubs.h libaout.h \
+ ecoffswap.h elf32-arm.h elfcode.h elfcore.h \
+ elflink.h freebsd.h genlink.h go32stub.h libaout.h \
libbfd.h libcoff.h libecoff.h elf-bfd.h libhppa.h libieee.h \
- libnlm.h liboasys.h netbsd.h nlm-target.h nlmcode.h ns32k.h som.h \
- targmatch.h
+ libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h nlmcode.h \
+ nlmswap.h ns32k.h peicode.h som.h vms.h
+
+HFILES = \
+ elf32-target.h elf64-target.h targmatch.h \
+ $(SOURCE_HFILES)
+
+POTFILES = $(CFILES) $(SOURCE_HFILES)
+
+po/POTFILES.in: @MAINT@ Makefile
+ for file in $(POTFILES); do echo $$file; done | sort > tmp \
+ && mv tmp $(srcdir)/po/POTFILES.in
diststuff: info
@@ -412,8 +480,8 @@ ofiles: stamp-ofiles ; @true
libbfd_la_SOURCES = $(BFD_LIBS_CFILES)
libbfd_la_DEPENDENCIES = $(OFILES) ofiles
-libbfd_la_LIBADD = `cat ofiles`
-libbfd_la_LDFLAGS = -release $(VERSION)
+libbfd_la_LIBADD = `cat ofiles` @WIN32LIBADD@
+libbfd_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
# libtool will build .libs/libbfd.a. We create libbfd.a in the build
# directory so that we don't have to convert all the programs that use
@@ -424,8 +492,9 @@ noinst_LIBRARIES = libbfd.a
libbfd_a_SOURCES =
stamp-lib: libbfd.la
- if [ -f .libs/libbfd.a ]; then \
- cp .libs/libbfd.a libbfd.tmp; \
+ libtooldir=`$(LIBTOOL) --config | sed -n -e 's/^objdir=//p'`; \
+ if [ -f $$libtooldir/libbfd.a ]; then \
+ cp $$libtooldir/libbfd.a libbfd.tmp; \
$(SHELL) $(srcdir)/../move-if-change libbfd.tmp libbfd.a; \
else true; fi
touch stamp-lib
@@ -468,29 +537,24 @@ $(OPTIONAL_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
# Install BFD include file, and others that it needs.
install-data-local: $(BFD_H)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(includedir)
$(INSTALL_DATA) $(BFD_H) $(includedir)/bfd.h
$(INSTALL_DATA) $(INCDIR)/ansidecl.h $(includedir)/ansidecl.h
$(INSTALL_DATA) $(INCDIR)/bfdlink.h $(includedir)/bfdlink.h
-# Have to get rid of .dep1 here so that "$?" later includes all of $(CFILES).
-.dep: dep.sed $(CFILES) $(HFILES) bfd.h
- rm -f .dep1
- $(MAKE) DEP=$(DEP) .dep1
- sed -f dep.sed <.dep1 >.dep
-
-# This rule really wants a mkdep that runs "gcc -MM".
-# The NetBSD mkdep overwrites any existing file contents, and doesn't insert
-# the "DO NOT DELETE" line.
-# Other mkdep versions require a file that already exists, and do insert it.
-# Hence the weirdness....
-.dep1: $(CFILES)
- rm -f .dep2 .dep2a
- echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep2
- echo > .dep2a
- $(DEP) -f .dep2a $(INCLUDES) $(CFLAGS) $?
- sed -e '/DO NOT DELETE/d' -e '/^$$/d' < .dep2a >> .dep2
- rm -f .dep2a
- $(SHELL) $(srcdir)/../move-if-change .dep2 .dep1
+# Have to get rid of DEP1 here so that "$?" later includes all of $(CFILES).
+DEP: dep.sed $(CFILES) $(HFILES) bfd.h
+ rm -f DEP1
+ $(MAKE) MKDEP="$(MKDEP)" DEP1
+ sed -f dep.sed < DEP1 > $@
+ echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> $@
+
+DEP1: $(CFILES)
+ echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > DEP2
+ echo '# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.' >> DEP2
+ $(MKDEP) $(INCLUDES) $(CFLAGS) $? >> DEP2
+ mv -f DEP2 $@
dep.sed: dep-in.sed config.status
sed <$(srcdir)/dep-in.sed >dep.sed \
@@ -498,19 +562,19 @@ dep.sed: dep-in.sed config.status
-e 's!@INCDIR@!$(INCDIR)!' \
-e 's!@SRCDIR@!$(srcdir)!'
-dep: .dep
+dep: DEP
sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
- cat .dep >> tmp-Makefile
+ cat DEP >> tmp-Makefile
$(SHELL) $(srcdir)/../move-if-change tmp-Makefile Makefile
-dep-in: .dep
+dep-in: DEP
sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.in > tmp-Makefile.in
- cat .dep >> tmp-Makefile.in
+ cat DEP >> tmp-Makefile.in
$(SHELL) $(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in
-dep-am: .dep
+dep-am: DEP
sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.am > tmp-Makefile.am
- cat .dep >> tmp-Makefile.am
+ cat DEP >> tmp-Makefile.am
$(SHELL) $(srcdir)/../move-if-change tmp-Makefile.am $(srcdir)/Makefile.am
host-aout.lo: Makefile
@@ -573,11 +637,22 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES)
MOSTLYCLEANFILES = elf32-target.h elf64-target.h ofiles stamp-ofiles \
targmatch.h
-CLEANFILES = bfd.h dep.sed stmp-bfd-h .dep .dep1 libbfd.a stamp-lib \
+CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEP1 DEP2 libbfd.a stamp-lib \
stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
+# We want to rerun configure if config.bfd or configure.host change.
+config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host
+ $(SHELL) ./config.status --recheck
+elfarm-oabi.lo: elfarm-oabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
+
+elfarm-nabi.lo: elfarm-nabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
+
# What appears below is generated by a hacked mkdep using gcc -MM.
# DO NOT DELETE THIS LINE -- mkdep uses it.
@@ -597,7 +672,7 @@ init.lo: init.c
libbfd.lo: libbfd.c
opncls.lo: opncls.c $(INCDIR)/objalloc.h
reloc.lo: reloc.c $(INCDIR)/bfdlink.h
-section.lo: section.c
+section.lo: section.c $(INCDIR)/bfdlink.h
syms.lo: syms.c $(INCDIR)/bfdlink.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def
targets.lo: targets.c $(INCDIR)/fnmatch.h targmatch.h
@@ -614,24 +689,32 @@ cpu-a29k.lo: cpu-a29k.c
cpu-alpha.lo: cpu-alpha.c
cpu-arc.lo: cpu-arc.c
cpu-arm.lo: cpu-arm.c
+cpu-avr.lo: cpu-avr.c
+cpu-d10v.lo: cpu-d10v.c
+cpu-d30v.lo: cpu-d30v.c
+cpu-fr30.lo: cpu-fr30.c
cpu-h8300.lo: cpu-h8300.c
cpu-h8500.lo: cpu-h8500.c
cpu-hppa.lo: cpu-hppa.c
+cpu-i370.lo: cpu-i370.c
cpu-i386.lo: cpu-i386.c
cpu-i860.lo: cpu-i860.c
cpu-i960.lo: cpu-i960.c
cpu-m32r.lo: cpu-m32r.c
cpu-m68k.lo: cpu-m68k.c
cpu-m88k.lo: cpu-m88k.c
-cpu-mips.lo: cpu-mips.c
cpu-m10200.lo: cpu-m10200.c
cpu-m10300.lo: cpu-m10300.c
+cpu-mcore.lo: cpu-mcore.c
+cpu-mips.lo: cpu-mips.c
cpu-ns32k.lo: cpu-ns32k.c ns32k.h
+cpu-pj.lo: cpu-pj.c
cpu-powerpc.lo: cpu-powerpc.c
cpu-rs6000.lo: cpu-rs6000.c
cpu-sh.lo: cpu-sh.c
cpu-sparc.lo: cpu-sparc.c
cpu-tic30.lo: cpu-tic30.c
+cpu-tic80.lo: cpu-tic80.c
cpu-v850.lo: cpu-v850.c
cpu-vax.lo: cpu-vax.c
cpu-we32k.lo: cpu-we32k.c
@@ -658,6 +741,9 @@ aout0.lo: aout0.c aoutf1.h $(INCDIR)/aout/sun4.h libaout.h \
aout32.lo: aout32.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
$(INCDIR)/aout/ar.h
+armnetbsd.lo: armnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
+ aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
bout.lo: bout.c $(INCDIR)/bfdlink.h genlink.h $(INCDIR)/bout.h \
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h
cf-i386lynx.lo: cf-i386lynx.c coff-i386.c $(INCDIR)/coff/i386.h \
@@ -721,6 +807,8 @@ coff-svm68k.lo: coff-svm68k.c coff-m68k.c $(INCDIR)/coff/m68k.h \
coffcode.h coffswap.h
coff-tic30.lo: coff-tic30.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic30.h \
$(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
+coff-tic80.lo: coff-tic80.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic80.h \
+ $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
coff-u68k.lo: coff-u68k.c coff-m68k.c $(INCDIR)/coff/m68k.h \
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h
@@ -733,6 +821,9 @@ coff-z8k.lo: coff-z8k.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/z8k.h \
$(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
cofflink.lo: cofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
libcoff.h
+dwarf1.lo: dwarf1.c $(INCDIR)/libiberty.h elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf.h
dwarf2.lo: dwarf2.c $(INCDIR)/libiberty.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h
@@ -749,61 +840,96 @@ elf.lo: elf.c $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h
elf32-arc.lo: elf32-arc.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
- $(INCDIR)/elf/arc.h elf32-target.h
+ $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
+elfarm-oabi.lo: elfarm-oabi.c $(INCDIR)/elf/arm-oabi.h \
+ $(INCDIR)/elf/reloc-macros.h elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ elf32-arm.h elf32-target.h
+elfarm-nabi.lo: elfarm-nabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \
+ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
+ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf32-arm.h \
+ elf32-target.h
+elf32-avr.lo: elf32-avr.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/elf/avr.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-d10v.lo: elf32-d10v.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf32-target.h
+elf32-d30v.lo: elf32-d30v.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ elf32-target.h
+elf32-fr30.lo: elf32-fr30.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/elf/fr30.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-gen.lo: elf32-gen.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf32-target.h
-elf32-hppa.lo: elf32-hppa.c $(INCDIR)/bfdlink.h elf-bfd.h \
+elf32-i370.lo: elf32-i370.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- elf32-hppa.h libhppa.h $(INCDIR)/elf/hppa.h hppa_stubs.h \
- elf32-target.h
+ $(INCDIR)/elf/i370.h elf32-target.h
elf32-i386.lo: elf32-i386.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- elf32-target.h
+ $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-i860.lo: elf32-i860.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf32-target.h
+elf32-i960.lo: elf32-i960.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/elf/i960.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-m32r.lo: elf32-m32r.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
- $(INCDIR)/elf/m32r.h elf32-target.h
+ $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-m68k.lo: elf32-m68k.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- elf32-target.h
+ $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-m88k.lo: elf32-m88k.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf32-target.h
-elf32-mips.lo: elf32-mips.c $(INCDIR)/bfdlink.h genlink.h \
- elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/coff/sym.h \
- $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h ecoffswap.h \
- elf32-target.h
elf-m10200.lo: elf-m10200.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf32-target.h
elf-m10300.lo: elf-m10300.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/reloc-macros.h \
+ elf32-target.h
+elf32-mcore.lo: elf32-mcore.c $(INCDIR)/bfdlink.h elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/elf/mcore.h $(INCDIR)/elf/reloc-macros.h \
+ elf32-target.h
+elf32-mips.lo: elf32-mips.c $(INCDIR)/bfdlink.h genlink.h \
+ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
+ $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \
+ $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
+ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h ecoffswap.h \
elf32-target.h
+elf32-pj.lo: elf32-pj.c $(INCDIR)/bfdlink.h elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/elf/pj.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-ppc.lo: elf32-ppc.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- $(INCDIR)/elf/ppc.h elf32-target.h
+ $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-sh.lo: elf32-sh.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- elf32-target.h
+ $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-sparc.lo: elf32-sparc.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- $(INCDIR)/elf/sparc.h elf32-target.h
+ $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \
+ elf32-target.h
elf32-v850.lo: elf32-v850.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- $(INCDIR)/elf/v850.h elf32-target.h
+ $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32.lo: elf32.c elfcode.h $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- $(INCDIR)/fnmatch.h elfcore.h elflink.h
+ elfcore.h elflink.h
elflink.lo: elflink.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h
+epoc-pe-arm.lo: epoc-pe-arm.c pe-arm.c coff-arm.c $(INCDIR)/coff/arm.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
+epoc-pei-arm.lo: epoc-pei-arm.c pei-arm.c coff-arm.c \
+ $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \
+ libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \
+ libpei.h
hp300bsd.lo: hp300bsd.c libaout.h $(INCDIR)/bfdlink.h \
aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
@@ -884,22 +1010,42 @@ pc532-mach.lo: pc532-mach.c libaout.h $(INCDIR)/bfdlink.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
pe-arm.lo: pe-arm.c coff-arm.c $(INCDIR)/coff/arm.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
- $(INCDIR)/bfdlink.h coffcode.h peicode.h
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pei-arm.lo: pei-arm.c coff-arm.c $(INCDIR)/coff/arm.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
- $(INCDIR)/bfdlink.h coffcode.h peicode.h
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pe-i386.lo: pe-i386.c coff-i386.c $(INCDIR)/coff/i386.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
- $(INCDIR)/bfdlink.h coffcode.h peicode.h
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pei-i386.lo: pei-i386.c coff-i386.c $(INCDIR)/coff/i386.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
- $(INCDIR)/bfdlink.h coffcode.h peicode.h
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
+pe-mcore.lo: pe-mcore.c coff-mcore.c $(INCDIR)/coff/mcore.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
+pei-mcore.lo: pei-mcore.c coff-mcore.c $(INCDIR)/coff/mcore.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pe-ppc.lo: pe-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
- $(INCDIR)/bfdlink.h coffcode.h peicode.h
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pei-ppc.lo: pei-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
- $(INCDIR)/bfdlink.h coffcode.h peicode.h
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
+pe-sh.lo: pe-sh.c coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
+ coffcode.h peicode.h libpei.h
+pei-sh.lo: pei-sh.c coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
+ coffcode.h peicode.h libpei.h
+pe-mips.lo: pe-mips.c $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/internal.h \
+ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
+ peicode.h libpei.h
+pei-mips.lo: pei-mips.c pe-mips.c $(INCDIR)/coff/mipspe.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
+peigen.lo: peigen.c $(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h \
+ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h
ppcboot.lo: ppcboot.c
reloc16.lo: reloc16.c $(INCDIR)/bfdlink.h genlink.h \
$(INCDIR)/coff/internal.h libcoff.h
@@ -922,6 +1068,11 @@ vaxnetbsd.lo: vaxnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
versados.lo: versados.c $(INCDIR)/libiberty.h
+vms.lo: vms.c $(INCDIR)/bfdlink.h vms.h
+vms-gsd.lo: vms-gsd.c $(INCDIR)/bfdlink.h vms.h
+vms-hdr.lo: vms-hdr.c $(INCDIR)/bfdlink.h vms.h
+vms-misc.lo: vms-misc.c $(INCDIR)/bfdlink.h vms.h
+vms-tir.lo: vms-tir.c $(INCDIR)/bfdlink.h vms.h
xcofflink.lo: xcofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
libcoff.h
aout64.lo: aout64.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \
@@ -937,30 +1088,26 @@ demo64.lo: demo64.c aoutf1.h $(INCDIR)/aout/sun4.h \
aout-target.h
elf64-alpha.lo: elf64-alpha.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
- $(INCDIR)/elf/alpha.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \
- $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h \
- $(INCDIR)/aout/ar.h libcoff.h libecoff.h ecoffswap.h \
- elf64-target.h
+ $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \
+ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h \
+ libcoff.h libecoff.h ecoffswap.h elf64-target.h
elf64-gen.lo: elf64-gen.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf64-target.h
elf64-mips.lo: elf64-mips.c $(INCDIR)/aout/ar.h $(INCDIR)/bfdlink.h \
genlink.h elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/coff/sym.h \
- $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
+ $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \
+ $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h ecoffswap.h \
elf64-target.h
elf64-sparc.lo: elf64-sparc.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
- $(INCDIR)/elf/sparc.h elf64-target.h
+ $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \
+ elf64-target.h
elf64.lo: elf64.c elfcode.h $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- $(INCDIR)/fnmatch.h elfcore.h elflink.h
-evax-alpha.lo: evax-alpha.c $(INCDIR)/bfdlink.h evax.h
-evax-egsd.lo: evax-egsd.c $(INCDIR)/bfdlink.h evax.h
-evax-etir.lo: evax-etir.c $(INCDIR)/bfdlink.h evax.h
-evax-emh.lo: evax-emh.c $(INCDIR)/bfdlink.h evax.h
-evax-misc.lo: evax-misc.c $(INCDIR)/bfdlink.h evax.h
+ elfcore.h elflink.h
nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/nlm/alpha-ext.h \
libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \
$(INCDIR)/nlm/external.h nlmswap.h nlm-target.h
@@ -972,6 +1119,7 @@ hpux-core.lo: hpux-core.c
irix-core.lo: irix-core.c
lynx-core.lo: lynx-core.c
osf-core.lo: osf-core.c
+sco5-core.lo: sco5-core.c libaout.h $(INCDIR)/bfdlink.h
trad-core.lo: trad-core.c libaout.h $(INCDIR)/bfdlink.h
cisco-core.lo: cisco-core.c
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/contrib/binutils/bfd/Makefile.in b/contrib/binutils/bfd/Makefile.in
index d8249a4a27e7..bb8e06c90f24 100644
--- a/contrib/binutils/bfd/Makefile.in
+++ b/contrib/binutils/bfd/Makefile.in
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.2e from Makefile.am
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -32,6 +32,8 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
+DESTDIR =
+
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -44,7 +46,7 @@ AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
@@ -62,30 +64,52 @@ host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
AR = @AR@
+AS = @AS@
BFD_HOST_64BIT_LONG = @BFD_HOST_64BIT_LONG@
BFD_HOST_64_BIT = @BFD_HOST_64_BIT@
BFD_HOST_64_BIT_DEFINED = @BFD_HOST_64_BIT_DEFINED@
BFD_HOST_U_64_BIT = @BFD_HOST_U_64_BIT@
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
CC = @CC@
CC_FOR_BUILD = @CC_FOR_BUILD@
COREFILE = @COREFILE@
COREFLAG = @COREFLAG@
+DATADIRNAME = @DATADIRNAME@
+DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
+GMOFILES = @GMOFILES@
+GMSGFMT = @GMSGFMT@
+GT_NO = @GT_NO@
+GT_YES = @GT_YES@
HDEFINES = @HDEFINES@
-LD = @LD@
+INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
+INSTOBJEXT = @INSTOBJEXT@
+INTLDEPS = @INTLDEPS@
+INTLLIBS = @INTLLIBS@
+INTLOBJS = @INTLOBJS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
-NM = @NM@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
+POFILES = @POFILES@
+POSUB = @POSUB@
RANLIB = @RANLIB@
TDEFINES = @TDEFINES@
+USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
+USE_NLS = @USE_NLS@
VERSION = @VERSION@
+WIN32LDFLAGS = @WIN32LDFLAGS@
+WIN32LIBADD = @WIN32LIBADD@
all_backends = @all_backends@
bfd_backends = @bfd_backends@
bfd_machines = @bfd_machines@
+l = @l@
tdefaults = @tdefaults@
wordsize = @wordsize@
@@ -93,9 +117,9 @@ AUTOMAKE_OPTIONS = cygnus
INCDIR = $(srcdir)/../include
CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
-DEP = mkdep
+MKDEP = gcc -MM
-SUBDIRS = doc
+SUBDIRS = doc po
docdir = doc
@@ -117,12 +141,14 @@ BFD_LIBS = \
section.lo syms.lo targets.lo hash.lo linker.lo \
srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo
+
BFD_LIBS_CFILES = \
archive.c archures.c bfd.c cache.c coffgen.c corefile.c \
format.c init.c libbfd.c opncls.c reloc.c \
section.c syms.c targets.c hash.c linker.c \
srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c
+
# This list is alphabetized to make it easier to keep in sync
# with the decls and initializer in archures.c.
ALL_MACHINES = \
@@ -130,60 +156,77 @@ ALL_MACHINES = \
cpu-alpha.lo \
cpu-arc.lo \
cpu-arm.lo \
+ cpu-avr.lo \
cpu-d10v.lo \
+ cpu-d30v.lo \
+ cpu-fr30.lo \
cpu-h8300.lo \
cpu-h8500.lo \
cpu-hppa.lo \
+ cpu-i370.lo \
cpu-i386.lo \
cpu-i860.lo \
cpu-i960.lo \
cpu-m32r.lo \
cpu-m68k.lo \
cpu-m88k.lo \
- cpu-mips.lo \
cpu-m10200.lo \
cpu-m10300.lo \
+ cpu-mcore.lo \
+ cpu-mips.lo \
cpu-ns32k.lo \
+ cpu-pj.lo \
cpu-powerpc.lo \
cpu-rs6000.lo \
cpu-sh.lo \
cpu-sparc.lo \
cpu-tic30.lo \
+ cpu-tic80.lo \
cpu-v850.lo \
cpu-vax.lo \
cpu-we32k.lo \
cpu-w65.lo \
cpu-z8k.lo
+
ALL_MACHINES_CFILES = \
cpu-a29k.c \
cpu-alpha.c \
cpu-arc.c \
cpu-arm.c \
+ cpu-avr.c \
+ cpu-d10v.c \
+ cpu-d30v.c \
+ cpu-fr30.c \
cpu-h8300.c \
cpu-h8500.c \
cpu-hppa.c \
+ cpu-i370.c \
cpu-i386.c \
cpu-i860.c \
cpu-i960.c \
cpu-m32r.c \
cpu-m68k.c \
cpu-m88k.c \
- cpu-mips.c \
cpu-m10200.c \
cpu-m10300.c \
+ cpu-mcore.c \
+ cpu-mips.c \
cpu-ns32k.c \
+ cpu-pj.c \
cpu-powerpc.c \
cpu-rs6000.c \
cpu-sh.c \
cpu-sparc.c \
cpu-tic30.c \
+ cpu-tic80.c \
cpu-v850.c \
cpu-vax.c \
cpu-we32k.c \
cpu-w65.c \
cpu-z8k.c
+
# The .o files needed by all of the 32 bit vectors that are configured into
# target_vector in targets.c if configured with --enable-targets=all.
BFD32_BACKENDS = \
@@ -194,6 +237,7 @@ BFD32_BACKENDS = \
aout-tic30.lo \
aout0.lo \
aout32.lo \
+ armnetbsd.lo \
bout.lo \
cf-i386lynx.lo \
cf-m68klynx.lo \
@@ -218,33 +262,45 @@ BFD32_BACKENDS = \
coff-stgo32.lo \
coff-svm68k.lo \
coff-tic30.lo \
+ coff-tic80.lo \
coff-u68k.lo \
coff-we32k.lo \
coff-w65.lo \
coff-z8k.lo \
cofflink.lo \
+ dwarf1.lo \
dwarf2.lo \
ecoff.lo \
ecofflink.lo \
elf.lo \
elf32-arc.lo \
+ elfarm-oabi.lo \
+ elfarm-nabi.lo \
+ elf32-avr.lo \
elf32-d10v.lo \
+ elf32-d30v.lo \
+ elf32-fr30.lo \
elf32-gen.lo \
- elf32-hppa.lo \
+ elf32-i370.lo \
elf32-i386.lo \
elf32-i860.lo \
+ elf32-i960.lo \
elf32-m32r.lo \
elf32-m68k.lo \
elf32-m88k.lo \
- elf32-mips.lo \
elf-m10200.lo \
elf-m10300.lo \
+ elf32-mcore.lo \
+ elf32-mips.lo \
+ elf32-pj.lo \
elf32-ppc.lo \
elf32-sh.lo \
elf32-sparc.lo \
elf32-v850.lo \
elf32.lo \
elflink.lo \
+ epoc-pe-arm.lo \
+ epoc-pei-arm.lo \
hp300bsd.lo \
hp300hpux.lo \
som.lo \
@@ -278,8 +334,15 @@ BFD32_BACKENDS = \
pei-arm.lo \
pe-i386.lo \
pei-i386.lo \
+ pe-mcore.lo \
+ pei-mcore.lo \
pe-ppc.lo \
pei-ppc.lo \
+ pe-sh.lo \
+ pei-sh.lo \
+ pe-mips.lo \
+ pei-mips.lo \
+ peigen.lo \
ppcboot.lo \
reloc16.lo \
riscix.lo \
@@ -289,8 +352,14 @@ BFD32_BACKENDS = \
sunos.lo \
vaxnetbsd.lo \
versados.lo \
+ vms.lo \
+ vms-gsd.lo \
+ vms-hdr.lo \
+ vms-misc.lo \
+ vms-tir.lo \
xcofflink.lo
+
BFD32_BACKENDS_CFILES = \
aout-adobe.c \
aout-arm.c \
@@ -299,6 +368,7 @@ BFD32_BACKENDS_CFILES = \
aout-tic30.c \
aout0.c \
aout32.c \
+ armnetbsd.c \
bout.c \
cf-i386lynx.c \
cf-m68klynx.c \
@@ -323,33 +393,45 @@ BFD32_BACKENDS_CFILES = \
coff-stgo32.c \
coff-svm68k.c \
coff-tic30.c \
+ coff-tic80.c \
coff-u68k.c \
coff-we32k.c \
coff-w65.c \
coff-z8k.c \
cofflink.c \
+ dwarf1.c \
dwarf2.c \
ecoff.c \
ecofflink.c \
elf.c \
elf32-arc.c \
+ elfarm-oabi.c \
+ elfarm-nabi.c \
+ elf32-avr.c \
elf32-d10v.c \
+ elf32-d30v.c \
+ elf32-fr30.c \
elf32-gen.c \
- elf32-hppa.c \
+ elf32-i370.c \
elf32-i386.c \
elf32-i860.c \
+ elf32-i960.c \
elf32-m32r.c \
elf32-m68k.c \
elf32-m88k.c \
- elf32-mips.c \
elf-m10200.c \
elf-m10300.c \
+ elf32-mcore.c \
+ elf32-mips.c \
+ elf32-pj.c \
elf32-ppc.c \
elf32-sh.c \
elf32-sparc.c \
elf32-v850.c \
elf32.c \
elflink.c \
+ epoc-pe-arm.c \
+ epoc-pei-arm.c \
hp300bsd.c \
hp300hpux.c \
som.c \
@@ -383,8 +465,15 @@ BFD32_BACKENDS_CFILES = \
pei-arm.c \
pe-i386.c \
pei-i386.c \
+ pe-mcore.c \
+ pei-mcore.c \
pe-ppc.c \
pei-ppc.c \
+ pe-sh.c \
+ pei-sh.c \
+ pe-mips.c \
+ pei-mips.c \
+ peigen.c \
ppcboot.c \
reloc16.c \
riscix.c \
@@ -394,8 +483,14 @@ BFD32_BACKENDS_CFILES = \
sunos.c \
vaxnetbsd.c \
versados.c \
+ vms.c \
+ vms-gsd.c \
+ vms-hdr.c \
+ vms-misc.c \
+ vms-tir.c \
xcofflink.c
+
# The .o files needed by all of the 64 bit vectors that are configured into
# target_vector in targets.c if configured with --enable-targets=all
# and --enable-64-bit-bfd.
@@ -408,14 +503,10 @@ BFD64_BACKENDS = \
elf64-mips.lo \
elf64-sparc.lo \
elf64.lo \
- evax-alpha.lo \
- evax-egsd.lo \
- evax-etir.lo \
- evax-emh.lo \
- evax-misc.lo \
nlm32-alpha.lo \
nlm64.lo
+
BFD64_BACKENDS_CFILES = \
aout64.c \
coff-alpha.c \
@@ -425,32 +516,32 @@ BFD64_BACKENDS_CFILES = \
elf64-mips.c \
elf64-sparc.c \
elf64.c \
- evax-alpha.c \
- evax-egsd.c \
- evax-etir.c \
- evax-emh.c \
- evax-misc.c \
nlm32-alpha.c \
nlm64.c
+
OPTIONAL_BACKENDS = \
aix386-core.lo \
hpux-core.lo \
irix-core.lo \
lynx-core.lo \
osf-core.lo \
+ sco5-core.lo \
trad-core.lo \
cisco-core.lo
+
OPTIONAL_BACKENDS_CFILES = \
aix386-core.c \
hpux-core.c \
irix-core.c \
lynx-core.c \
osf-core.c \
+ sco5-core.c \
trad-core.c \
cisco-core.c
+
# These are defined by configure.in:
WORDSIZE = @wordsize@
ALL_BACKENDS = @all_backends@
@@ -458,7 +549,7 @@ BFD_BACKENDS = @bfd_backends@
BFD_MACHINES = @bfd_machines@
TDEFAULTS = @tdefaults@
-INCLUDES = -D_GNU_SOURCE @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES)
+INCLUDES = -D_GNU_SOURCE @HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) -I$(srcdir)/../intl -I../intl
# C source files that correspond to .o's.
CFILES = \
@@ -468,13 +559,22 @@ CFILES = \
$(BFD64_BACKENDS_CFILES) \
$(OPTIONAL_BACKENDS_CFILES)
-HFILES = \
+
+SOURCE_HFILES = \
aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h \
- ecoffswap.h elf32-hppa.h elf32-target.h elf64-target.h \
- elfcode.h evax.h genlink.h go32stub.h hppa_stubs.h libaout.h \
+ ecoffswap.h elf32-arm.h elfcode.h elfcore.h \
+ elflink.h freebsd.h genlink.h go32stub.h libaout.h \
libbfd.h libcoff.h libecoff.h elf-bfd.h libhppa.h libieee.h \
- libnlm.h liboasys.h netbsd.h nlm-target.h nlmcode.h ns32k.h som.h \
- targmatch.h
+ libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h nlmcode.h \
+ nlmswap.h ns32k.h peicode.h som.h vms.h
+
+
+HFILES = \
+ elf32-target.h elf64-target.h targmatch.h \
+ $(SOURCE_HFILES)
+
+
+POTFILES = $(CFILES) $(SOURCE_HFILES)
# Various kinds of .o files to put in libbfd.a:
# BFD_BACKENDS Routines the configured targets need.
@@ -484,8 +584,8 @@ OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@
libbfd_la_SOURCES = $(BFD_LIBS_CFILES)
libbfd_la_DEPENDENCIES = $(OFILES) ofiles
-libbfd_la_LIBADD = `cat ofiles`
-libbfd_la_LDFLAGS = -release $(VERSION)
+libbfd_la_LIBADD = `cat ofiles` @WIN32LIBADD@
+libbfd_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
# libtool will build .libs/libbfd.a. We create libbfd.a in the build
# directory so that we don't have to convert all the programs that use
@@ -493,21 +593,24 @@ libbfd_la_LDFLAGS = -release $(VERSION)
# everything else starts using libtool. FIXME.
noinst_LIBRARIES = libbfd.a
-libbfd_a_SOURCES =
+libbfd_a_SOURCES =
-BFD_H_DEPS= $(INCDIR)/ansidecl.h
-LOCAL_H_DEPS= libbfd.h sysdep.h config.h
+BFD_H_DEPS = $(INCDIR)/ansidecl.h
+LOCAL_H_DEPS = libbfd.h sysdep.h config.h
BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c section.c archures.c \
reloc.c syms.c bfd.c archive.c corefile.c targets.c format.c
+
LIBBFD_H_FILES = libbfd-in.h init.c libbfd.c cache.c reloc.c archures.c elf.c
LIBCOFF_H_FILES = libcoff-in.h coffcode.h
MOSTLYCLEANFILES = elf32-target.h elf64-target.h ofiles stamp-ofiles \
targmatch.h
-CLEANFILES = bfd.h dep.sed stmp-bfd-h .dep .dep1 libbfd.a stamp-lib \
+
+CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEP1 DEP2 libbfd.a stamp-lib \
stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
+
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
CONFIG_HEADER = config.h
@@ -528,51 +631,55 @@ corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo \
syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo \
ihex.lo stabs.lo stab-syms.lo
CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
-DIST_COMMON = README COPYING ChangeLog Makefile.am Makefile.in TODO \
-acconfig.h acinclude.m4 aclocal.m4 bfd-in2.h config.in configure \
-configure.in stamp-h.in
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+DIST_COMMON = README ./stamp-h.in COPYING ChangeLog Makefile.am \
+Makefile.in TODO acinclude.m4 aclocal.m4 bfd-in2.h config.in configure \
+configure.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
-GZIP = --best
+GZIP_ENV = --best
SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES)
OBJECTS = $(libbfd_a_OBJECTS) $(libbfd_la_OBJECTS)
-default: all
-
+all: all-redirect
.SUFFIXES:
.SUFFIXES: .S .c .lo .o .s
-$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
-$(ACLOCAL_M4): @MAINT@ configure.in acinclude.m4
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4
cd $(srcdir) && $(ACLOCAL)
-
-config.status: $(srcdir)/configure
- $(SHELL) ./config.status --recheck
-$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
config.h: stamp-h
- @:
+ @if test ! -f $@; then \
+ rm -f stamp-h; \
+ $(MAKE) stamp-h; \
+ else :; fi
stamp-h: $(srcdir)/config.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES= CONFIG_HEADERS=config.h:config.in \
$(SHELL) ./config.status
- @echo timestamp > stamp-h
-$(srcdir)/config.in: @MAINT@$(srcdir)/stamp-h.in
-$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
+ @echo timestamp > stamp-h 2> /dev/null
+$(srcdir)/config.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in
+ @if test ! -f $@; then \
+ rm -f $(srcdir)/stamp-h.in; \
+ $(MAKE) $(srcdir)/stamp-h.in; \
+ else :; fi
+$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOHEADER)
- @echo timestamp > $(srcdir)/stamp-h.in
+ @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
mostlyclean-hdr:
@@ -583,7 +690,7 @@ distclean-hdr:
maintainer-clean-hdr:
bfd-in3.h: $(top_builddir)/config.status bfd-in2.h
- cd $(top_builddir) && CONFIG_FILES=$@:bfd-in2.h CONFIG_HEADERS= ./config.status
+ cd $(top_builddir) && CONFIG_FILES=$@:bfd-in2.h CONFIG_HEADERS= $(SHELL) ./config.status
mostlyclean-noinstLIBRARIES:
@@ -643,18 +750,18 @@ maintainer-clean-libLTLIBRARIES:
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
- $(mkinstalldirs) $(libdir)
+ $(mkinstalldirs) $(DESTDIR)$(libdir)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
- echo "$(LIBTOOL) --mode=install $(INSTALL_DATA) $$p $(libdir)/$$p"; \
- $(LIBTOOL) --mode=install $(INSTALL_DATA) $$p $(libdir)/$$p; \
+ echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \
+ $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \
else :; fi; \
done
uninstall-libLTLIBRARIES:
- $(NORMAL_UNINSTALL)
+ @$(NORMAL_UNINSTALL)
list='$(lib_LTLIBRARIES)'; for p in $$list; do \
- $(LIBTOOL) --mode=uninstall rm -f $(libdir)/$$p; \
+ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
done
libbfd.la: $(libbfd_la_OBJECTS) $(libbfd_la_DEPENDENCIES)
@@ -673,41 +780,65 @@ all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive install-info-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
- target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
- (cd $$subdir && $(MAKE) $$target) \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
- done && test -z "$$fail"
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
+ test "$$subdir" = "." && dot_seen=yes; \
done; \
+ test "$$dot_seen" = "no" && rev=". $$rev"; \
+ target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
- target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
- (cd $$subdir && $(MAKE) $$target) \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
- (cd $$subdir && $(MAKE) tags); \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
+ && mkid -f$$here/ID $$unique $(LISP)
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
- test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ if test "$$subdir" = .; then :; else \
+ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ fi; \
done; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
@@ -733,29 +864,31 @@ top_distdir = $(distdir)
# tarfile.
distcheck: dist
-rm -rf $(distdir)
- GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
+ GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
dc_install_base=`cd $(distdir)/=inst && pwd`; \
cd $(distdir)/=build \
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
- && $(MAKE) \
- && $(MAKE) dvi \
- && $(MAKE) check \
- && $(MAKE) install \
- && $(MAKE) installcheck \
- && $(MAKE) dist
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) dist
-rm -rf $(distdir)
- @echo "========================"; \
- echo "$(distdir).tar.gz is ready for distribution"; \
- echo "========================"
+ @banner="$(distdir).tar.gz is ready for distribution"; \
+ dashes=`echo "$$banner" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ echo "$$dashes"
dist: distdir
-chmod -R a+r $(distdir)
- GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
dist-all: distdir
-chmod -R a+r $(distdir)
- GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
distdir: $(DISTFILES)
-rm -rf $(distdir)
@@ -763,52 +896,55 @@ distdir: $(DISTFILES)
-chmod 777 $(distdir)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
done
for subdir in $(SUBDIRS); do \
- test -d $(distdir)/$$subdir \
- || mkdir $(distdir)/$$subdir \
- || exit 1; \
- chmod 777 $(distdir)/$$subdir; \
- (cd $$subdir && $(MAKE) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+ if test "$$subdir" = .; then :; else \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
|| exit 1; \
+ chmod 777 $(distdir)/$$subdir; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+ || exit 1; \
+ fi; \
done
+info-am:
info: info-recursive
+dvi-am:
dvi: dvi-recursive
-check:
- $(MAKE) check-recursive
+check-am:
+check: check-recursive
+installcheck-am:
installcheck: installcheck-recursive
+install-info-am:
install-info: install-info-recursive
all-recursive-am: config.h
- $(MAKE) all-recursive
-
-all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
install-exec-am: install-libLTLIBRARIES
+install-exec: install-exec-recursive
install-data-am: install-data-local
+install-data: install-data-recursive
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-recursive
uninstall-am: uninstall-libLTLIBRARIES
-
-install-exec: install-exec-recursive install-exec-am
- @$(NORMAL_INSTALL)
-
-install-data: install-data-recursive install-data-am
- @$(NORMAL_INSTALL)
-
-install: install-recursive install-exec-am install-data-am
- @:
-
-uninstall: uninstall-recursive uninstall-am
-
-all: all-recursive-am all-am
-
+uninstall: uninstall-recursive
+all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) config.h
+all-redirect: all-recursive-am
install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs: installdirs-recursive
- $(mkinstalldirs) $(libdir)
+installdirs-am:
+ $(mkinstalldirs) $(DESTDIR)$(libdir)
mostlyclean-generic:
@@ -818,67 +954,69 @@ clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean-am: mostlyclean-hdr mostlyclean-noinstLIBRARIES \
mostlyclean-compile mostlyclean-libtool \
mostlyclean-libLTLIBRARIES mostlyclean-tags \
mostlyclean-generic
+mostlyclean: mostlyclean-recursive
+
clean-am: clean-hdr clean-noinstLIBRARIES clean-compile clean-libtool \
clean-libLTLIBRARIES clean-tags clean-generic \
mostlyclean-am
+clean: clean-recursive
+
distclean-am: distclean-hdr distclean-noinstLIBRARIES distclean-compile \
distclean-libtool distclean-libLTLIBRARIES \
distclean-tags distclean-generic clean-am
+ -rm -f libtool
+
+distclean: distclean-recursive
+ -rm -f config.status
maintainer-clean-am: maintainer-clean-hdr \
maintainer-clean-noinstLIBRARIES \
maintainer-clean-compile maintainer-clean-libtool \
maintainer-clean-libLTLIBRARIES maintainer-clean-tags \
maintainer-clean-generic distclean-am
-
-mostlyclean: mostlyclean-recursive mostlyclean-am
-
-clean: clean-recursive clean-am
-
-distclean: distclean-recursive distclean-am
- -rm -f config.status
- -rm -f libtool
-
-maintainer-clean: maintainer-clean-recursive maintainer-clean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-recursive
-rm -f config.status
-.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
-maintainer-clean-hdr mostlyclean-noinstLIBRARIES \
-distclean-noinstLIBRARIES clean-noinstLIBRARIES \
-maintainer-clean-noinstLIBRARIES mostlyclean-compile distclean-compile \
-clean-compile maintainer-clean-compile mostlyclean-libtool \
-distclean-libtool clean-libtool maintainer-clean-libtool \
-mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
-clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
-uninstall-libLTLIBRARIES install-libLTLIBRARIES install-data-recursive \
-uninstall-data-recursive install-exec-recursive \
-uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
-all-recursive check-recursive installcheck-recursive info-recursive \
-dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
+clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+clean-libtool maintainer-clean-libtool mostlyclean-libLTLIBRARIES \
+distclean-libLTLIBRARIES clean-libLTLIBRARIES \
+maintainer-clean-libLTLIBRARIES uninstall-libLTLIBRARIES \
+install-libLTLIBRARIES install-data-recursive uninstall-data-recursive \
+install-exec-recursive uninstall-exec-recursive installdirs-recursive \
+uninstalldirs-recursive all-recursive check-recursive \
+installcheck-recursive info-recursive dvi-recursive \
+mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info dvi \
-installcheck install-info all-recursive-am all-am install-exec-am \
-install-data-am uninstall-am install-exec install-data install \
-uninstall all installdirs mostlyclean-generic distclean-generic \
-clean-generic maintainer-clean-generic clean mostlyclean distclean \
-maintainer-clean
+distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+dvi-am dvi check check-am installcheck-am installcheck install-info-am \
+install-info all-recursive-am install-exec-am install-exec \
+install-data-local install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all installdirs-am \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+po/POTFILES.in: @MAINT@ Makefile
+ for file in $(POTFILES); do echo $$file; done | sort > tmp \
+ && mv tmp $(srcdir)/po/POTFILES.in
+
diststuff: info
stamp-ofiles: Makefile
@@ -897,8 +1035,9 @@ stamp-ofiles: Makefile
ofiles: stamp-ofiles ; @true
stamp-lib: libbfd.la
- if [ -f .libs/libbfd.a ]; then \
- cp .libs/libbfd.a libbfd.tmp; \
+ libtooldir=`$(LIBTOOL) --config | sed -n -e 's/^objdir=//p'`; \
+ if [ -f $$libtooldir/libbfd.a ]; then \
+ cp $$libtooldir/libbfd.a libbfd.tmp; \
$(SHELL) $(srcdir)/../move-if-change libbfd.tmp libbfd.a; \
else true; fi
touch stamp-lib
@@ -938,29 +1077,24 @@ $(OPTIONAL_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
# Install BFD include file, and others that it needs.
install-data-local: $(BFD_H)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(includedir)
$(INSTALL_DATA) $(BFD_H) $(includedir)/bfd.h
$(INSTALL_DATA) $(INCDIR)/ansidecl.h $(includedir)/ansidecl.h
$(INSTALL_DATA) $(INCDIR)/bfdlink.h $(includedir)/bfdlink.h
-# Have to get rid of .dep1 here so that "$?" later includes all of $(CFILES).
-.dep: dep.sed $(CFILES) $(HFILES) bfd.h
- rm -f .dep1
- $(MAKE) DEP=$(DEP) .dep1
- sed -f dep.sed <.dep1 >.dep
-
-# This rule really wants a mkdep that runs "gcc -MM".
-# The NetBSD mkdep overwrites any existing file contents, and doesn't insert
-# the "DO NOT DELETE" line.
-# Other mkdep versions require a file that already exists, and do insert it.
-# Hence the weirdness....
-.dep1: $(CFILES)
- rm -f .dep2 .dep2a
- echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep2
- echo > .dep2a
- $(DEP) -f .dep2a $(INCLUDES) $(CFLAGS) $?
- sed -e '/DO NOT DELETE/d' -e '/^$$/d' < .dep2a >> .dep2
- rm -f .dep2a
- $(SHELL) $(srcdir)/../move-if-change .dep2 .dep1
+# Have to get rid of DEP1 here so that "$?" later includes all of $(CFILES).
+DEP: dep.sed $(CFILES) $(HFILES) bfd.h
+ rm -f DEP1
+ $(MAKE) MKDEP="$(MKDEP)" DEP1
+ sed -f dep.sed < DEP1 > $@
+ echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> $@
+
+DEP1: $(CFILES)
+ echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > DEP2
+ echo '# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.' >> DEP2
+ $(MKDEP) $(INCLUDES) $(CFLAGS) $? >> DEP2
+ mv -f DEP2 $@
dep.sed: dep-in.sed config.status
sed <$(srcdir)/dep-in.sed >dep.sed \
@@ -968,19 +1102,19 @@ dep.sed: dep-in.sed config.status
-e 's!@INCDIR@!$(INCDIR)!' \
-e 's!@SRCDIR@!$(srcdir)!'
-dep: .dep
+dep: DEP
sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
- cat .dep >> tmp-Makefile
+ cat DEP >> tmp-Makefile
$(SHELL) $(srcdir)/../move-if-change tmp-Makefile Makefile
-dep-in: .dep
+dep-in: DEP
sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.in > tmp-Makefile.in
- cat .dep >> tmp-Makefile.in
+ cat DEP >> tmp-Makefile.in
$(SHELL) $(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in
-dep-am: .dep
+dep-am: DEP
sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.am > tmp-Makefile.am
- cat .dep >> tmp-Makefile.am
+ cat DEP >> tmp-Makefile.am
$(SHELL) $(srcdir)/../move-if-change tmp-Makefile.am $(srcdir)/Makefile.am
host-aout.lo: Makefile
@@ -1035,6 +1169,18 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES)
$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
touch stmp-lcoff-h
+# We want to rerun configure if config.bfd or configure.host change.
+config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host
+ $(SHELL) ./config.status --recheck
+
+elfarm-oabi.lo: elfarm-oabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
+
+elfarm-nabi.lo: elfarm-nabi.c elf32-arm.h elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
+
# What appears below is generated by a hacked mkdep using gcc -MM.
# DO NOT DELETE THIS LINE -- mkdep uses it.
@@ -1054,7 +1200,7 @@ init.lo: init.c
libbfd.lo: libbfd.c
opncls.lo: opncls.c $(INCDIR)/objalloc.h
reloc.lo: reloc.c $(INCDIR)/bfdlink.h
-section.lo: section.c
+section.lo: section.c $(INCDIR)/bfdlink.h
syms.lo: syms.c $(INCDIR)/bfdlink.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def
targets.lo: targets.c $(INCDIR)/fnmatch.h targmatch.h
@@ -1071,24 +1217,32 @@ cpu-a29k.lo: cpu-a29k.c
cpu-alpha.lo: cpu-alpha.c
cpu-arc.lo: cpu-arc.c
cpu-arm.lo: cpu-arm.c
+cpu-avr.lo: cpu-avr.c
+cpu-d10v.lo: cpu-d10v.c
+cpu-d30v.lo: cpu-d30v.c
+cpu-fr30.lo: cpu-fr30.c
cpu-h8300.lo: cpu-h8300.c
cpu-h8500.lo: cpu-h8500.c
cpu-hppa.lo: cpu-hppa.c
+cpu-i370.lo: cpu-i370.c
cpu-i386.lo: cpu-i386.c
cpu-i860.lo: cpu-i860.c
cpu-i960.lo: cpu-i960.c
cpu-m32r.lo: cpu-m32r.c
cpu-m68k.lo: cpu-m68k.c
cpu-m88k.lo: cpu-m88k.c
-cpu-mips.lo: cpu-mips.c
cpu-m10200.lo: cpu-m10200.c
cpu-m10300.lo: cpu-m10300.c
+cpu-mcore.lo: cpu-mcore.c
+cpu-mips.lo: cpu-mips.c
cpu-ns32k.lo: cpu-ns32k.c ns32k.h
+cpu-pj.lo: cpu-pj.c
cpu-powerpc.lo: cpu-powerpc.c
cpu-rs6000.lo: cpu-rs6000.c
cpu-sh.lo: cpu-sh.c
cpu-sparc.lo: cpu-sparc.c
cpu-tic30.lo: cpu-tic30.c
+cpu-tic80.lo: cpu-tic80.c
cpu-v850.lo: cpu-v850.c
cpu-vax.lo: cpu-vax.c
cpu-we32k.lo: cpu-we32k.c
@@ -1115,6 +1269,9 @@ aout0.lo: aout0.c aoutf1.h $(INCDIR)/aout/sun4.h libaout.h \
aout32.lo: aout32.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \
$(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
$(INCDIR)/aout/ar.h
+armnetbsd.lo: armnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
+ aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
bout.lo: bout.c $(INCDIR)/bfdlink.h genlink.h $(INCDIR)/bout.h \
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h
cf-i386lynx.lo: cf-i386lynx.c coff-i386.c $(INCDIR)/coff/i386.h \
@@ -1178,6 +1335,8 @@ coff-svm68k.lo: coff-svm68k.c coff-m68k.c $(INCDIR)/coff/m68k.h \
coffcode.h coffswap.h
coff-tic30.lo: coff-tic30.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic30.h \
$(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
+coff-tic80.lo: coff-tic80.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic80.h \
+ $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
coff-u68k.lo: coff-u68k.c coff-m68k.c $(INCDIR)/coff/m68k.h \
$(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/bfdlink.h \
coffcode.h coffswap.h
@@ -1190,6 +1349,9 @@ coff-z8k.lo: coff-z8k.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/z8k.h \
$(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h
cofflink.lo: cofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
libcoff.h
+dwarf1.lo: dwarf1.c $(INCDIR)/libiberty.h elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf.h
dwarf2.lo: dwarf2.c $(INCDIR)/libiberty.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h
@@ -1206,61 +1368,96 @@ elf.lo: elf.c $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h
elf32-arc.lo: elf32-arc.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
- $(INCDIR)/elf/arc.h elf32-target.h
+ $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
+elfarm-oabi.lo: elfarm-oabi.c $(INCDIR)/elf/arm-oabi.h \
+ $(INCDIR)/elf/reloc-macros.h elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ elf32-arm.h elf32-target.h
+elfarm-nabi.lo: elfarm-nabi.c $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h \
+ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
+ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf32-arm.h \
+ elf32-target.h
+elf32-avr.lo: elf32-avr.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/elf/avr.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-d10v.lo: elf32-d10v.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf32-target.h
+elf32-d30v.lo: elf32-d30v.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ elf32-target.h
+elf32-fr30.lo: elf32-fr30.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/elf/fr30.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-gen.lo: elf32-gen.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf32-target.h
-elf32-hppa.lo: elf32-hppa.c $(INCDIR)/bfdlink.h elf-bfd.h \
+elf32-i370.lo: elf32-i370.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- elf32-hppa.h libhppa.h $(INCDIR)/elf/hppa.h hppa_stubs.h \
- elf32-target.h
+ $(INCDIR)/elf/i370.h elf32-target.h
elf32-i386.lo: elf32-i386.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- elf32-target.h
+ $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-i860.lo: elf32-i860.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf32-target.h
+elf32-i960.lo: elf32-i960.c elf-bfd.h $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/elf/i960.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-m32r.lo: elf32-m32r.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
- $(INCDIR)/elf/m32r.h elf32-target.h
+ $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-m68k.lo: elf32-m68k.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- elf32-target.h
+ $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-m88k.lo: elf32-m88k.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf32-target.h
-elf32-mips.lo: elf32-mips.c $(INCDIR)/bfdlink.h genlink.h \
- elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/coff/sym.h \
- $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h ecoffswap.h \
- elf32-target.h
elf-m10200.lo: elf-m10200.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf32-target.h
elf-m10300.lo: elf-m10300.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
+ $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h
+elf32-mcore.lo: elf32-mcore.c $(INCDIR)/bfdlink.h elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/elf/mcore.h $(INCDIR)/elf/reloc-macros.h \
+ elf32-target.h
+elf32-mips.lo: elf32-mips.c $(INCDIR)/bfdlink.h genlink.h \
+ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
+ $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \
+ $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
+ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h ecoffswap.h \
+ elf32-target.h
+elf32-pj.lo: elf32-pj.c $(INCDIR)/bfdlink.h elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/elf/pj.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-ppc.lo: elf32-ppc.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- $(INCDIR)/elf/ppc.h elf32-target.h
+ $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-sh.lo: elf32-sh.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- elf32-target.h
+ $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-sparc.lo: elf32-sparc.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- $(INCDIR)/elf/sparc.h elf32-target.h
+ $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \
+ elf32-target.h
elf32-v850.lo: elf32-v850.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- $(INCDIR)/elf/v850.h elf32-target.h
+ $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32.lo: elf32.c elfcode.h $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- $(INCDIR)/fnmatch.h elfcore.h elflink.h
+ elfcore.h elflink.h
elflink.lo: elflink.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h
+epoc-pe-arm.lo: epoc-pe-arm.c pe-arm.c coff-arm.c $(INCDIR)/coff/arm.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
+epoc-pei-arm.lo: epoc-pei-arm.c pei-arm.c coff-arm.c \
+ $(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \
+ libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \
+ libpei.h
hp300bsd.lo: hp300bsd.c libaout.h $(INCDIR)/bfdlink.h \
aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
@@ -1341,22 +1538,42 @@ pc532-mach.lo: pc532-mach.c libaout.h $(INCDIR)/bfdlink.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
pe-arm.lo: pe-arm.c coff-arm.c $(INCDIR)/coff/arm.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
- $(INCDIR)/bfdlink.h coffcode.h peicode.h
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pei-arm.lo: pei-arm.c coff-arm.c $(INCDIR)/coff/arm.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
- $(INCDIR)/bfdlink.h coffcode.h peicode.h
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pe-i386.lo: pe-i386.c coff-i386.c $(INCDIR)/coff/i386.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
- $(INCDIR)/bfdlink.h coffcode.h peicode.h
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pei-i386.lo: pei-i386.c coff-i386.c $(INCDIR)/coff/i386.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
- $(INCDIR)/bfdlink.h coffcode.h peicode.h
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
+pe-mcore.lo: pe-mcore.c coff-mcore.c $(INCDIR)/coff/mcore.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
+pei-mcore.lo: pei-mcore.c coff-mcore.c $(INCDIR)/coff/mcore.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pe-ppc.lo: pe-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
- $(INCDIR)/bfdlink.h coffcode.h peicode.h
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pei-ppc.lo: pei-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
- $(INCDIR)/bfdlink.h coffcode.h peicode.h
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
+pe-sh.lo: pe-sh.c coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
+ coffcode.h peicode.h libpei.h
+pei-sh.lo: pei-sh.c coff-sh.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/sh.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
+ coffcode.h peicode.h libpei.h
+pe-mips.lo: pe-mips.c $(INCDIR)/coff/mipspe.h $(INCDIR)/coff/internal.h \
+ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
+ peicode.h libpei.h
+pei-mips.lo: pei-mips.c pe-mips.c $(INCDIR)/coff/mipspe.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
+ $(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
+peigen.lo: peigen.c $(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h \
+ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h
ppcboot.lo: ppcboot.c
reloc16.lo: reloc16.c $(INCDIR)/bfdlink.h genlink.h \
$(INCDIR)/coff/internal.h libcoff.h
@@ -1379,6 +1596,11 @@ vaxnetbsd.lo: vaxnetbsd.c netbsd.h libaout.h $(INCDIR)/bfdlink.h \
aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
versados.lo: versados.c $(INCDIR)/libiberty.h
+vms.lo: vms.c $(INCDIR)/bfdlink.h vms.h
+vms-gsd.lo: vms-gsd.c $(INCDIR)/bfdlink.h vms.h
+vms-hdr.lo: vms-hdr.c $(INCDIR)/bfdlink.h vms.h
+vms-misc.lo: vms-misc.c $(INCDIR)/bfdlink.h vms.h
+vms-tir.lo: vms-tir.c $(INCDIR)/bfdlink.h vms.h
xcofflink.lo: xcofflink.c $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \
libcoff.h
aout64.lo: aout64.c aoutx.h $(INCDIR)/bfdlink.h libaout.h \
@@ -1394,30 +1616,26 @@ demo64.lo: demo64.c aoutf1.h $(INCDIR)/aout/sun4.h \
aout-target.h
elf64-alpha.lo: elf64-alpha.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
- $(INCDIR)/elf/alpha.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \
- $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h \
- $(INCDIR)/aout/ar.h libcoff.h libecoff.h ecoffswap.h \
- elf64-target.h
+ $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \
+ $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h \
+ libcoff.h libecoff.h ecoffswap.h elf64-target.h
elf64-gen.lo: elf64-gen.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
elf64-target.h
elf64-mips.lo: elf64-mips.c $(INCDIR)/aout/ar.h $(INCDIR)/bfdlink.h \
genlink.h elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
- $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/coff/sym.h \
- $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
+ $(INCDIR)/elf/external.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h \
+ $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/ecoff.h $(INCDIR)/coff/alpha.h ecoffswap.h \
elf64-target.h
elf64-sparc.lo: elf64-sparc.c elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
- $(INCDIR)/elf/sparc.h elf64-target.h
+ $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \
+ elf64-target.h
elf64.lo: elf64.c elfcode.h $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- $(INCDIR)/fnmatch.h elfcore.h elflink.h
-evax-alpha.lo: evax-alpha.c $(INCDIR)/bfdlink.h evax.h
-evax-egsd.lo: evax-egsd.c $(INCDIR)/bfdlink.h evax.h
-evax-etir.lo: evax-etir.c $(INCDIR)/bfdlink.h evax.h
-evax-emh.lo: evax-emh.c $(INCDIR)/bfdlink.h evax.h
-evax-misc.lo: evax-misc.c $(INCDIR)/bfdlink.h evax.h
+ elfcore.h elflink.h
nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/nlm/alpha-ext.h \
libnlm.h $(INCDIR)/nlm/common.h $(INCDIR)/nlm/internal.h \
$(INCDIR)/nlm/external.h nlmswap.h nlm-target.h
@@ -1429,6 +1647,7 @@ hpux-core.lo: hpux-core.c
irix-core.lo: irix-core.c
lynx-core.lo: lynx-core.c
osf-core.lo: osf-core.c
+sco5-core.lo: sco5-core.c libaout.h $(INCDIR)/bfdlink.h
trad-core.lo: trad-core.c libaout.h $(INCDIR)/bfdlink.h
cisco-core.lo: cisco-core.c
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/contrib/binutils/bfd/README b/contrib/binutils/bfd/README
index a9232bcdcdfc..51ce133355fc 100644
--- a/contrib/binutils/bfd/README
+++ b/contrib/binutils/bfd/README
@@ -8,6 +8,9 @@ The documentation on using BFD is scanty and may be occasionally
incorrect. Pointers to documentation problems, or an entirely
rewritten manual, would be appreciated.
+There is some BFD internals documentation in doc/bfdint.texi which may
+help programmers who want to modify BFD.
+
BFD is normally built as part of another package. See the build
instructions for that package, probably in a README file in the
appropriate directory.
diff --git a/contrib/binutils/bfd/acinclude.m4 b/contrib/binutils/bfd/acinclude.m4
index 6bd25ab969a2..cac26e8e7dd5 100644
--- a/contrib/binutils/bfd/acinclude.m4
+++ b/contrib/binutils/bfd/acinclude.m4
@@ -3,9 +3,9 @@ AC_DEFUN(BFD_BINARY_FOPEN,
[AC_REQUIRE([AC_CANONICAL_SYSTEM])
case "${host}" in
changequote(,)dnl
-i[345]86-*-msdos* | i[345]86-*-go32* | i[345]86-*-mingw32* | *-*-cygwin32* | *-*-windows)
+*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
changequote([,])dnl
- AC_DEFINE(USE_BINARY_FOPEN) ;;
+ AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;;
esac])dnl
dnl Get a default for CC_FOR_BUILD to put into Makefile.
@@ -24,15 +24,18 @@ if test "x$cross_compiling" = "xno"; then
EXEEXT_FOR_BUILD='$(EXEEXT)'
else
AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
- [cat > ac_c_test.c << 'EOF'
-int main() {
-/* Nothing needed here */
-}
-EOF
- ${CC_FOR_BUILD} -o ac_c_test am_c_test.c 1>&5 2>&5
- bfd_cv_build_exeext=`echo ac_c_test.* | grep -v ac_c_test.c | sed -e s/ac_c_test//`
- rm -f ac_c_test*
- test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
+ [rm -f conftest*
+ echo 'int main () { return 0; }' > conftest.c
+ bfd_cv_build_exeext=
+ ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
+ for file in conftest.*; do
+ case $file in
+ *.c | *.o | *.obj | *.ilk | *.pdb) ;;
+ *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
+ esac
+ done
+ rm -f conftest*
+ test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
EXEEXT_FOR_BUILD=""
test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
fi
@@ -61,7 +64,44 @@ AC_CACHE_VAL(bfd_cv_decl_needed_$1,
bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
AC_MSG_RESULT($bfd_cv_decl_needed_$1)
if test $bfd_cv_decl_needed_$1 = yes; then
- bfd_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- AC_DEFINE_UNQUOTED($bfd_tr_decl)
+ AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
+ [Define if $1 is not declared in system header files.])
fi
])dnl
+
+dnl Check for existence of a type $1 in sys/procfs.h
+
+AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE,
+[AC_MSG_CHECKING([for $1 in sys/procfs.h])
+ AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1,
+ [AC_TRY_COMPILE([#include <sys/procfs.h>],
+ [$1 avar],
+ bfd_cv_have_sys_procfs_type_$1=yes,
+ bfd_cv_have_sys_procfs_type_$1=no
+ )])
+ if test $bfd_cv_have_sys_procfs_type_$1 = yes; then
+ AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1,
+ [Define if <sys/procfs.h> has $1.])
+ fi
+ AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_$1)
+])
+
+
+dnl Check for existence of member $2 in type $1 in sys/procfs.h
+
+AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER,
+[AC_MSG_CHECKING([for $1.$2 in sys/procfs.h])
+ AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2,
+ [AC_TRY_COMPILE([#include <sys/procfs.h>],
+ [$1 avar; void* aref = (void*) &avar.$2],
+ bfd_cv_have_sys_procfs_type_member_$1_$2=yes,
+ bfd_cv_have_sys_procfs_type_member_$1_$2=no
+ )])
+ if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then
+ AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1,
+ [Define if <sys/procfs.h> has $1.$2.])
+ fi
+ AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2)
+])
+
+
diff --git a/contrib/binutils/bfd/aclocal.m4 b/contrib/binutils/bfd/aclocal.m4
index 9d84a5964bd8..ca9d432d712f 100644
--- a/contrib/binutils/bfd/aclocal.m4
+++ b/contrib/binutils/bfd/aclocal.m4
@@ -1,7 +1,7 @@
-dnl aclocal.m4 generated automatically by aclocal 1.2e
+dnl aclocal.m4 generated automatically by aclocal 1.4
-dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
-dnl This Makefile.in is free software; the Free Software Foundation
+dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -15,9 +15,9 @@ AC_DEFUN(BFD_BINARY_FOPEN,
[AC_REQUIRE([AC_CANONICAL_SYSTEM])
case "${host}" in
changequote(,)dnl
-i[345]86-*-msdos* | i[345]86-*-go32* | i[345]86-*-mingw32* | *-*-cygwin32* | *-*-windows)
+*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
changequote([,])dnl
- AC_DEFINE(USE_BINARY_FOPEN) ;;
+ AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;;
esac])dnl
dnl Get a default for CC_FOR_BUILD to put into Makefile.
@@ -36,15 +36,18 @@ if test "x$cross_compiling" = "xno"; then
EXEEXT_FOR_BUILD='$(EXEEXT)'
else
AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
- [cat > ac_c_test.c << 'EOF'
-int main() {
-/* Nothing needed here */
-}
-EOF
- ${CC_FOR_BUILD} -o ac_c_test am_c_test.c 1>&5 2>&5
- bfd_cv_build_exeext=`echo ac_c_test.* | grep -v ac_c_test.c | sed -e s/ac_c_test//`
- rm -f ac_c_test*
- test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
+ [rm -f conftest*
+ echo 'int main () { return 0; }' > conftest.c
+ bfd_cv_build_exeext=
+ ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
+ for file in conftest.*; do
+ case $file in
+ *.c | *.o | *.obj | *.ilk | *.pdb) ;;
+ *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
+ esac
+ done
+ rm -f conftest*
+ test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
EXEEXT_FOR_BUILD=""
test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
fi
@@ -73,11 +76,48 @@ AC_CACHE_VAL(bfd_cv_decl_needed_$1,
bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
AC_MSG_RESULT($bfd_cv_decl_needed_$1)
if test $bfd_cv_decl_needed_$1 = yes; then
- bfd_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- AC_DEFINE_UNQUOTED($bfd_tr_decl)
+ AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
+ [Define if $1 is not declared in system header files.])
fi
])dnl
+dnl Check for existence of a type $1 in sys/procfs.h
+
+AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE,
+[AC_MSG_CHECKING([for $1 in sys/procfs.h])
+ AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1,
+ [AC_TRY_COMPILE([#include <sys/procfs.h>],
+ [$1 avar],
+ bfd_cv_have_sys_procfs_type_$1=yes,
+ bfd_cv_have_sys_procfs_type_$1=no
+ )])
+ if test $bfd_cv_have_sys_procfs_type_$1 = yes; then
+ AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1,
+ [Define if <sys/procfs.h> has $1.])
+ fi
+ AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_$1)
+])
+
+
+dnl Check for existence of member $2 in type $1 in sys/procfs.h
+
+AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER,
+[AC_MSG_CHECKING([for $1.$2 in sys/procfs.h])
+ AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2,
+ [AC_TRY_COMPILE([#include <sys/procfs.h>],
+ [$1 avar; void* aref = (void*) &avar.$2],
+ bfd_cv_have_sys_procfs_type_member_$1_$2=yes,
+ bfd_cv_have_sys_procfs_type_member_$1_$2=no
+ )])
+ if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then
+ AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1,
+ [Define if <sys/procfs.h> has $1.$2.])
+ fi
+ AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2)
+])
+
+
+
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
@@ -88,7 +128,7 @@ dnl Usage:
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
AC_DEFUN(AM_INIT_AUTOMAKE,
-[AC_REQUIRE([AM_PROG_INSTALL])
+[AC_REQUIRE([AC_PROG_INSTALL])
PACKAGE=[$1]
AC_SUBST(PACKAGE)
VERSION=[$2]
@@ -98,8 +138,8 @@ if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
ifelse([$3],,
-AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
AC_REQUIRE([AM_SANITY_CHECK])
AC_REQUIRE([AC_ARG_PROGRAM])
dnl FIXME This is truly gross.
@@ -111,15 +151,6 @@ AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
AC_REQUIRE([AC_PROG_MAKE_SET])])
-
-# serial 1
-
-AC_DEFUN(AM_PROG_INSTALL,
-[AC_REQUIRE([AC_PROG_INSTALL])
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
-AC_SUBST(INSTALL_SCRIPT)dnl
-])
-
#
# Check to make sure that the build environment is sane.
#
@@ -180,32 +211,75 @@ fi
AC_SUBST($1)])
-# serial 24 AM_PROG_LIBTOOL
-AC_DEFUN(AM_PROG_LIBTOOL,
-[AC_REQUIRE([AM_ENABLE_SHARED])dnl
-AC_REQUIRE([AM_ENABLE_STATIC])dnl
+# serial 40 AC_PROG_LIBTOOL
+AC_DEFUN(AC_PROG_LIBTOOL,
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+
+# Save cache, so that ltconfig can load it
+AC_CACHE_SAVE
+
+# Actually configure libtool. ac_aux_dir is where install-sh is found.
+CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
+DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
+|| AC_MSG_ERROR([libtool configure failed])
+
+# Reload cache, that may have been modified by ltconfig
+AC_CACHE_LOAD
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+])
+
+AC_DEFUN(AC_LIBTOOL_SETUP,
+[AC_PREREQ(2.13)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AM_PROG_LD])dnl
-AC_REQUIRE([AM_PROG_NM])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
dnl
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
+
+case "$target" in
+NONE) lt_target="$host" ;;
+*) lt_target="$target" ;;
+esac
# Check for any special flags to pass to ltconfig.
-libtool_flags=
+libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
-test "$silent" = yes && libtool_flags="$libtool_flags --silent"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
+[libtool_flags="$libtool_flags --enable-dlopen"])
+ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+[libtool_flags="$libtool_flags --enable-win32-dll"])
+AC_ARG_ENABLE(libtool-lock,
+ [ --disable-libtool-lock avoid locking (might break parallel builds)])
+test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
+test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
-case "$host" in
+case "$lt_target" in
*-*-irix6*)
# Find out which ABI we are using.
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
@@ -227,30 +301,42 @@ case "$host" in
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
;;
-esac
-# Actually configure libtool. ac_aux_dir is where install-sh is found.
-CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
-LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
-${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
-$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
-|| AC_MSG_ERROR([libtool configure failed])
+ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw*)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+])
+esac
])
-# AM_ENABLE_SHARED - implement the --enable-shared flag
-# Usage: AM_ENABLE_SHARED[(DEFAULT)]
+# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
+AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
+
+# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
+AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
+
+# AC_ENABLE_SHARED - implement the --enable-shared flag
+# Usage: AC_ENABLE_SHARED[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
-AC_DEFUN(AM_ENABLE_SHARED,
-[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_DEFUN(AC_ENABLE_SHARED, [dnl
+define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(shared,
changequote(<<, >>)dnl
-<< --enable-shared build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
+<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
changequote([, ])dnl
-[ --enable-shared=PKGS only build shared libraries if the current package
- appears as an element in the PKGS list],
[p=${PACKAGE-default}
case "$enableval" in
yes) enable_shared=yes ;;
@@ -267,29 +353,23 @@ no) enable_shared=no ;;
IFS="$ac_save_ifs"
;;
esac],
-enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
+enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
])
-# AM_DISABLE_SHARED - set the default shared flag to --disable-shared
-AC_DEFUN(AM_DISABLE_SHARED,
-[AM_ENABLE_SHARED(no)])
+# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
+AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)])
-# AM_DISABLE_STATIC - set the default static flag to --disable-static
-AC_DEFUN(AM_DISABLE_STATIC,
-[AM_ENABLE_STATIC(no)])
-
-# AM_ENABLE_STATIC - implement the --enable-static flag
-# Usage: AM_ENABLE_STATIC[(DEFAULT)]
+# AC_ENABLE_STATIC - implement the --enable-static flag
+# Usage: AC_ENABLE_STATIC[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
-AC_DEFUN(AM_ENABLE_STATIC,
-[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_DEFUN(AC_ENABLE_STATIC, [dnl
+define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(static,
changequote(<<, >>)dnl
-<< --enable-static build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
+<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
changequote([, ])dnl
-[ --enable-static=PKGS only build shared libraries if the current package
- appears as an element in the PKGS list],
[p=${PACKAGE-default}
case "$enableval" in
yes) enable_static=yes ;;
@@ -306,28 +386,73 @@ no) enable_static=no ;;
IFS="$ac_save_ifs"
;;
esac],
-enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
+enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
])
+# AC_DISABLE_STATIC - set the default static flag to --disable-static
+AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)])
+
-# AM_PROG_LD - find the path to the GNU or non-GNU linker
-AC_DEFUN(AM_PROG_LD,
+# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
+# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
+define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(fast-install,
+changequote(<<, >>)dnl
+<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
+changequote([, ])dnl
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac],
+enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
+])
+
+# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
+AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)])
+
+# AC_PROG_LD - find the path to the GNU or non-GNU linker
+AC_DEFUN(AC_PROG_LD,
[AC_ARG_WITH(gnu-ld,
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
-AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
ac_prog=ld
if test "$ac_cv_prog_gcc" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by GCC])
ac_prog=`($CC -print-prog-name=ld) 2>&5`
case "$ac_prog" in
- # Accept absolute paths.
+ # Accept absolute paths.
changequote(,)dnl
- /* | [A-Za-z]:\\*)
+ [\\/]* | [A-Za-z]:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
changequote([,])dnl
- test -z "$LD" && LD="$ac_prog"
- ;;
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
@@ -344,10 +469,10 @@ else
fi
AC_CACHE_VAL(ac_cv_path_LD,
[if test -z "$LD"; then
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog"; then
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
ac_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
@@ -355,7 +480,7 @@ AC_CACHE_VAL(ac_cv_path_LD,
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
- test "$with_gnu_ld" != yes && break
+ test "$with_gnu_ld" != yes && break
fi
fi
done
@@ -370,11 +495,10 @@ else
AC_MSG_RESULT(no)
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_SUBST(LD)
-AM_PROG_LD_GNU
+AC_PROG_LD_GNU
])
-AC_DEFUN(AM_PROG_LD_GNU,
+AC_DEFUN(AC_PROG_LD_GNU,
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
@@ -384,43 +508,117 @@ else
fi])
])
-# AM_PROG_NM - find the path to a BSD-compatible name lister
-AC_DEFUN(AM_PROG_NM,
+# AC_PROG_NM - find the path to a BSD-compatible name lister
+AC_DEFUN(AC_PROG_NM,
[AC_MSG_CHECKING([for BSD-compatible nm])
AC_CACHE_VAL(ac_cv_path_NM,
-[case "$NM" in
-changequote(,)dnl
-/* | [A-Za-z]:\\*)
-changequote([,])dnl
- ac_cv_path_NM="$NM" # Let the user override the test with a path.
- ;;
-*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
+[if test -n "$NM"; then
+ # Let the user override the test.
+ ac_cv_path_NM="$NM"
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/nm; then
+ if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -B"
+ ac_cv_path_NM="$ac_dir/nm -B"
+ break
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -p"
+ ac_cv_path_NM="$ac_dir/nm -p"
+ break
else
- ac_cv_path_NM="$ac_dir/nm"
+ ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
fi
- break
fi
done
IFS="$ac_save_ifs"
test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
- ;;
-esac])
+fi])
NM="$ac_cv_path_NM"
AC_MSG_RESULT([$NM])
-AC_SUBST(NM)
])
+# AC_CHECK_LIBM - check for math library
+AC_DEFUN(AC_CHECK_LIBM,
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case "$lt_target" in
+*-*-beos* | *-*-cygwin*)
+ # These system don't have libm
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, main, LIBM="-lm")
+ ;;
+esac
+])
+
+# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl convenience library, adds --enable-ltdl-convenience to
+# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
+# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
+# to be `${top_builddir}/libltdl'. Make sure you start DIR with
+# '${top_builddir}/' (note the single quotes!) if your package is not
+# flat, and, if you're not using automake, define top_builddir as
+# appropriate in the Makefiles.
+AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ case "$enable_ltdl_convenience" in
+ no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+ "") enable_ltdl_convenience=yes
+ ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+ esac
+ LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
+ INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
+])
+
+# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl installable library, and adds --enable-ltdl-install to
+# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
+# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
+# to be `${top_builddir}/libltdl'. Make sure you start DIR with
+# '${top_builddir}/' (note the single quotes!) if your package is not
+# flat, and, if you're not using automake, define top_builddir as
+# appropriate in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ AC_CHECK_LIB(ltdl, main,
+ [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+ [if test x"$enable_ltdl_install" = xno; then
+ AC_MSG_WARN([libltdl not installed, but installation disabled])
+ else
+ enable_ltdl_install=yes
+ fi
+ ])
+ if test x"$enable_ltdl_install" = x"yes"; then
+ ac_configure_args="$ac_configure_args --enable-ltdl-install"
+ LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
+ INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
+ else
+ ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+ LIBLTDL="-lltdl"
+ INCLTDL=
+ fi
+])
+
+dnl old names
+AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
+AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
+AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
+AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
+AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
+AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
+AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
+
+dnl This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])dnl
+
# Like AC_CONFIG_HEADER, but automatically create stamp file.
AC_DEFUN(AM_CONFIG_HEADER,
@@ -458,69 +656,367 @@ AC_DEFUN(AM_MAINTAINER_MODE,
USE_MAINTAINER_MODE=$enableval,
USE_MAINTAINER_MODE=no)
AC_MSG_RESULT($USE_MAINTAINER_MODE)
- if test $USE_MAINTAINER_MODE = yes; then
- MAINT=
- else
- MAINT='#M#'
- fi
+ AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
+ MAINT=$MAINTAINER_MODE_TRUE
AC_SUBST(MAINT)dnl
]
)
-# Check to see if we're running under Cygwin32, without using
-# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
-# Otherwise set it to "no".
-
-dnl AM_CYGWIN32()
-AC_DEFUN(AM_CYGWIN32,
-[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
-[AC_TRY_COMPILE(,[return __CYGWIN32__;],
-am_cv_cygwin32=yes, am_cv_cygwin32=no)
-rm -f conftest*])
-CYGWIN32=
-test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
-
-# Check to see if we're running under Win32, without using
-# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
-# Otherwise set it to "".
-
-dnl AM_EXEEXT()
-dnl This knows we add .exe if we're building in the Cygwin32
-dnl environment. But if we're not, then it compiles a test program
-dnl to see if there is a suffix for executables.
-AC_DEFUN(AM_EXEEXT,
-[AC_REQUIRE([AM_CYGWIN32])
-AC_REQUIRE([AM_MINGW32])
-AC_MSG_CHECKING([for executable suffix])
-AC_CACHE_VAL(am_cv_exeext,
-[if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then
-am_cv_exeext=.exe
+# Define a conditional.
+
+AC_DEFUN(AM_CONDITIONAL,
+[AC_SUBST($1_TRUE)
+AC_SUBST($1_FALSE)
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi])
+
+# This file is derived from `gettext.m4'. The difference is that the
+# included macros assume Cygnus-style source and build trees.
+
+# Macro to add for using GNU gettext.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+#
+# This file file be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+# serial 3
+
+AC_DEFUN(CY_WITH_NLS,
+ [AC_MSG_CHECKING([whether NLS is requested])
+ dnl Default is enabled NLS
+ AC_ARG_ENABLE(nls,
+ [ --disable-nls do not use Native Language Support],
+ USE_NLS=$enableval, USE_NLS=yes)
+ AC_MSG_RESULT($USE_NLS)
+ AC_SUBST(USE_NLS)
+
+ USE_INCLUDED_LIBINTL=no
+
+ dnl If we use NLS figure out what method
+ if test "$USE_NLS" = "yes"; then
+ AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested])
+ AC_MSG_CHECKING([whether included gettext is requested])
+ AC_ARG_WITH(included-gettext,
+ [ --with-included-gettext use the GNU gettext library included here],
+ nls_cv_force_use_gnu_gettext=$withval,
+ nls_cv_force_use_gnu_gettext=no)
+ AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
+
+ nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+ if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+ dnl User does not insist on using GNU NLS library. Figure out what
+ dnl to use. If gettext or catgets are available (in this order) we
+ dnl use this. Else we have to fall back to GNU NLS library.
+ dnl catgets is only used if permitted by option --with-catgets.
+ nls_cv_header_intl=
+ nls_cv_header_libgt=
+ CATOBJEXT=NONE
+
+ AC_CHECK_HEADER(libintl.h,
+ [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
+ [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
+ gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
+
+ if test "$gt_cv_func_gettext_libc" != "yes"; then
+ AC_CHECK_LIB(intl, bindtextdomain,
+ [AC_CACHE_CHECK([for gettext in libintl],
+ gt_cv_func_gettext_libintl,
+ [AC_TRY_LINK([], [return (int) gettext ("")],
+ gt_cv_func_gettext_libintl=yes,
+ gt_cv_func_gettext_libintl=no)])])
+ fi
+
+ if test "$gt_cv_func_gettext_libc" = "yes" \
+ || test "$gt_cv_func_gettext_libintl" = "yes"; then
+ AC_DEFINE(HAVE_GETTEXT, 1,
+ [Define as 1 if you have gettext and don't want to use GNU gettext.])
+ AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
+ if test "$MSGFMT" != "no"; then
+ AC_CHECK_FUNCS(dcgettext)
+ AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+ AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+ AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
+ return _nl_msg_cat_cntr],
+ [CATOBJEXT=.gmo
+ DATADIRNAME=share],
+ [CATOBJEXT=.mo
+ DATADIRNAME=lib])
+ INSTOBJEXT=.mo
+ fi
+ fi
+ ])
+
+ dnl In the standard gettext, we would now check for catgets.
+ dnl However, we never want to use catgets for our releases.
+
+ if test "$CATOBJEXT" = "NONE"; then
+ dnl Neither gettext nor catgets in included in the C library.
+ dnl Fall back on GNU gettext library.
+ nls_cv_use_gnu_gettext=yes
+ fi
+ fi
+
+ if test "$nls_cv_use_gnu_gettext" = "yes"; then
+ dnl Mark actions used to generate GNU NLS library.
+ INTLOBJS="\$(GETTOBJS)"
+ AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
+ AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+ AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+ AC_SUBST(MSGFMT)
+ USE_INCLUDED_LIBINTL=yes
+ CATOBJEXT=.gmo
+ INSTOBJEXT=.mo
+ DATADIRNAME=share
+ INTLDEPS='$(top_builddir)/../intl/libintl.a'
+ INTLLIBS=$INTLDEPS
+ LIBS=`echo $LIBS | sed -e 's/-lintl//'`
+ nls_cv_header_intl=libintl.h
+ nls_cv_header_libgt=libgettext.h
+ fi
+
+ dnl Test whether we really found GNU xgettext.
+ if test "$XGETTEXT" != ":"; then
+ dnl If it is no GNU xgettext we define it as : so that the
+ dnl Makefiles still can work.
+ if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+ : ;
+ else
+ AC_MSG_RESULT(
+ [found xgettext programs is not GNU xgettext; ignore it])
+ XGETTEXT=":"
+ fi
+ fi
+
+ # We need to process the po/ directory.
+ POSUB=po
+ else
+ DATADIRNAME=share
+ nls_cv_header_intl=libintl.h
+ nls_cv_header_libgt=libgettext.h
+ fi
+
+ # If this is used in GNU gettext we have to set USE_NLS to `yes'
+ # because some of the sources are only built for this goal.
+ if test "$PACKAGE" = gettext; then
+ USE_NLS=yes
+ USE_INCLUDED_LIBINTL=yes
+ fi
+
+ dnl These rules are solely for the distribution goal. While doing this
+ dnl we only have to keep exactly one list of the available catalogs
+ dnl in configure.in.
+ for lang in $ALL_LINGUAS; do
+ GMOFILES="$GMOFILES $lang.gmo"
+ POFILES="$POFILES $lang.po"
+ done
+
+ dnl Make all variables we use known to autoconf.
+ AC_SUBST(USE_INCLUDED_LIBINTL)
+ AC_SUBST(CATALOGS)
+ AC_SUBST(CATOBJEXT)
+ AC_SUBST(DATADIRNAME)
+ AC_SUBST(GMOFILES)
+ AC_SUBST(INSTOBJEXT)
+ AC_SUBST(INTLDEPS)
+ AC_SUBST(INTLLIBS)
+ AC_SUBST(INTLOBJS)
+ AC_SUBST(POFILES)
+ AC_SUBST(POSUB)
+ ])
+
+AC_DEFUN(CY_GNU_GETTEXT,
+ [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+ AC_REQUIRE([AC_PROG_CC])dnl
+ AC_REQUIRE([AC_PROG_RANLIB])dnl
+ AC_REQUIRE([AC_ISC_POSIX])dnl
+ AC_REQUIRE([AC_HEADER_STDC])dnl
+ AC_REQUIRE([AC_C_CONST])dnl
+ AC_REQUIRE([AC_C_INLINE])dnl
+ AC_REQUIRE([AC_TYPE_OFF_T])dnl
+ AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+ AC_REQUIRE([AC_FUNC_ALLOCA])dnl
+ AC_REQUIRE([AC_FUNC_MMAP])dnl
+
+ AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
+unistd.h values.h sys/param.h])
+ AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
+__argz_count __argz_stringify __argz_next])
+
+ if test "${ac_cv_func_stpcpy+set}" != "set"; then
+ AC_CHECK_FUNCS(stpcpy)
+ fi
+ if test "${ac_cv_func_stpcpy}" = "yes"; then
+ AC_DEFINE(HAVE_STPCPY, 1, [Define if you have the stpcpy function])
+ fi
+
+ AM_LC_MESSAGES
+ CY_WITH_NLS
+
+ if test "x$CATOBJEXT" != "x"; then
+ if test "x$ALL_LINGUAS" = "x"; then
+ LINGUAS=
+ else
+ AC_MSG_CHECKING(for catalogs to be installed)
+ NEW_LINGUAS=
+ for lang in ${LINGUAS=$ALL_LINGUAS}; do
+ case "$ALL_LINGUAS" in
+ *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
+ esac
+ done
+ LINGUAS=$NEW_LINGUAS
+ AC_MSG_RESULT($LINGUAS)
+ fi
+
+ dnl Construct list of names of catalog files to be constructed.
+ if test -n "$LINGUAS"; then
+ for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+ fi
+ fi
+
+ dnl The reference to <locale.h> in the installed <libintl.h> file
+ dnl must be resolved because we cannot expect the users of this
+ dnl to define HAVE_LOCALE_H.
+ if test $ac_cv_header_locale_h = yes; then
+ INCLUDE_LOCALE_H="#include <locale.h>"
+ else
+ INCLUDE_LOCALE_H="\
+/* The system does not provide the header <locale.h>. Take care yourself. */"
+ fi
+ AC_SUBST(INCLUDE_LOCALE_H)
+
+ dnl Determine which catalog format we have (if any is needed)
+ dnl For now we know about two different formats:
+ dnl Linux libc-5 and the normal X/Open format
+ if test -f $srcdir/po2tbl.sed.in; then
+ if test "$CATOBJEXT" = ".cat"; then
+ AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
+
+ dnl Transform the SED scripts while copying because some dumb SEDs
+ dnl cannot handle comments.
+ sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
+ fi
+ dnl po2tbl.sed is always needed.
+ sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
+ $srcdir/po2tbl.sed.in > po2tbl.sed
+ fi
+
+ dnl In the intl/Makefile.in we have a special dependency which makes
+ dnl only sense for gettext. We comment this out for non-gettext
+ dnl packages.
+ if test "$PACKAGE" = "gettext"; then
+ GT_NO="#NO#"
+ GT_YES=
+ else
+ GT_NO=
+ GT_YES="#YES#"
+ fi
+ AC_SUBST(GT_NO)
+ AC_SUBST(GT_YES)
+
+ MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
+ AC_SUBST(MKINSTALLDIRS)
+
+ dnl *** For now the libtool support in intl/Makefile is not for real.
+ l=
+ AC_SUBST(l)
+
+ dnl Generate list of files to be processed by xgettext which will
+ dnl be included in po/Makefile. But only do this if the po directory
+ dnl exists in srcdir.
+ if test -d $srcdir/po; then
+ test -d po || mkdir po
+ if test "x$srcdir" != "x."; then
+ if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
+ posrcprefix="$srcdir/"
+ else
+ posrcprefix="../$srcdir/"
+ fi
+ else
+ posrcprefix="../"
+ fi
+ rm -f po/POTFILES
+ sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
+ < $srcdir/po/POTFILES.in > po/POTFILES
+ fi
+ ])
+
+# Search path for a program which passes the given test.
+# Ulrich Drepper <drepper@cygnus.com>, 1996.
+#
+# This file file be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+# serial 1
+
+dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
+dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN(AM_PATH_PROG_WITH_TEST,
+[# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL(ac_cv_path_$1,
+[case "[$]$1" in
+ /*)
+ ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in ifelse([$5], , $PATH, [$5]); do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if [$3]; then
+ ac_cv_path_$1="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+ ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test -n "[$]$1"; then
+ AC_MSG_RESULT([$]$1)
else
-cat > am_c_test.c << 'EOF'
-int main() {
-/* Nothing needed here */
-}
-EOF
-${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
-am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
-rm -f am_c_test*])
-test x"${am_cv_exeext}" = x && am_cv_exeext=no
+ AC_MSG_RESULT(no)
fi
-EXEEXT=""
-test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
-AC_MSG_RESULT(${am_cv_exeext})
-AC_SUBST(EXEEXT)])
-
-# Check to see if we're running under Mingw, without using
-# AC_CANONICAL_*. If so, set output variable MINGW32 to "yes".
-# Otherwise set it to "no".
-
-dnl AM_MINGW32()
-AC_DEFUN(AM_MINGW32,
-[AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
-[AC_TRY_COMPILE(,[return __MINGW32__;],
-am_cv_mingw32=yes, am_cv_mingw32=no)
-rm -f conftest*])
-MINGW32=
-test "$am_cv_mingw32" = yes && MINGW32=yes])
+AC_SUBST($1)dnl
+])
+
+# Check whether LC_MESSAGES is available in <locale.h>.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+#
+# This file file be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+# serial 1
+
+AC_DEFUN(AM_LC_MESSAGES,
+ [if test $ac_cv_header_locale_h = yes; then
+ AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+ [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+ am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+ if test $am_cv_val_LC_MESSAGES = yes; then
+ AC_DEFINE(HAVE_LC_MESSAGES, 1,
+ [Define if your locale.h file contains LC_MESSAGES.])
+ fi
+ fi])
diff --git a/contrib/binutils/bfd/aout-arm.c b/contrib/binutils/bfd/aout-arm.c
new file mode 100644
index 000000000000..7365f9d8e35e
--- /dev/null
+++ b/contrib/binutils/bfd/aout-arm.c
@@ -0,0 +1,552 @@
+/* BFD back-end for raw ARM a.out binaries.
+ Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
+ Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+
+#define N_TXTADDR(x) \
+ ((N_MAGIC(x) == NMAGIC) ? 0x8000 : \
+ (N_MAGIC(x) != ZMAGIC) ? 0 : \
+ (N_SHARED_LIB(x)) ? ((x).a_entry & ~(TARGET_PAGE_SIZE - 1)) : \
+ TEXT_START_ADDR)
+
+#define TEXT_START_ADDR 0x8000
+#define TARGET_PAGE_SIZE 0x8000
+#define SEGMENT_SIZE TARGET_PAGE_SIZE
+#define DEFAULT_ARCH bfd_arch_arm
+
+#define MY(OP) CAT(aoutarm_,OP)
+#define N_BADMAG(x) ((((x).a_info & ~007200) != ZMAGIC) && \
+ (((x).a_info & ~006000) != OMAGIC) && \
+ ((x).a_info != NMAGIC))
+#define N_MAGIC(x) ((x).a_info & ~07200)
+
+#include "bfd.h"
+#include "sysdep.h"
+
+#define MYARM(OP) CAT(aoutarm_,OP)
+reloc_howto_type *MYARM(bfd_reloc_type_lookup)
+ PARAMS((bfd *, bfd_reloc_code_real_type));
+static boolean MYARM(write_object_contents) PARAMS((bfd *));
+
+/* Avoid multiple defininitions from aoutx if supporting standarad a.out
+ as well as our own. */
+#define NAME(x,y) CAT3(aoutarm,_32_,y)
+
+#define MY_bfd_reloc_type_lookup aoutarm_bfd_reloc_type_lookup
+
+#include "libaout.h"
+#include "aout/aout64.h"
+
+static bfd_reloc_status_type
+MY(fix_pcrel_26_done) PARAMS ((bfd *, arelent *, asymbol *, PTR,
+ asection *, bfd *, char **));
+
+static bfd_reloc_status_type
+MY(fix_pcrel_26) PARAMS ((bfd *, arelent *, asymbol *, PTR,
+ asection *, bfd *, char **));
+static void MY(swap_std_reloc_in) PARAMS ((bfd *, struct reloc_std_external *,
+ arelent *, asymbol **,
+ bfd_size_type));
+void MY(swap_std_reloc_out) PARAMS ((bfd *, arelent *,
+ struct reloc_std_external *));
+
+reloc_howto_type MY(howto_table)[] =
+{
+ /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask
+ pcdone */
+ HOWTO (0, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "8", true,
+ 0x000000ff, 0x000000ff, false),
+ HOWTO (1, 0, 1, 16, false, 0, complain_overflow_bitfield, 0, "16", true,
+ 0x0000ffff, 0x0000ffff, false),
+ HOWTO (2, 0, 2, 32, false, 0, complain_overflow_bitfield, 0, "32", true,
+ 0xffffffff, 0xffffffff, false),
+ HOWTO (3, 2, 2, 26, true, 0, complain_overflow_signed, MY(fix_pcrel_26),
+ "ARM26", true, 0x00ffffff, 0x00ffffff, true),
+ HOWTO (4, 0, 0, 8, true, 0, complain_overflow_signed, 0, "DISP8", true,
+ 0x000000ff, 0x000000ff, true),
+ HOWTO (5, 0, 1, 16, true, 0, complain_overflow_signed, 0, "DISP16", true,
+ 0x0000ffff, 0x0000ffff, true),
+ HOWTO (6, 0, 2, 32, true, 0, complain_overflow_signed, 0, "DISP32", true,
+ 0xffffffff, 0xffffffff, true),
+ HOWTO (7, 2, 2, 26, false, 0, complain_overflow_signed,
+ MY(fix_pcrel_26_done), "ARM26D", true, 0x0, 0x0,
+ false),
+ EMPTY_HOWTO (-1),
+ HOWTO (9, 0, -1, 16, false, 0, complain_overflow_bitfield, 0, "NEG16", true,
+ 0x0000ffff, 0x0000ffff, false),
+ HOWTO (10, 0, -2, 32, false, 0, complain_overflow_bitfield, 0, "NEG32", true,
+ 0xffffffff, 0xffffffff, false)
+};
+
+#define RELOC_ARM_BITS_NEG_BIG ((unsigned int) 0x08)
+#define RELOC_ARM_BITS_NEG_LITTLE ((unsigned int) 0x10)
+
+reloc_howto_type *
+MY(reloc_howto)(abfd, rel, r_index, r_extern, r_pcrel)
+ bfd *abfd;
+ struct reloc_std_external *rel;
+ int *r_index;
+ int *r_extern;
+ int *r_pcrel;
+{
+ unsigned int r_length;
+ unsigned int r_pcrel_done;
+ unsigned int r_neg;
+ int index;
+
+ *r_pcrel = 0;
+ if (bfd_header_big_endian (abfd))
+ {
+ *r_index = ((rel->r_index[0] << 16)
+ | (rel->r_index[1] << 8)
+ | rel->r_index[2]);
+ *r_extern = (0 != (rel->r_type[0] & RELOC_STD_BITS_EXTERN_BIG));
+ r_pcrel_done = (0 != (rel->r_type[0] & RELOC_STD_BITS_PCREL_BIG));
+ r_neg = (0 != (rel->r_type[0] & RELOC_ARM_BITS_NEG_BIG));
+ r_length = ((rel->r_type[0] & RELOC_STD_BITS_LENGTH_BIG)
+ >> RELOC_STD_BITS_LENGTH_SH_BIG);
+ }
+ else
+ {
+ *r_index = ((rel->r_index[2] << 16)
+ | (rel->r_index[1] << 8)
+ | rel->r_index[0]);
+ *r_extern = (0 != (rel->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE));
+ r_pcrel_done = (0 != (rel->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE));
+ r_neg = (0 != (rel->r_type[0] & RELOC_ARM_BITS_NEG_LITTLE));
+ r_length = ((rel->r_type[0] & RELOC_STD_BITS_LENGTH_LITTLE)
+ >> RELOC_STD_BITS_LENGTH_SH_LITTLE);
+ }
+ index = r_length + 4 * r_pcrel_done + 8 * r_neg;
+ if (index == 3)
+ *r_pcrel = 1;
+
+ return MY(howto_table) + index;
+}
+
+#define MY_reloc_howto(BFD, REL, IN, EX, PC) \
+ MY(reloc_howto) (BFD, REL, &IN, &EX, &PC)
+
+void
+MY(put_reloc)(abfd, r_extern, r_index, value, howto, reloc)
+ bfd *abfd;
+ int r_extern;
+ int r_index;
+ long value;
+ reloc_howto_type *howto;
+ struct reloc_std_external *reloc;
+{
+ unsigned int r_length;
+ int r_pcrel;
+ int r_neg;
+
+ PUT_WORD (abfd, value, reloc->r_address);
+ r_length = howto->size ; /* Size as a power of two */
+
+ /* Special case for branch relocations. */
+ if (howto->type == 3 || howto->type == 7)
+ r_length = 3;
+
+ r_pcrel = howto->type & 4; /* PC Relative done? */
+ r_neg = howto->type & 8; /* Negative relocation */
+ if (bfd_header_big_endian (abfd))
+ {
+ reloc->r_index[0] = r_index >> 16;
+ reloc->r_index[1] = r_index >> 8;
+ reloc->r_index[2] = r_index;
+ reloc->r_type[0] =
+ ((r_extern ? RELOC_STD_BITS_EXTERN_BIG : 0)
+ | (r_pcrel ? RELOC_STD_BITS_PCREL_BIG : 0)
+ | (r_neg ? RELOC_ARM_BITS_NEG_BIG : 0)
+ | (r_length << RELOC_STD_BITS_LENGTH_SH_BIG));
+ }
+ else
+ {
+ reloc->r_index[2] = r_index >> 16;
+ reloc->r_index[1] = r_index >> 8;
+ reloc->r_index[0] = r_index;
+ reloc->r_type[0] =
+ ((r_extern ? RELOC_STD_BITS_EXTERN_LITTLE : 0)
+ | (r_pcrel ? RELOC_STD_BITS_PCREL_LITTLE : 0)
+ | (r_neg ? RELOC_ARM_BITS_NEG_LITTLE : 0)
+ | (r_length << RELOC_STD_BITS_LENGTH_SH_LITTLE));
+ }
+}
+
+#define MY_put_reloc(BFD, EXT, IDX, VAL, HOWTO, RELOC) \
+ MY(put_reloc)(BFD, EXT, IDX, VAL, HOWTO, RELOC)
+
+void
+MY(relocatable_reloc)(howto, abfd, reloc, amount, r_addr)
+ reloc_howto_type *howto;
+ bfd *abfd;
+ struct reloc_std_external *reloc;
+ bfd_vma *amount;
+ bfd_vma r_addr;
+{
+ if (howto->type == 3)
+ {
+ if (reloc->r_type[0]
+ & (bfd_header_big_endian (abfd)
+ ? RELOC_STD_BITS_EXTERN_BIG : RELOC_STD_BITS_EXTERN_LITTLE))
+ {
+ /* The reloc is still external, so don't modify anything. */
+ *amount = 0;
+ }
+ else
+ {
+ *amount -= r_addr;
+ /* Change the r_pcrel value -- on the ARM, this bit is set once the
+ relocation is done. */
+ if (bfd_header_big_endian (abfd))
+ reloc->r_type[0] |= RELOC_STD_BITS_PCREL_BIG;
+ else
+ reloc->r_type[0] |= RELOC_STD_BITS_PCREL_LITTLE;
+ }
+ }
+ else if (howto->type == 7)
+ *amount = 0;
+}
+
+#define MY_relocatable_reloc(HOW, BFD, REL, AMOUNT, ADDR) \
+ MY(relocatable_reloc)(HOW, BFD, REL, &(AMOUNT), ADDR)
+
+static bfd_reloc_status_type
+MY(fix_pcrel_26_done) (abfd, reloc_entry, symbol, data, input_section,
+ output_bfd, error_message)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *reloc_entry ATTRIBUTE_UNUSED;
+ asymbol *symbol ATTRIBUTE_UNUSED;
+ PTR data ATTRIBUTE_UNUSED;
+ asection *input_section ATTRIBUTE_UNUSED;
+ bfd *output_bfd ATTRIBUTE_UNUSED;
+ char **error_message ATTRIBUTE_UNUSED;
+{
+ /* This is dead simple at present. */
+ return bfd_reloc_ok;
+}
+
+static bfd_reloc_status_type
+MY(fix_pcrel_26) (abfd, reloc_entry, symbol, data, input_section,
+ output_bfd, error_message)
+ bfd *abfd;
+ arelent *reloc_entry;
+ asymbol *symbol;
+ PTR data;
+ asection *input_section;
+ bfd *output_bfd;
+ char **error_message ATTRIBUTE_UNUSED;
+{
+ bfd_vma relocation;
+ bfd_size_type addr = reloc_entry->address;
+ long target = bfd_get_32 (abfd, (bfd_byte *) data + addr);
+ bfd_reloc_status_type flag = bfd_reloc_ok;
+
+ /* If this is an undefined symbol, return error */
+ if (symbol->section == &bfd_und_section
+ && (symbol->flags & BSF_WEAK) == 0)
+ return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined;
+
+ /* If the sections are different, and we are doing a partial relocation,
+ just ignore it for now. */
+ if (symbol->section->name != input_section->name
+ && output_bfd != (bfd *)NULL)
+ return bfd_reloc_ok;
+
+ relocation = (target & 0x00ffffff) << 2;
+ relocation = (relocation ^ 0x02000000) - 0x02000000; /* Sign extend */
+ relocation += symbol->value;
+ relocation += symbol->section->output_section->vma;
+ relocation += symbol->section->output_offset;
+ relocation += reloc_entry->addend;
+ relocation -= input_section->output_section->vma;
+ relocation -= input_section->output_offset;
+ relocation -= addr;
+ if (relocation & 3)
+ return bfd_reloc_overflow;
+
+ /* Check for overflow */
+ if (relocation & 0x02000000)
+ {
+ if ((relocation & ~ (bfd_vma) 0x03ffffff) != ~ (bfd_vma) 0x03ffffff)
+ flag = bfd_reloc_overflow;
+ }
+ else if (relocation & ~0x03ffffff)
+ flag = bfd_reloc_overflow;
+
+ target &= ~0x00ffffff;
+ target |= (relocation >> 2) & 0x00ffffff;
+ bfd_put_32 (abfd, target, (bfd_byte *) data + addr);
+
+ /* Now the ARM magic... Change the reloc type so that it is marked as done.
+ Strictly this is only necessary if we are doing a partial relocation. */
+ reloc_entry->howto = &MY(howto_table)[7];
+
+ return flag;
+}
+
+reloc_howto_type *
+MY(bfd_reloc_type_lookup)(abfd,code)
+ bfd *abfd;
+ bfd_reloc_code_real_type code;
+{
+#define ASTD(i,j) case i: return &MY(howto_table)[j]
+ if (code == BFD_RELOC_CTOR)
+ switch (bfd_get_arch_info (abfd)->bits_per_address)
+ {
+ case 32:
+ code = BFD_RELOC_32;
+ break;
+ default: return (CONST struct reloc_howto_struct *) 0;
+ }
+
+ switch (code)
+ {
+ ASTD (BFD_RELOC_16, 1);
+ ASTD (BFD_RELOC_32, 2);
+ ASTD (BFD_RELOC_ARM_PCREL_BRANCH, 3);
+ ASTD (BFD_RELOC_8_PCREL, 4);
+ ASTD (BFD_RELOC_16_PCREL, 5);
+ ASTD (BFD_RELOC_32_PCREL, 6);
+ default: return (CONST struct reloc_howto_struct *) 0;
+ }
+}
+
+#define MY_swap_std_reloc_in MY(swap_std_reloc_in)
+#define MY_swap_std_reloc_out MY(swap_std_reloc_out)
+#define MY_get_section_contents _bfd_generic_get_section_contents
+/* #define MY_bfd_link_hash_table_create _bfd_generic_link_hash_table_create */
+/* #define MY_bfd_link_add_symbols _bfd_generic_link_add_symbols */
+/* #define MY_bfd_final_link _bfd_generic_final_link */
+
+#include "aoutx.h"
+
+static void
+MY_swap_std_reloc_in (abfd, bytes, cache_ptr, symbols, symcount)
+ bfd *abfd;
+ struct reloc_std_external *bytes;
+ arelent *cache_ptr;
+ asymbol **symbols;
+ bfd_size_type symcount ATTRIBUTE_UNUSED;
+{
+ int r_index;
+ int r_extern;
+ int r_pcrel;
+ struct aoutdata *su = &(abfd->tdata.aout_data->a);
+
+ cache_ptr->address = bfd_h_get_32 (abfd, bytes->r_address);
+
+ cache_ptr->howto = MY_reloc_howto (abfd, bytes, r_index, r_extern, r_pcrel);
+
+ MOVE_ADDRESS (0);
+}
+
+void
+MY_swap_std_reloc_out (abfd, g, natptr)
+ bfd *abfd;
+ arelent *g;
+ struct reloc_std_external *natptr;
+{
+ int r_index;
+ asymbol *sym = *(g->sym_ptr_ptr);
+ int r_extern;
+ int r_length;
+ int r_pcrel;
+ int r_neg = 0; /* Negative relocs use the BASEREL bit. */
+ asection *output_section = sym->section->output_section;
+
+ PUT_WORD(abfd, g->address, natptr->r_address);
+
+ r_length = g->howto->size ; /* Size as a power of two */
+ if (r_length < 0)
+ {
+ r_length = -r_length;
+ r_neg = 1;
+ }
+
+ r_pcrel = (int) g->howto->pc_relative; /* Relative to PC? */
+
+ /* For RISC iX, in pc-relative relocs the r_pcrel bit means that the
+ relocation has been done already (Only for the 26-bit one I think)???!!!
+ */
+
+ if (g->howto->type == 3)
+ {
+ r_length = 3;
+ r_pcrel = 0;
+ }
+ else if (g->howto->type == 7)
+ {
+ r_length = 3;
+ r_pcrel = 1;
+ }
+
+
+#if 0
+ /* For a standard reloc, the addend is in the object file. */
+ r_addend = g->addend + (*(g->sym_ptr_ptr))->section->output_section->vma;
+#endif
+
+ /* name was clobbered by aout_write_syms to be symbol index */
+
+ /* If this relocation is relative to a symbol then set the
+ r_index to the symbols index, and the r_extern bit.
+
+ Absolute symbols can come in in two ways, either as an offset
+ from the abs section, or as a symbol which has an abs value.
+ check for that here
+ */
+
+ if (bfd_is_com_section (output_section)
+ || output_section == &bfd_abs_section
+ || output_section == &bfd_und_section)
+ {
+ if (bfd_abs_section.symbol == sym)
+ {
+ /* Whoops, looked like an abs symbol, but is really an offset
+ from the abs section */
+ r_index = 0;
+ r_extern = 0;
+ }
+ else
+ {
+ /* Fill in symbol */
+ r_extern = 1;
+ r_index = (*(g->sym_ptr_ptr))->KEEPIT;
+ }
+ }
+ else
+ {
+ /* Just an ordinary section */
+ r_extern = 0;
+ r_index = output_section->target_index;
+ }
+
+ /* now the fun stuff */
+ if (bfd_header_big_endian (abfd))
+ {
+ natptr->r_index[0] = r_index >> 16;
+ natptr->r_index[1] = r_index >> 8;
+ natptr->r_index[2] = r_index;
+ natptr->r_type[0] =
+ ( (r_extern ? RELOC_STD_BITS_EXTERN_BIG: 0)
+ | (r_pcrel ? RELOC_STD_BITS_PCREL_BIG: 0)
+ | (r_neg ? RELOC_ARM_BITS_NEG_BIG: 0)
+ | (r_length << RELOC_STD_BITS_LENGTH_SH_BIG));
+ }
+ else
+ {
+ natptr->r_index[2] = r_index >> 16;
+ natptr->r_index[1] = r_index >> 8;
+ natptr->r_index[0] = r_index;
+ natptr->r_type[0] =
+ ( (r_extern ? RELOC_STD_BITS_EXTERN_LITTLE: 0)
+ | (r_pcrel ? RELOC_STD_BITS_PCREL_LITTLE: 0)
+ | (r_neg ? RELOC_ARM_BITS_NEG_LITTLE: 0)
+ | (r_length << RELOC_STD_BITS_LENGTH_SH_LITTLE));
+ }
+}
+
+#define MY_BFD_TARGET
+
+#include "aout-target.h"
+
+extern const bfd_target aout_arm_big_vec;
+
+const bfd_target aout_arm_little_vec =
+{
+ "a.out-arm-little", /* name */
+ bfd_target_aout_flavour,
+ BFD_ENDIAN_LITTLE, /* target byte order (little) */
+ BFD_ENDIAN_LITTLE, /* target headers byte order (little) */
+ (HAS_RELOC | EXEC_P | /* object flags */
+ HAS_LINENO | HAS_DEBUG |
+ HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA),
+ MY_symbol_leading_char,
+ AR_PAD_CHAR, /* ar_pad_char */
+ 15, /* ar_max_namelen */
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
+ {_bfd_dummy_target, MY_object_p, /* bfd_check_format */
+ bfd_generic_archive_p, MY_core_file_p},
+ {bfd_false, MY_mkobject, /* bfd_set_format */
+ _bfd_generic_mkarchive, bfd_false},
+ {bfd_false, MY_write_object_contents, /* bfd_write_contents */
+ _bfd_write_archive_contents, bfd_false},
+
+ BFD_JUMP_TABLE_GENERIC (MY),
+ BFD_JUMP_TABLE_COPY (MY),
+ BFD_JUMP_TABLE_CORE (MY),
+ BFD_JUMP_TABLE_ARCHIVE (MY),
+ BFD_JUMP_TABLE_SYMBOLS (MY),
+ BFD_JUMP_TABLE_RELOCS (MY),
+ BFD_JUMP_TABLE_WRITE (MY),
+ BFD_JUMP_TABLE_LINK (MY),
+ BFD_JUMP_TABLE_DYNAMIC (MY),
+
+ & aout_arm_big_vec,
+
+ (PTR) MY_backend_data,
+};
+
+const bfd_target aout_arm_big_vec =
+{
+ "a.out-arm-big", /* name */
+ bfd_target_aout_flavour,
+ BFD_ENDIAN_BIG, /* target byte order (big) */
+ BFD_ENDIAN_BIG, /* target headers byte order (big) */
+ (HAS_RELOC | EXEC_P | /* object flags */
+ HAS_LINENO | HAS_DEBUG |
+ HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA),
+ MY_symbol_leading_char,
+ AR_PAD_CHAR, /* ar_pad_char */
+ 15, /* ar_max_namelen */
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
+ {_bfd_dummy_target, MY_object_p, /* bfd_check_format */
+ bfd_generic_archive_p, MY_core_file_p},
+ {bfd_false, MY_mkobject, /* bfd_set_format */
+ _bfd_generic_mkarchive, bfd_false},
+ {bfd_false, MY_write_object_contents, /* bfd_write_contents */
+ _bfd_write_archive_contents, bfd_false},
+
+ BFD_JUMP_TABLE_GENERIC (MY),
+ BFD_JUMP_TABLE_COPY (MY),
+ BFD_JUMP_TABLE_CORE (MY),
+ BFD_JUMP_TABLE_ARCHIVE (MY),
+ BFD_JUMP_TABLE_SYMBOLS (MY),
+ BFD_JUMP_TABLE_RELOCS (MY),
+ BFD_JUMP_TABLE_WRITE (MY),
+ BFD_JUMP_TABLE_LINK (MY),
+ BFD_JUMP_TABLE_DYNAMIC (MY),
+
+ & aout_arm_little_vec,
+
+ (PTR) MY_backend_data,
+};
diff --git a/contrib/binutils/bfd/aout-sparcle.c b/contrib/binutils/bfd/aout-sparcle.c
new file mode 100644
index 000000000000..903b1367cb3b
--- /dev/null
+++ b/contrib/binutils/bfd/aout-sparcle.c
@@ -0,0 +1,32 @@
+/* BFD backend for sparc little-endian aout binaries.
+ Copyright (C) 1996 Free Software Foundation, Inc.
+ Written by Cygnus Support.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#define TARGETNAME "a.out-sparc-little"
+#define MY(OP) CAT(sparcle_aout_,OP)
+
+#include "bfd.h"
+#include "bfdlink.h"
+#include "libaout.h"
+
+#define MACHTYPE_OK(mtype) ((mtype) == M_SPARC || (mtype) == M_SPARCLET)
+
+/* Include the usual a.out support. */
+#define TARGET_IS_LITTLE_ENDIAN_P
+#include "aoutf1.h"
diff --git a/contrib/binutils/bfd/aout-target.h b/contrib/binutils/bfd/aout-target.h
index 4e0fc9b57d22..046417bb9583 100644
--- a/contrib/binutils/bfd/aout-target.h
+++ b/contrib/binutils/bfd/aout-target.h
@@ -1,5 +1,5 @@
/* Define a target vector and some small routines for a variant of a.out.
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -234,9 +234,9 @@ static boolean MY_bfd_copy_private_section_data
static boolean
MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
bfd *ibfd;
- asection *isec;
+ asection *isec ATTRIBUTE_UNUSED;
bfd *obfd;
- asection *osec;
+ asection *osec ATTRIBUTE_UNUSED;
{
if (bfd_get_flavour (ibfd) == bfd_target_aout_flavour
&& bfd_get_flavour (obfd) == bfd_target_aout_flavour)
@@ -258,11 +258,7 @@ MY(write_object_contents) (abfd)
struct external_exec exec_bytes;
struct internal_exec *execp = exec_hdr (abfd);
-#if CHOOSE_RELOC_SIZE
- CHOOSE_RELOC_SIZE(abfd);
-#else
obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
-#endif
WRITE_HEADERS(abfd, execp);
@@ -509,6 +505,9 @@ MY_bfd_final_link (abfd, info)
#ifndef MY_bfd_relax_section
#define MY_bfd_relax_section bfd_generic_relax_section
#endif
+#ifndef MY_bfd_gc_sections
+#define MY_bfd_gc_sections bfd_generic_gc_sections
+#endif
#ifndef MY_bfd_reloc_type_lookup
#define MY_bfd_reloc_type_lookup NAME(aout,reloc_type_lookup)
#endif
@@ -642,6 +641,9 @@ const bfd_target MY(vec) =
BFD_JUMP_TABLE_LINK (MY),
BFD_JUMP_TABLE_DYNAMIC (MY),
- (PTR) MY_backend_data,
+ /* Alternative_target */
+ NULL,
+
+ (PTR) MY_backend_data
};
#endif /* MY_BFD_TARGET */
diff --git a/contrib/binutils/bfd/aout-tic30.c b/contrib/binutils/bfd/aout-tic30.c
index cb7314e6cbaf..686c15942f8d 100644
--- a/contrib/binutils/bfd/aout-tic30.c
+++ b/contrib/binutils/bfd/aout-tic30.c
@@ -1,5 +1,5 @@
/* BFD back-end for TMS320C30 a.out binaries.
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
This file is part of BFD, the Binary File Descriptor library.
@@ -131,7 +131,7 @@ static CONST struct aout_backend_data tic30_aout_backend_data =
it. */
reloc_howto_type tic30_aout_howto_table[] =
{
- {-1},
+ EMPTY_HOWTO (-1),
HOWTO (1, 2, 1, 16, false, 0, 0, tic30_aout_fix_16,
"16", false, 0x0000FFFF, 0x0000FFFF, false),
HOWTO (2, 2, 2, 24, false, 0, complain_overflow_bitfield, NULL,
@@ -142,18 +142,18 @@ reloc_howto_type tic30_aout_howto_table[] =
"32", false, 0xFFFFFFFF, 0xFFFFFFFF, false),
HOWTO (5, 2, 1, 16, true, 0, complain_overflow_signed,
tic30_aout_fix_pcrel_16, "PCREL", true, 0x0000FFFF, 0x0000FFFF, true),
- {-1},
- {-1},
- {-1},
- {-1},
- {-1}
+ EMPTY_HOWTO (-1),
+ EMPTY_HOWTO (-1),
+ EMPTY_HOWTO (-1),
+ EMPTY_HOWTO (-1),
+ EMPTY_HOWTO (-1)
};
extern reloc_howto_type *NAME (aout, reloc_type_lookup) ();
reloc_howto_type *
tic30_aout_reloc_type_lookup (abfd, code)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
bfd_reloc_code_real_type code;
{
switch (code)
@@ -218,9 +218,9 @@ tic30_aout_fix_16 (abfd, reloc_entry, symbol, data, input_section, output_bfd, e
arelent *reloc_entry;
asymbol *symbol;
PTR data;
- asection *input_section;
+ asection *input_section ATTRIBUTE_UNUSED;
bfd *output_bfd;
- char **error_message;
+ char **error_message ATTRIBUTE_UNUSED;
{
bfd_vma relocation;
@@ -245,9 +245,9 @@ tic30_aout_fix_32 (abfd, reloc_entry, symbol, data, input_section,
arelent *reloc_entry;
asymbol *symbol;
PTR data;
- asection *input_section;
+ asection *input_section ATTRIBUTE_UNUSED;
bfd *output_bfd;
- char **error_message;
+ char **error_message ATTRIBUTE_UNUSED;
{
bfd_vma relocation;
@@ -274,11 +274,11 @@ tic30_aout_fix_pcrel_16 (abfd, reloc_entry, symbol, data, input_section,
output_bfd, error_message)
bfd *abfd;
arelent *reloc_entry;
- asymbol *symbol;
+ asymbol *symbol ATTRIBUTE_UNUSED;
PTR data;
- asection *input_section;
- bfd *output_bfd;
- char **error_message;
+ asection *input_section ATTRIBUTE_UNUSED;
+ bfd *output_bfd ATTRIBUTE_UNUSED;
+ char **error_message ATTRIBUTE_UNUSED;
{
bfd_vma relocation = 1;
bfd_byte offset_data = bfd_get_8 (abfd, (bfd_byte *) data + reloc_entry->address - 1);
@@ -590,9 +590,9 @@ tic30_aout_object_p (abfd)
static boolean
MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
bfd *ibfd;
- asection *isec;
+ asection *isec ATTRIBUTE_UNUSED;
bfd *obfd;
- asection *osec;
+ asection *osec ATTRIBUTE_UNUSED;
{
if (bfd_get_flavour (obfd) == bfd_target_aout_flavour)
obj_aout_subformat (obfd) = obj_aout_subformat (ibfd);
@@ -610,11 +610,8 @@ tic30_aout_write_object_contents (abfd)
struct external_exec exec_bytes;
struct internal_exec *execp = exec_hdr (abfd);
-#if CHOOSE_RELOC_SIZE
- CHOOSE_RELOC_SIZE (abfd);
-#else
obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
-#endif
+
{
bfd_size_type text_size; /* dummy vars */
file_ptr text_end;
@@ -779,7 +776,7 @@ MY_bfd_final_link (abfd, info)
enum machine_type
tic30_aout_machine_type (arch, machine, unknown)
enum bfd_architecture arch;
- unsigned long machine;
+ unsigned long machine ATTRIBUTE_UNUSED;
boolean *unknown;
{
enum machine_type arch_flags;
@@ -939,6 +936,9 @@ tic30_aout_set_arch_mach (abfd, arch, machine)
#ifndef MY_bfd_relax_section
#define MY_bfd_relax_section bfd_generic_relax_section
#endif
+#ifndef MY_bfd_gc_sections
+#define MY_bfd_gc_sections bfd_generic_gc_sections
+#endif
#ifndef MY_bfd_reloc_type_lookup
#define MY_bfd_reloc_type_lookup tic30_aout_reloc_type_lookup
#endif
@@ -1057,6 +1057,8 @@ const bfd_target tic30_aout_vec =
BFD_JUMP_TABLE_LINK (MY),
BFD_JUMP_TABLE_DYNAMIC (MY),
- (PTR) MY_backend_data,
+ NULL,
+
+ (PTR) MY_backend_data
};
#endif /* MY_BFD_TARGET */
diff --git a/contrib/binutils/bfd/aoutf1.h b/contrib/binutils/bfd/aoutf1.h
index 0446c5da8439..fdf95b5b1175 100644
--- a/contrib/binutils/bfd/aoutf1.h
+++ b/contrib/binutils/bfd/aoutf1.h
@@ -150,6 +150,11 @@ sunos_set_arch_mach (abfd, machtype)
machine = bfd_mach_sparc_sparclet;
break;
+ case M_SPARCLITE_LE:
+ arch = bfd_arch_sparc;
+ machine = bfd_mach_sparc_sparclite_le;
+ break;
+
case M_386:
case M_386_DYNIX:
arch = bfd_arch_i386;
@@ -232,6 +237,9 @@ sunos_write_object_contents (abfd)
case bfd_mach_sparc_sparclet:
N_SET_MACHTYPE (*execp, M_SPARCLET);
break;
+ case bfd_mach_sparc_sparclite_le:
+ N_SET_MACHTYPE (*execp, M_SPARCLITE_LE);
+ break;
default:
N_SET_MACHTYPE (*execp, M_SPARC);
break;
diff --git a/contrib/binutils/bfd/aoutx.h b/contrib/binutils/bfd/aoutx.h
index ff1cdd2bf41c..fa107a7cb942 100644
--- a/contrib/binutils/bfd/aoutx.h
+++ b/contrib/binutils/bfd/aoutx.h
@@ -1,5 +1,5 @@
/* BFD semi-generic back-end for a.out binaries.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -120,10 +120,9 @@ DESCRIPTION
#define KEEPIT udata.i
-#include <string.h> /* For strchr and friends */
#include <ctype.h>
#include "bfd.h"
-#include <sysdep.h>
+#include "sysdep.h"
#include "bfdlink.h"
#include "libaout.h"
@@ -199,7 +198,7 @@ reloc_howto_type howto_table_ext[] =
HOWTO(RELOC_SFA_BASE,0, 2, 32, false, 0, complain_overflow_bitfield,0,"SFA_BASE", false, 0,0xffffffff, false),
HOWTO(RELOC_SFA_OFF13,0,2, 32, false, 0, complain_overflow_bitfield,0,"SFA_OFF13",false, 0,0xffffffff, false),
HOWTO(RELOC_BASE10, 0, 2, 10, false, 0, complain_overflow_dont,0,"BASE10", false, 0,0x000003ff, false),
- HOWTO(RELOC_BASE13, 0, 2, 13, false, 0, complain_overflow_bitfield,0,"BASE13", false, 0,0x00001fff, false),
+ HOWTO(RELOC_BASE13, 0, 2, 13, false, 0, complain_overflow_signed,0,"BASE13", false, 0,0x00001fff, false),
HOWTO(RELOC_BASE22, 10, 2, 22, false, 0, complain_overflow_bitfield,0,"BASE22", false, 0,0x003fffff, false),
HOWTO(RELOC_PC10, 0, 2, 10, true, 0, complain_overflow_dont,0,"PC10", false, 0,0x000003ff, true),
HOWTO(RELOC_PC22, 10, 2, 22, true, 0, complain_overflow_signed,0,"PC22", false, 0,0x003fffff, true),
@@ -208,6 +207,10 @@ reloc_howto_type howto_table_ext[] =
HOWTO(RELOC_GLOB_DAT,0, 2, 0, false, 0, complain_overflow_bitfield,0,"GLOB_DAT", false, 0,0x00000000, false),
HOWTO(RELOC_JMP_SLOT,0, 2, 0, false, 0, complain_overflow_bitfield,0,"JMP_SLOT", false, 0,0x00000000, false),
HOWTO(RELOC_RELATIVE,0, 2, 0, false, 0, complain_overflow_bitfield,0,"RELATIVE", false, 0,0x00000000, false),
+ HOWTO(0, 0, 0, 0, false, 0, complain_overflow_dont, 0, "R_SPARC_NONE", false,0,0x00000000,true),
+ HOWTO(0, 0, 0, 0, false, 0, complain_overflow_dont, 0, "R_SPARC_NONE", false,0,0x00000000,true),
+#define RELOC_SPARC_REV32 RELOC_WDISP19
+ HOWTO(RELOC_SPARC_REV32, 0, 2, 32, false, 0, complain_overflow_dont,0,"R_SPARC_REV32", false, 0,0xffffffff, false),
};
/* Convert standard reloc records to "arelent" format (incl byte swap). */
@@ -225,28 +228,35 @@ HOWTO( 7, 0, 4, 64, true, 0, complain_overflow_signed, 0,"DISP64", tr
HOWTO( 8, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"GOT_REL", false, 0,0x00000000, false),
HOWTO( 9, 0, 1, 16, false, 0, complain_overflow_bitfield,0,"BASE16", false,0xffffffff,0xffffffff, false),
HOWTO(10, 0, 2, 32, false, 0, complain_overflow_bitfield,0,"BASE32", false,0xffffffff,0xffffffff, false),
-{ -1 },
-{ -1 },
-{ -1 },
-{ -1 },
-{ -1 },
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
HOWTO(16, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"JMP_TABLE", false, 0,0x00000000, false),
-{ -1 },
-{ -1 },
-{ -1 },
-{ -1 },
-{ -1 },
-{ -1 },
-{ -1 },
-{ -1 }, { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, { -1 },
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
HOWTO(32, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"RELATIVE", false, 0,0x00000000, false),
-{ -1 },
-{ -1 },
-{ -1 },
-{ -1 },
-{ -1 },
-{ -1 },
-{ -1 },
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
+EMPTY_HOWTO (-1),
HOWTO(40, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"BASEREL", false, 0,0x00000000, false),
};
@@ -286,6 +296,7 @@ NAME(aout,reloc_type_lookup) (abfd,code)
EXT (BFD_RELOC_SPARC_PC10, 17);
EXT (BFD_RELOC_SPARC_PC22, 18);
EXT (BFD_RELOC_SPARC_WPLT30, 19);
+ EXT (BFD_RELOC_SPARC_REV32, 26);
default: return (reloc_howto_type *) NULL;
}
else
@@ -708,6 +719,7 @@ NAME(aout,machine_type) (arch, machine, unknown)
if (machine == 0
|| machine == bfd_mach_sparc
|| machine == bfd_mach_sparc_sparclite
+ || machine == bfd_mach_sparc_sparclite_le
|| machine == bfd_mach_sparc_v9)
arch_flags = M_SPARC;
else if (machine == bfd_mach_sparc_sparclet)
@@ -739,14 +751,29 @@ NAME(aout,machine_type) (arch, machine, unknown)
case bfd_arch_mips:
switch (machine) {
case 0:
- case 2000:
- case 3000: arch_flags = M_MIPS1; break;
- case 4000: /* mips3 */
- case 4400:
- case 8000: /* mips4 */
- /* real mips2: */
- case 6000: arch_flags = M_MIPS2; break;
- default: arch_flags = M_UNKNOWN; break;
+ case bfd_mach_mips3000:
+ case bfd_mach_mips3900:
+ arch_flags = M_MIPS1;
+ break;
+ case bfd_mach_mips6000:
+ arch_flags = M_MIPS2;
+ break;
+ case bfd_mach_mips4000:
+ case bfd_mach_mips4010:
+ case bfd_mach_mips4100:
+ case bfd_mach_mips4300:
+ case bfd_mach_mips4400:
+ case bfd_mach_mips4600:
+ case bfd_mach_mips4650:
+ case bfd_mach_mips8000:
+ case bfd_mach_mips10000:
+ case bfd_mach_mips16:
+ /* FIXME: These should be MIPS3 or MIPS4. */
+ arch_flags = M_MIPS2;
+ break;
+ default:
+ arch_flags = M_UNKNOWN;
+ break;
}
break;
@@ -1052,7 +1079,7 @@ boolean
NAME(aout,adjust_sizes_and_vmas) (abfd, text_size, text_end)
bfd *abfd;
bfd_size_type *text_size;
- file_ptr *text_end;
+ file_ptr *text_end ATTRIBUTE_UNUSED;
{
struct internal_exec *execp = exec_hdr (abfd);
@@ -1214,7 +1241,7 @@ NAME(aout,set_section_contents) (abfd, section, location, offset, count)
&& section != obj_datasec (abfd))
{
(*_bfd_error_handler)
- ("%s: can not represent section `%s' in a.out object file format",
+ (_("%s: can not represent section `%s' in a.out object file format"),
bfd_get_filename (abfd), bfd_get_section_name (abfd, section));
bfd_set_error (bfd_error_nonrepresentable_section);
return false;
@@ -1598,9 +1625,9 @@ translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer)
/* This case occurs, e.g., for the *DEBUG* section of a COFF
file. */
(*_bfd_error_handler)
- ("%s: can not represent section for symbol `%s' in a.out object file format",
+ (_("%s: can not represent section for symbol `%s' in a.out object file format"),
bfd_get_filename (abfd),
- cache_ptr->name != NULL ? cache_ptr->name : "*unknown*");
+ cache_ptr->name != NULL ? cache_ptr->name : _("*unknown*"));
bfd_set_error (bfd_error_nonrepresentable_section);
return false;
}
@@ -1628,7 +1655,7 @@ translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer)
else
{
(*_bfd_error_handler)
- ("%s: can not represent section `%s' in a.out object file format",
+ (_("%s: can not represent section `%s' in a.out object file format"),
bfd_get_filename (abfd), bfd_get_section_name (abfd, sec));
bfd_set_error (bfd_error_nonrepresentable_section);
return false;
@@ -2511,16 +2538,16 @@ NAME(aout,get_symtab_upper_bound) (abfd)
/*ARGSUSED*/
alent *
NAME(aout,get_lineno) (ignore_abfd, ignore_symbol)
- bfd *ignore_abfd;
- asymbol *ignore_symbol;
+ bfd *ignore_abfd ATTRIBUTE_UNUSED;
+ asymbol *ignore_symbol ATTRIBUTE_UNUSED;
{
-return (alent *)NULL;
+ return (alent *)NULL;
}
/*ARGSUSED*/
void
NAME(aout,get_symbol_info) (ignore_abfd, symbol, ret)
- bfd *ignore_abfd;
+ bfd *ignore_abfd ATTRIBUTE_UNUSED;
asymbol *symbol;
symbol_info *ret;
{
@@ -2548,7 +2575,7 @@ NAME(aout,get_symbol_info) (ignore_abfd, symbol, ret)
/*ARGSUSED*/
void
NAME(aout,print_symbol) (ignore_abfd, afile, symbol, how)
- bfd *ignore_abfd;
+ bfd *ignore_abfd ATTRIBUTE_UNUSED;
PTR afile;
asymbol *symbol;
bfd_print_symbol_type how;
@@ -2679,6 +2706,7 @@ NAME(aout,find_nearest_line)
CONST char *main_file_name = NULL;
CONST char *current_file_name = NULL;
CONST char *line_file_name = NULL; /* Value of current_file_name at line number. */
+ CONST char *line_directory_name = NULL; /* Value of directory_name at line number. */
bfd_vma low_line_vma = 0;
bfd_vma low_func_vma = 0;
asymbol *func = 0;
@@ -2767,6 +2795,7 @@ NAME(aout,find_nearest_line)
*line_ptr = q->desc;
low_line_vma = q->symbol.value;
line_file_name = current_file_name;
+ line_directory_name = directory_name;
}
break;
case N_FUN:
@@ -2787,7 +2816,10 @@ NAME(aout,find_nearest_line)
done:
if (*line_ptr != 0)
- main_file_name = line_file_name;
+ {
+ main_file_name = line_file_name;
+ directory_name = line_directory_name;
+ }
if (main_file_name == NULL
|| main_file_name[0] == '/'
@@ -2853,7 +2885,7 @@ NAME(aout,find_nearest_line)
int
NAME(aout,sizeof_headers) (abfd, execable)
bfd *abfd;
- boolean execable;
+ boolean execable ATTRIBUTE_UNUSED;
{
return adata(abfd).exec_bytes_size;
}
@@ -3639,7 +3671,7 @@ NAME(aout,final_link) (abfd, info, callback)
work out the number of relocs needed, and then multiply
by the reloc size. */
(*_bfd_error_handler)
- ("%s: relocateable link from %s to %s not supported",
+ (_("%s: relocateable link from %s to %s not supported"),
bfd_get_filename (abfd),
sub->xvec->name, abfd->xvec->name);
bfd_set_error (bfd_error_invalid_operation);
@@ -4694,6 +4726,8 @@ aout_reloc_index_to_section (abfd, indx)
default:
abort ();
}
+ /*NOTREACHED*/
+ return NULL;
}
/* Relocate an a.out section using standard a.out relocs. */
@@ -4937,6 +4971,7 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs,
/* We are generating an executable, and must do a full
relocation. */
hundef = false;
+
if (r_extern)
{
h = sym_hashes[r_index];
@@ -4994,7 +5029,8 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs,
else
name = strings + GET_WORD (input_bfd, syms[r_index].e_strx);
if (! ((*finfo->info->callbacks->undefined_symbol)
- (finfo->info, name, input_bfd, input_section, r_addr)))
+ (finfo->info, name, input_bfd, input_section,
+ r_addr, true)))
return false;
}
@@ -5279,6 +5315,7 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs,
/* We are generating an executable, and must do a full
relocation. */
hundef = false;
+
if (r_extern)
{
h = sym_hashes[r_index];
@@ -5395,14 +5432,26 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs,
else
name = strings + GET_WORD (input_bfd, syms[r_index].e_strx);
if (! ((*finfo->info->callbacks->undefined_symbol)
- (finfo->info, name, input_bfd, input_section, r_addr)))
+ (finfo->info, name, input_bfd, input_section,
+ r_addr, true)))
return false;
}
- r = MY_final_link_relocate (howto_table_ext + r_type,
- input_bfd, input_section,
- contents, r_addr, relocation,
- r_addend);
+ if (r_type != RELOC_SPARC_REV32)
+ r = MY_final_link_relocate (howto_table_ext + r_type,
+ input_bfd, input_section,
+ contents, r_addr, relocation,
+ r_addend);
+ else
+ {
+ bfd_vma x;
+
+ x = bfd_get_32 (input_bfd, contents + r_addr);
+ x = x + relocation + r_addend;
+ bfd_putl32 (/*input_bfd,*/ x, contents + r_addr);
+ r = bfd_reloc_ok;
+ }
+
if (r != bfd_reloc_ok)
{
switch (r)
@@ -5455,7 +5504,7 @@ aout_link_reloc_link_order (finfo, o, p)
int r_index;
int r_extern;
reloc_howto_type *howto;
- file_ptr *reloff_ptr;
+ file_ptr *reloff_ptr = NULL;
struct reloc_std_external srel;
struct reloc_ext_external erel;
PTR rel_ptr;
diff --git a/contrib/binutils/bfd/archive.c b/contrib/binutils/bfd/archive.c
index 6b9dbbc4a724..19293af4573d 100644
--- a/contrib/binutils/bfd/archive.c
+++ b/contrib/binutils/bfd/archive.c
@@ -1,5 +1,5 @@
/* BFD back-end for archive files (libraries).
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Free Software Foundation, Inc.
Written by Cygnus Support. Mostly Gumby Henkel-Wallace's fault.
@@ -131,8 +131,6 @@ DESCRIPTION
#include "libbfd.h"
#include "aout/ar.h"
#include "aout/ranlib.h"
-#include <errno.h>
-#include <string.h> /* For memchr, strrchr and friends */
#include <ctype.h>
#ifndef errno
@@ -175,7 +173,8 @@ static boolean do_slurp_bsd_armap PARAMS ((bfd *abfd));
static boolean do_slurp_coff_armap PARAMS ((bfd *abfd));
static const char *normalize PARAMS ((bfd *, const char *file));
static struct areltdata *bfd_ar_hdr_from_filesystem PARAMS ((bfd *abfd,
- const char *));
+ const char *,
+ bfd *member));
boolean
_bfd_generic_mkarchive (abfd)
@@ -397,7 +396,7 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag)
}
/* Extract the filename from the archive - there are two ways to
- specify an extendend name table, either the first char of the
+ specify an extended name table, either the first char of the
name is a space, or it's a slash. */
if ((hdr.ar_name[0] == '/'
|| (hdr.ar_name[0] == ' '
@@ -443,19 +442,22 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag)
Note: The SYSV format (terminated by '/') allows embedded
spaces, so only look for ' ' if we don't find '/'. */
- namelen = 0;
- while (hdr.ar_name[namelen] != '\0' &&
- hdr.ar_name[namelen] != '/')
+ char *e;
+ e = memchr (hdr.ar_name, '\0', ar_maxnamelen (abfd));
+ if (e == NULL)
{
- namelen++;
- if (namelen == (unsigned) ar_maxnamelen (abfd))
- {
- namelen = 0;
- while (hdr.ar_name[namelen] != ' '
- && namelen < (unsigned) ar_maxnamelen (abfd))
- namelen++;
- break;
- }
+ e = memchr (hdr.ar_name, '/', ar_maxnamelen (abfd));
+ if (e == NULL)
+ e = memchr (hdr.ar_name, ' ', ar_maxnamelen (abfd));
+ }
+
+ if (e != NULL)
+ namelen = e - hdr.ar_name;
+ else
+ {
+ /* If we didn't find a termination character, then the name
+ must be the entire field. */
+ namelen = ar_maxnamelen (abfd);
}
allocsize += namelen + 1;
@@ -1176,7 +1178,7 @@ normalize (abfd, file)
#else
static const char *
normalize (abfd, file)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
const char *file;
{
const char *filename = strrchr (file, '/');
@@ -1338,21 +1340,41 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen)
/** A couple of functions for creating ar_hdrs */
+#ifndef HAVE_GETUID
+#define getuid() 0
+#endif
+
+#ifndef HAVE_GETGID
+#define getgid() 0
+#endif
+
/* Takes a filename, returns an arelt_data for it, or NULL if it can't
make one. The filename must refer to a filename in the filesystem.
- The filename field of the ar_hdr will NOT be initialized */
+ The filename field of the ar_hdr will NOT be initialized. If member
+ is set, and it's an in-memory bfd, we fake it. */
static struct areltdata *
-bfd_ar_hdr_from_filesystem (abfd, filename)
+bfd_ar_hdr_from_filesystem (abfd, filename, member)
bfd *abfd;
const char *filename;
+ bfd *member;
{
struct stat status;
struct areltdata *ared;
struct ar_hdr *hdr;
char *temp, *temp1;
- if (stat (filename, &status) != 0)
+ if (member && (member->flags & BFD_IN_MEMORY) != 0)
+ {
+ /* Assume we just "made" the member, and fake it */
+ struct bfd_in_memory *bim = (struct bfd_in_memory *) member->iostream;
+ time(&status.st_mtime);
+ status.st_uid = getuid();
+ status.st_gid = getgid();
+ status.st_mode = 0644;
+ status.st_size = bim->size;
+ }
+ else if (stat (filename, &status) != 0)
{
bfd_set_error (bfd_error_system_call);
return NULL;
@@ -1404,7 +1426,7 @@ bfd_special_undocumented_glue (abfd, filename)
bfd *abfd;
const char *filename;
{
- struct areltdata *ar_elt = bfd_ar_hdr_from_filesystem (abfd, filename);
+ struct areltdata *ar_elt = bfd_ar_hdr_from_filesystem (abfd, filename, 0);
if (ar_elt == NULL)
return NULL;
return (struct ar_hdr *) ar_elt->arch_header;
@@ -1586,7 +1608,7 @@ _bfd_write_archive_contents (arch)
if (!current->arelt_data)
{
current->arelt_data =
- (PTR) bfd_ar_hdr_from_filesystem (arch, current->filename);
+ (PTR) bfd_ar_hdr_from_filesystem (arch, current->filename, current);
if (!current->arelt_data)
return false;
@@ -1699,7 +1721,7 @@ _bfd_write_archive_contents (arch)
if (bfd_update_armap_timestamp (arch))
break;
(*_bfd_error_handler)
- ("Warning: writing archive was slow: rewriting timestamp\n");
+ (_("Warning: writing archive was slow: rewriting timestamp\n"));
}
while (++tries < 6);
}
@@ -1887,13 +1909,8 @@ bsd_write_armap (arch, elength, map, orl_count, stridx)
bfd_ardata (arch)->armap_datepos = (SARMAG
+ offsetof (struct ar_hdr, ar_date[0]));
sprintf (hdr.ar_date, "%ld", bfd_ardata (arch)->armap_timestamp);
-#ifndef _WIN32
sprintf (hdr.ar_uid, "%ld", (long) getuid ());
sprintf (hdr.ar_gid, "%ld", (long) getgid ());
-#else
- sprintf (hdr.ar_uid, "%ld", (long) 666);
- sprintf (hdr.ar_gid, "%ld", (long) 42);
-#endif
sprintf (hdr.ar_size, "%-10d", (int) mapsize);
strncpy (hdr.ar_fmag, ARFMAG, 2);
for (i = 0; i < sizeof (struct ar_hdr); i++)
@@ -1970,7 +1987,7 @@ _bfd_archive_bsd_update_armap_timestamp (arch)
bfd_flush (arch);
if (bfd_stat (arch, &archstat) == -1)
{
- perror ("Reading archive file mod timestamp");
+ perror (_("Reading archive file mod timestamp"));
return true; /* Can't read mod time for some reason */
}
if (archstat.st_mtime <= bfd_ardata (arch)->armap_timestamp)
@@ -1994,7 +2011,7 @@ _bfd_archive_bsd_update_armap_timestamp (arch)
!= sizeof (hdr.ar_date)))
{
/* FIXME: bfd can't call perror. */
- perror ("Writing updated armap timestamp");
+ perror (_("Writing updated armap timestamp"));
return true; /* Some error while writing */
}
diff --git a/contrib/binutils/bfd/archures.c b/contrib/binutils/bfd/archures.c
index fa6c7cc409bd..7462592742f6 100644
--- a/contrib/binutils/bfd/archures.c
+++ b/contrib/binutils/bfd/archures.c
@@ -1,5 +1,6 @@
/* BFD library support routines for architectures.
- Copyright (C) 1990, 91-97, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999, 2000
+ Free Software Foundation, Inc.
Hacked by John Gilmore and Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -77,6 +78,7 @@ DESCRIPTION
.#define bfd_mach_m68030 5
.#define bfd_mach_m68040 6
.#define bfd_mach_m68060 7
+.#define bfd_mach_cpu32 8
. bfd_arch_vax, {* DEC Vax *}
. bfd_arch_i960, {* Intel 960 *}
. {* The order of the following is important.
@@ -104,8 +106,9 @@ DESCRIPTION
.#define bfd_mach_sparc_sparclite 3
.#define bfd_mach_sparc_v8plus 4
.#define bfd_mach_sparc_v8plusa 5 {* with ultrasparc add'ns *}
-.#define bfd_mach_sparc_v9 6
-.#define bfd_mach_sparc_v9a 7 {* with ultrasparc add'ns *}
+.#define bfd_mach_sparc_sparclite_le 6
+.#define bfd_mach_sparc_v9 7
+.#define bfd_mach_sparc_v9a 8 {* with ultrasparc add'ns *}
.{* Nonzero if MACH has the v9 instruction set. *}
.#define bfd_mach_sparc_v9_p(mach) \
. ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9a)
@@ -115,6 +118,7 @@ DESCRIPTION
.#define bfd_mach_mips4000 4000
.#define bfd_mach_mips4010 4010
.#define bfd_mach_mips4100 4100
+.#define bfd_mach_mips4111 4111
.#define bfd_mach_mips4300 4300
.#define bfd_mach_mips4400 4400
.#define bfd_mach_mips4600 4600
@@ -127,9 +131,11 @@ DESCRIPTION
. bfd_arch_i386, {* Intel 386 *}
.#define bfd_mach_i386_i386 0
.#define bfd_mach_i386_i8086 1
+.#define bfd_mach_i386_i386_intel_syntax 2
. bfd_arch_we32k, {* AT&T WE32xxx *}
. bfd_arch_tahoe, {* CCI/Harris Tahoe *}
. bfd_arch_i860, {* Intel 860 *}
+. bfd_arch_i370, {* IBM 360/370 Mainframes *}
. bfd_arch_romp, {* IBM ROMP PC/RT *}
. bfd_arch_alliant, {* Alliant *}
. bfd_arch_convex, {* Convex *}
@@ -143,34 +149,61 @@ DESCRIPTION
. bfd_arch_rs6000, {* IBM RS/6000 *}
. bfd_arch_hppa, {* HP PA RISC *}
. bfd_arch_d10v, {* Mitsubishi D10V *}
+.#define bfd_mach_d10v 0
+.#define bfd_mach_d10v_ts2 2
+.#define bfd_mach_d10v_ts3 3
+. bfd_arch_d30v, {* Mitsubishi D30V *}
. bfd_arch_z8k, {* Zilog Z8000 *}
.#define bfd_mach_z8001 1
.#define bfd_mach_z8002 2
. bfd_arch_h8500, {* Hitachi H8/500 *}
. bfd_arch_sh, {* Hitachi SH *}
.#define bfd_mach_sh 0
+.#define bfd_mach_sh2 0x20
+.#define bfd_mach_sh_dsp 0x2d
.#define bfd_mach_sh3 0x30
+.#define bfd_mach_sh3_dsp 0x3d
.#define bfd_mach_sh3e 0x3e
.#define bfd_mach_sh4 0x40
. bfd_arch_alpha, {* Dec Alpha *}
+.#define bfd_mach_alpha_ev4 0x10
+.#define bfd_mach_alpha_ev5 0x20
+.#define bfd_mach_alpha_ev6 0x30
. bfd_arch_arm, {* Advanced Risc Machines ARM *}
.#define bfd_mach_arm_2 1
-.#define bfd_mach_arm_2a 2
+.#define bfd_mach_arm_2a 2
.#define bfd_mach_arm_3 3
.#define bfd_mach_arm_3M 4
-.#define bfd_mach_arm_4 5
+.#define bfd_mach_arm_4 5
.#define bfd_mach_arm_4T 6
+.#define bfd_mach_arm_5 7
+.#define bfd_mach_arm_5T 8
. bfd_arch_ns32k, {* National Semiconductors ns32000 *}
. bfd_arch_w65, {* WDC 65816 *}
. bfd_arch_tic30, {* Texas Instruments TMS320C30 *}
+. bfd_arch_tic80, {* TI TMS320c80 (MVP) *}
. bfd_arch_v850, {* NEC V850 *}
.#define bfd_mach_v850 0
+.#define bfd_mach_v850e 'E'
+.#define bfd_mach_v850ea 'A'
. bfd_arch_arc, {* Argonaut RISC Core *}
.#define bfd_mach_arc_base 0
. bfd_arch_m32r, {* Mitsubishi M32R/D *}
.#define bfd_mach_m32r 0 {* backwards compatibility *}
+.#define bfd_mach_m32rx 'x'
. bfd_arch_mn10200, {* Matsushita MN10200 *}
. bfd_arch_mn10300, {* Matsushita MN10300 *}
+.#define bfd_mach_mn10300 300
+.#define bfd_mach_am33 330
+. bfd_arch_fr30,
+.#define bfd_mach_fr30 0x46523330
+. bfd_arch_mcore,
+. bfd_arch_pj,
+. bfd_arch_avr, {* Atmel AVR microcontrollers *}
+.#define bfd_mach_avr1 1
+.#define bfd_mach_avr2 2
+.#define bfd_mach_avr3 3
+.#define bfd_mach_avr4 4
. bfd_arch_last
. };
@@ -214,9 +247,11 @@ extern const bfd_arch_info_type bfd_alpha_arch;
extern const bfd_arch_info_type bfd_arc_arch;
extern const bfd_arch_info_type bfd_arm_arch;
extern const bfd_arch_info_type bfd_d10v_arch;
+extern const bfd_arch_info_type bfd_d30v_arch;
extern const bfd_arch_info_type bfd_h8300_arch;
extern const bfd_arch_info_type bfd_h8500_arch;
extern const bfd_arch_info_type bfd_hppa_arch;
+extern const bfd_arch_info_type bfd_i370_arch;
extern const bfd_arch_info_type bfd_i386_arch;
extern const bfd_arch_info_type bfd_i860_arch;
extern const bfd_arch_info_type bfd_i960_arch;
@@ -228,15 +263,20 @@ extern const bfd_arch_info_type bfd_mn10200_arch;
extern const bfd_arch_info_type bfd_mn10300_arch;
extern const bfd_arch_info_type bfd_powerpc_arch;
extern const bfd_arch_info_type bfd_rs6000_arch;
+extern const bfd_arch_info_type bfd_pj_arch;
extern const bfd_arch_info_type bfd_sh_arch;
extern const bfd_arch_info_type bfd_sparc_arch;
extern const bfd_arch_info_type bfd_tic30_arch;
+extern const bfd_arch_info_type bfd_tic80_arch;
extern const bfd_arch_info_type bfd_vax_arch;
extern const bfd_arch_info_type bfd_we32k_arch;
extern const bfd_arch_info_type bfd_z8k_arch;
extern const bfd_arch_info_type bfd_ns32k_arch;
extern const bfd_arch_info_type bfd_w65_arch;
extern const bfd_arch_info_type bfd_v850_arch;
+extern const bfd_arch_info_type bfd_fr30_arch;
+extern const bfd_arch_info_type bfd_mcore_arch;
+extern const bfd_arch_info_type bfd_avr_arch;
static const bfd_arch_info_type * const bfd_archures_list[] =
{
@@ -248,9 +288,11 @@ static const bfd_arch_info_type * const bfd_archures_list[] =
&bfd_arc_arch,
&bfd_arm_arch,
&bfd_d10v_arch,
+ &bfd_d30v_arch,
&bfd_h8300_arch,
&bfd_h8500_arch,
&bfd_hppa_arch,
+ &bfd_i370_arch,
&bfd_i386_arch,
&bfd_i860_arch,
&bfd_i960_arch,
@@ -265,12 +307,16 @@ static const bfd_arch_info_type * const bfd_archures_list[] =
&bfd_sh_arch,
&bfd_sparc_arch,
&bfd_tic30_arch,
+ &bfd_tic80_arch,
&bfd_vax_arch,
&bfd_we32k_arch,
&bfd_z8k_arch,
&bfd_ns32k_arch,
&bfd_w65_arch,
&bfd_v850_arch,
+ &bfd_fr30_arch,
+ &bfd_mcore_arch,
+ &bfd_avr_arch,
#endif
0
};
@@ -747,10 +793,13 @@ bfd_default_scan (info, string)
arch = bfd_arch_m68k;
number = bfd_mach_m68040;
break;
+ case 68060:
+ arch = bfd_arch_m68k;
+ number = bfd_mach_m68060;
+ break;
case 68332:
arch = bfd_arch_m68k;
- /* FIXME: This should be cpu32. */
- number = bfd_mach_m68020;
+ number = bfd_mach_cpu32;
break;
case 32000:
@@ -771,6 +820,26 @@ bfd_default_scan (info, string)
arch = bfd_arch_rs6000;
break;
+ case 7410:
+ arch = bfd_arch_sh;
+ number = bfd_mach_sh_dsp;
+ break;
+
+ case 7708:
+ arch = bfd_arch_sh;
+ number = bfd_mach_sh3;
+ break;
+
+ case 7729:
+ arch = bfd_arch_sh;
+ number = bfd_mach_sh3_dsp;
+ break;
+
+ case 7750:
+ arch = bfd_arch_sh;
+ number = bfd_mach_sh4;
+ break;
+
default:
return false;
}
@@ -863,9 +932,58 @@ bfd_printable_arch_mach (arch, machine)
enum bfd_architecture arch;
unsigned long machine;
{
- const bfd_arch_info_type *ap = bfd_lookup_arch (arch, machine);
+ const bfd_arch_info_type * ap = bfd_lookup_arch (arch, machine);
if (ap)
return ap->printable_name;
return "UNKNOWN!";
}
+
+/*
+FUNCTION
+ bfd_octets_per_byte
+
+SYNOPSIS
+ unsigned int bfd_octets_per_byte(bfd *abfd);
+
+DESCRIPTION
+ Return the number of octets (8-bit quantities) per target byte
+ (minimum addressable unit). In most cases, this will be one, but some
+ DSP targets have 16, 32, or even 48 bits per byte.
+
+*/
+
+unsigned int
+bfd_octets_per_byte (abfd)
+ bfd * abfd;
+{
+ return bfd_arch_mach_octets_per_byte (bfd_get_arch (abfd),
+ bfd_get_mach (abfd));
+}
+
+/*
+FUNCTION
+ bfd_arch_mach_octets_per_byte
+
+SYNOPSIS
+ unsigned int bfd_arch_mach_octets_per_byte(enum bfd_architecture arch,
+ unsigned long machine);
+
+DESCRIPTION
+ See bfd_octets_per_byte.
+
+ This routine is provided for those cases where a bfd * is not
+ available
+*/
+
+unsigned int
+bfd_arch_mach_octets_per_byte (arch, mach)
+ enum bfd_architecture arch;
+ unsigned long mach;
+{
+ const bfd_arch_info_type * ap = bfd_lookup_arch (arch, mach);
+
+ if (ap)
+ return ap->bits_per_byte / 8;
+ return 1;
+}
diff --git a/contrib/binutils/bfd/armnetbsd.c b/contrib/binutils/bfd/armnetbsd.c
new file mode 100644
index 000000000000..3e6ee4707081
--- /dev/null
+++ b/contrib/binutils/bfd/armnetbsd.c
@@ -0,0 +1,49 @@
+/* BFD back-end for NetBSD/ARM a.out-ish binaries.
+ Copyright (C) 1999 Free Software Foundation, Inc.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#define BYTES_IN_WORD 4
+#undef TARGET_IS_BIG_ENDIAN_P
+
+#define TARGET_PAGE_SIZE 4096
+#define SEGMENT_SIZE TARGET_PAGE_SIZE
+
+#define DEFAULT_ARCH bfd_arch_arm
+#define DEFAULT_MID M_ARM6_NETBSD
+/*#define MACHTYPE_OK(mtype) ((mtype) == M_ARM6_NETBSD)*/
+
+#define MY(OP) CAT (armnetbsd_, OP)
+/* This needs to start with a.out so GDB knows it is an a.out variant. */
+#define TARGETNAME "a.out-arm-netbsd"
+
+#if 0
+#define NAME(x,y) CAT3(aoutarm,_32_,y)
+
+#define aoutarm_32_get_section_contents aout_32_get_section_contents
+
+#define MY_bfd_reloc_type_lookup aoutarm_bfd_reloc_type_lookup
+
+#include "bfd.h" /* To ensure following declaration is OK */
+
+CONST struct reloc_howto_struct *
+MY_bfd_reloc_type_lookup
+ PARAMS ((bfd * abfd AND
+ bfd_reloc_code_real_type code));
+#endif
+
+#include "netbsd.h"
diff --git a/contrib/binutils/bfd/bfd-in.h b/contrib/binutils/bfd/bfd-in.h
index e2ed9368a11a..09753c27535c 100644
--- a/contrib/binutils/bfd/bfd-in.h
+++ b/contrib/binutils/bfd/bfd-in.h
@@ -1,5 +1,5 @@
/* Main header file for the bfd library -- portable access to object files.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
Contributed by Cygnus Support.
@@ -89,7 +89,7 @@ typedef struct _bfd bfd;
/* Yup, SVR4 has a "typedef enum boolean" in <sys/types.h> -fnf */
/* It gets worse if the host also defines a true/false enum... -sts */
/* And even worse if your compiler has built-in boolean types... -law */
-#if defined (__GNUG__) && (__GNUC_MINOR__ > 5)
+#if defined (__GNUG__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6))
#define TRUE_FALSE_ALREADY_DEFINED
#endif
#ifdef MPW
@@ -121,20 +121,24 @@ typedef long int file_ptr;
use gcc's "long long" type. Otherwise, BFD_HOST_64_BIT must be
defined above. */
+#ifndef BFD_HOST_64_BIT
+# if BFD_HOST_64BIT_LONG
+# define BFD_HOST_64_BIT long
+# define BFD_HOST_U_64_BIT unsigned long
+# else
+# ifdef __GNUC__
+# if __GNUC__ >= 2
+# define BFD_HOST_64_BIT long long
+# define BFD_HOST_U_64_BIT unsigned long long
+# endif /* __GNUC__ >= 2 */
+# endif /* ! defined (__GNUC__) */
+# endif /* ! BFD_HOST_64BIT_LONG */
+#endif /* ! defined (BFD_HOST_64_BIT) */
+
#ifdef BFD64
#ifndef BFD_HOST_64_BIT
-#if BFD_HOST_64BIT_LONG
-#define BFD_HOST_64_BIT long
-#define BFD_HOST_U_64_BIT unsigned long
-#else
-#ifdef __GNUC__
-#define BFD_HOST_64_BIT long long
-#define BFD_HOST_U_64_BIT unsigned long long
-#else /* ! defined (__GNUC__) */
#error No 64 bit integer type available
-#endif /* ! defined (__GNUC__) */
-#endif /* ! BFD_HOST_64BIT_LONG */
#endif /* ! defined (BFD_HOST_64_BIT) */
typedef BFD_HOST_U_64_BIT bfd_vma;
@@ -175,7 +179,9 @@ typedef unsigned long bfd_size_type;
/* Print a bfd_vma x on stream s. */
#define fprintf_vma(s,x) fprintf(s, "%08lx", x)
#define sprintf_vma(s,x) sprintf(s, "%08lx", x)
+
#endif /* not BFD64 */
+
#define printf_vma(x) fprintf_vma(stdout,x)
typedef unsigned int flagword; /* 32 bits of flags */
@@ -620,6 +626,20 @@ extern boolean bfd_elf64_size_dynamic_sections
extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *));
+/* Return an upper bound on the number of bytes required to store a
+ copy of ABFD's program header table entries. Return -1 if an error
+ occurs; bfd_get_error will return an appropriate code. */
+extern long bfd_get_elf_phdr_upper_bound PARAMS ((bfd *abfd));
+
+/* Copy ABFD's program header table entries to *PHDRS. The entries
+ will be stored as an array of Elf_Internal_Phdr structures, as
+ defined in include/elf/internal.h. To find out how large the
+ buffer needs to be, call bfd_get_elf_phdr_upper_bound.
+
+ Return the number of program header table entries read, or -1 if an
+ error occurs; bfd_get_error will return an appropriate code. */
+extern int bfd_get_elf_phdrs PARAMS ((bfd *abfd, void *phdrs));
+
/* SunOS shared library support routines for the linker. */
extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
@@ -691,7 +711,41 @@ union internal_auxent;
extern boolean bfd_coff_get_syment
PARAMS ((bfd *, struct symbol_cache_entry *, struct internal_syment *));
+
extern boolean bfd_coff_get_auxent
PARAMS ((bfd *, struct symbol_cache_entry *, int, union internal_auxent *));
+extern boolean bfd_coff_set_symbol_class
+ PARAMS ((bfd *, struct symbol_cache_entry *, unsigned int));
+
+/* ARM Interworking support. Called from linker. */
+extern boolean bfd_arm_allocate_interworking_sections
+ PARAMS ((struct bfd_link_info *));
+
+extern boolean bfd_arm_process_before_allocation
+ PARAMS ((bfd *, struct bfd_link_info *, int));
+
+extern boolean bfd_arm_get_bfd_for_interworking
+ PARAMS ((bfd *, struct bfd_link_info *));
+
+/* PE ARM Interworking support. Called from linker. */
+extern boolean bfd_arm_pe_allocate_interworking_sections
+ PARAMS ((struct bfd_link_info *));
+
+extern boolean bfd_arm_pe_process_before_allocation
+ PARAMS ((bfd *, struct bfd_link_info *, int));
+
+extern boolean bfd_arm_pe_get_bfd_for_interworking
+ PARAMS ((bfd *, struct bfd_link_info *));
+
+/* ELF ARM Interworking support. Called from linker. */
+extern boolean bfd_elf32_arm_allocate_interworking_sections
+ PARAMS ((struct bfd_link_info *));
+
+extern boolean bfd_elf32_arm_process_before_allocation
+ PARAMS ((bfd *, struct bfd_link_info *, int));
+
+extern boolean bfd_elf32_arm_get_bfd_for_interworking
+ PARAMS ((bfd *, struct bfd_link_info *));
+
/* And more from the source. */
diff --git a/contrib/binutils/bfd/bfd-in2.h b/contrib/binutils/bfd/bfd-in2.h
index 913799804633..4c3eea02af4c 100644
--- a/contrib/binutils/bfd/bfd-in2.h
+++ b/contrib/binutils/bfd/bfd-in2.h
@@ -1,5 +1,5 @@
/* Main header file for the bfd library -- portable access to object files.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
Contributed by Cygnus Support.
@@ -89,7 +89,7 @@ typedef struct _bfd bfd;
/* Yup, SVR4 has a "typedef enum boolean" in <sys/types.h> -fnf */
/* It gets worse if the host also defines a true/false enum... -sts */
/* And even worse if your compiler has built-in boolean types... -law */
-#if defined (__GNUG__) && (__GNUC_MINOR__ > 5)
+#if defined (__GNUG__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6))
#define TRUE_FALSE_ALREADY_DEFINED
#endif
#ifdef MPW
@@ -121,20 +121,24 @@ typedef long int file_ptr;
use gcc's "long long" type. Otherwise, BFD_HOST_64_BIT must be
defined above. */
+#ifndef BFD_HOST_64_BIT
+# if BFD_HOST_64BIT_LONG
+# define BFD_HOST_64_BIT long
+# define BFD_HOST_U_64_BIT unsigned long
+# else
+# ifdef __GNUC__
+# if __GNUC__ >= 2
+# define BFD_HOST_64_BIT long long
+# define BFD_HOST_U_64_BIT unsigned long long
+# endif /* __GNUC__ >= 2 */
+# endif /* ! defined (__GNUC__) */
+# endif /* ! BFD_HOST_64BIT_LONG */
+#endif /* ! defined (BFD_HOST_64_BIT) */
+
#ifdef BFD64
#ifndef BFD_HOST_64_BIT
-#if BFD_HOST_64BIT_LONG
-#define BFD_HOST_64_BIT long
-#define BFD_HOST_U_64_BIT unsigned long
-#else
-#ifdef __GNUC__
-#define BFD_HOST_64_BIT long long
-#define BFD_HOST_U_64_BIT unsigned long long
-#else /* ! defined (__GNUC__) */
#error No 64 bit integer type available
-#endif /* ! defined (__GNUC__) */
-#endif /* ! BFD_HOST_64BIT_LONG */
#endif /* ! defined (BFD_HOST_64_BIT) */
typedef BFD_HOST_U_64_BIT bfd_vma;
@@ -175,7 +179,9 @@ typedef unsigned long bfd_size_type;
/* Print a bfd_vma x on stream s. */
#define fprintf_vma(s,x) fprintf(s, "%08lx", x)
#define sprintf_vma(s,x) sprintf(s, "%08lx", x)
+
#endif /* not BFD64 */
+
#define printf_vma(x) fprintf_vma(stdout,x)
typedef unsigned int flagword; /* 32 bits of flags */
@@ -620,6 +626,20 @@ extern boolean bfd_elf64_size_dynamic_sections
extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *));
+/* Return an upper bound on the number of bytes required to store a
+ copy of ABFD's program header table entries. Return -1 if an error
+ occurs; bfd_get_error will return an appropriate code. */
+extern long bfd_get_elf_phdr_upper_bound PARAMS ((bfd *abfd));
+
+/* Copy ABFD's program header table entries to *PHDRS. The entries
+ will be stored as an array of Elf_Internal_Phdr structures, as
+ defined in include/elf/internal.h. To find out how large the
+ buffer needs to be, call bfd_get_elf_phdr_upper_bound.
+
+ Return the number of program header table entries read, or -1 if an
+ error occurs; bfd_get_error will return an appropriate code. */
+extern int bfd_get_elf_phdrs PARAMS ((bfd *abfd, void *phdrs));
+
/* SunOS shared library support routines for the linker. */
extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
@@ -691,9 +711,43 @@ union internal_auxent;
extern boolean bfd_coff_get_syment
PARAMS ((bfd *, struct symbol_cache_entry *, struct internal_syment *));
+
extern boolean bfd_coff_get_auxent
PARAMS ((bfd *, struct symbol_cache_entry *, int, union internal_auxent *));
+extern boolean bfd_coff_set_symbol_class
+ PARAMS ((bfd *, struct symbol_cache_entry *, unsigned int));
+
+/* ARM Interworking support. Called from linker. */
+extern boolean bfd_arm_allocate_interworking_sections
+ PARAMS ((struct bfd_link_info *));
+
+extern boolean bfd_arm_process_before_allocation
+ PARAMS ((bfd *, struct bfd_link_info *, int));
+
+extern boolean bfd_arm_get_bfd_for_interworking
+ PARAMS ((bfd *, struct bfd_link_info *));
+
+/* PE ARM Interworking support. Called from linker. */
+extern boolean bfd_arm_pe_allocate_interworking_sections
+ PARAMS ((struct bfd_link_info *));
+
+extern boolean bfd_arm_pe_process_before_allocation
+ PARAMS ((bfd *, struct bfd_link_info *, int));
+
+extern boolean bfd_arm_pe_get_bfd_for_interworking
+ PARAMS ((bfd *, struct bfd_link_info *));
+
+/* ELF ARM Interworking support. Called from linker. */
+extern boolean bfd_elf32_arm_allocate_interworking_sections
+ PARAMS ((struct bfd_link_info *));
+
+extern boolean bfd_elf32_arm_process_before_allocation
+ PARAMS ((bfd *, struct bfd_link_info *, int));
+
+extern boolean bfd_elf32_arm_get_bfd_for_interworking
+ PARAMS ((bfd *, struct bfd_link_info *));
+
/* And more from the source. */
void
bfd_init PARAMS ((void));
@@ -719,11 +773,17 @@ bfd_close_all_done PARAMS ((bfd *));
bfd *
bfd_create PARAMS ((CONST char *filename, bfd *templ));
+boolean
+bfd_make_writable PARAMS ((bfd *abfd));
+
+boolean
+bfd_make_readable PARAMS ((bfd *abfd));
+
/* Byte swapping macros for user section data. */
#define bfd_put_8(abfd, val, ptr) \
- (*((unsigned char *)(ptr)) = (unsigned char)(val))
+ ((void) (*((unsigned char *)(ptr)) = (unsigned char)(val)))
#define bfd_put_signed_8 \
bfd_put_8
#define bfd_get_8(abfd, ptr) \
@@ -758,6 +818,20 @@ bfd_create PARAMS ((CONST char *filename, bfd *templ));
#define bfd_get_signed_64(abfd, ptr) \
BFD_SEND(abfd, bfd_getx_signed_64, (ptr))
+#define bfd_get(bits, abfd, ptr) \
+ ((bits) == 8 ? bfd_get_8 (abfd, ptr) \
+ : (bits) == 16 ? bfd_get_16 (abfd, ptr) \
+ : (bits) == 32 ? bfd_get_32 (abfd, ptr) \
+ : (bits) == 64 ? bfd_get_64 (abfd, ptr) \
+ : (abort (), (bfd_vma) - 1))
+
+#define bfd_put(bits, abfd, val, ptr) \
+ ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
+ : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
+ : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
+ : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
+ : (abort (), (void) 0))
+
/* Byte swapping macros for file header data. */
@@ -797,6 +871,27 @@ bfd_create PARAMS ((CONST char *filename, bfd *templ));
#define bfd_h_get_signed_64(abfd, ptr) \
BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr))
+ /* This structure is used for a comdat section, as in PE. A comdat
+ section is associated with a particular symbol. When the linker
+ sees a comdat section, it keeps only one of the sections with a
+ given name and associated with a given symbol. */
+
+struct bfd_comdat_info
+{
+ /* The name of the symbol associated with a comdat section. */
+ const char *name;
+
+ /* The local symbol table index of the symbol associated with a
+ comdat section. This is only meaningful to the object file format
+ specific code; it is not an index into the list returned by
+ bfd_canonicalize_symtab. */
+ long symbol;
+
+ /* If this section is being discarded, the linker uses this field
+ to point to the input section which is being kept. */
+ struct sec *sec;
+};
+
typedef struct sec
{
/* The name of the section; the name isn't a copy, the pointer is
@@ -862,7 +957,7 @@ typedef struct sec
standard data. */
#define SEC_CONSTRUCTOR 0x100
- /* The section is a constuctor, and should be placed at the
+ /* The section is a constructor, and should be placed at the
end of the text, data, or bss section(?). */
#define SEC_CONSTRUCTOR_TEXT 0x1100
#define SEC_CONSTRUCTOR_DATA 0x2100
@@ -951,6 +1046,17 @@ typedef struct sec
else up the line will take care of it later. */
#define SEC_LINKER_CREATED 0x800000
+ /* This section should not be subject to garbage collection. */
+#define SEC_KEEP 0x1000000
+
+ /* This section contains "short" data, and should be placed
+ "near" the GP. */
+#define SEC_SMALL_DATA 0x2000000
+
+ /* This section contains data which may be shared with other
+ executables or shared objects. */
+#define SEC_SHARED 0x4000000
+
/* End of section flags. */
/* Some internal packed boolean fields. */
@@ -964,6 +1070,9 @@ typedef struct sec
/* A mark flag used by some of the linker backends. */
unsigned int linker_mark : 1;
+ /* A mark flag used by some linker backends for garbage collection. */
+ unsigned int gc_mark : 1;
+
/* End of internal packed boolean fields. */
/* The virtual memory address of the section - where it will be
@@ -981,22 +1090,25 @@ typedef struct sec
bfd_vma lma;
- /* The size of the section in bytes, as it will be output.
- contains a value even if the section has no contents (e.g., the
- size of <<.bss>>). This will be filled in after relocation */
+ /* The size of the section in octets, as it will be output.
+ Contains a value even if the section has no contents (e.g., the
+ size of <<.bss>>). This will be filled in after relocation. */
bfd_size_type _cooked_size;
- /* The original size on disk of the section, in bytes. Normally this
+ /* The original size on disk of the section, in octets. Normally this
value is the same as the size, but if some relaxing has
been done, then this value will be bigger. */
bfd_size_type _raw_size;
/* If this section is going to be output, then this value is the
- offset into the output section of the first byte in the input
- section. E.g., if this was going to start at the 100th byte in
- the output section, this value would be 100. */
+ offset in *bytes* into the output section of the first byte in the
+ input section (byte ==> smallest addressable unit on the
+ target). In most cases, if this was going to start at the
+ 100th octet (8-bit quantity) in the output section, this value
+ would be 100. However, if the target byte size is 16 bits
+ (bfd_octets_per_byte is "2"), this value would be 50. */
bfd_vma output_offset;
@@ -1054,6 +1166,10 @@ typedef struct sec
unsigned int lineno_count;
+ /* Optional information about a COMDAT entry; NULL if not COMDAT */
+
+ struct bfd_comdat_info *comdat;
+
/* When a section is being output, this value changes as more
linenumbers are written out */
@@ -1113,9 +1229,11 @@ extern const struct symbol_cache_entry * const bfd_com_symbol;
extern const struct symbol_cache_entry * const bfd_und_symbol;
extern const struct symbol_cache_entry * const bfd_ind_symbol;
#define bfd_get_section_size_before_reloc(section) \
- (section->reloc_done ? (abort(),1): (section)->_raw_size)
+ ((section)->reloc_done ? (abort (), (bfd_size_type) 1) \
+ : (section)->_raw_size)
#define bfd_get_section_size_after_reloc(section) \
- ((section->reloc_done) ? (section)->_cooked_size: (abort(),1))
+ ((section)->reloc_done ? (section)->_cooked_size \
+ : (abort (), (bfd_size_type) 1))
asection *
bfd_get_section_by_name PARAMS ((bfd *abfd, CONST char *name));
@@ -1160,6 +1278,10 @@ bfd_copy_private_section_data PARAMS ((bfd *ibfd, asection *isec, bfd *obfd, ase
#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
BFD_SEND (obfd, _bfd_copy_private_section_data, \
(ibfd, isection, obfd, osection))
+void
+_bfd_strip_section_from_output
+ PARAMS ((struct bfd_link_info *info, asection *section));
+
enum bfd_architecture
{
bfd_arch_unknown, /* File arch not known */
@@ -1172,6 +1294,7 @@ enum bfd_architecture
#define bfd_mach_m68030 5
#define bfd_mach_m68040 6
#define bfd_mach_m68060 7
+#define bfd_mach_cpu32 8
bfd_arch_vax, /* DEC Vax */
bfd_arch_i960, /* Intel 960 */
/* The order of the following is important.
@@ -1199,8 +1322,9 @@ enum bfd_architecture
#define bfd_mach_sparc_sparclite 3
#define bfd_mach_sparc_v8plus 4
#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns */
-#define bfd_mach_sparc_v9 6
-#define bfd_mach_sparc_v9a 7 /* with ultrasparc add'ns */
+#define bfd_mach_sparc_sparclite_le 6
+#define bfd_mach_sparc_v9 7
+#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns */
/* Nonzero if MACH has the v9 instruction set. */
#define bfd_mach_sparc_v9_p(mach) \
((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9a)
@@ -1210,6 +1334,7 @@ enum bfd_architecture
#define bfd_mach_mips4000 4000
#define bfd_mach_mips4010 4010
#define bfd_mach_mips4100 4100
+#define bfd_mach_mips4111 4111
#define bfd_mach_mips4300 4300
#define bfd_mach_mips4400 4400
#define bfd_mach_mips4600 4600
@@ -1222,9 +1347,11 @@ enum bfd_architecture
bfd_arch_i386, /* Intel 386 */
#define bfd_mach_i386_i386 0
#define bfd_mach_i386_i8086 1
+#define bfd_mach_i386_i386_intel_syntax 2
bfd_arch_we32k, /* AT&T WE32xxx */
bfd_arch_tahoe, /* CCI/Harris Tahoe */
bfd_arch_i860, /* Intel 860 */
+ bfd_arch_i370, /* IBM 360/370 Mainframes */
bfd_arch_romp, /* IBM ROMP PC/RT */
bfd_arch_alliant, /* Alliant */
bfd_arch_convex, /* Convex */
@@ -1238,34 +1365,61 @@ enum bfd_architecture
bfd_arch_rs6000, /* IBM RS/6000 */
bfd_arch_hppa, /* HP PA RISC */
bfd_arch_d10v, /* Mitsubishi D10V */
+#define bfd_mach_d10v 0
+#define bfd_mach_d10v_ts2 2
+#define bfd_mach_d10v_ts3 3
+ bfd_arch_d30v, /* Mitsubishi D30V */
bfd_arch_z8k, /* Zilog Z8000 */
#define bfd_mach_z8001 1
#define bfd_mach_z8002 2
bfd_arch_h8500, /* Hitachi H8/500 */
bfd_arch_sh, /* Hitachi SH */
#define bfd_mach_sh 0
+#define bfd_mach_sh2 0x20
+#define bfd_mach_sh_dsp 0x2d
#define bfd_mach_sh3 0x30
+#define bfd_mach_sh3_dsp 0x3d
#define bfd_mach_sh3e 0x3e
#define bfd_mach_sh4 0x40
bfd_arch_alpha, /* Dec Alpha */
+#define bfd_mach_alpha_ev4 0x10
+#define bfd_mach_alpha_ev5 0x20
+#define bfd_mach_alpha_ev6 0x30
bfd_arch_arm, /* Advanced Risc Machines ARM */
#define bfd_mach_arm_2 1
-#define bfd_mach_arm_2a 2
+#define bfd_mach_arm_2a 2
#define bfd_mach_arm_3 3
#define bfd_mach_arm_3M 4
-#define bfd_mach_arm_4 5
+#define bfd_mach_arm_4 5
#define bfd_mach_arm_4T 6
+#define bfd_mach_arm_5 7
+#define bfd_mach_arm_5T 8
bfd_arch_ns32k, /* National Semiconductors ns32000 */
bfd_arch_w65, /* WDC 65816 */
bfd_arch_tic30, /* Texas Instruments TMS320C30 */
+ bfd_arch_tic80, /* TI TMS320c80 (MVP) */
bfd_arch_v850, /* NEC V850 */
#define bfd_mach_v850 0
+#define bfd_mach_v850e 'E'
+#define bfd_mach_v850ea 'A'
bfd_arch_arc, /* Argonaut RISC Core */
#define bfd_mach_arc_base 0
bfd_arch_m32r, /* Mitsubishi M32R/D */
#define bfd_mach_m32r 0 /* backwards compatibility */
+#define bfd_mach_m32rx 'x'
bfd_arch_mn10200, /* Matsushita MN10200 */
bfd_arch_mn10300, /* Matsushita MN10300 */
+#define bfd_mach_mn10300 300
+#define bfd_mach_am33 330
+ bfd_arch_fr30,
+#define bfd_mach_fr30 0x46523330
+ bfd_arch_mcore,
+ bfd_arch_pj,
+ bfd_arch_avr, /* Atmel AVR microcontrollers */
+#define bfd_mach_avr1 1
+#define bfd_mach_avr2 2
+#define bfd_mach_avr3 3
+#define bfd_mach_avr4 4
bfd_arch_last
};
@@ -1331,6 +1485,13 @@ const char *
bfd_printable_arch_mach
PARAMS ((enum bfd_architecture arch, unsigned long machine));
+unsigned int
+bfd_octets_per_byte PARAMS ((bfd *abfd));
+
+unsigned int
+bfd_arch_mach_octets_per_byte PARAMS ((enum bfd_architecture arch,
+ unsigned long machine));
+
typedef enum bfd_reloc_status
{
/* No errors detected */
@@ -1449,13 +1610,26 @@ struct reloc_howto_struct
/* The textual name of the relocation type. */
char *name;
- /* When performing a partial link, some formats must modify the
- relocations rather than the data - this flag signals this.*/
+ /* Some formats record a relocation addend in the section contents
+ rather than with the relocation. For ELF formats this is the
+ distinction between USE_REL and USE_RELA (though the code checks
+ for USE_REL == 1/0). The value of this field is TRUE if the
+ addend is recorded with the section contents; when performing a
+ partial link (ld -r) the section contents (the data) will be
+ modified. The value of this field is FALSE if addends are
+ recorded with the relocation (in arelent.addend); when performing
+ a partial link the relocation will be modified.
+ All relocations for all ELF USE_RELA targets should set this field
+ to FALSE (values of TRUE should be looked on with suspicion).
+ However, the converse is not true: not all relocations of all ELF
+ USE_REL targets set this field to TRUE. Why this is so is peculiar
+ to each particular target. For relocs that aren't used in partial
+ links (e.g. GOT stuff) it doesn't matter what this is set to. */
boolean partial_inplace;
/* The src_mask selects which parts of the read in data
are to be used in the relocation sum. E.g., if this was an 8 bit
- bit of data which we read and relocated, this would be
+ byte of data which we read and relocated, this would be
0x000000ff. When we have relocs which have an addend, such as
sun4 extended relocs, the value in the offset part of a
relocating field is garbage so we never use it. In this case
@@ -1481,6 +1655,9 @@ struct reloc_howto_struct
{(unsigned)C,R,S,B, P, BI, O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC}
#define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN)
+#define EMPTY_HOWTO(C) \
+ HOWTO((C),0,0,0,false,0,complain_overflow_dont,NULL,NULL,false,0,0,false)
+
#define HOWTO_PREPARE(relocation, symbol) \
{ \
if (symbol != (asymbol *)NULL) { \
@@ -1505,6 +1682,7 @@ bfd_check_overflow
PARAMS ((enum complain_overflow how,
unsigned int bitsize,
unsigned int rightshift,
+ unsigned int addrsize,
bfd_vma relocation));
bfd_reloc_status_type
@@ -1661,6 +1839,9 @@ relocation types already defined. */
BFD_RELOC_SPARC_L44,
BFD_RELOC_SPARC_REGISTER,
+/* SPARC little endian relocation */
+ BFD_RELOC_SPARC_REV32,
+
/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
"addend" in some special way.
For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
@@ -1709,6 +1890,17 @@ The GNU linker currently doesn't do any of this optimizing. */
BFD_RELOC_ALPHA_ELF_LITERAL,
BFD_RELOC_ALPHA_LITUSE,
+/* The BFD_RELOC_ALPHA_USER_* relocations are used by the assembler to
+process the explicit !<reloc>!sequence relocations, and are mapped
+into the normal relocations at the end of processing. */
+ BFD_RELOC_ALPHA_USER_LITERAL,
+ BFD_RELOC_ALPHA_USER_LITUSE_BASE,
+ BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF,
+ BFD_RELOC_ALPHA_USER_LITUSE_JSR,
+ BFD_RELOC_ALPHA_USER_GPDISP,
+ BFD_RELOC_ALPHA_USER_GPRELHIGH,
+ BFD_RELOC_ALPHA_USER_GPRELLOW,
+
/* The HINT relocation indicates a value that should be filled into the
"hint" field of a jmp/jsr/ret instruction, for possible branch-
prediction logic which may be provided on some processors. */
@@ -1764,6 +1956,10 @@ to compensate for the borrow when the low bits are added. */
BFD_RELOC_MIPS_GOT_LO16,
BFD_RELOC_MIPS_CALL_HI16,
BFD_RELOC_MIPS_CALL_LO16,
+ BFD_RELOC_MIPS_SUB,
+ BFD_RELOC_MIPS_GOT_PAGE,
+ BFD_RELOC_MIPS_GOT_OFST,
+ BFD_RELOC_MIPS_GOT_DISP,
/* i386/elf relocations */
@@ -1790,6 +1986,14 @@ to compensate for the borrow when the low bits are added. */
BFD_RELOC_NS32K_DISP_16_PCREL,
BFD_RELOC_NS32K_DISP_32_PCREL,
+/* Picojava relocs. Not all of these appear in object files. */
+ BFD_RELOC_PJ_CODE_HI16,
+ BFD_RELOC_PJ_CODE_LO16,
+ BFD_RELOC_PJ_CODE_DIR16,
+ BFD_RELOC_PJ_CODE_DIR32,
+ BFD_RELOC_PJ_CODE_REL16,
+ BFD_RELOC_PJ_CODE_REL32,
+
/* Power(rs6000) and PowerPC relocations. */
BFD_RELOC_PPC_B26,
BFD_RELOC_PPC_BA26,
@@ -1822,6 +2026,9 @@ to compensate for the borrow when the low bits are added. */
BFD_RELOC_PPC_EMB_BIT_FLD,
BFD_RELOC_PPC_EMB_RELSDA,
+/* IBM 370/390 relocations */
+ BFD_RELOC_I370_D12,
+
/* The type of reloc used to build a contructor table - at the moment
probably a 32 bit wide absolute relocation, but the target can choose.
It generally does map to one of the other relocation types. */
@@ -1834,6 +2041,7 @@ not stored in the instruction. */
/* These relocs are only used within the ARM assembler. They are not
(at present) written to any object files. */
BFD_RELOC_ARM_IMMEDIATE,
+ BFD_RELOC_ARM_ADRL_IMMEDIATE,
BFD_RELOC_ARM_OFFSET_IMM,
BFD_RELOC_ARM_SHIFT_IMM,
BFD_RELOC_ARM_SWI,
@@ -1849,6 +2057,15 @@ not stored in the instruction. */
BFD_RELOC_ARM_THUMB_IMM,
BFD_RELOC_ARM_THUMB_SHIFT,
BFD_RELOC_ARM_THUMB_OFFSET,
+ BFD_RELOC_ARM_GOT12,
+ BFD_RELOC_ARM_GOT32,
+ BFD_RELOC_ARM_JUMP_SLOT,
+ BFD_RELOC_ARM_COPY,
+ BFD_RELOC_ARM_GLOB_DAT,
+ BFD_RELOC_ARM_PLT32,
+ BFD_RELOC_ARM_RELATIVE,
+ BFD_RELOC_ARM_GOTOFF,
+ BFD_RELOC_ARM_GOTPC,
/* Hitachi SH relocs. Not all of these appear in object files. */
BFD_RELOC_SH_PCDISP8BY2,
@@ -1907,7 +2124,53 @@ assumed to be 0. */
assumed to be 0. */
BFD_RELOC_D10V_18_PCREL,
+/* Mitsubishi D30V relocs.
+This is a 6-bit absolute reloc. */
+ BFD_RELOC_D30V_6,
+
+/* This is a 6-bit pc-relative reloc with
+the right 3 bits assumed to be 0. */
+ BFD_RELOC_D30V_9_PCREL,
+
+/* This is a 6-bit pc-relative reloc with
+the right 3 bits assumed to be 0. Same
+as the previous reloc but on the right side
+of the container. */
+ BFD_RELOC_D30V_9_PCREL_R,
+
+/* This is a 12-bit absolute reloc with the
+right 3 bitsassumed to be 0. */
+ BFD_RELOC_D30V_15,
+
+/* This is a 12-bit pc-relative reloc with
+the right 3 bits assumed to be 0. */
+ BFD_RELOC_D30V_15_PCREL,
+/* This is a 12-bit pc-relative reloc with
+the right 3 bits assumed to be 0. Same
+as the previous reloc but on the right side
+of the container. */
+ BFD_RELOC_D30V_15_PCREL_R,
+
+/* This is an 18-bit absolute reloc with
+the right 3 bits assumed to be 0. */
+ BFD_RELOC_D30V_21,
+
+/* This is an 18-bit pc-relative reloc with
+the right 3 bits assumed to be 0. */
+ BFD_RELOC_D30V_21_PCREL,
+
+/* This is an 18-bit pc-relative reloc with
+the right 3 bits assumed to be 0. Same
+as the previous reloc but on the right side
+of the container. */
+ BFD_RELOC_D30V_21_PCREL_R,
+
+/* This is a 32-bit absolute reloc. */
+ BFD_RELOC_D30V_32,
+
+/* This is a 32-bit pc-relative reloc. */
+ BFD_RELOC_D30V_32_PCREL,
/* Mitsubishi M32R relocs.
This is a 24 bit absolute address. */
@@ -1971,6 +2234,27 @@ data area pointer. */
/* This is a 16 bit offset from the tiny data area pointer. */
BFD_RELOC_V850_TDA_16_16_OFFSET,
+/* This is a 5 bit offset (of which only 4 bits are used) from the tiny
+data area pointer. */
+ BFD_RELOC_V850_TDA_4_5_OFFSET,
+
+/* This is a 4 bit offset from the tiny data area pointer. */
+ BFD_RELOC_V850_TDA_4_4_OFFSET,
+
+/* This is a 16 bit offset from the short data area pointer, with the
+bits placed non-contigously in the instruction. */
+ BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
+
+/* This is a 16 bit offset from the zero data area pointer, with the
+bits placed non-contigously in the instruction. */
+ BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
+
+/* This is a 6 bit offset from the call table base pointer. */
+ BFD_RELOC_V850_CALLT_6_7_OFFSET,
+
+/* This is a 16 bit offset from the call table base pointer. */
+ BFD_RELOC_V850_CALLT_16_16_OFFSET,
+
/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
instruction. */
@@ -1984,6 +2268,133 @@ instruction. */
significant 8 bits of a 24 bit word are placed into the least
significant 8 bits of the opcode. */
BFD_RELOC_TIC30_LDP,
+
+/* This is a 48 bit reloc for the FR30 that stores 32 bits. */
+ BFD_RELOC_FR30_48,
+
+/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
+two sections. */
+ BFD_RELOC_FR30_20,
+
+/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
+4 bits. */
+ BFD_RELOC_FR30_6_IN_4,
+
+/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
+into 8 bits. */
+ BFD_RELOC_FR30_8_IN_8,
+
+/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
+into 8 bits. */
+ BFD_RELOC_FR30_9_IN_8,
+
+/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
+into 8 bits. */
+ BFD_RELOC_FR30_10_IN_8,
+
+/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
+short offset into 8 bits. */
+ BFD_RELOC_FR30_9_PCREL,
+
+/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
+short offset into 11 bits. */
+ BFD_RELOC_FR30_12_PCREL,
+
+/* Motorola Mcore relocations. */
+ BFD_RELOC_MCORE_PCREL_IMM8BY4,
+ BFD_RELOC_MCORE_PCREL_IMM11BY2,
+ BFD_RELOC_MCORE_PCREL_IMM4BY2,
+ BFD_RELOC_MCORE_PCREL_32,
+ BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
+ BFD_RELOC_MCORE_RVA,
+
+/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
+short offset into 7 bits. */
+ BFD_RELOC_AVR_7_PCREL,
+
+/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
+short offset into 12 bits. */
+ BFD_RELOC_AVR_13_PCREL,
+
+/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
+program memory address) into 16 bits. */
+ BFD_RELOC_AVR_16_PM,
+
+/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
+data memory address) into 8 bit immediate value of LDI insn. */
+ BFD_RELOC_AVR_LO8_LDI,
+
+/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
+of data memory address) into 8 bit immediate value of LDI insn. */
+ BFD_RELOC_AVR_HI8_LDI,
+
+/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
+of program memory address) into 8 bit immediate value of LDI insn. */
+ BFD_RELOC_AVR_HH8_LDI,
+
+/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
+(usually data memory address) into 8 bit immediate value of SUBI insn. */
+ BFD_RELOC_AVR_LO8_LDI_NEG,
+
+/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
+(high 8 bit of data memory address) into 8 bit immediate value of
+SUBI insn. */
+ BFD_RELOC_AVR_HI8_LDI_NEG,
+
+/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
+(most high 8 bit of program memory address) into 8 bit immediate value
+of LDI or SUBI insn. */
+ BFD_RELOC_AVR_HH8_LDI_NEG,
+
+/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
+command address) into 8 bit immediate value of LDI insn. */
+ BFD_RELOC_AVR_LO8_LDI_PM,
+
+/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
+of command address) into 8 bit immediate value of LDI insn. */
+ BFD_RELOC_AVR_HI8_LDI_PM,
+
+/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
+of command address) into 8 bit immediate value of LDI insn. */
+ BFD_RELOC_AVR_HH8_LDI_PM,
+
+/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
+(usually command address) into 8 bit immediate value of SUBI insn. */
+ BFD_RELOC_AVR_LO8_LDI_PM_NEG,
+
+/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
+(high 8 bit of 16 bit command address) into 8 bit immediate value
+of SUBI insn. */
+ BFD_RELOC_AVR_HI8_LDI_PM_NEG,
+
+/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
+(high 6 bit of 22 bit command address) into 8 bit immediate
+value of SUBI insn. */
+ BFD_RELOC_AVR_HH8_LDI_PM_NEG,
+
+/* This is a 32 bit reloc for the AVR that stores 23 bit value
+into 22 bits. */
+ BFD_RELOC_AVR_CALL,
+
+/* These two relocations are used by the linker to determine which of
+the entries in a C++ virtual function table are actually used. When
+the --gc-sections option is given, the linker will zero out the entries
+that are not used, so that the code for those functions need not be
+included in the output.
+
+VTABLE_INHERIT is a zero-space relocation used to describe to the
+linker the inheritence tree of a C++ virtual function table. The
+relocation's symbol should be the parent class' vtable, and the
+relocation should be located at the child vtable.
+
+VTABLE_ENTRY is a zero-space relocation that describes the use of a
+virtual function table entry. The reloc's symbol should refer to the
+table of the class mentioned in the code. Off of that base, an offset
+describes the entry that is being used. For Rela hosts, this offset
+is stored in the reloc's addend. For Rel hosts, we are forced to put
+this offset in the reloc's section offset. */
+ BFD_RELOC_VTABLE_INHERIT,
+ BFD_RELOC_VTABLE_ENTRY,
BFD_RELOC_UNUSED };
typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
reloc_howto_type *
@@ -2038,7 +2449,7 @@ typedef struct symbol_cache_entry
<<BSF_GLOBAL>> */
/* The symbol is a debugging record. The value has an arbitary
- meaning. */
+ meaning, unless BSF_DEBUGGING_RELOC is also set. */
#define BSF_DEBUGGING 0x08
/* The symbol denotes a function entry point. Used in ELF,
@@ -2096,6 +2507,11 @@ typedef struct symbol_cache_entry
others someday. */
#define BSF_OBJECT 0x10000
+ /* This symbol is a debugging symbol. The value is the offset
+ into the section of the data. BSF_DEBUGGING should be set
+ as well. */
+#define BSF_DEBUGGING_RELOC 0x20000
+
flagword flags;
/* A pointer to the section to which this symbol is
@@ -2137,6 +2553,9 @@ bfd_print_symbol_vandf PARAMS ((PTR file, asymbol *symbol));
int
bfd_decode_symclass PARAMS ((asymbol *symbol));
+boolean
+bfd_is_undefined_symclass PARAMS ((int symclass));
+
void
bfd_symbol_info PARAMS ((asymbol *symbol, symbol_info *ret));
@@ -2280,6 +2699,7 @@ struct _bfd
struct nlm_obj_tdata *nlm_obj_data;
struct bout_data_struct *bout_data;
struct sun_core_struct *sun_core_data;
+ struct sco5_core_struct *sco5_core_data;
struct trad_core_struct *trad_core_data;
struct som_data_struct *som_data;
struct hpux_core_struct *hpux_core_data;
@@ -2432,6 +2852,9 @@ bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags));
#define bfd_relax_section(abfd, section, link_info, again) \
BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
+#define bfd_gc_sections(abfd, link_info) \
+ BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
+
#define bfd_link_hash_table_create(abfd) \
BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
@@ -2519,6 +2942,7 @@ enum bfd_flavour {
bfd_target_os9k_flavour,
bfd_target_versados_flavour,
bfd_target_msdos_flavour,
+ bfd_target_ovax_flavour,
bfd_target_evax_flavour
};
@@ -2726,7 +3150,8 @@ CAT(NAME,_bfd_relax_section),\
CAT(NAME,_bfd_link_hash_table_create),\
CAT(NAME,_bfd_link_add_symbols),\
CAT(NAME,_bfd_final_link),\
-CAT(NAME,_bfd_link_split_section)
+CAT(NAME,_bfd_link_split_section),\
+CAT(NAME,_bfd_gc_sections)
int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean));
bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *,
struct bfd_link_info *, struct bfd_link_order *,
@@ -2750,7 +3175,10 @@ CAT(NAME,_bfd_link_split_section)
/* Should this section be split up into smaller pieces during linking. */
boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *));
- /* Routines to handle dynamic symbols and relocs. */
+ /* Remove sections that are not referenced from the output. */
+ boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *));
+
+ /* Routines to handle dynamic symbols and relocs. */
#define BFD_JUMP_TABLE_DYNAMIC(NAME)\
CAT(NAME,_get_dynamic_symtab_upper_bound),\
CAT(NAME,_canonicalize_dynamic_symtab),\
@@ -2767,7 +3195,11 @@ CAT(NAME,_canonicalize_dynamic_reloc)
long (*_bfd_canonicalize_dynamic_reloc)
PARAMS ((bfd *, arelent **, struct symbol_cache_entry **));
+ /* Opposite endian version of this target. */
+ const struct bfd_target * alternative_target;
+
PTR backend_data;
+
} bfd_target;
boolean
bfd_set_default_target PARAMS ((const char *name));
@@ -2778,6 +3210,9 @@ bfd_find_target PARAMS ((CONST char *target_name, bfd *abfd));
const char **
bfd_target_list PARAMS ((void));
+const bfd_target *
+bfd_search_for_target PARAMS ((int (* search_func)(const bfd_target *, void *), void *));
+
boolean
bfd_check_format PARAMS ((bfd *abfd, bfd_format format));
diff --git a/contrib/binutils/bfd/bfd.c b/contrib/binutils/bfd/bfd.c
index 8293a724a7e6..e04172fb016a 100644
--- a/contrib/binutils/bfd/bfd.c
+++ b/contrib/binutils/bfd/bfd.c
@@ -1,5 +1,5 @@
/* Generic BFD library interface and support routines.
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -167,6 +167,7 @@ CODE_FRAGMENT
. struct nlm_obj_tdata *nlm_obj_data;
. struct bout_data_struct *bout_data;
. struct sun_core_struct *sun_core_data;
+. struct sco5_core_struct *sco5_core_data;
. struct trad_core_struct *trad_core_data;
. struct som_data_struct *som_data;
. struct hpux_core_struct *hpux_core_data;
@@ -270,25 +271,25 @@ CODE_FRAGMENT
static bfd_error_type bfd_error = bfd_error_no_error;
CONST char *CONST bfd_errmsgs[] = {
- "No error",
- "System call error",
- "Invalid bfd target",
- "File in wrong format",
- "Invalid operation",
- "Memory exhausted",
- "No symbols",
- "Archive has no index; run ranlib to add one",
- "No more archived files",
- "Malformed archive",
- "File format not recognized",
- "File format is ambiguous",
- "Section has no contents",
- "Nonrepresentable section on output",
- "Symbol needs debug section which does not exist",
- "Bad value",
- "File truncated",
- "File too big",
- "#<Invalid error code>"
+ N_("No error"),
+ N_("System call error"),
+ N_("Invalid bfd target"),
+ N_("File in wrong format"),
+ N_("Invalid operation"),
+ N_("Memory exhausted"),
+ N_("No symbols"),
+ N_("Archive has no index; run ranlib to add one"),
+ N_("No more archived files"),
+ N_("Malformed archive"),
+ N_("File format not recognized"),
+ N_("File format is ambiguous"),
+ N_("Section has no contents"),
+ N_("Nonrepresentable section on output"),
+ N_("Symbol needs debug section which does not exist"),
+ N_("Bad value"),
+ N_("File truncated"),
+ N_("File too big"),
+ N_("#<Invalid error code>")
};
/*
@@ -352,7 +353,7 @@ bfd_errmsg (error_tag)
((int)error_tag > (int)bfd_error_invalid_error_code)))
error_tag = bfd_error_invalid_error_code;/* sanity check */
- return bfd_errmsgs [(int)error_tag];
+ return _(bfd_errmsgs [(int)error_tag]);
}
/*
@@ -617,7 +618,7 @@ DESCRIPTION
/*ARGSUSED*/
void
bfd_set_reloc (ignore_abfd, asect, location, count)
- bfd *ignore_abfd;
+ bfd *ignore_abfd ATTRIBUTE_UNUSED;
sec_ptr asect;
arelent **location;
unsigned int count;
@@ -675,9 +676,33 @@ bfd_assert (file, line)
const char *file;
int line;
{
- (*_bfd_error_handler) ("bfd assertion fail %s:%d", file, line);
+ (*_bfd_error_handler) (_("bfd assertion fail %s:%d"), file, line);
}
+/* A more or less friendly abort message. In libbfd.h abort is
+ defined to call this function. */
+
+#ifndef EXIT_FAILURE
+#define EXIT_FAILURE 1
+#endif
+
+void
+_bfd_abort (file, line, fn)
+ const char *file;
+ int line;
+ const char *fn;
+{
+ if (fn != NULL)
+ (*_bfd_error_handler)
+ (_("BFD internal error, aborting at %s line %d in %s\n"),
+ file, line, fn);
+ else
+ (*_bfd_error_handler)
+ (_("BFD internal error, aborting at %s line %d\n"),
+ file, line);
+ (*_bfd_error_handler) (_("Please report this bug.\n"));
+ xexit (EXIT_FAILURE);
+}
/*
FUNCTION
@@ -1044,6 +1069,9 @@ DESCRIPTION
.#define bfd_relax_section(abfd, section, link_info, again) \
. BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
.
+.#define bfd_gc_sections(abfd, link_info) \
+. BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
+.
.#define bfd_link_hash_table_create(abfd) \
. BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
.
diff --git a/contrib/binutils/bfd/binary.c b/contrib/binutils/bfd/binary.c
index 8fcbadcf958e..c2980b02621a 100644
--- a/contrib/binutils/bfd/binary.c
+++ b/contrib/binutils/bfd/binary.c
@@ -1,5 +1,5 @@
/* BFD back-end for binary objects.
- Copyright 1994, 95, 96, 97, 1998 Free Software Foundation, Inc.
+ Copyright 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>
This file is part of BFD, the Binary File Descriptor library.
@@ -58,7 +58,7 @@ static int binary_sizeof_headers PARAMS ((bfd *, boolean));
static boolean
binary_mkobject (abfd)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
{
return true;
}
@@ -112,7 +112,7 @@ binary_object_p (abfd)
static boolean
binary_get_section_contents (abfd, section, location, offset, count)
bfd *abfd;
- asection *section;
+ asection *section ATTRIBUTE_UNUSED;
PTR location;
file_ptr offset;
bfd_size_type count;
@@ -127,7 +127,7 @@ binary_get_section_contents (abfd, section, location, offset, count)
static long
binary_get_symtab_upper_bound (abfd)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
{
return (BIN_SYMS + 1) * sizeof (asymbol *);
}
@@ -222,7 +222,7 @@ binary_make_empty_symbol (abfd)
static void
binary_get_symbol_info (ignore_abfd, symbol, ret)
- bfd *ignore_abfd;
+ bfd *ignore_abfd ATTRIBUTE_UNUSED;
asymbol *symbol;
symbol_info *ret;
{
@@ -255,14 +255,6 @@ binary_set_section_contents (abfd, sec, data, offset, size)
file_ptr offset;
bfd_size_type size;
{
- /* We don't want to output anything for a section that is neither
- loaded nor allocated. The contents of such a section are not
- meaningful in the binary format. */
- if ((sec->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
- return true;
- if ((sec->flags & SEC_NEVER_LOAD) != 0)
- return true;
-
if (! abfd->output_has_begun)
{
boolean found_low;
@@ -275,7 +267,8 @@ binary_set_section_contents (abfd, sec, data, offset, size)
found_low = false;
low = 0;
for (s = abfd->sections; s != NULL; s = s->next)
- if (((s->flags & (SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC))
+ if (((s->flags
+ & (SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC | SEC_NEVER_LOAD))
== (SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC))
&& (! found_low || s->lma < low))
{
@@ -284,11 +277,40 @@ binary_set_section_contents (abfd, sec, data, offset, size)
}
for (s = abfd->sections; s != NULL; s = s->next)
- s->filepos = s->lma - low;
+ {
+ s->filepos = s->lma - low;
+
+ /* Skip following warning check for sections that will not
+ occupy file space. */
+ if ((s->flags
+ & (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_NEVER_LOAD))
+ != (SEC_HAS_CONTENTS | SEC_ALLOC))
+ continue;
+
+ /* If attempting to generate a binary file from a bfd with
+ LMA's all over the place, huge (sparse?) binary files may
+ result. This condition attempts to detect this situation
+ and print a warning. Better heuristics would be nice to
+ have. */
+
+ if (s->filepos < 0)
+ (*_bfd_error_handler)
+ (_("Warning: Writing section `%s' to huge (ie negative) file offset 0x%lx."),
+ bfd_get_section_name (abfd, s),
+ (unsigned long) s->filepos);
+ }
abfd->output_has_begun = true;
}
+ /* We don't want to output anything for a section that is neither
+ loaded nor allocated. The contents of such a section are not
+ meaningful in the binary format. */
+ if ((sec->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
+ return true;
+ if ((sec->flags & SEC_NEVER_LOAD) != 0)
+ return true;
+
return _bfd_generic_set_section_contents (abfd, sec, data, offset, size);
}
@@ -296,8 +318,8 @@ binary_set_section_contents (abfd, sec, data, offset, size)
static int
binary_sizeof_headers (abfd, exec)
- bfd *abfd;
- boolean exec;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ boolean exec ATTRIBUTE_UNUSED;
{
return 0;
}
@@ -305,6 +327,7 @@ binary_sizeof_headers (abfd, exec)
#define binary_bfd_get_relocated_section_contents \
bfd_generic_get_relocated_section_contents
#define binary_bfd_relax_section bfd_generic_relax_section
+#define binary_bfd_gc_sections bfd_generic_gc_sections
#define binary_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
#define binary_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define binary_bfd_final_link _bfd_generic_final_link
@@ -359,5 +382,7 @@ const bfd_target binary_vec =
BFD_JUMP_TABLE_LINK (binary),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+ NULL,
+
NULL
};
diff --git a/contrib/binutils/bfd/cache.c b/contrib/binutils/bfd/cache.c
index b28de4bc4b96..ad3140e1ed73 100644
--- a/contrib/binutils/bfd/cache.c
+++ b/contrib/binutils/bfd/cache.c
@@ -285,10 +285,25 @@ bfd_open_file (abfd)
}
else
{
- /* Create the file. Unlink it first, for the convenience of
- operating systems which worry about overwriting running
- binaries. */
- unlink (abfd->filename);
+ /* Create the file.
+
+ Some operating systems won't let us overwrite a running
+ binary. For them, we want to unlink the file first.
+
+ However, gcc 2.95 will create temporary files using
+ O_EXCL and tight permissions to prevent other users from
+ substituting other .o files during the compilation. gcc
+ will then tell the assembler to use the newly created
+ file as an output file. If we unlink the file here, we
+ open a brief window when another user could still
+ substitute a file.
+
+ So we unlink the output file if and only if it has
+ non-zero size. */
+ struct stat s;
+
+ if (stat (abfd->filename, &s) == 0 && s.st_size != 0)
+ unlink (abfd->filename);
abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_WB);
abfd->opened_once = true;
}
diff --git a/contrib/binutils/bfd/coff-alpha.c b/contrib/binutils/bfd/coff-alpha.c
index 0ec72b96bbcf..6bbc279aeead 100644
--- a/contrib/binutils/bfd/coff-alpha.c
+++ b/contrib/binutils/bfd/coff-alpha.c
@@ -1,5 +1,5 @@
/* BFD back-end for ALPHA Extended-Coff files.
- Copyright 1993, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1993, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
Modified from coff-mips.c by Steve Chamberlain <sac@cygnus.com> and
Ian Lance Taylor <ian@cygnus.com>.
@@ -877,7 +877,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
if (r == bfd_reloc_ok && gp_undefined)
{
r = bfd_reloc_dangerous;
- err = (char *) "GP relative relocation used when GP not defined";
+ err = (char *) _("GP relative relocation used when GP not defined");
}
break;
@@ -914,7 +914,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
{
r = bfd_reloc_dangerous;
err =
- (char *) "GP relative relocation used when GP not defined";
+ (char *) _("GP relative relocation used when GP not defined");
}
}
break;
@@ -1133,7 +1133,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
case bfd_reloc_undefined:
if (! ((*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (*rel->sym_ptr_ptr),
- input_bfd, input_section, rel->address)))
+ input_bfd, input_section, rel->address, true)))
goto error_return;
break;
case bfd_reloc_dangerous:
@@ -1483,7 +1483,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
if (gp && !ecoff_data (output_bfd)->issued_multiple_gp_warning)
{
(*info->callbacks->warning) (info,
- "using multiple gp values",
+ _("using multiple gp values"),
(char *) NULL, output_bfd,
(asection *) NULL, (bfd_vma) 0);
ecoff_data (output_bfd)->issued_multiple_gp_warning = true;
@@ -1719,7 +1719,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
relocated. */
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, (bfd_vma) 0)))
+ input_section, (bfd_vma) 0, true)))
return false;
addend = 0;
}
@@ -1921,7 +1921,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
input_section,
- r_vaddr - input_section->vma)))
+ r_vaddr - input_section->vma, true)))
return false;
relocation = 0;
}
@@ -1989,7 +1989,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
if (gp_usedp && gp_undefined)
{
if (! ((*info->callbacks->reloc_dangerous)
- (info, "GP relative relocation when GP not defined",
+ (info, _("GP relative relocation when GP not defined"),
input_bfd, input_section, r_vaddr - input_section->vma)))
return false;
/* Only give the error once per link. */
@@ -2266,13 +2266,14 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data =
(unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* reloc_out */
alpha_ecoff_swap_filehdr_out, alpha_ecoff_swap_aouthdr_out,
alpha_ecoff_swap_scnhdr_out,
- FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, true, false, 4,
+ FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, true, false, 4,
alpha_ecoff_swap_filehdr_in, alpha_ecoff_swap_aouthdr_in,
alpha_ecoff_swap_scnhdr_in, NULL,
alpha_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook,
alpha_ecoff_mkobject_hook, _bfd_ecoff_styp_to_sec_flags,
_bfd_ecoff_set_alignment_hook, _bfd_ecoff_slurp_symbol_table,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL
},
/* Supported architecture. */
bfd_arch_alpha,
@@ -2357,6 +2358,7 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data =
/* Relaxing sections is generic. */
#define _bfd_ecoff_bfd_relax_section bfd_generic_relax_section
+#define _bfd_ecoff_bfd_gc_sections bfd_generic_gc_sections
const bfd_target ecoffalpha_little_vec =
{
@@ -2397,5 +2399,7 @@ const bfd_target ecoffalpha_little_vec =
BFD_JUMP_TABLE_LINK (_bfd_ecoff),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+ NULL,
+
(PTR) &alpha_ecoff_backend_data
};
diff --git a/contrib/binutils/bfd/coff-arm.c b/contrib/binutils/bfd/coff-arm.c
new file mode 100644
index 000000000000..2b89b848c8cd
--- /dev/null
+++ b/contrib/binutils/bfd/coff-arm.c
@@ -0,0 +1,2552 @@
+/* BFD back-end for ARM COFF files.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
+ Free Software Foundation, Inc.
+ Written by Cygnus Support.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+
+#include "coff/arm.h"
+
+#include "coff/internal.h"
+
+#ifdef COFF_WITH_PE
+#include "coff/pe.h"
+#endif
+
+#include "libcoff.h"
+
+/* Macros for manipulation the bits in the flags field of the coff data
+ structure. */
+#define APCS_26_FLAG( abfd ) (coff_data (abfd)->flags & F_APCS_26)
+#define APCS_FLOAT_FLAG( abfd ) (coff_data (abfd)->flags & F_APCS_FLOAT)
+#define PIC_FLAG( abfd ) (coff_data (abfd)->flags & F_PIC)
+#define APCS_SET( abfd ) (coff_data (abfd)->flags & F_APCS_SET)
+#define SET_APCS_FLAGS( abfd, flgs) (coff_data (abfd)->flags = \
+ (coff_data (abfd)->flags & ~ (F_APCS_26 | F_APCS_FLOAT | F_PIC)) \
+ | (flgs | F_APCS_SET))
+#define INTERWORK_FLAG( abfd ) (coff_data (abfd)->flags & F_INTERWORK)
+#define INTERWORK_SET( abfd ) (coff_data (abfd)->flags & F_INTERWORK_SET)
+#define SET_INTERWORK_FLAG( abfd, flg ) (coff_data (abfd)->flags = \
+ (coff_data (abfd)->flags & ~ F_INTERWORK) \
+ | (flg | F_INTERWORK_SET))
+
+#ifndef NUM_ELEM
+#define NUM_ELEM(a) ((sizeof (a)) / sizeof ((a)[0]))
+#endif
+
+typedef enum {bunknown, b9, b12, b23} thumb_pcrel_branchtype;
+/* some typedefs for holding instructions */
+typedef unsigned long int insn32;
+typedef unsigned short int insn16;
+
+
+ /* Forward declarations for stupid compilers. */
+static boolean coff_arm_relocate_section
+ PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
+ struct internal_reloc *, struct internal_syment *, asection **));
+static bfd_reloc_status_type aoutarm_fix_pcrel_26_done
+ PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+static bfd_reloc_status_type aoutarm_fix_pcrel_26
+ PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+static bfd_reloc_status_type coff_thumb_pcrel_23
+ PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+static bfd_reloc_status_type coff_thumb_pcrel_12
+ PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+static bfd_reloc_status_type coff_thumb_pcrel_9
+ PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+static bfd_reloc_status_type coff_arm_reloc
+ PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+static boolean coff_arm_adjust_symndx
+ PARAMS ((bfd *, struct bfd_link_info *, bfd *,
+ asection *, struct internal_reloc *, boolean *));
+static reloc_howto_type * coff_arm_rtype_to_howto
+ PARAMS ((bfd *, asection *, struct internal_reloc *,
+ struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *));
+static bfd_reloc_status_type coff_thumb_pcrel_common
+ PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **,
+ thumb_pcrel_branchtype));
+static CONST struct reloc_howto_struct * coff_arm_reloc_type_lookup
+ PARAMS ((bfd *, bfd_reloc_code_real_type));
+static struct bfd_link_hash_table * coff_arm_link_hash_table_create
+ PARAMS ((bfd *));
+static insn32 insert_thumb_branch
+ PARAMS ((insn32, int));
+static struct coff_link_hash_entry * find_thumb_glue
+ PARAMS ((struct bfd_link_info *, CONST char *, bfd *));
+static struct coff_link_hash_entry * find_arm_glue
+ PARAMS ((struct bfd_link_info *, CONST char *, bfd *));
+#ifndef COFF_IMAGE_WITH_PE
+static void record_arm_to_thumb_glue
+ PARAMS ((struct bfd_link_info *, struct coff_link_hash_entry *));
+static void record_thumb_to_arm_glue
+ PARAMS ((struct bfd_link_info *, struct coff_link_hash_entry *));
+#endif
+static boolean coff_arm_merge_private_bfd_data
+ PARAMS ((bfd *, bfd *));
+static boolean coff_arm_print_private_bfd_data
+ PARAMS ((bfd *, PTR));
+static boolean _bfd_coff_arm_set_private_flags
+ PARAMS ((bfd *, flagword));
+static boolean coff_arm_copy_private_bfd_data
+ PARAMS ((bfd *, bfd *));
+static boolean coff_arm_is_local_label_name
+ PARAMS ((bfd *, const char *));
+static boolean coff_arm_link_output_has_begun
+ PARAMS ((bfd *, struct coff_final_link_info *));
+static boolean coff_arm_final_link_postscript
+ PARAMS ((bfd *, struct coff_final_link_info *));
+
+/* The linker script knows the section names for placement.
+ The entry_names are used to do simple name mangling on the stubs.
+ Given a function name, and its type, the stub can be found. The
+ name can be changed. The only requirement is the %s be present.
+ */
+
+#define THUMB2ARM_GLUE_SECTION_NAME ".glue_7t"
+#define THUMB2ARM_GLUE_ENTRY_NAME "__%s_from_thumb"
+
+#define ARM2THUMB_GLUE_SECTION_NAME ".glue_7"
+#define ARM2THUMB_GLUE_ENTRY_NAME "__%s_from_arm"
+
+/* Used by the assembler. */
+static bfd_reloc_status_type
+coff_arm_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
+ error_message)
+ bfd *abfd;
+ arelent *reloc_entry;
+ asymbol *symbol ATTRIBUTE_UNUSED;
+ PTR data;
+ asection *input_section ATTRIBUTE_UNUSED;
+ bfd *output_bfd;
+ char **error_message ATTRIBUTE_UNUSED;
+{
+ symvalue diff;
+ if (output_bfd == (bfd *) NULL)
+ return bfd_reloc_continue;
+
+ diff = reloc_entry->addend;
+
+#define DOIT(x) \
+ x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + diff) & howto->dst_mask))
+
+ if (diff != 0)
+ {
+ reloc_howto_type *howto = reloc_entry->howto;
+ unsigned char *addr = (unsigned char *) data + reloc_entry->address;
+
+ switch (howto->size)
+ {
+ case 0:
+ {
+ char x = bfd_get_8 (abfd, addr);
+ DOIT (x);
+ bfd_put_8 (abfd, x, addr);
+ }
+ break;
+
+ case 1:
+ {
+ short x = bfd_get_16 (abfd, addr);
+ DOIT (x);
+ bfd_put_16 (abfd, x, addr);
+ }
+ break;
+
+ case 2:
+ {
+ long x = bfd_get_32 (abfd, addr);
+ DOIT (x);
+ bfd_put_32 (abfd, x, addr);
+ }
+ break;
+
+ default:
+ abort ();
+ }
+ }
+
+ /* Now let bfd_perform_relocation finish everything up. */
+ return bfd_reloc_continue;
+}
+
+/* If USER_LABEL_PREFIX is defined as "_" (see coff_arm_is_local_label_name()
+ in this file), then TARGET_UNDERSCORE should be defined, otherwise it
+ should not. */
+#ifndef TARGET_UNDERSCORE
+#define TARGET_UNDERSCORE '_'
+#endif
+
+#ifndef PCRELOFFSET
+#define PCRELOFFSET true
+#endif
+
+/* These most certainly belong somewhere else. Just had to get rid of
+ the manifest constants in the code. */
+#define ARM_8 0
+#define ARM_16 1
+#define ARM_32 2
+#define ARM_26 3
+#define ARM_DISP8 4
+#define ARM_DISP16 5
+#define ARM_DISP32 6
+#define ARM_26D 7
+/* 8 is unused */
+#define ARM_NEG16 9
+#define ARM_NEG32 10
+#define ARM_RVA32 11
+#define ARM_THUMB9 12
+#define ARM_THUMB12 13
+#define ARM_THUMB23 14
+
+#ifdef ARM_WINCE
+#undef ARM_32
+#undef ARM_RVA32
+#undef ARM_26
+#undef ARM_THUMB12
+#undef ARM_26D
+
+#define ARM_32 1
+#define ARM_RVA32 2
+#define ARM_26 3
+#define ARM_THUMB12 4
+#define ARM_26D 5
+#define ARM_SECTION 14
+#define ARM_SECREL 15
+#endif
+
+static reloc_howto_type aoutarm_std_reloc_howto[] =
+{
+ /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone */
+#ifdef ARM_WINCE
+ EMPTY_HOWTO (-1),
+ HOWTO (ARM_32,
+ 0,
+ 2,
+ 32,
+ false,
+ 0,
+ complain_overflow_bitfield,
+ coff_arm_reloc,
+ "ARM_32",
+ true,
+ 0xffffffff,
+ 0xffffffff,
+ PCRELOFFSET),
+ HOWTO (ARM_RVA32,
+ 0,
+ 2,
+ 32,
+ false,
+ 0,
+ complain_overflow_bitfield,
+ coff_arm_reloc,
+ "ARM_RVA32",
+ true,
+ 0xffffffff,
+ 0xffffffff,
+ PCRELOFFSET),
+ HOWTO (ARM_26,
+ 2,
+ 2,
+ 24,
+ true,
+ 0,
+ complain_overflow_signed,
+ aoutarm_fix_pcrel_26 ,
+ "ARM_26",
+ false,
+ 0x00ffffff,
+ 0x00ffffff,
+ PCRELOFFSET),
+ HOWTO (ARM_THUMB12,
+ 1,
+ 1,
+ 11,
+ true,
+ 0,
+ complain_overflow_signed,
+ coff_thumb_pcrel_12 ,
+ "ARM_THUMB12",
+ false,
+ 0x000007ff,
+ 0x000007ff,
+ PCRELOFFSET),
+ HOWTO (ARM_26D,
+ 2,
+ 2,
+ 24,
+ false,
+ 0,
+ complain_overflow_dont,
+ aoutarm_fix_pcrel_26_done,
+ "ARM_26D",
+ true,
+ 0x00ffffff,
+ 0x0,
+ false),
+ EMPTY_HOWTO (-1),
+ EMPTY_HOWTO (-1),
+ EMPTY_HOWTO (-1),
+ EMPTY_HOWTO (-1),
+ EMPTY_HOWTO (-1),
+ EMPTY_HOWTO (-1),
+ EMPTY_HOWTO (-1),
+ EMPTY_HOWTO (-1),
+ HOWTO (ARM_SECTION,
+ 0,
+ 1,
+ 16,
+ false,
+ 0,
+ complain_overflow_bitfield,
+ coff_arm_reloc,
+ "ARM_16",
+ true,
+ 0x0000ffff,
+ 0x0000ffff,
+ PCRELOFFSET),
+ HOWTO (ARM_SECREL,
+ 0,
+ 2,
+ 32,
+ false,
+ 0,
+ complain_overflow_bitfield,
+ coff_arm_reloc,
+ "ARM_32",
+ true,
+ 0xffffffff,
+ 0xffffffff,
+ PCRELOFFSET),
+#else /* not ARM_WINCE */
+ HOWTO(ARM_8, /* type */
+ 0, /* rightshift */
+ 0, /* size */
+ 8, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ coff_arm_reloc, /* special_function */
+ "ARM_8", /* name */
+ true, /* partial_inplace */
+ 0x000000ff, /* src_mask */
+ 0x000000ff, /* dst_mask */
+ PCRELOFFSET /* pcrel_offset */),
+ HOWTO(ARM_16,
+ 0,
+ 1,
+ 16,
+ false,
+ 0,
+ complain_overflow_bitfield,
+ coff_arm_reloc,
+ "ARM_16",
+ true,
+ 0x0000ffff,
+ 0x0000ffff,
+ PCRELOFFSET),
+ HOWTO(ARM_32,
+ 0,
+ 2,
+ 32,
+ false,
+ 0,
+ complain_overflow_bitfield,
+ coff_arm_reloc,
+ "ARM_32",
+ true,
+ 0xffffffff,
+ 0xffffffff,
+ PCRELOFFSET),
+ HOWTO(ARM_26,
+ 2,
+ 2,
+ 24,
+ true,
+ 0,
+ complain_overflow_signed,
+ aoutarm_fix_pcrel_26 ,
+ "ARM_26",
+ false,
+ 0x00ffffff,
+ 0x00ffffff,
+ PCRELOFFSET),
+ HOWTO(ARM_DISP8,
+ 0,
+ 0,
+ 8,
+ true,
+ 0,
+ complain_overflow_signed,
+ coff_arm_reloc,
+ "ARM_DISP8",
+ true,
+ 0x000000ff,
+ 0x000000ff,
+ true),
+ HOWTO( ARM_DISP16,
+ 0,
+ 1,
+ 16,
+ true,
+ 0,
+ complain_overflow_signed,
+ coff_arm_reloc,
+ "ARM_DISP16",
+ true,
+ 0x0000ffff,
+ 0x0000ffff,
+ true),
+ HOWTO( ARM_DISP32,
+ 0,
+ 2,
+ 32,
+ true,
+ 0,
+ complain_overflow_signed,
+ coff_arm_reloc,
+ "ARM_DISP32",
+ true,
+ 0xffffffff,
+ 0xffffffff,
+ true),
+ HOWTO( ARM_26D,
+ 2,
+ 2,
+ 24,
+ false,
+ 0,
+ complain_overflow_dont,
+ aoutarm_fix_pcrel_26_done,
+ "ARM_26D",
+ true,
+ 0x00ffffff,
+ 0x0,
+ false),
+ /* 8 is unused */
+ EMPTY_HOWTO (-1),
+ HOWTO( ARM_NEG16,
+ 0,
+ -1,
+ 16,
+ false,
+ 0,
+ complain_overflow_bitfield,
+ coff_arm_reloc,
+ "ARM_NEG16",
+ true,
+ 0x0000ffff,
+ 0x0000ffff,
+ false),
+ HOWTO( ARM_NEG32,
+ 0,
+ -2,
+ 32,
+ false,
+ 0,
+ complain_overflow_bitfield,
+ coff_arm_reloc,
+ "ARM_NEG32",
+ true,
+ 0xffffffff,
+ 0xffffffff,
+ false),
+ HOWTO( ARM_RVA32,
+ 0,
+ 2,
+ 32,
+ false,
+ 0,
+ complain_overflow_bitfield,
+ coff_arm_reloc,
+ "ARM_RVA32",
+ true,
+ 0xffffffff,
+ 0xffffffff,
+ PCRELOFFSET),
+ HOWTO( ARM_THUMB9,
+ 1,
+ 1,
+ 8,
+ true,
+ 0,
+ complain_overflow_signed,
+ coff_thumb_pcrel_9 ,
+ "ARM_THUMB9",
+ false,
+ 0x000000ff,
+ 0x000000ff,
+ PCRELOFFSET),
+ HOWTO( ARM_THUMB12,
+ 1,
+ 1,
+ 11,
+ true,
+ 0,
+ complain_overflow_signed,
+ coff_thumb_pcrel_12 ,
+ "ARM_THUMB12",
+ false,
+ 0x000007ff,
+ 0x000007ff,
+ PCRELOFFSET),
+ HOWTO( ARM_THUMB23,
+ 1,
+ 2,
+ 22,
+ true,
+ 0,
+ complain_overflow_signed,
+ coff_thumb_pcrel_23 ,
+ "ARM_THUMB23",
+ false,
+ 0x07ff07ff,
+ 0x07ff07ff,
+ PCRELOFFSET)
+#endif /* not ARM_WINCE */
+};
+
+#define NUM_RELOCS NUM_ELEM (aoutarm_std_reloc_howto)
+
+#ifdef COFF_WITH_PE
+/* Return true if this relocation should
+ appear in the output .reloc section. */
+
+static boolean
+in_reloc_p (abfd, howto)
+ bfd * abfd ATTRIBUTE_UNUSED;
+ reloc_howto_type * howto;
+{
+ return !howto->pc_relative && howto->type != ARM_RVA32;
+}
+#endif
+
+#define RTYPE2HOWTO(cache_ptr, dst) \
+ (cache_ptr)->howto = \
+ (dst)->r_type < NUM_RELOCS \
+ ? aoutarm_std_reloc_howto + (dst)->r_type \
+ : NULL
+
+#define coff_rtype_to_howto coff_arm_rtype_to_howto
+
+static reloc_howto_type *
+coff_arm_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asection *sec;
+ struct internal_reloc *rel;
+ struct coff_link_hash_entry *h ATTRIBUTE_UNUSED;
+ struct internal_syment *sym ATTRIBUTE_UNUSED;
+ bfd_vma *addendp;
+{
+ reloc_howto_type * howto;
+
+ if (rel->r_type >= NUM_RELOCS)
+ return NULL;
+
+ howto = aoutarm_std_reloc_howto + rel->r_type;
+
+ if (rel->r_type == ARM_RVA32)
+ *addendp -= pe_data (sec->output_section->owner)->pe_opthdr.ImageBase;
+
+ return howto;
+}
+/* Used by the assembler. */
+
+static bfd_reloc_status_type
+aoutarm_fix_pcrel_26_done (abfd, reloc_entry, symbol, data, input_section,
+ output_bfd, error_message)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *reloc_entry ATTRIBUTE_UNUSED;
+ asymbol *symbol ATTRIBUTE_UNUSED;
+ PTR data ATTRIBUTE_UNUSED;
+ asection *input_section ATTRIBUTE_UNUSED;
+ bfd *output_bfd ATTRIBUTE_UNUSED;
+ char **error_message ATTRIBUTE_UNUSED;
+{
+ /* This is dead simple at present. */
+ return bfd_reloc_ok;
+}
+
+/* Used by the assembler. */
+
+static bfd_reloc_status_type
+aoutarm_fix_pcrel_26 (abfd, reloc_entry, symbol, data, input_section,
+ output_bfd, error_message)
+ bfd *abfd;
+ arelent *reloc_entry;
+ asymbol *symbol;
+ PTR data;
+ asection *input_section;
+ bfd *output_bfd;
+ char **error_message ATTRIBUTE_UNUSED;
+{
+ bfd_vma relocation;
+ bfd_size_type addr = reloc_entry->address;
+ long target = bfd_get_32 (abfd, (bfd_byte *) data + addr);
+ bfd_reloc_status_type flag = bfd_reloc_ok;
+
+ /* If this is an undefined symbol, return error */
+ if (symbol->section == &bfd_und_section
+ && (symbol->flags & BSF_WEAK) == 0)
+ return output_bfd ? bfd_reloc_continue : bfd_reloc_undefined;
+
+ /* If the sections are different, and we are doing a partial relocation,
+ just ignore it for now. */
+ if (symbol->section->name != input_section->name
+ && output_bfd != (bfd *)NULL)
+ return bfd_reloc_continue;
+
+ relocation = (target & 0x00ffffff) << 2;
+ relocation = (relocation ^ 0x02000000) - 0x02000000; /* Sign extend */
+ relocation += symbol->value;
+ relocation += symbol->section->output_section->vma;
+ relocation += symbol->section->output_offset;
+ relocation += reloc_entry->addend;
+ relocation -= input_section->output_section->vma;
+ relocation -= input_section->output_offset;
+ relocation -= addr;
+
+ if (relocation & 3)
+ return bfd_reloc_overflow;
+
+ /* Check for overflow */
+ if (relocation & 0x02000000)
+ {
+ if ((relocation & ~ (bfd_vma) 0x03ffffff) != ~ (bfd_vma) 0x03ffffff)
+ flag = bfd_reloc_overflow;
+ }
+ else if (relocation & ~0x03ffffff)
+ flag = bfd_reloc_overflow;
+
+ target &= ~0x00ffffff;
+ target |= (relocation >> 2) & 0x00ffffff;
+ bfd_put_32 (abfd, target, (bfd_byte *) data + addr);
+
+ /* Now the ARM magic... Change the reloc type so that it is marked as done.
+ Strictly this is only necessary if we are doing a partial relocation. */
+ reloc_entry->howto = &aoutarm_std_reloc_howto[ARM_26D];
+
+ return flag;
+}
+
+static bfd_reloc_status_type
+coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data, input_section,
+ output_bfd, error_message, btype)
+ bfd *abfd;
+ arelent *reloc_entry;
+ asymbol *symbol;
+ PTR data;
+ asection *input_section;
+ bfd *output_bfd;
+ char **error_message ATTRIBUTE_UNUSED;
+ thumb_pcrel_branchtype btype;
+{
+ bfd_vma relocation = 0;
+ bfd_size_type addr = reloc_entry->address;
+ long target = bfd_get_32 (abfd, (bfd_byte *) data + addr);
+ bfd_reloc_status_type flag = bfd_reloc_ok;
+ bfd_vma dstmsk;
+ bfd_vma offmsk;
+ bfd_vma signbit;
+
+ /* NOTE: This routine is currently used by GAS, but not by the link
+ phase. */
+
+ switch (btype)
+ {
+ case b9:
+ dstmsk = 0x000000ff;
+ offmsk = 0x000001fe;
+ signbit = 0x00000100;
+ break;
+
+ case b12:
+ dstmsk = 0x000007ff;
+ offmsk = 0x00000ffe;
+ signbit = 0x00000800;
+ break;
+
+ case b23:
+ dstmsk = 0x07ff07ff;
+ offmsk = 0x007fffff;
+ signbit = 0x00400000;
+ break;
+
+ default:
+ abort ();
+ }
+
+ /* If this is an undefined symbol, return error */
+ if (symbol->section == &bfd_und_section
+ && (symbol->flags & BSF_WEAK) == 0)
+ return output_bfd ? bfd_reloc_continue : bfd_reloc_undefined;
+
+ /* If the sections are different, and we are doing a partial relocation,
+ just ignore it for now. */
+ if (symbol->section->name != input_section->name
+ && output_bfd != (bfd *)NULL)
+ return bfd_reloc_continue;
+
+ switch (btype)
+ {
+ case b9:
+ case b12:
+ relocation = ((target & dstmsk) << 1);
+ break;
+
+ case b23:
+ if (bfd_big_endian (abfd))
+ relocation = ((target & 0x7ff) << 1) | ((target & 0x07ff0000) >> 4);
+ else
+ relocation = ((target & 0x7ff) << 12) | ((target & 0x07ff0000) >> 15);
+ break;
+
+ default:
+ abort ();
+ }
+
+ relocation = (relocation ^ signbit) - signbit; /* Sign extend */
+ relocation += symbol->value;
+ relocation += symbol->section->output_section->vma;
+ relocation += symbol->section->output_offset;
+ relocation += reloc_entry->addend;
+ relocation -= input_section->output_section->vma;
+ relocation -= input_section->output_offset;
+ relocation -= addr;
+
+ if (relocation & 1)
+ return bfd_reloc_overflow;
+
+ /* Check for overflow */
+ if (relocation & signbit)
+ {
+ if ((relocation & ~offmsk) != ~offmsk)
+ flag = bfd_reloc_overflow;
+ }
+ else if (relocation & ~offmsk)
+ flag = bfd_reloc_overflow;
+
+ target &= ~dstmsk;
+ switch (btype)
+ {
+ case b9:
+ case b12:
+ target |= (relocation >> 1);
+ break;
+
+ case b23:
+ if (bfd_big_endian (abfd))
+ target |= ((relocation & 0xfff) >> 1) | ((relocation << 4) & 0x07ff0000);
+ else
+ target |= ((relocation & 0xffe) << 15) | ((relocation >> 12) & 0x7ff);
+ break;
+
+ default:
+ abort ();
+ }
+
+ bfd_put_32 (abfd, target, (bfd_byte *) data + addr);
+
+ /* Now the ARM magic... Change the reloc type so that it is marked as done.
+ Strictly this is only necessary if we are doing a partial relocation. */
+ reloc_entry->howto = & aoutarm_std_reloc_howto [ARM_26D];
+
+ /* TODO: We should possibly have DONE entries for the THUMB PCREL relocations */
+ return flag;
+}
+
+static bfd_reloc_status_type
+coff_thumb_pcrel_23 (abfd, reloc_entry, symbol, data, input_section,
+ output_bfd, error_message)
+ bfd *abfd;
+ arelent *reloc_entry;
+ asymbol *symbol;
+ PTR data;
+ asection *input_section;
+ bfd *output_bfd;
+ char **error_message;
+{
+ return coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data,
+ input_section, output_bfd, error_message, b23);
+}
+
+static bfd_reloc_status_type
+coff_thumb_pcrel_12 (abfd, reloc_entry, symbol, data, input_section,
+ output_bfd, error_message)
+ bfd *abfd;
+ arelent *reloc_entry;
+ asymbol *symbol;
+ PTR data;
+ asection *input_section;
+ bfd *output_bfd;
+ char **error_message;
+{
+ return coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data,
+ input_section, output_bfd, error_message, b12);
+}
+
+static bfd_reloc_status_type
+coff_thumb_pcrel_9 (abfd, reloc_entry, symbol, data, input_section,
+ output_bfd, error_message)
+ bfd *abfd;
+ arelent *reloc_entry;
+ asymbol *symbol;
+ PTR data;
+ asection *input_section;
+ bfd *output_bfd;
+ char **error_message;
+{
+ return coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data,
+ input_section, output_bfd, error_message, b9);
+}
+
+
+static CONST struct reloc_howto_struct *
+coff_arm_reloc_type_lookup (abfd, code)
+ bfd * abfd;
+ bfd_reloc_code_real_type code;
+{
+#define ASTD(i,j) case i: return aoutarm_std_reloc_howto + j
+
+ if (code == BFD_RELOC_CTOR)
+ switch (bfd_get_arch_info (abfd)->bits_per_address)
+ {
+ case 32:
+ code = BFD_RELOC_32;
+ break;
+ default: return (CONST struct reloc_howto_struct *) 0;
+ }
+
+ switch (code)
+ {
+#ifdef ARM_WINCE
+ ASTD (BFD_RELOC_32, ARM_32);
+ ASTD (BFD_RELOC_RVA, ARM_RVA32);
+ ASTD (BFD_RELOC_ARM_PCREL_BRANCH, ARM_26);
+ ASTD (BFD_RELOC_THUMB_PCREL_BRANCH12, ARM_THUMB12);
+#else
+ ASTD (BFD_RELOC_8, ARM_8);
+ ASTD (BFD_RELOC_16, ARM_16);
+ ASTD (BFD_RELOC_32, ARM_32);
+ ASTD (BFD_RELOC_ARM_PCREL_BRANCH, ARM_26);
+ ASTD (BFD_RELOC_8_PCREL, ARM_DISP8);
+ ASTD (BFD_RELOC_16_PCREL, ARM_DISP16);
+ ASTD (BFD_RELOC_32_PCREL, ARM_DISP32);
+ ASTD (BFD_RELOC_RVA, ARM_RVA32);
+ ASTD (BFD_RELOC_THUMB_PCREL_BRANCH9, ARM_THUMB9);
+ ASTD (BFD_RELOC_THUMB_PCREL_BRANCH12, ARM_THUMB12);
+ ASTD (BFD_RELOC_THUMB_PCREL_BRANCH23, ARM_THUMB23);
+#endif
+ default: return (CONST struct reloc_howto_struct *) 0;
+ }
+}
+
+#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2)
+#define COFF_PAGE_SIZE 0x1000
+/* Turn a howto into a reloc nunmber */
+
+#define SELECT_RELOC(x,howto) { x.r_type = howto->type; }
+#define BADMAG(x) ARMBADMAG(x)
+#define ARM 1 /* Customize coffcode.h */
+
+/* Extend the coff_link_hash_table structure with a few ARM specific fields.
+ This allows us to store global data here without actually creating any
+ global variables, which is a no-no in the BFD world. */
+struct coff_arm_link_hash_table
+{
+ /* The original coff_link_hash_table structure. MUST be first field. */
+ struct coff_link_hash_table root;
+
+ /* The size in bytes of the section containg the Thumb-to-ARM glue. */
+ long int thumb_glue_size;
+
+ /* The size in bytes of the section containg the ARM-to-Thumb glue. */
+ long int arm_glue_size;
+
+ /* An arbitary input BFD chosen to hold the glue sections. */
+ bfd * bfd_of_glue_owner;
+
+ /* Support interworking with old, non-interworking aware ARM code. */
+ int support_old_code;
+};
+
+/* Get the ARM coff linker hash table from a link_info structure. */
+#define coff_arm_hash_table(info) \
+ ((struct coff_arm_link_hash_table *) ((info)->hash))
+
+/* Create an ARM coff linker hash table. */
+
+static struct bfd_link_hash_table *
+coff_arm_link_hash_table_create (abfd)
+ bfd * abfd;
+{
+ struct coff_arm_link_hash_table * ret;
+
+ ret = ((struct coff_arm_link_hash_table *)
+ bfd_alloc (abfd, sizeof (struct coff_arm_link_hash_table)));
+ if (ret == (struct coff_arm_link_hash_table *) NULL)
+ return NULL;
+
+ if (! _bfd_coff_link_hash_table_init
+ (& ret->root, abfd, _bfd_coff_link_hash_newfunc))
+ {
+ bfd_release (abfd, ret);
+ return (struct bfd_link_hash_table *) NULL;
+ }
+
+ ret->thumb_glue_size = 0;
+ ret->arm_glue_size = 0;
+ ret->bfd_of_glue_owner = NULL;
+
+ return & ret->root.root;
+}
+
+static void
+arm_emit_base_file_entry (info, output_bfd, input_section, reloc_offset)
+ struct bfd_link_info *info;
+ bfd *output_bfd;
+ asection *input_section;
+ bfd_vma reloc_offset;
+{
+ bfd_vma addr = reloc_offset
+ - input_section->vma
+ + input_section->output_offset
+ + input_section->output_section->vma;
+
+ if (coff_data(output_bfd)->pe)
+ addr -= pe_data(output_bfd)->pe_opthdr.ImageBase;
+ fwrite (&addr, 1, sizeof (addr), (FILE *) info->base_file);
+
+}
+
+/* The thumb form of a long branch is a bit finicky, because the offset
+ encoding is split over two fields, each in it's own instruction. They
+ can occur in any order. So given a thumb form of long branch, and an
+ offset, insert the offset into the thumb branch and return finished
+ instruction.
+
+ It takes two thumb instructions to encode the target address. Each has
+ 11 bits to invest. The upper 11 bits are stored in one (identifed by
+ H-0.. see below), the lower 11 bits are stored in the other (identified
+ by H-1).
+
+ Combine together and shifted left by 1 (it's a half word address) and
+ there you have it.
+
+ Op: 1111 = F,
+ H-0, upper address-0 = 000
+ Op: 1111 = F,
+ H-1, lower address-0 = 800
+
+ They can be ordered either way, but the arm tools I've seen always put
+ the lower one first. It probably doesn't matter. krk@cygnus.com
+
+ XXX: Actually the order does matter. The second instruction (H-1)
+ moves the computed address into the PC, so it must be the second one
+ in the sequence. The problem, however is that whilst little endian code
+ stores the instructions in HI then LOW order, big endian code does the
+ reverse. nickc@cygnus.com */
+
+#define LOW_HI_ORDER 0xF800F000
+#define HI_LOW_ORDER 0xF000F800
+
+static insn32
+insert_thumb_branch (br_insn, rel_off)
+ insn32 br_insn;
+ int rel_off;
+{
+ unsigned int low_bits;
+ unsigned int high_bits;
+
+
+ BFD_ASSERT((rel_off & 1) != 1);
+
+ rel_off >>= 1; /* half word aligned address */
+ low_bits = rel_off & 0x000007FF; /* the bottom 11 bits */
+ high_bits = (rel_off >> 11) & 0x000007FF; /* the top 11 bits */
+
+ if ((br_insn & LOW_HI_ORDER) == LOW_HI_ORDER)
+ br_insn = LOW_HI_ORDER | (low_bits << 16) | high_bits;
+ else if ((br_insn & HI_LOW_ORDER) == HI_LOW_ORDER)
+ br_insn = HI_LOW_ORDER | (high_bits << 16) | low_bits;
+ else
+ abort(); /* error - not a valid branch instruction form */
+
+ /* FIXME: abort is probably not the right call. krk@cygnus.com */
+
+ return br_insn;
+}
+
+
+static struct coff_link_hash_entry *
+find_thumb_glue (info, name, input_bfd)
+ struct bfd_link_info * info;
+ CONST char * name;
+ bfd * input_bfd;
+{
+ char * tmp_name;
+ struct coff_link_hash_entry * myh;
+
+ tmp_name = ((char *)
+ bfd_malloc (strlen (name) + strlen (THUMB2ARM_GLUE_ENTRY_NAME) + 1));
+
+ BFD_ASSERT (tmp_name);
+
+ sprintf (tmp_name, THUMB2ARM_GLUE_ENTRY_NAME, name);
+
+ myh = coff_link_hash_lookup
+ (coff_hash_table (info), tmp_name, false, false, true);
+
+ if (myh == NULL)
+ /* xgettext:c-format */
+ _bfd_error_handler (_("%s: unable to find THUMB glue '%s' for `%s'"),
+ bfd_get_filename (input_bfd), tmp_name, name);
+
+ free (tmp_name);
+
+ return myh;
+}
+
+static struct coff_link_hash_entry *
+find_arm_glue (info, name, input_bfd)
+ struct bfd_link_info * info;
+ CONST char * name;
+ bfd * input_bfd;
+{
+ char * tmp_name;
+ struct coff_link_hash_entry * myh;
+
+ tmp_name = ((char *)
+ bfd_malloc (strlen (name) + strlen (ARM2THUMB_GLUE_ENTRY_NAME) + 1));
+
+ BFD_ASSERT (tmp_name);
+
+ sprintf (tmp_name, ARM2THUMB_GLUE_ENTRY_NAME, name);
+
+ myh = coff_link_hash_lookup
+ (coff_hash_table (info), tmp_name, false, false, true);
+
+ if (myh == NULL)
+ /* xgettext:c-format */
+ _bfd_error_handler (_("%s: unable to find ARM glue '%s' for `%s'"),
+ bfd_get_filename (input_bfd), tmp_name, name);
+
+ free (tmp_name);
+
+ return myh;
+}
+
+/*
+ ARM->Thumb glue:
+
+ .arm
+ __func_from_arm:
+ ldr r12, __func_addr
+ bx r12
+ __func_addr:
+ .word func @ behave as if you saw a ARM_32 reloc
+*/
+
+#define ARM2THUMB_GLUE_SIZE 12
+static const insn32 a2t1_ldr_insn = 0xe59fc000;
+static const insn32 a2t2_bx_r12_insn = 0xe12fff1c;
+static const insn32 a2t3_func_addr_insn = 0x00000001;
+
+/*
+ Thumb->ARM: Thumb->(non-interworking aware) ARM
+
+ .thumb .thumb
+ .align 2 .align 2
+ __func_from_thumb: __func_from_thumb:
+ bx pc push {r6, lr}
+ nop ldr r6, __func_addr
+ .arm mov lr, pc
+ __func_change_to_arm: bx r6
+ b func .arm
+ __func_back_to_thumb:
+ ldmia r13! {r6, lr}
+ bx lr
+ __func_addr:
+ .word func
+*/
+
+#define THUMB2ARM_GLUE_SIZE (globals->support_old_code ? 20 : 8)
+static const insn16 t2a1_bx_pc_insn = 0x4778;
+static const insn16 t2a2_noop_insn = 0x46c0;
+static const insn32 t2a3_b_insn = 0xea000000;
+
+static const insn16 t2a1_push_insn = 0xb540;
+static const insn16 t2a2_ldr_insn = 0x4e03;
+static const insn16 t2a3_mov_insn = 0x46fe;
+static const insn16 t2a4_bx_insn = 0x4730;
+static const insn32 t2a5_pop_insn = 0xe8bd4040;
+static const insn32 t2a6_bx_insn = 0xe12fff1e;
+
+/* TODO:
+ We should really create new local (static) symbols in destination
+ object for each stub we create. We should also create local
+ (static) symbols within the stubs when switching between ARM and
+ Thumb code. This will ensure that the debugger and disassembler
+ can present a better view of stubs.
+
+ We can treat stubs like literal sections, and for the THUMB9 ones
+ (short addressing range) we should be able to insert the stubs
+ between sections. i.e. the simplest approach (since relocations
+ are done on a section basis) is to dump the stubs at the end of
+ processing a section. That way we can always try and minimise the
+ offset to and from a stub. However, this does not map well onto
+ the way that the linker/BFD does its work: mapping all input
+ sections to output sections via the linker script before doing
+ all the processing.
+
+ Unfortunately it may be easier to just to disallow short range
+ Thumb->ARM stubs (i.e. no conditional inter-working branches,
+ only branch-and-link (BL) calls. This will simplify the processing
+ since we can then put all of the stubs into their own section.
+
+ TODO:
+ On a different subject, rather than complaining when a
+ branch cannot fit in the number of bits available for the
+ instruction we should generate a trampoline stub (needed to
+ address the complete 32bit address space). */
+
+/* The standard COFF backend linker does not cope with the special
+ Thumb BRANCH23 relocation. The alternative would be to split the
+ BRANCH23 into seperate HI23 and LO23 relocations. However, it is a
+ bit simpler simply providing our own relocation driver. */
+
+/* The reloc processing routine for the ARM/Thumb COFF linker. NOTE:
+ This code is a very slightly modified copy of
+ _bfd_coff_generic_relocate_section. It would be a much more
+ maintainable solution to have a MACRO that could be expanded within
+ _bfd_coff_generic_relocate_section that would only be provided for
+ ARM/Thumb builds. It is only the code marked THUMBEXTENSION that
+ is different from the original. */
+
+static boolean
+coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
+ contents, relocs, syms, sections)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+ bfd *input_bfd;
+ asection *input_section;
+ bfd_byte *contents;
+ struct internal_reloc *relocs;
+ struct internal_syment *syms;
+ asection **sections;
+{
+ struct internal_reloc * rel;
+ struct internal_reloc * relend;
+
+ rel = relocs;
+ relend = rel + input_section->reloc_count;
+
+ for (; rel < relend; rel++)
+ {
+ int done = 0;
+ long symndx;
+ struct coff_link_hash_entry * h;
+ struct internal_syment * sym;
+ bfd_vma addend;
+ bfd_vma val;
+ reloc_howto_type * howto;
+ bfd_reloc_status_type rstat;
+ bfd_vma h_val;
+
+ symndx = rel->r_symndx;
+
+ if (symndx == -1)
+ {
+ h = NULL;
+ sym = NULL;
+ }
+ else
+ {
+ h = obj_coff_sym_hashes (input_bfd)[symndx];
+ sym = syms + symndx;
+ }
+
+ /* COFF treats common symbols in one of two ways. Either the
+ size of the symbol is included in the section contents, or it
+ is not. We assume that the size is not included, and force
+ the rtype_to_howto function to adjust the addend as needed. */
+
+ if (sym != NULL && sym->n_scnum != 0)
+ addend = - sym->n_value;
+ else
+ addend = 0;
+
+
+ howto = coff_rtype_to_howto (input_bfd, input_section, rel, h,
+ sym, &addend);
+ if (howto == NULL)
+ return false;
+
+ /* The relocation_section function will skip pcrel_offset relocs
+ when doing a relocateable link. However, we want to convert
+ ARM26 to ARM26D relocs if possible. We return a fake howto in
+ this case without pcrel_offset set, and adjust the addend to
+ compensate. */
+ if (rel->r_type == ARM_26
+ && h != NULL
+ && info->relocateable
+ && (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ && h->root.u.def.section->output_section == input_section->output_section)
+ {
+ static reloc_howto_type fake_arm26_reloc =
+ HOWTO (ARM_26,
+ 2,
+ 2,
+ 24,
+ true,
+ 0,
+ complain_overflow_signed,
+ aoutarm_fix_pcrel_26 ,
+ "ARM_26",
+ false,
+ 0x00ffffff,
+ 0x00ffffff,
+ false);
+
+ addend -= rel->r_vaddr - input_section->vma;
+ howto = &fake_arm26_reloc;
+ }
+
+#ifdef ARM_WINCE
+ /* MS ARM-CE makes the reloc relative to the opcode's pc, not
+ the next opcode's pc, so is off by one. */
+ if (howto->pc_relative && !info->relocateable)
+ addend -= 8;
+#endif
+
+ /* If we are doing a relocateable link, then we can just ignore
+ a PC relative reloc that is pcrel_offset. It will already
+ have the correct value. If this is not a relocateable link,
+ then we should ignore the symbol value. */
+ if (howto->pc_relative && howto->pcrel_offset)
+ {
+ if (info->relocateable)
+ continue;
+ if (sym != NULL && sym->n_scnum != 0)
+ addend += sym->n_value;
+ }
+
+ val = 0;
+
+ if (h == NULL)
+ {
+ asection *sec;
+
+ if (symndx == -1)
+ {
+ sec = bfd_abs_section_ptr;
+ val = 0;
+ }
+ else
+ {
+ sec = sections[symndx];
+ val = (sec->output_section->vma
+ + sec->output_offset
+ + sym->n_value
+ - sec->vma);
+ }
+ }
+ else
+ {
+#if 1 /* THUMBEXTENSION */
+ /* We don't output the stubs if we are generating a
+ relocatable output file, since we may as well leave the
+ stub generation to the final linker pass. If we fail to
+ verify that the name is defined, we'll try to build stubs
+ for an undefined name... */
+ if (! info->relocateable
+ && ( h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak))
+ {
+ asection * h_sec = h->root.u.def.section;
+ const char * name = h->root.root.string;
+
+ /* h locates the symbol referenced in the reloc. */
+ h_val = (h->root.u.def.value
+ + h_sec->output_section->vma
+ + h_sec->output_offset);
+
+ if (howto->type == ARM_26)
+ {
+ if ( h->class == C_THUMBSTATFUNC
+ || h->class == C_THUMBEXTFUNC)
+ {
+ /* Arm code calling a Thumb function */
+ unsigned long int tmp;
+ long int my_offset;
+ asection * s;
+ long int ret_offset;
+ struct coff_link_hash_entry * myh;
+ struct coff_arm_link_hash_table * globals;
+
+ myh = find_arm_glue (info, name, input_bfd);
+ if (myh == NULL)
+ return false;
+
+ globals = coff_arm_hash_table (info);
+
+ BFD_ASSERT (globals != NULL);
+ BFD_ASSERT (globals->bfd_of_glue_owner != NULL);
+
+ my_offset = myh->root.u.def.value;
+
+ s = bfd_get_section_by_name (globals->bfd_of_glue_owner,
+ ARM2THUMB_GLUE_SECTION_NAME);
+ BFD_ASSERT (s != NULL);
+ BFD_ASSERT (s->contents != NULL);
+ BFD_ASSERT (s->output_section != NULL);
+
+ if ((my_offset & 0x01) == 0x01)
+ {
+ if (h_sec->owner != NULL
+ && INTERWORK_SET (h_sec->owner)
+ && ! INTERWORK_FLAG (h_sec->owner))
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%s(%s): warning: interworking not enabled."),
+ bfd_get_filename (h_sec->owner), name);
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_(" first occurrence: %s: arm call to thumb"),
+ bfd_get_filename (input_bfd));
+ }
+
+ --my_offset;
+ myh->root.u.def.value = my_offset;
+
+ bfd_put_32 (output_bfd, a2t1_ldr_insn,
+ s->contents + my_offset);
+
+ bfd_put_32 (output_bfd, a2t2_bx_r12_insn,
+ s->contents + my_offset + 4);
+
+ /* It's a thumb address. Add the low order bit. */
+ bfd_put_32 (output_bfd, h_val | a2t3_func_addr_insn,
+ s->contents + my_offset + 8);
+
+ if (info->base_file)
+ arm_emit_base_file_entry (info, output_bfd, s,
+ my_offset + 8);
+
+ }
+
+ BFD_ASSERT (my_offset <= globals->arm_glue_size);
+
+ tmp = bfd_get_32 (input_bfd, contents + rel->r_vaddr
+ - input_section->vma);
+
+ tmp = tmp & 0xFF000000;
+
+ /* Somehow these are both 4 too far, so subtract 8. */
+ ret_offset =
+ s->output_offset
+ + my_offset
+ + s->output_section->vma
+ - (input_section->output_offset
+ + input_section->output_section->vma
+ + rel->r_vaddr)
+ - 8;
+
+ tmp = tmp | ((ret_offset >> 2) & 0x00FFFFFF);
+
+ bfd_put_32 (output_bfd, tmp, contents + rel->r_vaddr
+ - input_section->vma);
+ done = 1;
+ }
+ }
+
+#ifndef ARM_WINCE
+ /* Note: We used to check for ARM_THUMB9 and ARM_THUMB12 */
+ else if (howto->type == ARM_THUMB23)
+ {
+ if ( h->class == C_EXT
+ || h->class == C_STAT
+ || h->class == C_LABEL)
+ {
+ /* Thumb code calling an ARM function */
+ asection * s = 0;
+ long int my_offset;
+ unsigned long int tmp;
+ long int ret_offset;
+ struct coff_link_hash_entry * myh;
+ struct coff_arm_link_hash_table * globals;
+
+ myh = find_thumb_glue (info, name, input_bfd);
+ if (myh == NULL)
+ return false;
+
+ globals = coff_arm_hash_table (info);
+
+ BFD_ASSERT (globals != NULL);
+ BFD_ASSERT (globals->bfd_of_glue_owner != NULL);
+
+ my_offset = myh->root.u.def.value;
+
+ s = bfd_get_section_by_name (globals->bfd_of_glue_owner,
+ THUMB2ARM_GLUE_SECTION_NAME);
+
+ BFD_ASSERT (s != NULL);
+ BFD_ASSERT (s->contents != NULL);
+ BFD_ASSERT (s->output_section != NULL);
+
+ if ((my_offset & 0x01) == 0x01)
+ {
+ if (h_sec->owner != NULL
+ && INTERWORK_SET (h_sec->owner)
+ && ! INTERWORK_FLAG (h_sec->owner)
+ && ! globals->support_old_code)
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%s(%s): warning: interworking not enabled."),
+ bfd_get_filename (h_sec->owner), name);
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_(" first occurrence: %s: thumb call to arm"),
+ bfd_get_filename (input_bfd));
+ _bfd_error_handler
+ (_(" consider relinking with --support-old-code enabled"));
+ }
+
+ -- my_offset;
+ myh->root.u.def.value = my_offset;
+
+ if (globals->support_old_code)
+ {
+ bfd_put_16 (output_bfd, t2a1_push_insn,
+ s->contents + my_offset);
+
+ bfd_put_16 (output_bfd, t2a2_ldr_insn,
+ s->contents + my_offset + 2);
+
+ bfd_put_16 (output_bfd, t2a3_mov_insn,
+ s->contents + my_offset + 4);
+
+ bfd_put_16 (output_bfd, t2a4_bx_insn,
+ s->contents + my_offset + 6);
+
+ bfd_put_32 (output_bfd, t2a5_pop_insn,
+ s->contents + my_offset + 8);
+
+ bfd_put_32 (output_bfd, t2a6_bx_insn,
+ s->contents + my_offset + 12);
+
+ /* Store the address of the function in the last word of the stub. */
+ bfd_put_32 (output_bfd, h_val,
+ s->contents + my_offset + 16);
+
+ if (info->base_file)
+ arm_emit_base_file_entry (info, output_bfd, s, my_offset + 16);
+ }
+ else
+ {
+ bfd_put_16 (output_bfd, t2a1_bx_pc_insn,
+ s->contents + my_offset);
+
+ bfd_put_16 (output_bfd, t2a2_noop_insn,
+ s->contents + my_offset + 2);
+
+ ret_offset =
+ ((bfd_signed_vma) h_val) /* Address of destination of the stub */
+ - ((bfd_signed_vma)
+ (s->output_offset /* Offset from the start of the current section to the start of the stubs. */
+ + my_offset /* Offset of the start of this stub from the start of the stubs. */
+ + s->output_section->vma) /* Address of the start of the current section. */
+ + 4 /* The branch instruction is 4 bytes into the stub. */
+ + 8); /* ARM branches work from the pc of the instruction + 8. */
+
+ bfd_put_32 (output_bfd,
+ t2a3_b_insn | ((ret_offset >> 2) & 0x00FFFFFF),
+ s->contents + my_offset + 4);
+
+ }
+ }
+
+ BFD_ASSERT (my_offset <= globals->thumb_glue_size);
+
+ /* Now go back and fix up the original BL insn to point
+ to here. */
+ ret_offset =
+ s->output_offset
+ + my_offset
+ - (input_section->output_offset
+ + rel->r_vaddr)
+ -4;
+
+ tmp = bfd_get_32 (input_bfd, contents + rel->r_vaddr
+ - input_section->vma);
+
+ bfd_put_32 (output_bfd,
+ insert_thumb_branch (tmp, ret_offset),
+ contents + rel->r_vaddr
+ - input_section->vma);
+
+ done = 1;
+ }
+ }
+#endif
+ }
+
+ /* If the relocation type and destination symbol does not
+ fall into one of the above categories, then we can just
+ perform a direct link. */
+
+ if (done)
+ rstat = bfd_reloc_ok;
+ else
+#endif /* THUMBEXTENSION */
+ if ( h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ {
+ asection *sec;
+
+ sec = h->root.u.def.section;
+ val = (h->root.u.def.value
+ + sec->output_section->vma
+ + sec->output_offset);
+ }
+
+ else if (! info->relocateable)
+ {
+ if (! ((*info->callbacks->undefined_symbol)
+ (info, h->root.root.string, input_bfd, input_section,
+ rel->r_vaddr - input_section->vma, true)))
+ return false;
+ }
+ }
+
+ if (info->base_file)
+ {
+ /* Emit a reloc if the backend thinks it needs it. */
+ if (sym && pe_data(output_bfd)->in_reloc_p(output_bfd, howto))
+ arm_emit_base_file_entry (info, output_bfd, input_section, rel->r_vaddr);
+ }
+
+#if 1 /* THUMBEXTENSION */
+ if (done)
+ rstat = bfd_reloc_ok;
+#ifndef ARM_WINCE
+ /* Only perform this fix during the final link, not a relocatable link. nickc@cygnus.com */
+ else if (! info->relocateable
+ && howto->type == ARM_THUMB23)
+ {
+ /* This is pretty much a copy of what the default
+ _bfd_final_link_relocate and _bfd_relocate_contents
+ routines do to perform a relocation, with special
+ processing for the split addressing of the Thumb BL
+ instruction. Again, it would probably be simpler adding a
+ ThumbBRANCH23 specific macro expansion into the default
+ code. */
+
+ bfd_vma address = rel->r_vaddr - input_section->vma;
+
+ if (address > input_section->_raw_size)
+ rstat = bfd_reloc_outofrange;
+ else
+ {
+ bfd_vma relocation = val + addend;
+ int size = bfd_get_reloc_size (howto);
+ boolean overflow = false;
+ bfd_byte * location = contents + address;
+ bfd_vma x = bfd_get_32 (input_bfd, location);
+ bfd_vma src_mask = 0x007FFFFE;
+ bfd_signed_vma reloc_signed_max = (1 << (howto->bitsize - 1)) - 1;
+ bfd_signed_vma reloc_signed_min = ~reloc_signed_max;
+ bfd_vma check;
+ bfd_signed_vma signed_check;
+ bfd_vma add;
+ bfd_signed_vma signed_add;
+
+ BFD_ASSERT (size == 4);
+
+ /* howto->pc_relative should be TRUE for type 14 BRANCH23 */
+ relocation -= (input_section->output_section->vma
+ + input_section->output_offset);
+
+ /* howto->pcrel_offset should be TRUE for type 14 BRANCH23 */
+ relocation -= address;
+
+ /* No need to negate the relocation with BRANCH23. */
+ /* howto->complain_on_overflow == complain_overflow_signed for BRANCH23. */
+ /* howto->rightshift == 1 */
+ /* Drop unwanted bits from the value we are relocating to. */
+
+ check = relocation >> howto->rightshift;
+
+ /* If this is a signed value, the rightshift just dropped
+ leading 1 bits (assuming twos complement). */
+ if ((bfd_signed_vma) relocation >= 0)
+ signed_check = check;
+ else
+ signed_check = (check
+ | ((bfd_vma) - 1
+ & ~((bfd_vma) - 1 >> howto->rightshift)));
+
+ /* Get the value from the object file. */
+ if (bfd_big_endian (input_bfd))
+ {
+ add = (((x) & 0x07ff0000) >> 4) | (((x) & 0x7ff) << 1);
+ }
+ else
+ {
+ add = ((((x) & 0x7ff) << 12) | (((x) & 0x07ff0000) >> 15));
+ }
+
+ /* Get the value from the object file with an appropriate sign.
+ The expression involving howto->src_mask isolates the upper
+ bit of src_mask. If that bit is set in the value we are
+ adding, it is negative, and we subtract out that number times
+ two. If src_mask includes the highest possible bit, then we
+ can not get the upper bit, but that does not matter since
+ signed_add needs no adjustment to become negative in that
+ case. */
+
+ signed_add = add;
+
+ if ((add & (((~ src_mask) >> 1) & src_mask)) != 0)
+ signed_add -= (((~ src_mask) >> 1) & src_mask) << 1;
+
+ /* Add the value from the object file, shifted so that it is a
+ straight number. */
+ /* howto->bitpos == 0 */
+
+ signed_check += signed_add;
+ relocation += signed_add;
+
+ BFD_ASSERT (howto->complain_on_overflow == complain_overflow_signed);
+
+ /* Assumes two's complement. */
+ if ( signed_check > reloc_signed_max
+ || signed_check < reloc_signed_min)
+ overflow = true;
+
+ /* Put RELOCATION into the correct bits: */
+
+ if (bfd_big_endian (input_bfd))
+ {
+ relocation = (((relocation & 0xffe) >> 1) | ((relocation << 4) & 0x07ff0000));
+ }
+ else
+ {
+ relocation = (((relocation & 0xffe) << 15) | ((relocation >> 12) & 0x7ff));
+ }
+
+ /* Add RELOCATION to the correct bits of X: */
+ x = ((x & ~howto->dst_mask) | relocation);
+
+ /* Put the relocated value back in the object file: */
+ bfd_put_32 (input_bfd, x, location);
+
+ rstat = overflow ? bfd_reloc_overflow : bfd_reloc_ok;
+ }
+ }
+#endif
+ else
+#endif /* THUMBEXTENSION */
+ rstat = _bfd_final_link_relocate (howto, input_bfd, input_section,
+ contents,
+ rel->r_vaddr - input_section->vma,
+ val, addend);
+#if 1 /* THUMBEXTENSION */
+ /* FIXME:
+ Is this the best way to fix up thumb addresses? krk@cygnus.com
+ Probably not, but it works, and if it works it don't need fixing! nickc@cygnus.com */
+ /* Only perform this fix during the final link, not a relocatable link. nickc@cygnus.com */
+ if (! info->relocateable
+ && (rel->r_type == ARM_32 || rel->r_type == ARM_RVA32))
+ {
+ /* Determine if we need to set the bottom bit of a relocated address
+ because the address is the address of a Thumb code symbol. */
+
+ int patchit = false;
+
+ if (h != NULL
+ && ( h->class == C_THUMBSTATFUNC
+ || h->class == C_THUMBEXTFUNC))
+ {
+ patchit = true;
+ }
+ else if (sym != NULL
+ && sym->n_scnum > N_UNDEF)
+ {
+ /* No hash entry - use the symbol instead. */
+
+ if ( sym->n_sclass == C_THUMBSTATFUNC
+ || sym->n_sclass == C_THUMBEXTFUNC)
+ patchit = true;
+ }
+
+ if (patchit)
+ {
+ bfd_byte * location = contents + rel->r_vaddr - input_section->vma;
+ bfd_vma x = bfd_get_32 (input_bfd, location);
+
+ bfd_put_32 (input_bfd, x | 1, location);
+ }
+ }
+#endif /* THUMBEXTENSION */
+
+ switch (rstat)
+ {
+ default:
+ abort ();
+ case bfd_reloc_ok:
+ break;
+ case bfd_reloc_outofrange:
+ (*_bfd_error_handler)
+ (_("%s: bad reloc address 0x%lx in section `%s'"),
+ bfd_get_filename (input_bfd),
+ (unsigned long) rel->r_vaddr,
+ bfd_get_section_name (input_bfd, input_section));
+ return false;
+ case bfd_reloc_overflow:
+ {
+ const char *name;
+ char buf[SYMNMLEN + 1];
+
+ if (symndx == -1)
+ name = "*ABS*";
+ else if (h != NULL)
+ name = h->root.root.string;
+ else
+ {
+ name = _bfd_coff_internal_syment_name (input_bfd, sym, buf);
+ if (name == NULL)
+ return false;
+ }
+
+ if (! ((*info->callbacks->reloc_overflow)
+ (info, name, howto->name, (bfd_vma) 0, input_bfd,
+ input_section, rel->r_vaddr - input_section->vma)))
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+#ifndef COFF_IMAGE_WITH_PE
+
+boolean
+bfd_arm_allocate_interworking_sections (info)
+ struct bfd_link_info * info;
+{
+ asection * s;
+ bfd_byte * foo;
+ struct coff_arm_link_hash_table * globals;
+#if 0
+ static char test_char = '1';
+#endif
+
+ globals = coff_arm_hash_table (info);
+
+ BFD_ASSERT (globals != NULL);
+
+ if (globals->arm_glue_size != 0)
+ {
+ BFD_ASSERT (globals->bfd_of_glue_owner != NULL);
+
+ s = bfd_get_section_by_name
+ (globals->bfd_of_glue_owner, ARM2THUMB_GLUE_SECTION_NAME);
+
+ BFD_ASSERT (s != NULL);
+
+ foo = (bfd_byte *) bfd_alloc
+ (globals->bfd_of_glue_owner, globals->arm_glue_size);
+#if 0
+ memset (foo, test_char, globals->arm_glue_size);
+#endif
+
+ s->_raw_size = s->_cooked_size = globals->arm_glue_size;
+ s->contents = foo;
+ }
+
+ if (globals->thumb_glue_size != 0)
+ {
+ BFD_ASSERT (globals->bfd_of_glue_owner != NULL);
+
+ s = bfd_get_section_by_name
+ (globals->bfd_of_glue_owner, THUMB2ARM_GLUE_SECTION_NAME);
+
+ BFD_ASSERT (s != NULL);
+
+ foo = (bfd_byte *) bfd_alloc
+ (globals->bfd_of_glue_owner, globals->thumb_glue_size);
+#if 0
+ memset (foo, test_char, globals->thumb_glue_size);
+#endif
+
+ s->_raw_size = s->_cooked_size = globals->thumb_glue_size;
+ s->contents = foo;
+ }
+
+ return true;
+}
+
+static void
+record_arm_to_thumb_glue (info, h)
+ struct bfd_link_info * info;
+ struct coff_link_hash_entry * h;
+{
+ const char * name = h->root.root.string;
+ register asection * s;
+ char * tmp_name;
+ struct coff_link_hash_entry * myh;
+ struct coff_arm_link_hash_table * globals;
+
+ globals = coff_arm_hash_table (info);
+
+ BFD_ASSERT (globals != NULL);
+ BFD_ASSERT (globals->bfd_of_glue_owner != NULL);
+
+ s = bfd_get_section_by_name
+ (globals->bfd_of_glue_owner, ARM2THUMB_GLUE_SECTION_NAME);
+
+ BFD_ASSERT (s != NULL);
+
+ tmp_name = ((char *)
+ bfd_malloc (strlen (name) + strlen (ARM2THUMB_GLUE_ENTRY_NAME) + 1));
+
+ BFD_ASSERT (tmp_name);
+
+ sprintf (tmp_name, ARM2THUMB_GLUE_ENTRY_NAME, name);
+
+ myh = coff_link_hash_lookup
+ (coff_hash_table (info), tmp_name, false, false, true);
+
+ if (myh != NULL)
+ {
+ free (tmp_name);
+ return; /* we've already seen this guy */
+ }
+
+ /* The only trick here is using globals->arm_glue_size as the value. Even
+ though the section isn't allocated yet, this is where we will be putting
+ it. */
+
+ bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name,
+ BSF_GLOBAL,
+ s, globals->arm_glue_size + 1,
+ NULL, true, false,
+ (struct bfd_link_hash_entry **) & myh);
+
+ free (tmp_name);
+
+ globals->arm_glue_size += ARM2THUMB_GLUE_SIZE;
+
+ return;
+}
+
+static void
+record_thumb_to_arm_glue (info, h)
+ struct bfd_link_info * info;
+ struct coff_link_hash_entry * h;
+{
+ const char * name = h->root.root.string;
+ register asection * s;
+ char * tmp_name;
+ struct coff_link_hash_entry * myh;
+ struct coff_arm_link_hash_table * globals;
+
+
+ globals = coff_arm_hash_table (info);
+
+ BFD_ASSERT (globals != NULL);
+ BFD_ASSERT (globals->bfd_of_glue_owner != NULL);
+
+ s = bfd_get_section_by_name
+ (globals->bfd_of_glue_owner, THUMB2ARM_GLUE_SECTION_NAME);
+
+ BFD_ASSERT (s != NULL);
+
+ tmp_name = (char *) bfd_malloc (strlen (name) + strlen (THUMB2ARM_GLUE_ENTRY_NAME) + 1);
+
+ BFD_ASSERT (tmp_name);
+
+ sprintf (tmp_name, THUMB2ARM_GLUE_ENTRY_NAME, name);
+
+ myh = coff_link_hash_lookup
+ (coff_hash_table (info), tmp_name, false, false, true);
+
+ if (myh != NULL)
+ {
+ free (tmp_name);
+ return; /* we've already seen this guy */
+ }
+
+ bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name,
+ BSF_GLOBAL, s, globals->thumb_glue_size + 1,
+ NULL, true, false,
+ (struct bfd_link_hash_entry **) & myh);
+
+ /* If we mark it 'thumb', the disassembler will do a better job. */
+ myh->class = C_THUMBEXTFUNC;
+
+ free (tmp_name);
+
+ /* Allocate another symbol to mark where we switch to arm mode. */
+
+#define CHANGE_TO_ARM "__%s_change_to_arm"
+#define BACK_FROM_ARM "__%s_back_from_arm"
+
+ tmp_name = (char *) bfd_malloc (strlen (name) + strlen (CHANGE_TO_ARM) + 1);
+
+ BFD_ASSERT (tmp_name);
+
+ sprintf (tmp_name, globals->support_old_code ? BACK_FROM_ARM : CHANGE_TO_ARM, name);
+
+ myh = NULL;
+
+ bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name,
+ BSF_LOCAL, s, globals->thumb_glue_size
+ + (globals->support_old_code ? 8 : 4),
+ NULL, true, false,
+ (struct bfd_link_hash_entry **) & myh);
+
+ free (tmp_name);
+
+ globals->thumb_glue_size += THUMB2ARM_GLUE_SIZE;
+
+ return;
+}
+
+/* Select a BFD to be used to hold the sections used by the glue code.
+ This function is called from the linker scripts in ld/emultempl/
+ {armcoff/pe}.em */
+
+boolean
+bfd_arm_get_bfd_for_interworking (abfd, info)
+ bfd * abfd;
+ struct bfd_link_info * info;
+{
+ struct coff_arm_link_hash_table * globals;
+ flagword flags;
+ asection * sec;
+
+ /* If we are only performing a partial link do not bother
+ getting a bfd to hold the glue. */
+ if (info->relocateable)
+ return true;
+
+ globals = coff_arm_hash_table (info);
+
+ BFD_ASSERT (globals != NULL);
+
+ if (globals->bfd_of_glue_owner != NULL)
+ return true;
+
+ sec = bfd_get_section_by_name (abfd, ARM2THUMB_GLUE_SECTION_NAME);
+
+ if (sec == NULL)
+ {
+ flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE | SEC_READONLY;
+
+ sec = bfd_make_section (abfd, ARM2THUMB_GLUE_SECTION_NAME);
+
+ if (sec == NULL
+ || ! bfd_set_section_flags (abfd, sec, flags)
+ || ! bfd_set_section_alignment (abfd, sec, 2))
+ return false;
+ }
+
+ sec = bfd_get_section_by_name (abfd, THUMB2ARM_GLUE_SECTION_NAME);
+
+ if (sec == NULL)
+ {
+ flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE | SEC_READONLY;
+
+ sec = bfd_make_section (abfd, THUMB2ARM_GLUE_SECTION_NAME);
+
+ if (sec == NULL
+ || ! bfd_set_section_flags (abfd, sec, flags)
+ || ! bfd_set_section_alignment (abfd, sec, 2))
+ return false;
+ }
+
+ /* Save the bfd for later use. */
+ globals->bfd_of_glue_owner = abfd;
+
+ return true;
+}
+
+boolean
+bfd_arm_process_before_allocation (abfd, info, support_old_code)
+ bfd * abfd;
+ struct bfd_link_info * info;
+ int support_old_code;
+{
+ asection * sec;
+ struct coff_arm_link_hash_table * globals;
+
+ /* If we are only performing a partial link do not bother
+ to construct any glue. */
+ if (info->relocateable)
+ return true;
+
+ /* Here we have a bfd that is to be included on the link. We have a hook
+ to do reloc rummaging, before section sizes are nailed down. */
+
+ _bfd_coff_get_external_symbols (abfd);
+
+ globals = coff_arm_hash_table (info);
+
+ BFD_ASSERT (globals != NULL);
+ BFD_ASSERT (globals->bfd_of_glue_owner != NULL);
+
+ globals->support_old_code = support_old_code;
+
+ /* Rummage around all the relocs and map the glue vectors. */
+ sec = abfd->sections;
+
+ if (sec == NULL)
+ return true;
+
+ for (; sec != NULL; sec = sec->next)
+ {
+ struct internal_reloc * i;
+ struct internal_reloc * rel;
+
+ if (sec->reloc_count == 0)
+ continue;
+
+ /* Load the relocs. */
+ /* FIXME: there may be a storage leak here. */
+
+ i = _bfd_coff_read_internal_relocs (abfd, sec, 1, 0, 0, 0);
+
+ BFD_ASSERT (i != 0);
+
+ for (rel = i; rel < i + sec->reloc_count; ++rel)
+ {
+ unsigned short r_type = rel->r_type;
+ long symndx;
+ struct coff_link_hash_entry * h;
+
+ symndx = rel->r_symndx;
+
+ /* If the relocation is not against a symbol it cannot concern us. */
+ if (symndx == -1)
+ continue;
+
+ /* If the index is outside of the range of our table, something has gone wrong. */
+ if (symndx >= obj_conv_table_size (abfd))
+ {
+ _bfd_error_handler (_("%s: illegal symbol index in reloc: %d"),
+ bfd_get_filename (abfd), symndx);
+ continue;
+ }
+
+ h = obj_coff_sym_hashes (abfd)[symndx];
+
+ /* If the relocation is against a static symbol it must be within
+ the current section and so cannot be a cross ARM/Thumb relocation. */
+ if (h == NULL)
+ continue;
+
+ switch (r_type)
+ {
+ case ARM_26:
+ /* This one is a call from arm code. We need to look up
+ the target of the call. If it is a thumb target, we
+ insert glue. */
+
+ if (h->class == C_THUMBEXTFUNC)
+ record_arm_to_thumb_glue (info, h);
+ break;
+
+#ifndef ARM_WINCE
+ case ARM_THUMB23:
+ /* This one is a call from thumb code. We used to look
+ for ARM_THUMB9 and ARM_THUMB12 as well. We need to look
+ up the target of the call. If it is an arm target, we
+ insert glue. If the symbol does not exist it will be
+ given a class of C_EXT and so we will generate a stub
+ for it. This is not really a problem, since the link
+ is doomed anyway. */
+
+ switch (h->class)
+ {
+ case C_EXT:
+ case C_STAT:
+ case C_LABEL:
+ record_thumb_to_arm_glue (info, h);
+ break;
+ default:
+ ;
+ }
+ break;
+#endif
+
+ default:
+ break;
+ }
+ }
+ }
+
+ return true;
+}
+
+#endif /* ! defined (COFF_IMAGE_WITH_PE) */
+
+#define coff_bfd_reloc_type_lookup coff_arm_reloc_type_lookup
+#define coff_relocate_section coff_arm_relocate_section
+#define coff_bfd_is_local_label_name coff_arm_is_local_label_name
+#define coff_adjust_symndx coff_arm_adjust_symndx
+#define coff_link_output_has_begun coff_arm_link_output_has_begun
+#define coff_final_link_postscript coff_arm_final_link_postscript
+#define coff_bfd_merge_private_bfd_data coff_arm_merge_private_bfd_data
+#define coff_bfd_print_private_bfd_data coff_arm_print_private_bfd_data
+#define coff_bfd_set_private_flags _bfd_coff_arm_set_private_flags
+#define coff_bfd_copy_private_bfd_data coff_arm_copy_private_bfd_data
+#define coff_bfd_link_hash_table_create coff_arm_link_hash_table_create
+
+
+/* When doing a relocateable link, we want to convert ARM26 relocs
+ into ARM26D relocs. */
+
+static boolean
+coff_arm_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp)
+ bfd *obfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ bfd *ibfd;
+ asection *sec;
+ struct internal_reloc *irel;
+ boolean *adjustedp;
+{
+ if (irel->r_type == 3)
+ {
+ struct coff_link_hash_entry *h;
+
+ h = obj_coff_sym_hashes (ibfd)[irel->r_symndx];
+ if (h != NULL
+ && (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ && h->root.u.def.section->output_section == sec->output_section)
+ irel->r_type = 7;
+ }
+ *adjustedp = false;
+ return true;
+}
+
+/* Called when merging the private data areas of two BFDs.
+ This is important as it allows us to detect if we are
+ attempting to merge binaries compiled for different ARM
+ targets, eg different CPUs or differents APCS's. */
+
+static boolean
+coff_arm_merge_private_bfd_data (ibfd, obfd)
+ bfd * ibfd;
+ bfd * obfd;
+{
+ BFD_ASSERT (ibfd != NULL && obfd != NULL);
+
+ if (ibfd == obfd)
+ return true;
+
+ /* If the two formats are different we cannot merge anything.
+ This is not an error, since it is permissable to change the
+ input and output formats. */
+ if ( ibfd->xvec->flavour != bfd_target_coff_flavour
+ || obfd->xvec->flavour != bfd_target_coff_flavour)
+ return true;
+
+ /* Verify that the APCS is the same for the two BFDs */
+ if (APCS_SET (ibfd))
+ {
+ if (APCS_SET (obfd))
+ {
+ /* If the src and dest have different APCS flag bits set, fail. */
+ if (APCS_26_FLAG (obfd) != APCS_26_FLAG (ibfd))
+ {
+ _bfd_error_handler
+ /* xgettext: c-format */
+ (_("%s: ERROR: compiled for APCS-%d whereas target %s uses APCS-%d"),
+ bfd_get_filename (ibfd), APCS_26_FLAG (ibfd) ? 26 : 32,
+ bfd_get_filename (obfd), APCS_26_FLAG (obfd) ? 26 : 32
+ );
+
+ bfd_set_error (bfd_error_wrong_format);
+ return false;
+ }
+
+ if (APCS_FLOAT_FLAG (obfd) != APCS_FLOAT_FLAG (ibfd))
+ {
+ const char *msg;
+
+ if (APCS_FLOAT_FLAG (ibfd))
+ /* xgettext: c-format */
+ msg = _("%s: ERROR: passes floats in float registers whereas target %s uses integer registers");
+ else
+ /* xgettext: c-format */
+ msg = _("%s: ERROR: passes floats in integer registers whereas target %s uses float registers");
+
+ _bfd_error_handler (msg, bfd_get_filename (ibfd),
+ bfd_get_filename (obfd));
+
+ bfd_set_error (bfd_error_wrong_format);
+ return false;
+ }
+
+ if (PIC_FLAG (obfd) != PIC_FLAG (ibfd))
+ {
+ const char * msg;
+
+ if (PIC_FLAG (ibfd))
+ /* xgettext: c-format */
+ msg = _("%s: ERROR: compiled as position independent code, whereas target %s is absolute position");
+ else
+ /* xgettext: c-format */
+ msg = _("%s: ERROR: compiled as absolute position code, whereas target %s is position independent");
+ _bfd_error_handler (msg, bfd_get_filename (ibfd),
+ bfd_get_filename (obfd));
+
+ bfd_set_error (bfd_error_wrong_format);
+ return false;
+ }
+ }
+ else
+ {
+ SET_APCS_FLAGS (obfd, APCS_26_FLAG (ibfd) | APCS_FLOAT_FLAG (ibfd) | PIC_FLAG (ibfd));
+
+ /* Set up the arch and fields as well as these are probably wrong. */
+ bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), bfd_get_mach (ibfd));
+ }
+ }
+
+ /* Check the interworking support. */
+ if (INTERWORK_SET (ibfd))
+ {
+ if (INTERWORK_SET (obfd))
+ {
+ /* If the src and dest differ in their interworking issue a warning. */
+ if (INTERWORK_FLAG (obfd) != INTERWORK_FLAG (ibfd))
+ {
+ const char * msg;
+
+ if (INTERWORK_FLAG (ibfd))
+ /* xgettext: c-format */
+ msg = _("Warning: input file %s supports interworking, whereas %s does not.");
+ else
+ /* xgettext: c-format */
+ msg = _("Warning: input file %s does not support interworking, whereas %s does.");
+
+ _bfd_error_handler (msg, bfd_get_filename (ibfd),
+ bfd_get_filename (obfd));
+ }
+ }
+ else
+ {
+ SET_INTERWORK_FLAG (obfd, INTERWORK_FLAG (ibfd));
+ }
+ }
+
+ return true;
+}
+
+
+/* Display the flags field. */
+
+static boolean
+coff_arm_print_private_bfd_data (abfd, ptr)
+ bfd * abfd;
+ PTR ptr;
+{
+ FILE * file = (FILE *) ptr;
+
+ BFD_ASSERT (abfd != NULL && ptr != NULL);
+
+ /* xgettext:c-format */
+ fprintf (file, _("private flags = %x:"), coff_data (abfd)->flags);
+
+ if (APCS_SET (abfd))
+ {
+ /* xgettext: APCS is ARM Prodecure Call Standard, it should not be translated. */
+ fprintf (file, " [APCS-%d]", APCS_26_FLAG (abfd) ? 26 : 32);
+
+ if (APCS_FLOAT_FLAG (abfd))
+ fprintf (file, _(" [floats passed in float registers]"));
+ else
+ fprintf (file, _(" [floats passed in integer registers]"));
+
+ if (PIC_FLAG (abfd))
+ fprintf (file, _(" [position independent]"));
+ else
+ fprintf (file, _(" [absolute position]"));
+ }
+
+ if (! INTERWORK_SET (abfd))
+ fprintf (file, _(" [interworking flag not initialised]"));
+ else if (INTERWORK_FLAG (abfd))
+ fprintf (file, _(" [interworking supported]"));
+ else
+ fprintf (file, _(" [interworking not supported]"));
+
+ fputc ('\n', file);
+
+ return true;
+}
+
+
+/* Copies the given flags into the coff_tdata.flags field.
+ Typically these flags come from the f_flags[] field of
+ the COFF filehdr structure, which contains important,
+ target specific information.
+ Note: Although this function is static, it is explicitly
+ called from both coffcode.h and peicode.h. */
+
+static boolean
+_bfd_coff_arm_set_private_flags (abfd, flags)
+ bfd * abfd;
+ flagword flags;
+{
+ flagword flag;
+
+ BFD_ASSERT (abfd != NULL);
+
+ flag = (flags & F_APCS26) ? F_APCS_26 : 0;
+
+ /* Make sure that the APCS field has not been initialised to the opposite
+ value. */
+ if (APCS_SET (abfd)
+ && ( (APCS_26_FLAG (abfd) != flag)
+ || (APCS_FLOAT_FLAG (abfd) != (flags & F_APCS_FLOAT))
+ || (PIC_FLAG (abfd) != (flags & F_PIC))
+ ))
+ return false;
+
+ flag |= (flags & (F_APCS_FLOAT | F_PIC));
+
+ SET_APCS_FLAGS (abfd, flag);
+
+ flag = (flags & F_INTERWORK);
+
+ /* If the BFD has already had its interworking flag set, but it
+ is different from the value that we have been asked to set,
+ then assume that that merged code will not support interworking
+ and set the flag accordingly. */
+ if (INTERWORK_SET (abfd) && (INTERWORK_FLAG (abfd) != flag))
+ {
+ if (flag)
+ /* xgettext: c-format */
+ _bfd_error_handler (_("Warning: Not setting interworking flag of %s, since it has already been specified as non-interworking"),
+ bfd_get_filename (abfd));
+ else
+ /* xgettext: c-format */
+ _bfd_error_handler (_("Warning: Clearing the interworking flag of %s due to outside request"),
+ bfd_get_filename (abfd));
+ flag = 0;
+ }
+
+ SET_INTERWORK_FLAG (abfd, flag);
+
+ return true;
+}
+
+
+/* Copy the important parts of the target specific data
+ from one instance of a BFD to another. */
+
+static boolean
+coff_arm_copy_private_bfd_data (src, dest)
+ bfd * src;
+ bfd * dest;
+{
+ BFD_ASSERT (src != NULL && dest != NULL);
+
+ if (src == dest)
+ return true;
+
+ /* If the destination is not in the same format as the source, do not do
+ the copy. */
+ if (src->xvec != dest->xvec)
+ return true;
+
+ /* copy the flags field */
+ if (APCS_SET (src))
+ {
+ if (APCS_SET (dest))
+ {
+ /* If the src and dest have different APCS flag bits set, fail. */
+ if (APCS_26_FLAG (dest) != APCS_26_FLAG (src))
+ return false;
+
+ if (APCS_FLOAT_FLAG (dest) != APCS_FLOAT_FLAG (src))
+ return false;
+
+ if (PIC_FLAG (dest) != PIC_FLAG (src))
+ return false;
+ }
+ else
+ SET_APCS_FLAGS (dest, APCS_26_FLAG (src) | APCS_FLOAT_FLAG (src)
+ | PIC_FLAG (src));
+ }
+
+ if (INTERWORK_SET (src))
+ {
+ if (INTERWORK_SET (dest))
+ {
+ /* If the src and dest have different interworking flags then turn
+ off the interworking bit. */
+ if (INTERWORK_FLAG (dest) != INTERWORK_FLAG (src))
+ {
+ if (INTERWORK_FLAG (dest))
+ {
+ /* xgettext:c-format */
+ _bfd_error_handler (("Warning: Clearing the interworking bit of %s, because the non-interworking code in %s has been copied into it"),
+ bfd_get_filename (dest),
+ bfd_get_filename (src));
+ }
+
+ SET_INTERWORK_FLAG (dest, 0);
+ }
+ }
+ else
+ {
+ SET_INTERWORK_FLAG (dest, INTERWORK_FLAG (src));
+ }
+ }
+
+ return true;
+}
+
+/* Note: the definitions here of LOCAL_LABEL_PREFIX and USER_LABEL_PREIFX
+ *must* match the definitions in gcc/config/arm/coff.h and semi.h */
+#define LOCAL_LABEL_PREFIX "."
+#ifndef USER_LABEL_PREFIX
+#define USER_LABEL_PREFIX "_"
+#endif
+
+/* Like _bfd_coff_is_local_label_name, but
+ a) test against USER_LABEL_PREFIX, to avoid stripping labels known to be
+ non-local.
+ b) Allow other prefixes than ".", e.g. an empty prefix would cause all
+ labels of the form Lxxx to be stripped. */
+static boolean
+coff_arm_is_local_label_name (abfd, name)
+ bfd * abfd ATTRIBUTE_UNUSED;
+ const char * name;
+{
+#ifdef USER_LABEL_PREFIX
+ if (USER_LABEL_PREFIX[0] != 0)
+ {
+ if (strncmp (name, USER_LABEL_PREFIX, strlen (USER_LABEL_PREFIX)) == 0)
+ return false;
+ }
+#endif
+
+#ifdef LOCAL_LABEL_PREFIX
+ /* If there is a prefix for local labels then look for this.
+ If the prefix exists, but it is empty, then ignore the test. */
+
+ if (LOCAL_LABEL_PREFIX[0] != 0)
+ {
+ int len = strlen (LOCAL_LABEL_PREFIX);
+
+ if (strncmp (name, LOCAL_LABEL_PREFIX, len) != 0)
+ return false;
+
+ /* Perform the checks below for the rest of the name. */
+ name += len;
+ }
+#endif
+
+ return name[0] == 'L';
+}
+
+/* This piece of machinery exists only to guarantee that the bfd that holds
+ the glue section is written last.
+
+ This does depend on bfd_make_section attaching a new section to the
+ end of the section list for the bfd.
+
+ krk@cygnus.com */
+
+static boolean
+coff_arm_link_output_has_begun (sub, info)
+ bfd * sub;
+ struct coff_final_link_info * info;
+{
+ return (sub->output_has_begun
+ || sub == coff_arm_hash_table (info->info)->bfd_of_glue_owner);
+}
+
+static boolean
+coff_arm_final_link_postscript (abfd, pfinfo)
+ bfd * abfd ATTRIBUTE_UNUSED;
+ struct coff_final_link_info * pfinfo;
+{
+ struct coff_arm_link_hash_table * globals;
+
+ globals = coff_arm_hash_table (pfinfo->info);
+
+ BFD_ASSERT (globals != NULL);
+
+ if (globals->bfd_of_glue_owner != NULL)
+ {
+ if (! _bfd_coff_link_input_bfd (pfinfo, globals->bfd_of_glue_owner))
+ return false;
+
+ globals->bfd_of_glue_owner->output_has_begun = true;
+ }
+
+ return true;
+}
+
+#include "coffcode.h"
+
+#ifndef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM armcoff_little_vec
+#endif
+#ifndef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME "coff-arm-little"
+#endif
+#ifndef TARGET_BIG_SYM
+#define TARGET_BIG_SYM armcoff_big_vec
+#endif
+#ifndef TARGET_BIG_NAME
+#define TARGET_BIG_NAME "coff-arm-big"
+#endif
+
+#ifndef TARGET_UNDERSCORE
+#define TARGET_UNDERSCORE 0
+#endif
+
+#ifdef COFF_WITH_PE
+#define EXTRA_S_FLAGS (SEC_LINK_ONCE | SEC_LINK_DUPLICATES)
+#else
+#define EXTRA_S_FLAGS 0
+#endif
+
+/* Forward declaration for use initialising alternative_target field. */
+extern const bfd_target TARGET_BIG_SYM ;
+
+/* Target vectors. */
+CREATE_LITTLE_COFF_TARGET_VEC (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, D_PAGED, EXTRA_S_FLAGS, TARGET_UNDERSCORE, & TARGET_BIG_SYM)
+CREATE_BIG_COFF_TARGET_VEC (TARGET_BIG_SYM, TARGET_BIG_NAME, D_PAGED, EXTRA_S_FLAGS, TARGET_UNDERSCORE, & TARGET_LITTLE_SYM)
+
diff --git a/contrib/binutils/bfd/coff-i386.c b/contrib/binutils/bfd/coff-i386.c
index 7898cc159ca8..84d4d145c7b6 100644
--- a/contrib/binutils/bfd/coff-i386.c
+++ b/contrib/binutils/bfd/coff-i386.c
@@ -1,5 +1,5 @@
/* BFD back-end for Intel 386 COFF files.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -37,13 +37,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "libcoff.h"
-static bfd_reloc_status_type coff_i386_reloc
+static bfd_reloc_status_type coff_i386_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static reloc_howto_type *coff_i386_rtype_to_howto
PARAMS ((bfd *, asection *, struct internal_reloc *,
struct coff_link_hash_entry *, struct internal_syment *,
-
bfd_vma *));
+static reloc_howto_type *coff_i386_reloc_type_lookup
+ PARAMS ((bfd *, bfd_reloc_code_real_type));
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2)
/* The page size is a guess based on ELF. */
@@ -66,9 +67,9 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
arelent *reloc_entry;
asymbol *symbol;
PTR data;
- asection *input_section;
+ asection *input_section ATTRIBUTE_UNUSED;
bfd *output_bfd;
- char **error_message;
+ char **error_message ATTRIBUTE_UNUSED;
{
symvalue diff;
@@ -106,8 +107,8 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
#ifdef COFF_WITH_PE
/* FIXME: How should this case be handled? */
- if (reloc_entry->howto->type == R_IMAGEBASE && diff != 0)
- abort ();
+ if (reloc_entry->howto->type == R_IMAGEBASE)
+ diff -= pe_data (output_bfd)->pe_opthdr.ImageBase;
#endif
#define DOIT(x) \
@@ -154,140 +155,150 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
}
#ifdef COFF_WITH_PE
-/* Return true if this relocation should
- appear in the output .reloc section. */
-static boolean in_reloc_p(abfd, howto)
- bfd * abfd;
+/* Return true if this relocation should appear in the output .reloc
+ section. */
+
+static boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *));
+
+static boolean in_reloc_p (abfd, howto)
+ bfd *abfd ATTRIBUTE_UNUSED;
reloc_howto_type *howto;
{
return ! howto->pc_relative && howto->type != R_IMAGEBASE;
-}
-#endif
+}
+
+#endif /* COFF_WITH_PE */
#ifndef PCRELOFFSET
#define PCRELOFFSET false
#endif
-static reloc_howto_type howto_table[] =
+static reloc_howto_type howto_table[] =
{
- {0},
- {1},
- {2},
- {3},
- {4},
- {5},
- HOWTO (R_DIR32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- false, /* pc_relative */
- 0, /* bitpos */
+ EMPTY_HOWTO (0),
+ EMPTY_HOWTO (1),
+ EMPTY_HOWTO (2),
+ EMPTY_HOWTO (3),
+ EMPTY_HOWTO (4),
+ EMPTY_HOWTO (5),
+ HOWTO (R_DIR32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- coff_i386_reloc, /* special_function */
- "dir32", /* name */
- true, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- true), /* pcrel_offset */
- /* {7}, */
- HOWTO (R_IMAGEBASE, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- false, /* pc_relative */
- 0, /* bitpos */
+ coff_i386_reloc, /* special_function */
+ "dir32", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ true), /* pcrel_offset */
+ /* PE IMAGE_REL_I386_DIR32NB relocation (7). */
+ HOWTO (R_IMAGEBASE, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- coff_i386_reloc, /* special_function */
- "rva32", /* name */
- true, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- false), /* pcrel_offset */
- {010},
- {011},
- {012},
- {013},
- {014},
- {015},
- {016},
- HOWTO (R_RELBYTE, /* type */
- 0, /* rightshift */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
- 8, /* bitsize */
- false, /* pc_relative */
- 0, /* bitpos */
+ coff_i386_reloc, /* special_function */
+ "rva32", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+ EMPTY_HOWTO (010),
+ EMPTY_HOWTO (011),
+ EMPTY_HOWTO (012),
+ EMPTY_HOWTO (013),
+ EMPTY_HOWTO (014),
+ EMPTY_HOWTO (015),
+ EMPTY_HOWTO (016),
+ /* Byte relocation (017). */
+ HOWTO (R_RELBYTE, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- coff_i386_reloc, /* special_function */
- "8", /* name */
- true, /* partial_inplace */
- 0x000000ff, /* src_mask */
- 0x000000ff, /* dst_mask */
+ coff_i386_reloc, /* special_function */
+ "8", /* name */
+ true, /* partial_inplace */
+ 0x000000ff, /* src_mask */
+ 0x000000ff, /* dst_mask */
PCRELOFFSET), /* pcrel_offset */
- HOWTO (R_RELWORD, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- false, /* pc_relative */
- 0, /* bitpos */
+ /* 16-bit word relocation (020). */
+ HOWTO (R_RELWORD, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- coff_i386_reloc, /* special_function */
- "16", /* name */
- true, /* partial_inplace */
- 0x0000ffff, /* src_mask */
- 0x0000ffff, /* dst_mask */
+ coff_i386_reloc, /* special_function */
+ "16", /* name */
+ true, /* partial_inplace */
+ 0x0000ffff, /* src_mask */
+ 0x0000ffff, /* dst_mask */
PCRELOFFSET), /* pcrel_offset */
- HOWTO (R_RELLONG, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- false, /* pc_relative */
- 0, /* bitpos */
+ /* 32-bit longword relocation (021). */
+ HOWTO (R_RELLONG, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- coff_i386_reloc, /* special_function */
- "32", /* name */
- true, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
+ coff_i386_reloc, /* special_function */
+ "32", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
PCRELOFFSET), /* pcrel_offset */
- HOWTO (R_PCRBYTE, /* type */
- 0, /* rightshift */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
- 8, /* bitsize */
- true, /* pc_relative */
- 0, /* bitpos */
+ /* Byte PC relative relocation (022). */
+ HOWTO (R_PCRBYTE, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
- coff_i386_reloc, /* special_function */
- "DISP8", /* name */
- true, /* partial_inplace */
- 0x000000ff, /* src_mask */
- 0x000000ff, /* dst_mask */
+ coff_i386_reloc, /* special_function */
+ "DISP8", /* name */
+ true, /* partial_inplace */
+ 0x000000ff, /* src_mask */
+ 0x000000ff, /* dst_mask */
PCRELOFFSET), /* pcrel_offset */
- HOWTO (R_PCRWORD, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- true, /* pc_relative */
- 0, /* bitpos */
+ /* 16-bit word PC relative relocation (023). */
+ HOWTO (R_PCRWORD, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
- coff_i386_reloc, /* special_function */
- "DISP16", /* name */
- true, /* partial_inplace */
- 0x0000ffff, /* src_mask */
- 0x0000ffff, /* dst_mask */
+ coff_i386_reloc, /* special_function */
+ "DISP16", /* name */
+ true, /* partial_inplace */
+ 0x0000ffff, /* src_mask */
+ 0x0000ffff, /* dst_mask */
PCRELOFFSET), /* pcrel_offset */
- HOWTO (R_PCRLONG, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- true, /* pc_relative */
- 0, /* bitpos */
+ /* 32-bit longword PC relative relocation (024). */
+ HOWTO (R_PCRLONG, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
- coff_i386_reloc, /* special_function */
- "DISP32", /* name */
- true, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
+ coff_i386_reloc, /* special_function */
+ "DISP32", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
PCRELOFFSET) /* pcrel_offset */
};
@@ -297,8 +308,11 @@ static reloc_howto_type howto_table[] =
#define BADMAG(x) I386BADMAG(x)
#define I386 1 /* Customize coffcode.h */
-#define RTYPE2HOWTO(cache_ptr, dst) \
- (cache_ptr)->howto = howto_table + (dst)->r_type;
+#define RTYPE2HOWTO(cache_ptr, dst) \
+ ((cache_ptr)->howto = \
+ ((dst)->r_type < sizeof (howto_table) / sizeof (howto_table[0]) \
+ ? howto_table + (dst)->r_type \
+ : NULL))
/* For 386 COFF a STYP_NOLOAD | STYP_BSS section is part of a shared
library. On some other COFF targets STYP_BSS is normally
@@ -385,19 +399,25 @@ coff_pe_i386_relocate_section (output_bfd, info, input_bfd,
static reloc_howto_type *
coff_i386_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
asection *sec;
struct internal_reloc *rel;
struct coff_link_hash_entry *h;
struct internal_syment *sym;
bfd_vma *addendp;
{
-
reloc_howto_type *howto;
+ if (rel->r_type > sizeof (howto_table) / sizeof (howto_table[0]))
+ {
+ bfd_set_error (bfd_error_bad_value);
+ return NULL;
+ }
+
howto = howto_table + rel->r_type;
#ifdef COFF_WITH_PE
+ /* Cancel out code in _bfd_coff_generic_relocate_section. */
*addendp = 0;
#endif
@@ -411,7 +431,7 @@ coff_i386_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
function will be adding in the final value of the symbol. We
need to subtract out the current size in order to get the
correct result. */
-
+
BFD_ASSERT (h != NULL);
#ifndef COFF_WITH_PE
@@ -430,7 +450,7 @@ coff_i386_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
/* If the output symbol is common (in which case this must be a
relocateable link), we need to add in the final size of the
common symbol. */
- if (h != NULL && h->root.type == bfd_link_hash_common)
+ if (h != NULL && h->root.type == bfd_link_hash_common)
*addendp += h->root.u.c.size;
#endif
@@ -458,23 +478,29 @@ coff_i386_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
return howto;
}
-
#define coff_bfd_reloc_type_lookup coff_i386_reloc_type_lookup
-
static reloc_howto_type *
coff_i386_reloc_type_lookup (abfd, code)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
bfd_reloc_code_real_type code;
{
switch (code)
{
case BFD_RELOC_RVA:
- return howto_table +R_IMAGEBASE;
+ return howto_table + R_IMAGEBASE;
case BFD_RELOC_32:
return howto_table + R_DIR32;
case BFD_RELOC_32_PCREL:
return howto_table + R_PCRLONG;
+ case BFD_RELOC_16:
+ return howto_table + R_RELWORD;
+ case BFD_RELOC_16_PCREL:
+ return howto_table + R_PCRWORD;
+ case BFD_RELOC_8:
+ return howto_table + R_RELBYTE;
+ case BFD_RELOC_8_PCREL:
+ return howto_table + R_PCRBYTE;
default:
BFD_FAIL ();
return 0;
@@ -508,69 +534,6 @@ coff_i386_is_local_label_name (abfd, name)
#include "coffcode.h"
-static const bfd_target *
-i3coff_object_p (abfd)
- bfd *abfd;
-{
-#ifdef COFF_IMAGE_WITH_PE
- /* We need to hack badly to handle a PE image correctly. In PE
- images created by the GNU linker, the offset to the COFF header
- is always the size. However, this is not the case in images
- generated by other PE linkers. The PE format stores a four byte
- offset to the PE signature just before the COFF header at
- location 0x3c of the file. We pick up that offset, verify that
- the PE signature is there, and then set ourselves up to read in
- the COFF header. */
- {
- bfd_byte ext_offset[4];
- file_ptr offset;
- bfd_byte ext_signature[4];
- unsigned long signature;
-
- if (bfd_seek (abfd, 0x3c, SEEK_SET) != 0
- || bfd_read (ext_offset, 1, 4, abfd) != 4)
- {
- if (bfd_get_error () != bfd_error_system_call)
- bfd_set_error (bfd_error_wrong_format);
- return NULL;
- }
- offset = bfd_h_get_32 (abfd, ext_offset);
- if (bfd_seek (abfd, offset, SEEK_SET) != 0
- || bfd_read (ext_signature, 1, 4, abfd) != 4)
- {
- if (bfd_get_error () != bfd_error_system_call)
- bfd_set_error (bfd_error_wrong_format);
- return NULL;
- }
- signature = bfd_h_get_32 (abfd, ext_signature);
-
- if (signature != 0x4550)
- {
- bfd_set_error (bfd_error_wrong_format);
- return NULL;
- }
-
- /* Here is the hack. coff_object_p wants to read filhsz bytes to
- pick up the COFF header. We adjust so that that will work. 20
- is the size of the i386 COFF filehdr. */
-
- if (bfd_seek (abfd,
- (bfd_tell (abfd)
- - bfd_coff_filhsz (abfd)
- + 20),
- SEEK_SET)
- != 0)
- {
- if (bfd_get_error () != bfd_error_system_call)
- bfd_set_error (bfd_error_wrong_format);
- return NULL;
- }
- }
-#endif
-
- return coff_object_p (abfd);
-}
-
const bfd_target
#ifdef TARGET_SYM
TARGET_SYM =
@@ -591,14 +554,11 @@ const bfd_target
HAS_LINENO | HAS_DEBUG |
HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
-#ifndef COFF_WITH_PE
- (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */
- | SEC_CODE | SEC_DATA),
-#else
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */
- | SEC_CODE | SEC_DATA
- | SEC_LINK_ONCE | SEC_LINK_DUPLICATES),
+#ifdef COFF_WITH_PE
+ | SEC_LINK_ONCE | SEC_LINK_DUPLICATES
#endif
+ | SEC_CODE | SEC_DATA),
#ifdef TARGET_UNDERSCORE
TARGET_UNDERSCORE, /* leading underscore */
@@ -616,8 +576,8 @@ const bfd_target
bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
/* Note that we allow an object file to be treated as a core file as well. */
- {_bfd_dummy_target, i3coff_object_p, /* bfd_check_format */
- bfd_generic_archive_p, i3coff_object_p},
+ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
+ bfd_generic_archive_p, coff_object_p},
{bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
bfd_false},
{bfd_false, coff_write_object_contents, /* bfd_write_contents */
@@ -633,5 +593,7 @@ const bfd_target
BFD_JUMP_TABLE_LINK (coff),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
- COFF_SWAP_TABLE,
+ NULL,
+
+ COFF_SWAP_TABLE
};
diff --git a/contrib/binutils/bfd/coff-mips.c b/contrib/binutils/bfd/coff-mips.c
index 23c38a167b2c..bb4b15e96c24 100644
--- a/contrib/binutils/bfd/coff-mips.c
+++ b/contrib/binutils/bfd/coff-mips.c
@@ -1,5 +1,5 @@
/* BFD back-end for MIPS Extended-Coff files.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Free Software Foundation, Inc.
Original version by Per Bothner.
Full support added by Ian Lance Taylor, ian@cygnus.com.
@@ -273,10 +273,10 @@ static reloc_howto_type mips_howto_table[] =
0xffff, /* dst_mask */
false), /* pcrel_offset */
- { 8 },
- { 9 },
- { 10 },
- { 11 },
+ EMPTY_HOWTO (8),
+ EMPTY_HOWTO (9),
+ EMPTY_HOWTO (10),
+ EMPTY_HOWTO (11),
/* This reloc is a Cygnus extension used when generating position
independent code for embedded systems. It represents a 16 bit PC
@@ -334,13 +334,13 @@ static reloc_howto_type mips_howto_table[] =
0xffff, /* dst_mask */
true), /* pcrel_offset */
- { 15 },
- { 16 },
- { 17 },
- { 18 },
- { 19 },
- { 20 },
- { 21 },
+ EMPTY_HOWTO (15),
+ EMPTY_HOWTO (16),
+ EMPTY_HOWTO (17),
+ EMPTY_HOWTO (18),
+ EMPTY_HOWTO (19),
+ EMPTY_HOWTO (20),
+ EMPTY_HOWTO (21),
/* This reloc is a Cygnus extension used when generating position
independent code for embedded systems. It represents an entry in
@@ -569,7 +569,7 @@ mips_adjust_reloc_in (abfd, intern, rptr)
static void
mips_adjust_reloc_out (abfd, rel, intern)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
const arelent *rel;
struct internal_reloc *intern;
{
@@ -604,13 +604,13 @@ mips_generic_reloc (abfd,
input_section,
output_bfd,
error_message)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
arelent *reloc_entry;
asymbol *symbol;
- PTR data;
+ PTR data ATTRIBUTE_UNUSED;
asection *input_section;
bfd *output_bfd;
- char **error_message;
+ char **error_message ATTRIBUTE_UNUSED;
{
if (output_bfd != (bfd *) NULL
&& (symbol->flags & BSF_SECTION_SYM) == 0
@@ -651,13 +651,13 @@ mips_refhi_reloc (abfd,
input_section,
output_bfd,
error_message)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
arelent *reloc_entry;
asymbol *symbol;
PTR data;
asection *input_section;
bfd *output_bfd;
- char **error_message;
+ char **error_message ATTRIBUTE_UNUSED;
{
bfd_reloc_status_type ret;
bfd_vma relocation;
@@ -872,7 +872,7 @@ mips_gprel_reloc (abfd,
gp = 4;
_bfd_set_gp_value (output_bfd, gp);
*error_message =
- (char *) "GP relative relocation when _gp not defined";
+ (char *) _("GP relative relocation when _gp not defined");
return bfd_reloc_dangerous;
}
}
@@ -933,13 +933,13 @@ mips_relhi_reloc (abfd,
input_section,
output_bfd,
error_message)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
arelent *reloc_entry;
asymbol *symbol;
PTR data;
asection *input_section;
bfd *output_bfd;
- char **error_message;
+ char **error_message ATTRIBUTE_UNUSED;
{
bfd_reloc_status_type ret;
bfd_vma relocation;
@@ -1109,13 +1109,13 @@ mips_switch_reloc (abfd,
input_section,
output_bfd,
error_message)
- bfd *abfd;
- arelent *reloc_entry;
- asymbol *symbol;
- PTR data;
- asection *input_section;
- bfd *output_bfd;
- char **error_message;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *reloc_entry ATTRIBUTE_UNUSED;
+ asymbol *symbol ATTRIBUTE_UNUSED;
+ PTR data ATTRIBUTE_UNUSED;
+ asection *input_section ATTRIBUTE_UNUSED;
+ bfd *output_bfd ATTRIBUTE_UNUSED;
+ char **error_message ATTRIBUTE_UNUSED;
{
return bfd_reloc_ok;
}
@@ -1124,7 +1124,7 @@ mips_switch_reloc (abfd,
static reloc_howto_type *
mips_bfd_reloc_type_lookup (abfd, code)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
bfd_reloc_code_real_type code;
{
int mips_type;
@@ -1193,11 +1193,18 @@ mips_relocate_hi (refhi, reflo, input_bfd, input_section, contents, adjust,
unsigned long val;
unsigned long vallo;
+ if (refhi == NULL)
+ return;
+
insn = bfd_get_32 (input_bfd,
contents + adjust + refhi->r_vaddr - input_section->vma);
- vallo = (bfd_get_32 (input_bfd,
- contents + adjust + reflo->r_vaddr - input_section->vma)
- & 0xffff);
+ if (reflo == NULL)
+ vallo = 0;
+ else
+ vallo = (bfd_get_32 (input_bfd,
+ contents + adjust + reflo->r_vaddr - input_section->vma)
+ & 0xffff);
+
val = ((insn & 0xffff) << 16) + vallo;
val += relocation;
@@ -1425,7 +1432,7 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
if (gp_undefined)
{
if (! ((*info->callbacks->reloc_dangerous)
- (info, "GP relative relocation when GP not defined",
+ (info, _("GP relative relocation when GP not defined"),
input_bfd, input_section,
int_rel.r_vaddr - input_section->vma)))
return false;
@@ -1774,7 +1781,7 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
input_section,
- int_rel.r_vaddr - input_section->vma)))
+ int_rel.r_vaddr - input_section->vma, true)))
return false;
relocation = 0;
}
@@ -2322,9 +2329,9 @@ mips_relax_section (abfd, sec, info, again)
static boolean
mips_relax_pcrel16 (info, input_bfd, input_section, h, location, address)
- struct bfd_link_info *info;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
bfd *input_bfd;
- asection *input_section;
+ asection *input_section ATTRIBUTE_UNUSED;
struct ecoff_link_hash_entry *h;
bfd_byte *location;
bfd_vma address;
@@ -2423,7 +2430,7 @@ bfd_mips_ecoff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
/* We can only relocate REFWORD relocs at run time. */
if (int_rel.r_type != MIPS_R_REFWORD)
{
- *errmsg = "unsupported reloc type";
+ *errmsg = _("unsupported reloc type");
bfd_set_error (bfd_error_bad_value);
return false;
}
@@ -2460,7 +2467,7 @@ bfd_mips_ecoff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
default:
/* No other sections should appear in -membedded-pic
code. */
- *errmsg = "reloc against unsupported section";
+ *errmsg = _("reloc against unsupported section");
bfd_set_error (bfd_error_bad_value);
return false;
}
@@ -2468,7 +2475,7 @@ bfd_mips_ecoff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
if ((int_rel.r_offset & 3) != 0)
{
- *errmsg = "reloc not properly aligned";
+ *errmsg = _("reloc not properly aligned");
bfd_set_error (bfd_error_bad_value);
return false;
}
@@ -2498,13 +2505,14 @@ static const struct ecoff_backend_data mips_ecoff_backend_data =
(unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* reloc_out */
mips_ecoff_swap_filehdr_out, mips_ecoff_swap_aouthdr_out,
mips_ecoff_swap_scnhdr_out,
- FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, true, false, 4,
+ FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, true, false, 4,
mips_ecoff_swap_filehdr_in, mips_ecoff_swap_aouthdr_in,
mips_ecoff_swap_scnhdr_in, NULL,
mips_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook,
_bfd_ecoff_mkobject_hook, _bfd_ecoff_styp_to_sec_flags,
_bfd_ecoff_set_alignment_hook, _bfd_ecoff_slurp_symbol_table,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL
},
/* Supported architecture. */
bfd_arch_mips,
@@ -2590,6 +2598,11 @@ static const struct ecoff_backend_data mips_ecoff_backend_data =
/* Relaxing sections is MIPS specific. */
#define _bfd_ecoff_bfd_relax_section mips_relax_section
+/* GC of sections is not done. */
+#define _bfd_ecoff_bfd_gc_sections bfd_generic_gc_sections
+
+extern const bfd_target ecoff_big_vec;
+
const bfd_target ecoff_little_vec =
{
"ecoff-littlemips", /* name */
@@ -2629,6 +2642,8 @@ const bfd_target ecoff_little_vec =
BFD_JUMP_TABLE_LINK (_bfd_ecoff),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+ & ecoff_big_vec,
+
(PTR) &mips_ecoff_backend_data
};
@@ -2670,6 +2685,8 @@ const bfd_target ecoff_big_vec =
BFD_JUMP_TABLE_LINK (_bfd_ecoff),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+ & ecoff_little_vec,
+
(PTR) &mips_ecoff_backend_data
};
@@ -2712,5 +2729,7 @@ const bfd_target ecoff_biglittle_vec =
BFD_JUMP_TABLE_LINK (_bfd_ecoff),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+ NULL,
+
(PTR) &mips_ecoff_backend_data
};
diff --git a/contrib/binutils/bfd/coff-ppc.c b/contrib/binutils/bfd/coff-ppc.c
new file mode 100644
index 000000000000..c5e695d311a9
--- /dev/null
+++ b/contrib/binutils/bfd/coff-ppc.c
@@ -0,0 +1,2969 @@
+/* BFD back-end for PowerPC Microsoft Portable Executable files.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
+ Free Software Foundation, Inc.
+
+ Original version pieced together by Kim Knuttila (krk@cygnus.com)
+
+ There is nothing new under the sun. This file draws a lot on other
+ coff files, in particular, those for the rs/6000, alpha, mips, and
+ intel backends, and the PE work for the arm.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* Current State:
+ - objdump works
+ - relocs generated by gas
+ - ld will link files, but they do not run.
+ - dlltool will not produce correct output in some .reloc cases, and will
+ not produce the right glue code for dll function calls.
+*/
+
+
+#include "bfd.h"
+#include "sysdep.h"
+
+#include "libbfd.h"
+
+#include "coff/powerpc.h"
+#include "coff/internal.h"
+
+#include "coff/pe.h"
+
+#ifdef BADMAG
+#undef BADMAG
+#endif
+
+#define BADMAG(x) PPCBADMAG(x)
+
+#include "libcoff.h"
+
+/* This file is compiled more than once, but we only compile the
+ final_link routine once. */
+extern boolean ppc_bfd_coff_final_link
+ PARAMS ((bfd *, struct bfd_link_info *));
+extern void dump_toc PARAMS ((PTR));
+
+/* The toc is a set of bfd_vma fields. We use the fact that valid */
+/* addresses are even (i.e. the bit representing "1" is off) to allow */
+/* us to encode a little extra information in the field */
+/* - Unallocated addresses are intialized to 1. */
+/* - Allocated addresses are even numbers. */
+/* The first time we actually write a reference to the toc in the bfd, */
+/* we want to record that fact in a fixup file (if it is asked for), so */
+/* we keep track of whether or not an address has been written by marking */
+/* the low order bit with a "1" upon writing */
+
+#define SET_UNALLOCATED(x) ((x) = 1)
+#define IS_UNALLOCATED(x) ((x) == 1)
+
+#define IS_WRITTEN(x) ((x) & 1)
+#define MARK_AS_WRITTEN(x) ((x) |= 1)
+#define MAKE_ADDR_AGAIN(x) ((x) &= ~1)
+
+
+/* Turn on this check if you suspect something amiss in the hash tables */
+#ifdef DEBUG_HASH
+
+/* Need a 7 char string for an eye catcher */
+#define EYE "krkjunk"
+
+#define HASH_CHECK_DCL char eye_catcher[8];
+#define HASH_CHECK_INIT(ret) strcpy(ret->eye_catcher, EYE)
+#define HASH_CHECK(addr) \
+ if (strcmp(addr->eye_catcher, EYE) != 0) \
+ { \
+ fprintf(stderr,\
+ _("File %s, line %d, Hash check failure, bad eye %8s\n"), \
+ __FILE__, __LINE__, addr->eye_catcher); \
+ abort(); \
+ }
+
+
+#else
+
+#define HASH_CHECK_DCL
+#define HASH_CHECK_INIT(ret)
+#define HASH_CHECK(addr)
+
+#endif
+
+/* In order not to add an int to every hash table item for every coff
+ linker, we define our own hash table, derived from the coff one */
+
+/* PE linker hash table entries. */
+
+struct ppc_coff_link_hash_entry
+{
+ struct coff_link_hash_entry root; /* First entry, as required */
+
+ /* As we wonder around the relocs, we'll keep the assigned toc_offset
+ here */
+ bfd_vma toc_offset; /* Our addition, as required */
+ int symbol_is_glue;
+ unsigned long int glue_insn;
+
+ HASH_CHECK_DCL
+};
+
+
+/* PE linker hash table. */
+
+struct ppc_coff_link_hash_table
+{
+ struct coff_link_hash_table root; /* First entry, as required */
+};
+
+static struct bfd_hash_entry *ppc_coff_link_hash_newfunc
+ PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *,
+ const char *));
+static boolean ppc_coff_link_hash_table_init
+ PARAMS ((struct ppc_coff_link_hash_table *, bfd *,
+ struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
+ struct bfd_hash_table *,
+ const char *)));
+static struct bfd_link_hash_table *ppc_coff_link_hash_table_create
+ PARAMS ((bfd *));
+static boolean coff_ppc_relocate_section
+ PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
+ struct internal_reloc *, struct internal_syment *, asection **));
+static reloc_howto_type *coff_ppc_rtype_to_howto
+ PARAMS ((bfd *, asection *, struct internal_reloc *,
+ struct coff_link_hash_entry *, struct internal_syment *,
+ bfd_vma *));
+
+/* Routine to create an entry in the link hash table. */
+
+static struct bfd_hash_entry *
+ppc_coff_link_hash_newfunc (entry, table, string)
+ struct bfd_hash_entry *entry;
+ struct bfd_hash_table *table;
+ const char *string;
+{
+ struct ppc_coff_link_hash_entry *ret =
+ (struct ppc_coff_link_hash_entry *) entry;
+
+ /* Allocate the structure if it has not already been allocated by a
+ subclass. */
+ if (ret == (struct ppc_coff_link_hash_entry *) NULL)
+ ret = (struct ppc_coff_link_hash_entry *)
+ bfd_hash_allocate (table,
+ sizeof (struct ppc_coff_link_hash_entry));
+
+ if (ret == (struct ppc_coff_link_hash_entry *) NULL)
+ return NULL;
+
+ /* Call the allocation method of the superclass. */
+ ret = ((struct ppc_coff_link_hash_entry *)
+ _bfd_coff_link_hash_newfunc ((struct bfd_hash_entry *) ret,
+ table, string));
+
+ if (ret)
+ {
+ /* Initialize the local fields. */
+ SET_UNALLOCATED(ret->toc_offset);
+ ret->symbol_is_glue = 0;
+ ret->glue_insn = 0;
+
+ HASH_CHECK_INIT(ret);
+ }
+
+ return (struct bfd_hash_entry *) ret;
+}
+
+/* Initialize a PE linker hash table. */
+
+static boolean
+ppc_coff_link_hash_table_init (table, abfd, newfunc)
+ struct ppc_coff_link_hash_table *table;
+ bfd *abfd;
+ struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *,
+ struct bfd_hash_table *,
+ const char *));
+{
+ return _bfd_coff_link_hash_table_init (&table->root, abfd, newfunc);
+}
+
+/* Create a PE linker hash table. */
+
+static struct bfd_link_hash_table *
+ppc_coff_link_hash_table_create (abfd)
+ bfd *abfd;
+{
+ struct ppc_coff_link_hash_table *ret;
+
+ ret = ((struct ppc_coff_link_hash_table *)
+ bfd_alloc (abfd, sizeof (struct ppc_coff_link_hash_table)));
+ if (ret == NULL)
+ return NULL;
+ if (! ppc_coff_link_hash_table_init (ret, abfd,
+ ppc_coff_link_hash_newfunc))
+ {
+ bfd_release (abfd, ret);
+ return (struct bfd_link_hash_table *) NULL;
+ }
+ return &ret->root.root;
+}
+
+/* Now, tailor coffcode.h to use our hash stuff */
+
+#define coff_bfd_link_hash_table_create ppc_coff_link_hash_table_create
+
+
+/* The nt loader points the toc register to &toc + 32768, in order to */
+/* use the complete range of a 16-bit displacement. We have to adjust */
+/* for this when we fix up loads displaced off the toc reg. */
+#define TOC_LOAD_ADJUSTMENT (-32768)
+#define TOC_SECTION_NAME ".private.toc"
+
+/* The main body of code is in coffcode.h. */
+
+#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3)
+
+/* In case we're on a 32-bit machine, construct a 64-bit "-1" value
+ from smaller values. Start with zero, widen, *then* decrement. */
+#define MINUS_ONE (((bfd_vma)0) - 1)
+
+/* these should definitely go in a header file somewhere... */
+
+/* NOP */
+#define IMAGE_REL_PPC_ABSOLUTE 0x0000
+
+/* 64-bit address */
+#define IMAGE_REL_PPC_ADDR64 0x0001
+
+/* 32-bit address */
+#define IMAGE_REL_PPC_ADDR32 0x0002
+
+/* 26-bit address, shifted left 2 (branch absolute) */
+#define IMAGE_REL_PPC_ADDR24 0x0003
+
+/* 16-bit address */
+#define IMAGE_REL_PPC_ADDR16 0x0004
+
+/* 16-bit address, shifted left 2 (load doubleword) */
+#define IMAGE_REL_PPC_ADDR14 0x0005
+
+/* 26-bit PC-relative offset, shifted left 2 (branch relative) */
+#define IMAGE_REL_PPC_REL24 0x0006
+
+/* 16-bit PC-relative offset, shifted left 2 (br cond relative) */
+#define IMAGE_REL_PPC_REL14 0x0007
+
+/* 16-bit offset from TOC base */
+#define IMAGE_REL_PPC_TOCREL16 0x0008
+
+/* 16-bit offset from TOC base, shifted left 2 (load doubleword) */
+#define IMAGE_REL_PPC_TOCREL14 0x0009
+
+/* 32-bit addr w/o image base */
+#define IMAGE_REL_PPC_ADDR32NB 0x000A
+
+/* va of containing section (as in an image sectionhdr) */
+#define IMAGE_REL_PPC_SECREL 0x000B
+
+/* sectionheader number */
+#define IMAGE_REL_PPC_SECTION 0x000C
+
+/* substitute TOC restore instruction iff symbol is glue code */
+#define IMAGE_REL_PPC_IFGLUE 0x000D
+
+/* symbol is glue code; virtual address is TOC restore instruction */
+#define IMAGE_REL_PPC_IMGLUE 0x000E
+
+/* va of containing section (limited to 16 bits) */
+#define IMAGE_REL_PPC_SECREL16 0x000F
+
+/* stuff to handle immediate data when the number of bits in the */
+/* data is greater than the number of bits in the immediate field */
+/* We need to do (usually) 32 bit arithmetic on 16 bit chunks */
+#define IMAGE_REL_PPC_REFHI 0x0010
+#define IMAGE_REL_PPC_REFLO 0x0011
+#define IMAGE_REL_PPC_PAIR 0x0012
+
+/* This is essentially the same as tocrel16, with TOCDEFN assumed */
+#define IMAGE_REL_PPC_TOCREL16_DEFN 0x0013
+
+/* Flag bits in IMAGE_RELOCATION.TYPE */
+
+/* subtract reloc value rather than adding it */
+#define IMAGE_REL_PPC_NEG 0x0100
+
+/* fix branch prediction bit to predict branch taken */
+#define IMAGE_REL_PPC_BRTAKEN 0x0200
+
+/* fix branch prediction bit to predict branch not taken */
+#define IMAGE_REL_PPC_BRNTAKEN 0x0400
+
+/* toc slot defined in file (or, data in toc) */
+#define IMAGE_REL_PPC_TOCDEFN 0x0800
+
+/* masks to isolate above values in IMAGE_RELOCATION.Type */
+#define IMAGE_REL_PPC_TYPEMASK 0x00FF
+#define IMAGE_REL_PPC_FLAGMASK 0x0F00
+
+#define EXTRACT_TYPE(x) ((x) & IMAGE_REL_PPC_TYPEMASK)
+#define EXTRACT_FLAGS(x) ((x) & IMAGE_REL_PPC_FLAGMASK)
+#define EXTRACT_JUNK(x) \
+ ((x) & ~(IMAGE_REL_PPC_TYPEMASK | IMAGE_REL_PPC_FLAGMASK))
+
+
+/* static helper functions to make relocation work */
+/* (Work In Progress) */
+
+static bfd_reloc_status_type ppc_refhi_reloc PARAMS ((bfd *abfd,
+ arelent *reloc,
+ asymbol *symbol,
+ PTR data,
+ asection *section,
+ bfd *output_bfd,
+ char **error));
+#if 0
+static bfd_reloc_status_type ppc_reflo_reloc PARAMS ((bfd *abfd,
+ arelent *reloc,
+ asymbol *symbol,
+ PTR data,
+ asection *section,
+ bfd *output_bfd,
+ char **error));
+#endif
+static bfd_reloc_status_type ppc_pair_reloc PARAMS ((bfd *abfd,
+ arelent *reloc,
+ asymbol *symbol,
+ PTR data,
+ asection *section,
+ bfd *output_bfd,
+ char **error));
+
+
+static bfd_reloc_status_type ppc_toc16_reloc PARAMS ((bfd *abfd,
+ arelent *reloc,
+ asymbol *symbol,
+ PTR data,
+ asection *section,
+ bfd *output_bfd,
+ char **error));
+
+#if 0
+static bfd_reloc_status_type ppc_addr32nb_reloc PARAMS ((bfd *abfd,
+ arelent *reloc,
+ asymbol *symbol,
+ PTR data,
+ asection *section,
+ bfd *output_bfd,
+ char **error));
+#endif
+static bfd_reloc_status_type ppc_section_reloc PARAMS ((bfd *abfd,
+ arelent *reloc,
+ asymbol *symbol,
+ PTR data,
+ asection *section,
+ bfd *output_bfd,
+ char **error));
+
+static bfd_reloc_status_type ppc_secrel_reloc PARAMS ((bfd *abfd,
+ arelent *reloc,
+ asymbol *symbol,
+ PTR data,
+ asection *section,
+ bfd *output_bfd,
+ char **error));
+
+static bfd_reloc_status_type ppc_imglue_reloc PARAMS ((bfd *abfd,
+ arelent *reloc,
+ asymbol *symbol,
+ PTR data,
+ asection *section,
+ bfd *output_bfd,
+ char **error));
+
+
+
+static boolean in_reloc_p PARAMS((bfd *abfd, reloc_howto_type *howto));
+
+
+/* FIXME: It'll take a while to get through all of these. I only need a few to
+ get us started, so those I'll make sure work. Those marked FIXME are either
+ completely unverified or have a specific unknown marked in the comment */
+
+/*---------------------------------------------------------------------------*/
+/* */
+/* Relocation entries for Windows/NT on PowerPC. */
+/* */
+/* From the document "" we find the following listed as used relocs: */
+/* */
+/* ABSOLUTE : The noop */
+/* ADDR[64|32|16] : fields that hold addresses in data fields or the */
+/* 16 bit displacement field on a load/store. */
+/* ADDR[24|14] : fields that hold addresses in branch and cond */
+/* branches. These represent [26|16] bit addresses. */
+/* The low order 2 bits are preserved. */
+/* REL[24|14] : branches relative to the Instruction Address */
+/* register. These represent [26|16] bit addresses, */
+/* as before. The instruction field will be zero, and */
+/* the address of the SYM will be inserted at link time. */
+/* TOCREL16 : 16 bit displacement field referring to a slot in */
+/* toc. */
+/* TOCREL14 : 16 bit displacement field, similar to REL14 or ADDR14. */
+/* ADDR32NB : 32 bit address relative to the virtual origin. */
+/* (On the alpha, this is always a linker generated thunk)*/
+/* (i.e. 32bit addr relative to the image base) */
+/* SECREL : The value is relative to the start of the section */
+/* containing the symbol. */
+/* SECTION : access to the header containing the item. Supports the */
+/* codeview debugger. */
+/* */
+/* In particular, note that the document does not indicate that the */
+/* relocations listed in the header file are used. */
+/* */
+/* */
+/* */
+/*---------------------------------------------------------------------------*/
+
+static reloc_howto_type ppc_coff_howto_table[] =
+{
+ /* IMAGE_REL_PPC_ABSOLUTE 0x0000 NOP */
+ /* Unused: */
+ HOWTO (IMAGE_REL_PPC_ABSOLUTE, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* dont complain_on_overflow */
+ 0, /* special_function */
+ "ABSOLUTE", /* name */
+ false, /* partial_inplace */
+ 0x00, /* src_mask */
+ 0x00, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* IMAGE_REL_PPC_ADDR64 0x0001 64-bit address */
+ /* Unused: */
+ HOWTO(IMAGE_REL_PPC_ADDR64, /* type */
+ 0, /* rightshift */
+ 3, /* size (0 = byte, 1 = short, 2 = long) */
+ 64, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ 0, /* special_function */
+ "ADDR64", /* name */
+ true, /* partial_inplace */
+ MINUS_ONE, /* src_mask */
+ MINUS_ONE, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* IMAGE_REL_PPC_ADDR32 0x0002 32-bit address */
+ /* Used: */
+ HOWTO (IMAGE_REL_PPC_ADDR32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ 0, /* special_function */
+ "ADDR32", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* IMAGE_REL_PPC_ADDR24 0x0003 26-bit address, shifted left 2 (branch absolute) */
+ /* the LI field is in bit 6 through bit 29 is 24 bits, + 2 for the shift */
+ /* Of course, That's the IBM approved bit numbering, which is not what */
+ /* anyone else uses.... The li field is in bit 2 thru 25 */
+ /* Used: */
+ HOWTO (IMAGE_REL_PPC_ADDR24, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ 0, /* special_function */
+ "ADDR24", /* name */
+ true, /* partial_inplace */
+ 0x07fffffc, /* src_mask */
+ 0x07fffffc, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* IMAGE_REL_PPC_ADDR16 0x0004 16-bit address */
+ /* Used: */
+ HOWTO (IMAGE_REL_PPC_ADDR16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ 0, /* special_function */
+ "ADDR16", /* name */
+ true, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* IMAGE_REL_PPC_ADDR14 0x0005 */
+ /* 16-bit address, shifted left 2 (load doubleword) */
+ /* FIXME: the mask is likely wrong, and the bit position may be as well */
+ /* Unused: */
+ HOWTO (IMAGE_REL_PPC_ADDR14, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ 0, /* special_function */
+ "ADDR16", /* name */
+ true, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* IMAGE_REL_PPC_REL24 0x0006 */
+ /* 26-bit PC-relative offset, shifted left 2 (branch relative) */
+ /* Used: */
+ HOWTO (IMAGE_REL_PPC_REL24, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ 0, /* special_function */
+ "REL24", /* name */
+ true, /* partial_inplace */
+ 0x3fffffc, /* src_mask */
+ 0x3fffffc, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* IMAGE_REL_PPC_REL14 0x0007 */
+ /* 16-bit PC-relative offset, shifted left 2 (br cond relative) */
+ /* FIXME: the mask is likely wrong, and the bit position may be as well */
+ /* FIXME: how does it know how far to shift? */
+ /* Unused: */
+ HOWTO (IMAGE_REL_PPC_ADDR14, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ 0, /* special_function */
+ "ADDR16", /* name */
+ true, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* IMAGE_REL_PPC_TOCREL16 0x0008 */
+ /* 16-bit offset from TOC base */
+ /* Used: */
+ HOWTO (IMAGE_REL_PPC_TOCREL16,/* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_toc16_reloc, /* special_function */
+ "TOCREL16", /* name */
+ false, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* IMAGE_REL_PPC_TOCREL14 0x0009 */
+ /* 16-bit offset from TOC base, shifted left 2 (load doubleword) */
+ /* Unused: */
+ HOWTO (IMAGE_REL_PPC_TOCREL14,/* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ 0, /* special_function */
+ "TOCREL14", /* name */
+ false, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* IMAGE_REL_PPC_ADDR32NB 0x000A */
+ /* 32-bit addr w/ image base */
+ /* Unused: */
+ HOWTO (IMAGE_REL_PPC_ADDR32NB,/* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ 0, /* special_function */
+ "ADDR32NB", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* IMAGE_REL_PPC_SECREL 0x000B */
+ /* va of containing section (as in an image sectionhdr) */
+ /* Unused: */
+ HOWTO (IMAGE_REL_PPC_SECREL,/* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ ppc_secrel_reloc, /* special_function */
+ "SECREL", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* IMAGE_REL_PPC_SECTION 0x000C */
+ /* sectionheader number */
+ /* Unused: */
+ HOWTO (IMAGE_REL_PPC_SECTION,/* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ ppc_section_reloc, /* special_function */
+ "SECTION", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* IMAGE_REL_PPC_IFGLUE 0x000D */
+ /* substitute TOC restore instruction iff symbol is glue code */
+ /* Used: */
+ HOWTO (IMAGE_REL_PPC_IFGLUE,/* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ 0, /* special_function */
+ "IFGLUE", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* IMAGE_REL_PPC_IMGLUE 0x000E */
+ /* symbol is glue code; virtual address is TOC restore instruction */
+ /* Unused: */
+ HOWTO (IMAGE_REL_PPC_IMGLUE,/* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_imglue_reloc, /* special_function */
+ "IMGLUE", /* name */
+ false, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* IMAGE_REL_PPC_SECREL16 0x000F */
+ /* va of containing section (limited to 16 bits) */
+ /* Unused: */
+ HOWTO (IMAGE_REL_PPC_SECREL16,/* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ 0, /* special_function */
+ "SECREL16", /* name */
+ true, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* IMAGE_REL_PPC_REFHI 0x0010 */
+ /* Unused: */
+ HOWTO (IMAGE_REL_PPC_REFHI, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ ppc_refhi_reloc, /* special_function */
+ "REFHI", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* IMAGE_REL_PPC_REFLO 0x0011 */
+ /* Unused: */
+ HOWTO (IMAGE_REL_PPC_REFLO, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ ppc_refhi_reloc, /* special_function */
+ "REFLO", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* IMAGE_REL_PPC_PAIR 0x0012 */
+ /* Unused: */
+ HOWTO (IMAGE_REL_PPC_PAIR, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ ppc_pair_reloc, /* special_function */
+ "PAIR", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* IMAGE_REL_PPC_TOCREL16_DEFN 0x0013 */
+ /* 16-bit offset from TOC base, without causing a definition */
+ /* Used: */
+ HOWTO ( (IMAGE_REL_PPC_TOCREL16 | IMAGE_REL_PPC_TOCDEFN), /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ 0, /* special_function */
+ "TOCREL16, TOCDEFN", /* name */
+ false, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+};
+
+
+
+
+/* Some really cheezy macros that can be turned on to test stderr :-) */
+
+#ifdef DEBUG_RELOC
+#define UN_IMPL(x) \
+{ \
+ static int i; \
+ if (i == 0) \
+ { \
+ i = 1; \
+ fprintf(stderr,_("Unimplemented Relocation -- %s\n"),x); \
+ } \
+}
+
+#define DUMP_RELOC(n,r) \
+{ \
+ fprintf(stderr,"%s sym %d, addr %d, addend %d\n", \
+ n, (*(r->sym_ptr_ptr))->name, \
+ r->address, r->addend); \
+}
+
+/* Given a reloc name, n, and a pointer to an internal_reloc,
+ dump out interesting information on the contents
+
+#define n_name _n._n_name
+#define n_zeroes _n._n_n._n_zeroes
+#define n_offset _n._n_n._n_offset
+
+*/
+
+#define DUMP_RELOC2(n,r) \
+{ \
+ fprintf(stderr,"%s sym %d, r_vaddr %d %s\n", \
+ n, r->r_symndx, r->r_vaddr,\
+ (((r->r_type) & IMAGE_REL_PPC_TOCDEFN) == 0) \
+ ?" ":" TOCDEFN" ); \
+}
+
+#else
+#define UN_IMPL(x)
+#define DUMP_RELOC(n,r)
+#define DUMP_RELOC2(n,r)
+#endif
+
+
+
+/* toc construction and management routines */
+
+/* This file is compiled twice, and these variables are defined in one
+ of the compilations. FIXME: This is confusing and weird. Also,
+ BFD should not use global variables. */
+extern bfd* bfd_of_toc_owner;
+extern long int global_toc_size;
+
+extern long int import_table_size;
+extern long int first_thunk_address;
+extern long int thunk_size;
+
+enum toc_type
+{
+ default_toc,
+ toc_32,
+ toc_64
+};
+
+enum ref_category
+{
+ priv,
+ pub,
+ data
+};
+
+struct list_ele
+{
+ struct list_ele *next;
+ bfd_vma addr;
+ enum ref_category cat;
+ int offset;
+ const char *name;
+};
+
+extern struct list_ele *head;
+extern struct list_ele *tail;
+
+static void record_toc
+ PARAMS ((asection *, int, enum ref_category, const char *));
+
+static void
+record_toc (toc_section, our_toc_offset, cat, name)
+ asection *toc_section;
+ int our_toc_offset;
+ enum ref_category cat;
+ const char *name;
+{
+ /* add this entry to our toc addr-offset-name list */
+ struct list_ele *t;
+ t = (struct list_ele *) bfd_malloc (sizeof (struct list_ele));
+ if (t == NULL)
+ abort ();
+ t->next = 0;
+ t->offset = our_toc_offset;
+ t->name = name;
+ t->cat = cat;
+ t->addr = toc_section->output_offset + our_toc_offset;
+
+ if (head == 0)
+ {
+ head = t;
+ tail = t;
+ }
+ else
+ {
+ tail->next = t;
+ tail = t;
+ }
+}
+
+#ifdef COFF_IMAGE_WITH_PE
+
+static boolean ppc_record_toc_entry
+ PARAMS ((bfd *, struct bfd_link_info *, asection *, int, enum toc_type));
+static void ppc_mark_symbol_as_glue
+ PARAMS ((bfd *, int, struct internal_reloc *));
+
+/* record a toc offset against a symbol */
+static boolean
+ppc_record_toc_entry(abfd, info, sec, sym, toc_kind)
+ bfd *abfd;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ asection *sec ATTRIBUTE_UNUSED;
+ int sym;
+ enum toc_type toc_kind ATTRIBUTE_UNUSED;
+{
+ struct ppc_coff_link_hash_entry *h;
+ const char *name;
+
+ int *local_syms;
+
+ h = 0;
+
+ h = (struct ppc_coff_link_hash_entry *) (obj_coff_sym_hashes (abfd)[sym]);
+ if (h != 0)
+ {
+ HASH_CHECK(h);
+ }
+
+ if (h == 0)
+ {
+ local_syms = obj_coff_local_toc_table(abfd);
+ if (local_syms == 0)
+ {
+ unsigned int i;
+ /* allocate a table */
+ local_syms =
+ (int *) bfd_zalloc (abfd,
+ obj_raw_syment_count(abfd) * sizeof(int));
+ if (local_syms == 0)
+ return false;
+ obj_coff_local_toc_table(abfd) = local_syms;
+ for (i = 0; i < obj_raw_syment_count(abfd); ++i)
+ {
+ SET_UNALLOCATED(local_syms[i]);
+ }
+ }
+
+ if (IS_UNALLOCATED(local_syms[sym]))
+ {
+ local_syms[sym] = global_toc_size;
+ global_toc_size += 4;
+
+ /* The size must fit in a 16bit displacment */
+ if (global_toc_size > 65535)
+ {
+ (*_bfd_error_handler) (_("TOC overflow"));
+ bfd_set_error (bfd_error_file_too_big);
+ return false;
+ }
+ }
+ }
+ else
+ {
+ name = h->root.root.root.string;
+
+ /* check to see if there's a toc slot allocated. If not, do it
+ here. It will be used in relocate_section */
+ if (IS_UNALLOCATED(h->toc_offset))
+ {
+ h->toc_offset = global_toc_size;
+ global_toc_size += 4;
+
+ /* The size must fit in a 16bit displacment */
+ if (global_toc_size >= 65535)
+ {
+ (*_bfd_error_handler) (_("TOC overflow"));
+ bfd_set_error (bfd_error_file_too_big);
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+/* record a toc offset against a symbol */
+static void
+ppc_mark_symbol_as_glue(abfd, sym, rel)
+ bfd *abfd;
+ int sym;
+ struct internal_reloc *rel;
+{
+ struct ppc_coff_link_hash_entry *h;
+
+ h = (struct ppc_coff_link_hash_entry *) (obj_coff_sym_hashes (abfd)[sym]);
+
+ HASH_CHECK(h);
+
+ h->symbol_is_glue = 1;
+ h->glue_insn = bfd_get_32 (abfd, (bfd_byte *) &rel->r_vaddr);
+
+ return;
+}
+
+#endif /* COFF_IMAGE_WITH_PE */
+
+
+/* Return true if this relocation should
+ appear in the output .reloc section. */
+
+static boolean in_reloc_p(abfd, howto)
+ bfd * abfd ATTRIBUTE_UNUSED;
+ reloc_howto_type *howto;
+{
+ return
+ (! howto->pc_relative)
+ && (howto->type != IMAGE_REL_PPC_ADDR32NB)
+ && (howto->type != IMAGE_REL_PPC_TOCREL16)
+ && (howto->type != IMAGE_REL_PPC_IMGLUE)
+ && (howto->type != IMAGE_REL_PPC_IFGLUE)
+ && (howto->type != IMAGE_REL_PPC_SECREL)
+ && (howto->type != IMAGE_REL_PPC_SECTION)
+ && (howto->type != IMAGE_REL_PPC_SECREL16)
+ && (howto->type != IMAGE_REL_PPC_REFHI)
+ && (howto->type != IMAGE_REL_PPC_REFLO)
+ && (howto->type != IMAGE_REL_PPC_PAIR)
+ && (howto->type != IMAGE_REL_PPC_TOCREL16_DEFN) ;
+}
+
+#if 0
+
+/* this function is in charge of performing all the ppc PE relocations */
+/* Don't yet know if we want to do this this particular way ... (krk) */
+/* FIXME: (it is not yet enabled) */
+
+static bfd_reloc_status_type
+pe_ppc_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
+ error_message)
+ bfd *abfd;
+ arelent *reloc_entry;
+ asymbol *symbol_in;
+ PTR data;
+ asection *input_section;
+ bfd *output_bfd;
+ char **error_message;
+{
+ /* the consth relocation comes in two parts, we have to remember
+ the state between calls, in these variables */
+ static boolean part1_consth_active = false;
+ static unsigned long part1_consth_value;
+
+ unsigned long sym_value;
+ unsigned short r_type;
+ unsigned long addr = reloc_entry->address ; /*+ input_section->vma*/
+
+ r_type = reloc_entry->howto->type;
+
+ if (output_bfd)
+ {
+ /* Partial linking - do nothing */
+ reloc_entry->address += input_section->output_offset;
+ return bfd_reloc_ok;
+ }
+
+ if (symbol_in != NULL
+ && bfd_is_und_section (symbol_in->section))
+ {
+ /* Keep the state machine happy in case we're called again */
+ if (r_type == IMAGE_REL_PPC_REFHI)
+ {
+ part1_consth_active = true;
+ part1_consth_value = 0;
+ }
+ return(bfd_reloc_undefined);
+ }
+
+ if ((part1_consth_active) && (r_type != IMAGE_REL_PPC_PAIR))
+ {
+ part1_consth_active = false;
+ *error_message = (char *) _("Missing PAIR");
+ return(bfd_reloc_dangerous);
+ }
+
+
+ sym_value = get_symbol_value(symbol_in);
+
+ return(bfd_reloc_ok);
+}
+
+#endif /* 0 */
+
+/* The reloc processing routine for the optimized COFF linker. */
+
+static boolean
+coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
+ contents, relocs, syms, sections)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+ bfd *input_bfd;
+ asection *input_section;
+ bfd_byte *contents;
+ struct internal_reloc *relocs;
+ struct internal_syment *syms;
+ asection **sections;
+{
+ struct internal_reloc *rel;
+ struct internal_reloc *relend;
+ boolean hihalf;
+ bfd_vma hihalf_val;
+ asection *toc_section = 0;
+ bfd_vma relocation;
+ reloc_howto_type *howto = 0;
+
+ /* If we are performing a relocateable link, we don't need to do a
+ thing. The caller will take care of adjusting the reloc
+ addresses and symbol indices. */
+ if (info->relocateable)
+ return true;
+
+ hihalf = false;
+ hihalf_val = 0;
+
+ rel = relocs;
+ relend = rel + input_section->reloc_count;
+ for (; rel < relend; rel++)
+ {
+ long symndx;
+ struct ppc_coff_link_hash_entry *h;
+ struct internal_syment *sym;
+ bfd_vma val;
+
+ asection *sec;
+ bfd_reloc_status_type rstat;
+ bfd_byte *loc;
+
+ unsigned short r_type = EXTRACT_TYPE (rel->r_type);
+ unsigned short r_flags = EXTRACT_FLAGS(rel->r_type);
+
+ symndx = rel->r_symndx;
+ loc = contents + rel->r_vaddr - input_section->vma;
+
+ /* FIXME: check bounds on r_type */
+ howto = ppc_coff_howto_table + r_type;
+
+ if (symndx == -1)
+ {
+ h = NULL;
+ sym = NULL;
+ }
+ else
+ {
+ h = (struct ppc_coff_link_hash_entry *)
+ (obj_coff_sym_hashes (input_bfd)[symndx]);
+ if (h != 0)
+ {
+ HASH_CHECK(h);
+ }
+
+ sym = syms + symndx;
+ }
+
+ if (r_type == IMAGE_REL_PPC_IMGLUE && h == 0)
+ {
+ /* An IMGLUE reloc must have a name. Something is very wrong. */
+ abort();
+ }
+
+ sec = NULL;
+ val = 0;
+
+ /* FIXME: PAIR unsupported in the following code */
+ if (h == NULL)
+ {
+ if (symndx == -1)
+ sec = bfd_abs_section_ptr;
+ else
+ {
+ sec = sections[symndx];
+ val = (sec->output_section->vma
+ + sec->output_offset
+ + sym->n_value);
+ if (! obj_pe (output_bfd))
+ val -= sec->vma;
+ }
+ }
+ else
+ {
+ HASH_CHECK(h);
+
+ if (h->root.root.type == bfd_link_hash_defined
+ || h->root.root.type == bfd_link_hash_defweak)
+ {
+ sec = h->root.root.u.def.section;
+ val = (h->root.root.u.def.value
+ + sec->output_section->vma
+ + sec->output_offset);
+ }
+ else
+ {
+ if (! ((*info->callbacks->undefined_symbol)
+ (info, h->root.root.root.string, input_bfd, input_section,
+ rel->r_vaddr - input_section->vma, true)))
+ return false;
+ }
+ }
+
+ rstat = bfd_reloc_ok;
+
+ /* Each case must do its own relocation, setting rstat appropriately */
+ switch (r_type)
+ {
+ default:
+ (*_bfd_error_handler)
+ (_("%s: unsupported relocation type 0x%02x"),
+ bfd_get_filename (input_bfd), r_type);
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ case IMAGE_REL_PPC_TOCREL16:
+ {
+ bfd_vma our_toc_offset;
+ int fixit;
+
+ DUMP_RELOC2(howto->name, rel);
+
+ if (toc_section == 0)
+ {
+ toc_section = bfd_get_section_by_name (bfd_of_toc_owner,
+ TOC_SECTION_NAME);
+
+ if ( toc_section == NULL )
+ {
+ /* There is no toc section. Something is very wrong. */
+ abort();
+ }
+ }
+
+ /*
+ * Amazing bit tricks present. As we may have seen earlier, we
+ * use the 1 bit to tell us whether or not a toc offset has been
+ * allocated. Now that they've all been allocated, we will use
+ * the 1 bit to tell us if we've written this particular toc
+ * entry out.
+ */
+ fixit = false;
+ if (h == 0)
+ { /* it is a file local symbol */
+ int *local_toc_table;
+ const char *name;
+
+ sym = syms + symndx;
+ name = sym->_n._n_name;
+
+ local_toc_table = obj_coff_local_toc_table(input_bfd);
+ our_toc_offset = local_toc_table[symndx];
+
+ if (IS_WRITTEN(our_toc_offset))
+ {
+ /* if it has been written out, it is marked with the
+ 1 bit. Fix up our offset, but do not write it out
+ again.
+ */
+ MAKE_ADDR_AGAIN(our_toc_offset);
+ }
+ else
+ {
+ /* write out the toc entry */
+ record_toc(toc_section,
+ our_toc_offset,
+ priv,
+ strdup(name));
+
+ bfd_put_32(output_bfd,
+ val,
+ toc_section->contents + our_toc_offset);
+
+ MARK_AS_WRITTEN(local_toc_table[symndx]);
+ fixit = true;
+ }
+ }
+ else
+ {
+ const char *name = h->root.root.root.string;
+ our_toc_offset = h->toc_offset;
+
+ if ((r_flags & IMAGE_REL_PPC_TOCDEFN)
+ == IMAGE_REL_PPC_TOCDEFN )
+ {
+ /* This is unbelievable cheese. Some knowledgable asm
+ hacker has decided to use r2 as a base for loading
+ a value. He/She does this by setting the tocdefn bit,
+ and not supplying a toc definition. The behaviour is
+ then to use the difference between the value of the
+ symbol and the actual location of the toc as the toc
+ index.
+
+ In fact, what is usually happening is, because the
+ Import Address Table is mapped immediately following
+ the toc, some trippy library code trying for speed on
+ dll linkage, takes advantage of that and considers
+ the IAT to be part of the toc, thus saving a load.
+ */
+
+ our_toc_offset = val -
+ (toc_section->output_section->vma +
+ toc_section->output_offset);
+
+ /* The size must still fit in a 16bit displacment */
+ if (our_toc_offset >= 65535)
+ {
+ (*_bfd_error_handler)
+ (_("%s: Relocation for %s of %x exceeds Toc size limit"),
+ bfd_get_filename (input_bfd), name, our_toc_offset);
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ }
+
+ record_toc(toc_section, our_toc_offset, pub, strdup(name));
+ }
+ else if (IS_WRITTEN(our_toc_offset))
+ {
+ /* if it has been written out, it is marked with the
+ 1 bit. Fix up our offset, but do not write it out
+ again.
+ */
+ MAKE_ADDR_AGAIN(our_toc_offset);
+ }
+ else
+ {
+ record_toc(toc_section, our_toc_offset, pub, strdup(name));
+
+ /* write out the toc entry */
+ bfd_put_32(output_bfd,
+ val,
+ toc_section->contents + our_toc_offset);
+
+ MARK_AS_WRITTEN(h->toc_offset);
+ /* The tricky part is that this is the address that */
+ /* needs a .reloc entry for it */
+ fixit = true;
+ }
+ }
+
+ if (fixit && info->base_file)
+ {
+ /* So if this is non pcrelative, and is referenced
+ to a section or a common symbol, then it needs a reloc */
+
+ /* relocation to a symbol in a section which
+ isn't absolute - we output the address here
+ to a file */
+
+ bfd_vma addr = toc_section->output_section->vma
+ + toc_section->output_offset + our_toc_offset;
+
+ if (coff_data(output_bfd)->pe)
+ addr -= pe_data(output_bfd)->pe_opthdr.ImageBase;
+
+ fwrite (&addr, 1,4, (FILE *) info->base_file);
+ }
+
+
+ /* FIXME: this test is conservative */
+ if ( (r_flags & IMAGE_REL_PPC_TOCDEFN) != IMAGE_REL_PPC_TOCDEFN &&
+ our_toc_offset > toc_section->_raw_size)
+ {
+ (*_bfd_error_handler)
+ (_("%s: Relocation exceeds allocated TOC (%x)"),
+ bfd_get_filename (input_bfd),
+ toc_section->_raw_size);
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ }
+
+ /* Now we know the relocation for this toc reference */
+ relocation = our_toc_offset + TOC_LOAD_ADJUSTMENT;
+ rstat = _bfd_relocate_contents (howto,
+ input_bfd,
+ relocation,
+ loc);
+ }
+ break;
+ case IMAGE_REL_PPC_IFGLUE:
+ {
+ /* To solve this, we need to know whether or not the symbol */
+ /* appearing on the call instruction is a glue function or not. */
+ /* A glue function must announce itself via a IMGLUE reloc, and */
+ /* the reloc contains the required toc restore instruction */
+
+ bfd_vma x;
+ const char *my_name;
+ DUMP_RELOC2(howto->name, rel);
+
+ if (h != 0)
+ {
+ my_name = h->root.root.root.string;
+ if (h->symbol_is_glue == 1)
+ {
+ x = bfd_get_32(input_bfd, loc);
+ bfd_put_32(input_bfd, h->glue_insn, loc);
+ }
+ }
+ }
+ break;
+ case IMAGE_REL_PPC_SECREL:
+ /* Unimplemented: codeview debugging information */
+ /* For fast access to the header of the section
+ containing the item. */
+ break;
+ case IMAGE_REL_PPC_SECTION:
+ /* Unimplemented: codeview debugging information */
+ /* Is used to indicate that the value should be relative
+ to the beginning of the section that contains the
+ symbol */
+ break;
+ case IMAGE_REL_PPC_ABSOLUTE:
+ {
+ const char *my_name;
+ if (h == 0)
+ my_name = (syms+symndx)->_n._n_name;
+ else
+ {
+ my_name = h->root.root.root.string;
+ }
+
+ fprintf(stderr,
+ _("Warning: unsupported reloc %s <file %s, section %s>\n"),
+ howto->name,
+ bfd_get_filename(input_bfd),
+ input_section->name);
+
+ fprintf(stderr,"sym %ld (%s), r_vaddr %ld (%lx)\n",
+ rel->r_symndx, my_name, (long) rel->r_vaddr,
+ (unsigned long) rel->r_vaddr);
+ }
+ break;
+ case IMAGE_REL_PPC_IMGLUE:
+ {
+ /* There is nothing to do now. This reloc was noted in the first
+ pass over the relocs, and the glue instruction extracted */
+ const char *my_name;
+ if (h->symbol_is_glue == 1)
+ break;
+ my_name = h->root.root.root.string;
+
+ (*_bfd_error_handler)
+ (_("%s: Out of order IMGLUE reloc for %s"),
+ bfd_get_filename (input_bfd), my_name);
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ }
+
+ case IMAGE_REL_PPC_ADDR32NB:
+ {
+ struct coff_link_hash_entry *myh = 0;
+ const char *name = 0;
+ DUMP_RELOC2(howto->name, rel);
+
+ if (strncmp(".idata$2",input_section->name,8) == 0 && first_thunk_address == 0)
+ {
+ /* set magic values */
+ int idata5offset;
+ struct coff_link_hash_entry *myh = 0;
+ myh = coff_link_hash_lookup (coff_hash_table (info),
+ "__idata5_magic__",
+ false, false, true);
+ first_thunk_address = myh->root.u.def.value +
+ sec->output_section->vma +
+ sec->output_offset -
+ pe_data(output_bfd)->pe_opthdr.ImageBase;
+
+ idata5offset = myh->root.u.def.value;
+ myh = coff_link_hash_lookup (coff_hash_table (info),
+ "__idata6_magic__",
+ false, false, true);
+
+ thunk_size = myh->root.u.def.value - idata5offset;
+ myh = coff_link_hash_lookup (coff_hash_table (info),
+ "__idata4_magic__",
+ false, false, true);
+ import_table_size = myh->root.u.def.value;
+ }
+
+ if (h == 0)
+ { /* it is a file local symbol */
+ sym = syms + symndx;
+ name = sym->_n._n_name;
+ }
+ else
+ {
+ char *target = 0;
+
+ name = h->root.root.root.string;
+ if (strcmp(".idata$2", name) == 0)
+ target = "__idata2_magic__";
+ else if (strcmp(".idata$4", name) == 0)
+ target = "__idata4_magic__";
+ else if (strcmp(".idata$5", name) == 0)
+ target = "__idata5_magic__";
+
+ if (target != 0)
+ {
+ myh = 0;
+
+ myh = coff_link_hash_lookup (coff_hash_table (info),
+ target,
+ false, false, true);
+ if (myh == 0)
+ {
+ /* Missing magic cookies. Something is very wrong. */
+ abort();
+ }
+
+ val = myh->root.u.def.value +
+ sec->output_section->vma + sec->output_offset;
+ if (first_thunk_address == 0)
+ {
+ int idata5offset;
+ myh = coff_link_hash_lookup (coff_hash_table (info),
+ "__idata5_magic__",
+ false, false, true);
+ first_thunk_address = myh->root.u.def.value +
+ sec->output_section->vma +
+ sec->output_offset -
+ pe_data(output_bfd)->pe_opthdr.ImageBase;
+
+ idata5offset = myh->root.u.def.value;
+ myh = coff_link_hash_lookup (coff_hash_table (info),
+ "__idata6_magic__",
+ false, false, true);
+
+ thunk_size = myh->root.u.def.value - idata5offset;
+ myh = coff_link_hash_lookup (coff_hash_table (info),
+ "__idata4_magic__",
+ false, false, true);
+ import_table_size = myh->root.u.def.value;
+ }
+ }
+ }
+
+ rstat = _bfd_relocate_contents (howto,
+ input_bfd,
+ val -
+ pe_data(output_bfd)->pe_opthdr.ImageBase,
+ loc);
+ }
+ break;
+
+ case IMAGE_REL_PPC_REL24:
+ DUMP_RELOC2(howto->name, rel);
+ val -= (input_section->output_section->vma
+ + input_section->output_offset);
+
+ rstat = _bfd_relocate_contents (howto,
+ input_bfd,
+ val,
+ loc);
+ break;
+ case IMAGE_REL_PPC_ADDR16:
+ case IMAGE_REL_PPC_ADDR24:
+ case IMAGE_REL_PPC_ADDR32:
+ DUMP_RELOC2(howto->name, rel);
+ rstat = _bfd_relocate_contents (howto,
+ input_bfd,
+ val,
+ loc);
+ break;
+ }
+
+ if ( info->base_file )
+ {
+ /* So if this is non pcrelative, and is referenced
+ to a section or a common symbol, then it needs a reloc */
+ if (sym && pe_data(output_bfd)->in_reloc_p(output_bfd, howto))
+ {
+ /* relocation to a symbol in a section which
+ isn't absolute - we output the address here
+ to a file */
+ bfd_vma addr = rel->r_vaddr
+ - input_section->vma
+ + input_section->output_offset
+ + input_section->output_section->vma;
+
+ if (coff_data(output_bfd)->pe)
+ {
+ addr -= pe_data(output_bfd)->pe_opthdr.ImageBase;
+ }
+ fwrite (&addr, 1,4, (FILE *) info->base_file);
+ }
+ }
+
+ switch (rstat)
+ {
+ default:
+ abort ();
+ case bfd_reloc_ok:
+ break;
+ case bfd_reloc_overflow:
+ {
+ const char *name;
+ char buf[SYMNMLEN + 1];
+
+ if (symndx == -1)
+ name = "*ABS*";
+ else if (h != NULL)
+ name = h->root.root.root.string;
+ else if (sym == NULL)
+ name = "*unknown*";
+ else if (sym->_n._n_n._n_zeroes == 0
+ && sym->_n._n_n._n_offset != 0)
+ name = obj_coff_strings (input_bfd) + sym->_n._n_n._n_offset;
+ else
+ {
+ strncpy (buf, sym->_n._n_name, SYMNMLEN);
+ buf[SYMNMLEN] = '\0';
+ name = buf;
+ }
+
+ if (! ((*info->callbacks->reloc_overflow)
+ (info, name, howto->name,
+ (bfd_vma) 0, input_bfd,
+ input_section, rel->r_vaddr - input_section->vma)))
+ {
+ return false;
+ }
+ }
+ }
+
+ }
+
+ return true;
+}
+
+#ifdef COFF_IMAGE_WITH_PE
+
+/* FIXME: BFD should not use global variables. This file is compiled
+ twice, and these variables are shared. This is confusing and
+ weird. */
+
+long int global_toc_size = 4;
+
+bfd* bfd_of_toc_owner = 0;
+
+long int import_table_size;
+long int first_thunk_address;
+long int thunk_size;
+
+struct list_ele *head;
+struct list_ele *tail;
+
+static char *
+h1 = N_("\n\t\t\tTOC MAPPING\n\n");
+static char *
+h2 = N_(" TOC disassembly Comments Name\n");
+static char *
+h3 = N_(" Offset spelling (if present)\n");
+
+void
+dump_toc (vfile)
+ PTR vfile;
+{
+ FILE *file = (FILE *) vfile;
+ struct list_ele *t;
+
+ fprintf(file, _(h1));
+ fprintf(file, _(h2));
+ fprintf(file, _(h3));
+
+ for(t = head; t != 0; t=t->next)
+ {
+ const char *cat = "";
+
+ if (t->cat == priv)
+ cat = _("private ");
+ else if (t->cat == pub)
+ cat = _("public ");
+ else if (t->cat == data)
+ cat = _("data-in-toc ");
+
+ if (t->offset > global_toc_size)
+ {
+ if (t->offset <= global_toc_size + thunk_size)
+ cat = _("IAT reference ");
+ else
+ {
+ fprintf(file,
+ _("**** global_toc_size %ld(%lx), thunk_size %ld(%lx)\n"),
+ global_toc_size, global_toc_size, thunk_size, thunk_size);
+ cat = _("Out of bounds!");
+ }
+ }
+
+ fprintf(file,
+ " %04lx (%d)", (unsigned long) t->offset, t->offset - 32768);
+ fprintf(file,
+ " %s %s\n",
+ cat, t->name);
+
+ }
+
+ fprintf(file, "\n");
+}
+
+boolean
+ppc_allocate_toc_section (info)
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+{
+ asection *s;
+ bfd_byte *foo;
+ static char test_char = '1';
+
+ if ( global_toc_size == 0 ) /* FIXME: does this get me in trouble? */
+ return true;
+
+ if (bfd_of_toc_owner == 0)
+ {
+ /* No toc owner? Something is very wrong. */
+ abort();
+ }
+
+ s = bfd_get_section_by_name ( bfd_of_toc_owner , TOC_SECTION_NAME);
+ if (s == NULL)
+ {
+ /* No toc section? Something is very wrong. */
+ abort();
+ }
+
+ foo = (bfd_byte *) bfd_alloc(bfd_of_toc_owner, global_toc_size);
+ memset(foo, test_char, global_toc_size);
+
+ s->_raw_size = s->_cooked_size = global_toc_size;
+ s->contents = foo;
+
+ return true;
+}
+
+boolean
+ppc_process_before_allocation (abfd, info)
+ bfd *abfd;
+ struct bfd_link_info *info;
+{
+ asection *sec;
+ struct internal_reloc *i, *rel;
+
+ /* here we have a bfd that is to be included on the link. We have a hook
+ to do reloc rummaging, before section sizes are nailed down. */
+
+ _bfd_coff_get_external_symbols(abfd);
+
+ /* rummage around all the relocs and map the toc */
+ sec = abfd->sections;
+
+ if (sec == 0)
+ {
+ return true;
+ }
+
+ for (; sec != 0; sec = sec->next)
+ {
+ if (sec->reloc_count == 0)
+ continue;
+
+ /* load the relocs */
+ /* FIXME: there may be a storage leak here */
+ i=_bfd_coff_read_internal_relocs(abfd,sec,1,0,0,0);
+
+ if (i == 0)
+ abort();
+
+ for (rel=i;rel<i+sec->reloc_count;++rel)
+ {
+ unsigned short r_type = EXTRACT_TYPE (rel->r_type);
+ unsigned short r_flags = EXTRACT_FLAGS(rel->r_type);
+ boolean ok = true;
+
+ DUMP_RELOC2(ppc_coff_howto_table[r_type].name, rel);
+
+ switch(r_type)
+ {
+ case IMAGE_REL_PPC_TOCREL16:
+ /* if TOCDEFN is on, ignore as someone else has allocated the
+ toc entry */
+ if ( (r_flags & IMAGE_REL_PPC_TOCDEFN) != IMAGE_REL_PPC_TOCDEFN )
+ ok = ppc_record_toc_entry(abfd, info, sec,
+ rel->r_symndx, default_toc);
+ if (!ok)
+ return false;
+ break;
+ case IMAGE_REL_PPC_IMGLUE:
+ ppc_mark_symbol_as_glue(abfd, rel->r_symndx, rel);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ return true;
+}
+
+#endif
+
+
+static bfd_reloc_status_type
+ppc_refhi_reloc (abfd,
+ reloc_entry,
+ symbol,
+ data,
+ input_section,
+ output_bfd,
+ error_message)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *reloc_entry ATTRIBUTE_UNUSED;
+ asymbol *symbol ATTRIBUTE_UNUSED;
+ PTR data ATTRIBUTE_UNUSED;
+ asection *input_section ATTRIBUTE_UNUSED;
+ bfd *output_bfd;
+ char **error_message ATTRIBUTE_UNUSED;
+{
+ UN_IMPL("REFHI");
+ DUMP_RELOC("REFHI",reloc_entry);
+
+ if (output_bfd == (bfd *) NULL)
+ return bfd_reloc_continue;
+
+ return bfd_reloc_undefined;
+}
+
+#if 0
+
+static bfd_reloc_status_type
+ppc_reflo_reloc (abfd,
+ reloc_entry,
+ symbol,
+ data,
+ input_section,
+ output_bfd,
+ error_message)
+ bfd *abfd;
+ arelent *reloc_entry;
+ asymbol *symbol;
+ PTR data;
+ asection *input_section;
+ bfd *output_bfd;
+ char **error_message;
+{
+ UN_IMPL("REFLO");
+ DUMP_RELOC("REFLO",reloc_entry);
+
+ if (output_bfd == (bfd *) NULL)
+ return bfd_reloc_continue;
+
+ return bfd_reloc_undefined;
+}
+
+#endif
+
+static bfd_reloc_status_type
+ppc_pair_reloc (abfd,
+ reloc_entry,
+ symbol,
+ data,
+ input_section,
+ output_bfd,
+ error_message)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *reloc_entry ATTRIBUTE_UNUSED;
+ asymbol *symbol ATTRIBUTE_UNUSED;
+ PTR data ATTRIBUTE_UNUSED;
+ asection *input_section ATTRIBUTE_UNUSED;
+ bfd *output_bfd;
+ char **error_message ATTRIBUTE_UNUSED;
+{
+ UN_IMPL("PAIR");
+ DUMP_RELOC("PAIR",reloc_entry);
+
+ if (output_bfd == (bfd *) NULL)
+ return bfd_reloc_continue;
+
+ return bfd_reloc_undefined;
+}
+
+
+static bfd_reloc_status_type
+ppc_toc16_reloc (abfd,
+ reloc_entry,
+ symbol,
+ data,
+ input_section,
+ output_bfd,
+ error_message)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *reloc_entry ATTRIBUTE_UNUSED;
+ asymbol *symbol ATTRIBUTE_UNUSED;
+ PTR data ATTRIBUTE_UNUSED;
+ asection *input_section ATTRIBUTE_UNUSED;
+ bfd *output_bfd;
+ char **error_message ATTRIBUTE_UNUSED;
+{
+ UN_IMPL("TOCREL16");
+ DUMP_RELOC("TOCREL16",reloc_entry);
+
+ if (output_bfd == (bfd *) NULL)
+ {
+ return bfd_reloc_continue;
+ }
+
+ return bfd_reloc_ok;
+}
+
+#if 0
+
+/* ADDR32NB : 32 bit address relative to the virtual origin. */
+/* (On the alpha, this is always a linker generated thunk)*/
+/* (i.e. 32bit addr relative to the image base) */
+/* */
+/* */
+
+static bfd_reloc_status_type
+ppc_addr32nb_reloc (abfd,
+ reloc_entry,
+ symbol,
+ data,
+ input_section,
+ output_bfd,
+ error_message)
+ bfd *abfd;
+ arelent *reloc_entry;
+ asymbol *symbol;
+ PTR data;
+ asection *input_section;
+ bfd *output_bfd;
+ char **error_message;
+{
+ UN_IMPL("ADDR32NB");
+ DUMP_RELOC("ADDR32NB",reloc_entry);
+
+ return bfd_reloc_ok;
+}
+
+#endif
+
+static bfd_reloc_status_type
+ppc_secrel_reloc (abfd,
+ reloc_entry,
+ symbol,
+ data,
+ input_section,
+ output_bfd,
+ error_message)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *reloc_entry ATTRIBUTE_UNUSED;
+ asymbol *symbol ATTRIBUTE_UNUSED;
+ PTR data ATTRIBUTE_UNUSED;
+ asection *input_section ATTRIBUTE_UNUSED;
+ bfd *output_bfd;
+ char **error_message ATTRIBUTE_UNUSED;
+{
+ UN_IMPL("SECREL");
+ DUMP_RELOC("SECREL",reloc_entry);
+
+ if (output_bfd == (bfd *) NULL)
+ return bfd_reloc_continue;
+
+ return bfd_reloc_ok;
+}
+
+static bfd_reloc_status_type
+ppc_section_reloc (abfd,
+ reloc_entry,
+ symbol,
+ data,
+ input_section,
+ output_bfd,
+ error_message)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *reloc_entry ATTRIBUTE_UNUSED;
+ asymbol *symbol ATTRIBUTE_UNUSED;
+ PTR data ATTRIBUTE_UNUSED;
+ asection *input_section ATTRIBUTE_UNUSED;
+ bfd *output_bfd;
+ char **error_message ATTRIBUTE_UNUSED;
+{
+ UN_IMPL("SECTION");
+ DUMP_RELOC("SECTION",reloc_entry);
+
+ if (output_bfd == (bfd *) NULL)
+ return bfd_reloc_continue;
+
+ return bfd_reloc_ok;
+}
+
+static bfd_reloc_status_type
+ppc_imglue_reloc (abfd,
+ reloc_entry,
+ symbol,
+ data,
+ input_section,
+ output_bfd,
+ error_message)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *reloc_entry ATTRIBUTE_UNUSED;
+ asymbol *symbol ATTRIBUTE_UNUSED;
+ PTR data ATTRIBUTE_UNUSED;
+ asection *input_section ATTRIBUTE_UNUSED;
+ bfd *output_bfd;
+ char **error_message ATTRIBUTE_UNUSED;
+{
+ UN_IMPL("IMGLUE");
+ DUMP_RELOC("IMGLUE",reloc_entry);
+
+ if (output_bfd == (bfd *) NULL)
+ return bfd_reloc_continue;
+
+ return bfd_reloc_ok;
+}
+
+
+
+#define MAX_RELOC_INDEX \
+ (sizeof(ppc_coff_howto_table) / sizeof(ppc_coff_howto_table[0]) - 1)
+
+
+/* FIXME: There is a possiblity that when we read in a reloc from a file,
+ that there are some bits encoded in the upper portion of the
+ type field. Not yet implemented.
+*/
+static void ppc_coff_rtype2howto PARAMS ((arelent *relent,
+ struct internal_reloc *internal));
+
+static void
+ppc_coff_rtype2howto (relent, internal)
+ arelent *relent;
+ struct internal_reloc *internal;
+{
+
+ /* We can encode one of three things in the type field, aside from the
+ type:
+ 1. IMAGE_REL_PPC_NEG - indicates the value field is a subtraction
+ value, rather than an addition value
+ 2. IMAGE_REL_PPC_BRTAKEN, IMAGE_REL_PPC_BRNTAKEN - indicates that
+ the branch is expected to be taken or not.
+ 3. IMAGE_REL_PPC_TOCDEFN - toc slot definition in the file
+ For now, we just strip this stuff to find the type, and ignore it other
+ than that.
+ */
+ reloc_howto_type *howto;
+ unsigned short r_type = EXTRACT_TYPE (internal->r_type);
+ unsigned short r_flags = EXTRACT_FLAGS(internal->r_type);
+ unsigned short junk = EXTRACT_JUNK (internal->r_type);
+
+ /* the masking process only slices off the bottom byte for r_type. */
+ if ( r_type > MAX_RELOC_INDEX )
+ abort();
+
+ /* check for absolute crap */
+ if ( junk != 0 )
+ abort();
+
+ switch(r_type)
+ {
+ case IMAGE_REL_PPC_ADDR16:
+ case IMAGE_REL_PPC_REL24:
+ case IMAGE_REL_PPC_ADDR24:
+ case IMAGE_REL_PPC_ADDR32:
+ case IMAGE_REL_PPC_IFGLUE:
+ case IMAGE_REL_PPC_ADDR32NB:
+ case IMAGE_REL_PPC_SECTION:
+ case IMAGE_REL_PPC_SECREL:
+ DUMP_RELOC2(ppc_coff_howto_table[r_type].name, internal);
+ howto = ppc_coff_howto_table + r_type;
+ break;
+ case IMAGE_REL_PPC_IMGLUE:
+ DUMP_RELOC2(ppc_coff_howto_table[r_type].name, internal);
+ howto = ppc_coff_howto_table + r_type;
+ break;
+ case IMAGE_REL_PPC_TOCREL16:
+ DUMP_RELOC2(ppc_coff_howto_table[r_type].name, internal);
+ if (r_flags & IMAGE_REL_PPC_TOCDEFN)
+ howto = ppc_coff_howto_table + IMAGE_REL_PPC_TOCREL16_DEFN;
+ else
+ howto = ppc_coff_howto_table + IMAGE_REL_PPC_TOCREL16;
+ break;
+ default:
+ fprintf(stderr,
+ _("Warning: Unsupported reloc %s [%d] used -- it may not work.\n"),
+ ppc_coff_howto_table[r_type].name,
+ r_type);
+ howto = ppc_coff_howto_table + r_type;
+ break;
+ }
+
+ relent->howto = howto;
+
+}
+
+static reloc_howto_type *
+coff_ppc_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asection *sec;
+ struct internal_reloc *rel;
+ struct coff_link_hash_entry *h ATTRIBUTE_UNUSED;
+ struct internal_syment *sym ATTRIBUTE_UNUSED;
+ bfd_vma *addendp;
+{
+ reloc_howto_type *howto;
+
+ /* We can encode one of three things in the type field, aside from the
+ type:
+ 1. IMAGE_REL_PPC_NEG - indicates the value field is a subtraction
+ value, rather than an addition value
+ 2. IMAGE_REL_PPC_BRTAKEN, IMAGE_REL_PPC_BRNTAKEN - indicates that
+ the branch is expected to be taken or not.
+ 3. IMAGE_REL_PPC_TOCDEFN - toc slot definition in the file
+ For now, we just strip this stuff to find the type, and ignore it other
+ than that.
+ */
+
+ unsigned short r_type = EXTRACT_TYPE (rel->r_type);
+ unsigned short r_flags = EXTRACT_FLAGS(rel->r_type);
+ unsigned short junk = EXTRACT_JUNK (rel->r_type);
+
+ /* the masking process only slices off the bottom byte for r_type. */
+ if ( r_type > MAX_RELOC_INDEX )
+ abort();
+
+ /* check for absolute crap */
+ if ( junk != 0 )
+ abort();
+
+ switch(r_type)
+ {
+ case IMAGE_REL_PPC_ADDR32NB:
+ DUMP_RELOC2(ppc_coff_howto_table[r_type].name, rel);
+ *addendp -= pe_data(sec->output_section->owner)->pe_opthdr.ImageBase;
+ howto = ppc_coff_howto_table + r_type;
+ break;
+ case IMAGE_REL_PPC_TOCREL16:
+ DUMP_RELOC2(ppc_coff_howto_table[r_type].name, rel);
+ if (r_flags & IMAGE_REL_PPC_TOCDEFN)
+ howto = ppc_coff_howto_table + IMAGE_REL_PPC_TOCREL16_DEFN;
+ else
+ howto = ppc_coff_howto_table + IMAGE_REL_PPC_TOCREL16;
+ break;
+ case IMAGE_REL_PPC_ADDR16:
+ case IMAGE_REL_PPC_REL24:
+ case IMAGE_REL_PPC_ADDR24:
+ case IMAGE_REL_PPC_ADDR32:
+ case IMAGE_REL_PPC_IFGLUE:
+ case IMAGE_REL_PPC_SECTION:
+ case IMAGE_REL_PPC_SECREL:
+ DUMP_RELOC2(ppc_coff_howto_table[r_type].name, rel);
+ howto = ppc_coff_howto_table + r_type;
+ break;
+ case IMAGE_REL_PPC_IMGLUE:
+ DUMP_RELOC2(ppc_coff_howto_table[r_type].name, rel);
+ howto = ppc_coff_howto_table + r_type;
+ break;
+ default:
+ fprintf(stderr,
+ _("Warning: Unsupported reloc %s [%d] used -- it may not work.\n"),
+ ppc_coff_howto_table[r_type].name,
+ r_type);
+ howto = ppc_coff_howto_table + r_type;
+ break;
+ }
+
+ return howto;
+}
+
+
+/* a cheesy little macro to make the code a little more readable */
+#define HOW2MAP(bfd_rtype,ppc_rtype) \
+ case bfd_rtype: return &ppc_coff_howto_table[ppc_rtype]
+
+static reloc_howto_type *ppc_coff_reloc_type_lookup
+PARAMS ((bfd *, bfd_reloc_code_real_type));
+
+static reloc_howto_type *
+ppc_coff_reloc_type_lookup (abfd, code)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ bfd_reloc_code_real_type code;
+{
+ switch (code)
+ {
+ HOW2MAP(BFD_RELOC_32_GOTOFF, IMAGE_REL_PPC_IMGLUE);
+ HOW2MAP(BFD_RELOC_16_GOT_PCREL, IMAGE_REL_PPC_IFGLUE);
+ HOW2MAP(BFD_RELOC_16, IMAGE_REL_PPC_ADDR16);
+ HOW2MAP(BFD_RELOC_PPC_B26, IMAGE_REL_PPC_REL24);
+ HOW2MAP(BFD_RELOC_PPC_BA26, IMAGE_REL_PPC_ADDR24);
+ HOW2MAP(BFD_RELOC_PPC_TOC16, IMAGE_REL_PPC_TOCREL16);
+ HOW2MAP(BFD_RELOC_16_GOTOFF, IMAGE_REL_PPC_TOCREL16_DEFN);
+ HOW2MAP(BFD_RELOC_32, IMAGE_REL_PPC_ADDR32);
+ HOW2MAP(BFD_RELOC_RVA, IMAGE_REL_PPC_ADDR32NB);
+ default:
+ return NULL;
+ }
+ /*NOTREACHED*/
+}
+
+#undef HOW2MAP
+
+
+/* Tailor coffcode.h -- macro heaven. */
+
+#define RTYPE2HOWTO(cache_ptr, dst) ppc_coff_rtype2howto (cache_ptr, dst)
+
+#ifndef COFF_IMAGE_WITH_PE
+static void ppc_coff_swap_sym_in_hook PARAMS ((bfd *, PTR, PTR));
+#endif
+
+/* We use the special COFF backend linker, with our own special touch. */
+
+#define coff_bfd_reloc_type_lookup ppc_coff_reloc_type_lookup
+#define coff_rtype_to_howto coff_ppc_rtype_to_howto
+#define coff_relocate_section coff_ppc_relocate_section
+#define coff_bfd_final_link ppc_bfd_coff_final_link
+
+#ifndef COFF_IMAGE_WITH_PE
+/* FIXME: This no longer works. */
+#define coff_swap_sym_in_hook ppc_coff_swap_sym_in_hook
+#endif
+
+#define SELECT_RELOC(internal, howto) {internal.r_type=howto->type;}
+
+#define COFF_PAGE_SIZE 0x1000
+
+/* FIXME: This controls some code that used to be in peicode.h and is
+ now in peigen.c. It will not control the code in peigen.c. If
+ anybody wants to get this working, you will need to fix that. */
+#define POWERPC_LE_PE
+
+#define COFF_SECTION_ALIGNMENT_ENTRIES \
+{ COFF_SECTION_NAME_EXACT_MATCH (".idata$2"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }, \
+{ COFF_SECTION_NAME_EXACT_MATCH (".idata$3"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }, \
+{ COFF_SECTION_NAME_EXACT_MATCH (".idata$4"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
+{ COFF_SECTION_NAME_EXACT_MATCH (".idata$5"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
+{ COFF_SECTION_NAME_EXACT_MATCH (".idata$6"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 1 }, \
+{ COFF_SECTION_NAME_EXACT_MATCH (".reloc"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 1 }
+
+#include "coffcode.h"
+
+
+
+#ifndef COFF_IMAGE_WITH_PE
+/* FIXME:
+ What we're trying to do here is allocate a toc section (early), and attach
+ it to the last bfd to be processed. This avoids the problem of having a toc
+ written out before all files have been processed. This code allocates
+ a toc section for every file, and records the last one seen. There are
+ at least two problems with this approach:
+ 1. We allocate whole bunches of toc sections that are ignored, but at
+ at least we will not allocate a toc if no .toc is present.
+ 2. It's not clear to me that being the last bfd read necessarily means
+ that you are the last bfd closed.
+ 3. Doing it on a "swap in" hook depends on when the "swap in" is called,
+ and how often, etc. It's not clear to me that there isn't a hole here.
+*/
+
+static void
+ppc_coff_swap_sym_in_hook (abfd, ext1, in1)
+ bfd *abfd;
+ PTR ext1 ATTRIBUTE_UNUSED;
+ PTR in1;
+{
+ struct internal_syment *in = (struct internal_syment *)in1;
+
+ if (bfd_of_toc_owner != 0) /* we already have a toc, so go home */
+ return;
+
+ if (strcmp(in->_n._n_name, ".toc") == 0)
+ {
+ flagword flags;
+ register asection *s;
+
+ s = bfd_get_section_by_name ( abfd , TOC_SECTION_NAME);
+ if (s != NULL)
+ {
+ return;
+ }
+
+ flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY ;
+
+ s = bfd_make_section (abfd, TOC_SECTION_NAME);
+
+ if (s == NULL
+ || !bfd_set_section_flags (abfd, s, flags)
+ || !bfd_set_section_alignment (abfd, s, 2))
+ {
+ /* FIXME: set appropriate bfd error */
+ abort();
+ }
+
+ /* save the bfd for later allocation */
+ bfd_of_toc_owner = abfd;
+ }
+
+ return;
+}
+#endif
+
+#ifndef COFF_IMAGE_WITH_PE
+
+static boolean ppc_do_last PARAMS ((bfd *));
+static bfd *ppc_get_last PARAMS ((void));
+
+static boolean
+ppc_do_last (abfd)
+ bfd *abfd;
+{
+ if (abfd == bfd_of_toc_owner)
+ return true;
+ else
+ return false;
+}
+
+static bfd *
+ppc_get_last()
+{
+ return bfd_of_toc_owner;
+}
+
+/* this piece of machinery exists only to guarantee that the bfd that holds
+ the toc section is written last.
+
+ This does depend on bfd_make_section attaching a new section to the
+ end of the section list for the bfd.
+
+ This is otherwise intended to be functionally the same as
+ cofflink.c:_bfd_coff_final_link(). It is specifically different only
+ where the POWERPC_LE_PE macro modifies the code. It is left in as a
+ precise form of comment. krk@cygnus.com
+*/
+
+
+/* Do the final link step. */
+
+boolean
+ppc_bfd_coff_final_link (abfd, info)
+ bfd *abfd;
+ struct bfd_link_info *info;
+{
+ bfd_size_type symesz;
+ struct coff_final_link_info finfo;
+ boolean debug_merge_allocated;
+ asection *o;
+ struct bfd_link_order *p;
+ size_t max_sym_count;
+ size_t max_lineno_count;
+ size_t max_reloc_count;
+ size_t max_output_reloc_count;
+ size_t max_contents_size;
+ file_ptr rel_filepos;
+ unsigned int relsz;
+ file_ptr line_filepos;
+ unsigned int linesz;
+ bfd *sub;
+ bfd_byte *external_relocs = NULL;
+ char strbuf[STRING_SIZE_SIZE];
+
+ symesz = bfd_coff_symesz (abfd);
+
+ finfo.info = info;
+ finfo.output_bfd = abfd;
+ finfo.strtab = NULL;
+ finfo.section_info = NULL;
+ finfo.last_file_index = -1;
+ finfo.last_bf_index = -1;
+ finfo.internal_syms = NULL;
+ finfo.sec_ptrs = NULL;
+ finfo.sym_indices = NULL;
+ finfo.outsyms = NULL;
+ finfo.linenos = NULL;
+ finfo.contents = NULL;
+ finfo.external_relocs = NULL;
+ finfo.internal_relocs = NULL;
+ debug_merge_allocated = false;
+
+ coff_data (abfd)->link_info = info;
+
+ finfo.strtab = _bfd_stringtab_init ();
+ if (finfo.strtab == NULL)
+ goto error_return;
+
+ if (! coff_debug_merge_hash_table_init (&finfo.debug_merge))
+ goto error_return;
+ debug_merge_allocated = true;
+
+ /* Compute the file positions for all the sections. */
+ if (! abfd->output_has_begun)
+ {
+ if (! bfd_coff_compute_section_file_positions (abfd))
+ return false;
+ }
+
+ /* Count the line numbers and relocation entries required for the
+ output file. Set the file positions for the relocs. */
+ rel_filepos = obj_relocbase (abfd);
+ relsz = bfd_coff_relsz (abfd);
+ max_contents_size = 0;
+ max_lineno_count = 0;
+ max_reloc_count = 0;
+
+ for (o = abfd->sections; o != NULL; o = o->next)
+ {
+ o->reloc_count = 0;
+ o->lineno_count = 0;
+ for (p = o->link_order_head; p != NULL; p = p->next)
+ {
+
+ if (p->type == bfd_indirect_link_order)
+ {
+ asection *sec;
+
+ sec = p->u.indirect.section;
+
+ /* Mark all sections which are to be included in the
+ link. This will normally be every section. We need
+ to do this so that we can identify any sections which
+ the linker has decided to not include. */
+ sec->linker_mark = true;
+
+ if (info->strip == strip_none
+ || info->strip == strip_some)
+ o->lineno_count += sec->lineno_count;
+
+ if (info->relocateable)
+ o->reloc_count += sec->reloc_count;
+
+ if (sec->_raw_size > max_contents_size)
+ max_contents_size = sec->_raw_size;
+ if (sec->lineno_count > max_lineno_count)
+ max_lineno_count = sec->lineno_count;
+ if (sec->reloc_count > max_reloc_count)
+ max_reloc_count = sec->reloc_count;
+ }
+ else if (info->relocateable
+ && (p->type == bfd_section_reloc_link_order
+ || p->type == bfd_symbol_reloc_link_order))
+ ++o->reloc_count;
+ }
+ if (o->reloc_count == 0)
+ o->rel_filepos = 0;
+ else
+ {
+ o->flags |= SEC_RELOC;
+ o->rel_filepos = rel_filepos;
+ rel_filepos += o->reloc_count * relsz;
+ }
+ }
+
+ /* If doing a relocateable link, allocate space for the pointers we
+ need to keep. */
+ if (info->relocateable)
+ {
+ unsigned int i;
+
+ /* We use section_count + 1, rather than section_count, because
+ the target_index fields are 1 based. */
+ finfo.section_info =
+ ((struct coff_link_section_info *)
+ bfd_malloc ((abfd->section_count + 1)
+ * sizeof (struct coff_link_section_info)));
+ if (finfo.section_info == NULL)
+ goto error_return;
+ for (i = 0; i <= abfd->section_count; i++)
+ {
+ finfo.section_info[i].relocs = NULL;
+ finfo.section_info[i].rel_hashes = NULL;
+ }
+ }
+
+ /* We now know the size of the relocs, so we can determine the file
+ positions of the line numbers. */
+ line_filepos = rel_filepos;
+ linesz = bfd_coff_linesz (abfd);
+ max_output_reloc_count = 0;
+ for (o = abfd->sections; o != NULL; o = o->next)
+ {
+ if (o->lineno_count == 0)
+ o->line_filepos = 0;
+ else
+ {
+ o->line_filepos = line_filepos;
+ line_filepos += o->lineno_count * linesz;
+ }
+
+ if (o->reloc_count != 0)
+ {
+ /* We don't know the indices of global symbols until we have
+ written out all the local symbols. For each section in
+ the output file, we keep an array of pointers to hash
+ table entries. Each entry in the array corresponds to a
+ reloc. When we find a reloc against a global symbol, we
+ set the corresponding entry in this array so that we can
+ fix up the symbol index after we have written out all the
+ local symbols.
+
+ Because of this problem, we also keep the relocs in
+ memory until the end of the link. This wastes memory,
+ but only when doing a relocateable link, which is not the
+ common case. */
+ BFD_ASSERT (info->relocateable);
+ finfo.section_info[o->target_index].relocs =
+ ((struct internal_reloc *)
+ bfd_malloc (o->reloc_count * sizeof (struct internal_reloc)));
+ finfo.section_info[o->target_index].rel_hashes =
+ ((struct coff_link_hash_entry **)
+ bfd_malloc (o->reloc_count
+ * sizeof (struct coff_link_hash_entry *)));
+ if (finfo.section_info[o->target_index].relocs == NULL
+ || finfo.section_info[o->target_index].rel_hashes == NULL)
+ goto error_return;
+
+ if (o->reloc_count > max_output_reloc_count)
+ max_output_reloc_count = o->reloc_count;
+ }
+
+ /* Reset the reloc and lineno counts, so that we can use them to
+ count the number of entries we have output so far. */
+ o->reloc_count = 0;
+ o->lineno_count = 0;
+ }
+
+ obj_sym_filepos (abfd) = line_filepos;
+
+ /* Figure out the largest number of symbols in an input BFD. Take
+ the opportunity to clear the output_has_begun fields of all the
+ input BFD's. */
+ max_sym_count = 0;
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ {
+ size_t sz;
+
+ sub->output_has_begun = false;
+ sz = obj_raw_syment_count (sub);
+ if (sz > max_sym_count)
+ max_sym_count = sz;
+ }
+
+ /* Allocate some buffers used while linking. */
+ finfo.internal_syms = ((struct internal_syment *)
+ bfd_malloc (max_sym_count
+ * sizeof (struct internal_syment)));
+ finfo.sec_ptrs = (asection **) bfd_malloc (max_sym_count
+ * sizeof (asection *));
+ finfo.sym_indices = (long *) bfd_malloc (max_sym_count * sizeof (long));
+ finfo.outsyms = ((bfd_byte *)
+ bfd_malloc ((size_t) ((max_sym_count + 1) * symesz)));
+ finfo.linenos = (bfd_byte *) bfd_malloc (max_lineno_count
+ * bfd_coff_linesz (abfd));
+ finfo.contents = (bfd_byte *) bfd_malloc (max_contents_size);
+ finfo.external_relocs = (bfd_byte *) bfd_malloc (max_reloc_count * relsz);
+ if (! info->relocateable)
+ finfo.internal_relocs = ((struct internal_reloc *)
+ bfd_malloc (max_reloc_count
+ * sizeof (struct internal_reloc)));
+ if ((finfo.internal_syms == NULL && max_sym_count > 0)
+ || (finfo.sec_ptrs == NULL && max_sym_count > 0)
+ || (finfo.sym_indices == NULL && max_sym_count > 0)
+ || finfo.outsyms == NULL
+ || (finfo.linenos == NULL && max_lineno_count > 0)
+ || (finfo.contents == NULL && max_contents_size > 0)
+ || (finfo.external_relocs == NULL && max_reloc_count > 0)
+ || (! info->relocateable
+ && finfo.internal_relocs == NULL
+ && max_reloc_count > 0))
+ goto error_return;
+
+ /* We now know the position of everything in the file, except that
+ we don't know the size of the symbol table and therefore we don't
+ know where the string table starts. We just build the string
+ table in memory as we go along. We process all the relocations
+ for a single input file at once. */
+ obj_raw_syment_count (abfd) = 0;
+
+ if (coff_backend_info (abfd)->_bfd_coff_start_final_link)
+ {
+ if (! bfd_coff_start_final_link (abfd, info))
+ goto error_return;
+ }
+
+ for (o = abfd->sections; o != NULL; o = o->next)
+ {
+ for (p = o->link_order_head; p != NULL; p = p->next)
+ {
+ if (p->type == bfd_indirect_link_order
+ && (bfd_get_flavour (p->u.indirect.section->owner)
+ == bfd_target_coff_flavour))
+ {
+ sub = p->u.indirect.section->owner;
+#ifdef POWERPC_LE_PE
+ if (! sub->output_has_begun && !ppc_do_last(sub))
+#else
+ if (! sub->output_has_begun)
+#endif
+ {
+ if (! _bfd_coff_link_input_bfd (&finfo, sub))
+ goto error_return;
+ sub->output_has_begun = true;
+ }
+ }
+ else if (p->type == bfd_section_reloc_link_order
+ || p->type == bfd_symbol_reloc_link_order)
+ {
+ if (! _bfd_coff_reloc_link_order (abfd, &finfo, o, p))
+ goto error_return;
+ }
+ else
+ {
+ if (! _bfd_default_link_order (abfd, info, o, p))
+ goto error_return;
+ }
+ }
+ }
+
+#ifdef POWERPC_LE_PE
+ {
+ bfd* last_one = ppc_get_last();
+ if (last_one)
+ {
+ if (! _bfd_coff_link_input_bfd (&finfo, last_one))
+ goto error_return;
+ }
+ last_one->output_has_begun = true;
+ }
+#endif
+
+ /* Free up the buffers used by _bfd_coff_link_input_bfd. */
+
+ coff_debug_merge_hash_table_free (&finfo.debug_merge);
+ debug_merge_allocated = false;
+
+ if (finfo.internal_syms != NULL)
+ {
+ free (finfo.internal_syms);
+ finfo.internal_syms = NULL;
+ }
+ if (finfo.sec_ptrs != NULL)
+ {
+ free (finfo.sec_ptrs);
+ finfo.sec_ptrs = NULL;
+ }
+ if (finfo.sym_indices != NULL)
+ {
+ free (finfo.sym_indices);
+ finfo.sym_indices = NULL;
+ }
+ if (finfo.linenos != NULL)
+ {
+ free (finfo.linenos);
+ finfo.linenos = NULL;
+ }
+ if (finfo.contents != NULL)
+ {
+ free (finfo.contents);
+ finfo.contents = NULL;
+ }
+ if (finfo.external_relocs != NULL)
+ {
+ free (finfo.external_relocs);
+ finfo.external_relocs = NULL;
+ }
+ if (finfo.internal_relocs != NULL)
+ {
+ free (finfo.internal_relocs);
+ finfo.internal_relocs = NULL;
+ }
+
+ /* The value of the last C_FILE symbol is supposed to be the symbol
+ index of the first external symbol. Write it out again if
+ necessary. */
+ if (finfo.last_file_index != -1
+ && (unsigned int) finfo.last_file.n_value != obj_raw_syment_count (abfd))
+ {
+ finfo.last_file.n_value = obj_raw_syment_count (abfd);
+ bfd_coff_swap_sym_out (abfd, (PTR) &finfo.last_file,
+ (PTR) finfo.outsyms);
+ if (bfd_seek (abfd,
+ (obj_sym_filepos (abfd)
+ + finfo.last_file_index * symesz),
+ SEEK_SET) != 0
+ || bfd_write (finfo.outsyms, symesz, 1, abfd) != symesz)
+ return false;
+ }
+
+ /* Write out the global symbols. */
+ finfo.failed = false;
+ coff_link_hash_traverse (coff_hash_table (info), _bfd_coff_write_global_sym,
+ (PTR) &finfo);
+ if (finfo.failed)
+ goto error_return;
+
+ /* The outsyms buffer is used by _bfd_coff_write_global_sym. */
+ if (finfo.outsyms != NULL)
+ {
+ free (finfo.outsyms);
+ finfo.outsyms = NULL;
+ }
+
+ if (info->relocateable)
+ {
+ /* Now that we have written out all the global symbols, we know
+ the symbol indices to use for relocs against them, and we can
+ finally write out the relocs. */
+ external_relocs = ((bfd_byte *)
+ bfd_malloc (max_output_reloc_count * relsz));
+ if (external_relocs == NULL)
+ goto error_return;
+
+ for (o = abfd->sections; o != NULL; o = o->next)
+ {
+ struct internal_reloc *irel;
+ struct internal_reloc *irelend;
+ struct coff_link_hash_entry **rel_hash;
+ bfd_byte *erel;
+
+ if (o->reloc_count == 0)
+ continue;
+
+ irel = finfo.section_info[o->target_index].relocs;
+ irelend = irel + o->reloc_count;
+ rel_hash = finfo.section_info[o->target_index].rel_hashes;
+ erel = external_relocs;
+ for (; irel < irelend; irel++, rel_hash++, erel += relsz)
+ {
+ if (*rel_hash != NULL)
+ {
+ BFD_ASSERT ((*rel_hash)->indx >= 0);
+ irel->r_symndx = (*rel_hash)->indx;
+ }
+ bfd_coff_swap_reloc_out (abfd, (PTR) irel, (PTR) erel);
+ }
+
+ if (bfd_seek (abfd, o->rel_filepos, SEEK_SET) != 0
+ || bfd_write ((PTR) external_relocs, relsz, o->reloc_count,
+ abfd) != relsz * o->reloc_count)
+ goto error_return;
+ }
+
+ free (external_relocs);
+ external_relocs = NULL;
+ }
+
+ /* Free up the section information. */
+ if (finfo.section_info != NULL)
+ {
+ unsigned int i;
+
+ for (i = 0; i < abfd->section_count; i++)
+ {
+ if (finfo.section_info[i].relocs != NULL)
+ free (finfo.section_info[i].relocs);
+ if (finfo.section_info[i].rel_hashes != NULL)
+ free (finfo.section_info[i].rel_hashes);
+ }
+ free (finfo.section_info);
+ finfo.section_info = NULL;
+ }
+
+ /* If we have optimized stabs strings, output them. */
+ if (coff_hash_table (info)->stab_info != NULL)
+ {
+ if (! _bfd_write_stab_strings (abfd, &coff_hash_table (info)->stab_info))
+ return false;
+ }
+
+ /* Write out the string table. */
+ if (obj_raw_syment_count (abfd) != 0)
+ {
+ if (bfd_seek (abfd,
+ (obj_sym_filepos (abfd)
+ + obj_raw_syment_count (abfd) * symesz),
+ SEEK_SET) != 0)
+ return false;
+
+#if STRING_SIZE_SIZE == 4
+ bfd_h_put_32 (abfd,
+ _bfd_stringtab_size (finfo.strtab) + STRING_SIZE_SIZE,
+ (bfd_byte *) strbuf);
+#else
+ #error Change bfd_h_put_32
+#endif
+
+ if (bfd_write (strbuf, 1, STRING_SIZE_SIZE, abfd) != STRING_SIZE_SIZE)
+ return false;
+
+ if (! _bfd_stringtab_emit (abfd, finfo.strtab))
+ return false;
+ }
+
+ _bfd_stringtab_free (finfo.strtab);
+
+ /* Setting bfd_get_symcount to 0 will cause write_object_contents to
+ not try to write out the symbols. */
+ bfd_get_symcount (abfd) = 0;
+
+ return true;
+
+ error_return:
+ if (debug_merge_allocated)
+ coff_debug_merge_hash_table_free (&finfo.debug_merge);
+ if (finfo.strtab != NULL)
+ _bfd_stringtab_free (finfo.strtab);
+ if (finfo.section_info != NULL)
+ {
+ unsigned int i;
+
+ for (i = 0; i < abfd->section_count; i++)
+ {
+ if (finfo.section_info[i].relocs != NULL)
+ free (finfo.section_info[i].relocs);
+ if (finfo.section_info[i].rel_hashes != NULL)
+ free (finfo.section_info[i].rel_hashes);
+ }
+ free (finfo.section_info);
+ }
+ if (finfo.internal_syms != NULL)
+ free (finfo.internal_syms);
+ if (finfo.sec_ptrs != NULL)
+ free (finfo.sec_ptrs);
+ if (finfo.sym_indices != NULL)
+ free (finfo.sym_indices);
+ if (finfo.outsyms != NULL)
+ free (finfo.outsyms);
+ if (finfo.linenos != NULL)
+ free (finfo.linenos);
+ if (finfo.contents != NULL)
+ free (finfo.contents);
+ if (finfo.external_relocs != NULL)
+ free (finfo.external_relocs);
+ if (finfo.internal_relocs != NULL)
+ free (finfo.internal_relocs);
+ if (external_relocs != NULL)
+ free (external_relocs);
+ return false;
+}
+#endif
+
+
+/* Forward declaration for use by alternative_target field. */
+#ifdef TARGET_BIG_SYM
+extern const bfd_target TARGET_BIG_SYM;
+#endif
+
+/* The transfer vectors that lead the outside world to all of the above. */
+
+#ifdef TARGET_LITTLE_SYM
+const bfd_target TARGET_LITTLE_SYM =
+{
+ TARGET_LITTLE_NAME, /* name or coff-arm-little */
+ bfd_target_coff_flavour,
+ BFD_ENDIAN_LITTLE, /* data byte order is little */
+ BFD_ENDIAN_LITTLE, /* header byte order is little */
+
+ (HAS_RELOC | EXEC_P | /* FIXME: object flags */
+ HAS_LINENO | HAS_DEBUG |
+ HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
+
+#ifndef COFF_WITH_PE
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
+#else
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */
+ | SEC_LINK_ONCE | SEC_LINK_DUPLICATES),
+#endif
+
+ 0, /* leading char */
+ '/', /* ar_pad_char */
+ 15, /* ar_max_namelen??? FIXMEmgo */
+
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
+
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
+
+ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
+ bfd_generic_archive_p, /* _bfd_dummy_target */ coff_object_p },
+ {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
+ bfd_false},
+ {bfd_false, coff_write_object_contents, /* bfd_write_contents */
+ _bfd_write_archive_contents, bfd_false},
+
+ BFD_JUMP_TABLE_GENERIC (coff),
+ BFD_JUMP_TABLE_COPY (coff),
+ BFD_JUMP_TABLE_CORE (_bfd_nocore),
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
+ BFD_JUMP_TABLE_SYMBOLS (coff),
+ BFD_JUMP_TABLE_RELOCS (coff),
+ BFD_JUMP_TABLE_WRITE (coff),
+ BFD_JUMP_TABLE_LINK (coff),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+
+ /* Alternative_target. */
+#ifdef TARGET_BIG_SYM
+ & TARGET_BIG_SYM,
+#else
+ NULL,
+#endif
+
+ COFF_SWAP_TABLE
+};
+#endif
+
+#ifdef TARGET_BIG_SYM
+const bfd_target TARGET_BIG_SYM =
+{
+ TARGET_BIG_NAME,
+ bfd_target_coff_flavour,
+ BFD_ENDIAN_BIG, /* data byte order is big */
+ BFD_ENDIAN_BIG, /* header byte order is big */
+
+ (HAS_RELOC | EXEC_P | /* FIXME: object flags */
+ HAS_LINENO | HAS_DEBUG |
+ HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
+
+#ifndef COFF_WITH_PE
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
+#else
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */
+ | SEC_LINK_ONCE | SEC_LINK_DUPLICATES),
+#endif
+
+ 0, /* leading char */
+ '/', /* ar_pad_char */
+ 15, /* ar_max_namelen??? FIXMEmgo */
+
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
+
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
+
+ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
+ bfd_generic_archive_p, /* _bfd_dummy_target */ coff_object_p },
+ {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
+ bfd_false},
+ {bfd_false, coff_write_object_contents, /* bfd_write_contents */
+ _bfd_write_archive_contents, bfd_false},
+
+ BFD_JUMP_TABLE_GENERIC (coff),
+ BFD_JUMP_TABLE_COPY (coff),
+ BFD_JUMP_TABLE_CORE (_bfd_nocore),
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
+ BFD_JUMP_TABLE_SYMBOLS (coff),
+ BFD_JUMP_TABLE_RELOCS (coff),
+ BFD_JUMP_TABLE_WRITE (coff),
+ BFD_JUMP_TABLE_LINK (coff),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+
+
+ /* Alternative_target. */
+#ifdef TARGET_LITTLE_SYM
+ & TARGET_LITTLE_SYM,
+#else
+ NULL,
+#endif
+
+ COFF_SWAP_TABLE
+};
+
+#endif
diff --git a/contrib/binutils/bfd/coff-sparc.c b/contrib/binutils/bfd/coff-sparc.c
new file mode 100644
index 000000000000..5e919da1f990
--- /dev/null
+++ b/contrib/binutils/bfd/coff-sparc.c
@@ -0,0 +1,214 @@
+/* BFD back-end for Sparc COFF files.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
+ Free Software Foundation, Inc.
+ Written by Cygnus Support.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "coff/sparc.h"
+#include "coff/internal.h"
+#include "libcoff.h"
+
+#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3)
+
+#define BADMAG(x) ((x).f_magic != SPARCMAGIC && (x).f_magic != LYNXCOFFMAGIC)
+
+/* The page size is a guess based on ELF. */
+#define COFF_PAGE_SIZE 0x10000
+
+enum reloc_type
+ {
+ R_SPARC_NONE = 0,
+ R_SPARC_8, R_SPARC_16, R_SPARC_32,
+ R_SPARC_DISP8, R_SPARC_DISP16, R_SPARC_DISP32,
+ R_SPARC_WDISP30, R_SPARC_WDISP22,
+ R_SPARC_HI22, R_SPARC_22,
+ R_SPARC_13, R_SPARC_LO10,
+ R_SPARC_GOT10, R_SPARC_GOT13, R_SPARC_GOT22,
+ R_SPARC_PC10, R_SPARC_PC22,
+ R_SPARC_WPLT30,
+ R_SPARC_COPY,
+ R_SPARC_GLOB_DAT, R_SPARC_JMP_SLOT,
+ R_SPARC_RELATIVE,
+ R_SPARC_UA32,
+ R_SPARC_max
+ };
+
+#if 0
+static CONST char *CONST reloc_type_names[] =
+{
+ "R_SPARC_NONE",
+ "R_SPARC_8", "R_SPARC_16", "R_SPARC_32",
+ "R_SPARC_DISP8", "R_SPARC_DISP16", "R_SPARC_DISP32",
+ "R_SPARC_WDISP30", "R_SPARC_WDISP22",
+ "R_SPARC_HI22", "R_SPARC_22",
+ "R_SPARC_13", "R_SPARC_LO10",
+ "R_SPARC_GOT10", "R_SPARC_GOT13", "R_SPARC_GOT22",
+ "R_SPARC_PC10", "R_SPARC_PC22",
+ "R_SPARC_WPLT30",
+ "R_SPARC_COPY",
+ "R_SPARC_GLOB_DAT", "R_SPARC_JMP_SLOT",
+ "R_SPARC_RELATIVE",
+ "R_SPARC_UA32",
+};
+#endif
+
+/* This is stolen pretty directly from elf.c. */
+static bfd_reloc_status_type
+bfd_coff_generic_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR,
+ asection *, bfd *, char **));
+
+static bfd_reloc_status_type
+bfd_coff_generic_reloc (abfd, reloc_entry, symbol, data, input_section,
+ output_bfd, error_message)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *reloc_entry;
+ asymbol *symbol;
+ PTR data ATTRIBUTE_UNUSED;
+ asection *input_section;
+ bfd *output_bfd;
+ char **error_message ATTRIBUTE_UNUSED;
+{
+ if (output_bfd != (bfd *) NULL
+ && (symbol->flags & BSF_SECTION_SYM) == 0)
+ {
+ reloc_entry->address += input_section->output_offset;
+ return bfd_reloc_ok;
+ }
+
+ return bfd_reloc_continue;
+}
+
+static reloc_howto_type coff_sparc_howto_table[] =
+{
+ HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_NONE", false,0,0x00000000,true),
+ HOWTO(R_SPARC_8, 0,0, 8,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_8", false,0,0x000000ff,true),
+ HOWTO(R_SPARC_16, 0,1,16,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_16", false,0,0x0000ffff,true),
+ HOWTO(R_SPARC_32, 0,2,32,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_32", false,0,0xffffffff,true),
+ HOWTO(R_SPARC_DISP8, 0,0, 8,true, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_DISP8", false,0,0x000000ff,true),
+ HOWTO(R_SPARC_DISP16, 0,1,16,true, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_DISP16", false,0,0x0000ffff,true),
+ HOWTO(R_SPARC_DISP32, 0,2,32,true, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_DISP32", false,0,0x00ffffff,true),
+ HOWTO(R_SPARC_WDISP30, 2,2,30,true, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_WDISP30", false,0,0x3fffffff,true),
+ HOWTO(R_SPARC_WDISP22, 2,2,22,true, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_WDISP22", false,0,0x003fffff,true),
+ HOWTO(R_SPARC_HI22, 10,2,22,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_HI22", false,0,0x003fffff,true),
+ HOWTO(R_SPARC_22, 0,2,22,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_22", false,0,0x003fffff,true),
+ HOWTO(R_SPARC_13, 0,2,13,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_13", false,0,0x00001fff,true),
+ HOWTO(R_SPARC_LO10, 0,2,10,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_LO10", false,0,0x000003ff,true),
+ HOWTO(R_SPARC_GOT10, 0,2,10,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_GOT10", false,0,0x000003ff,true),
+ HOWTO(R_SPARC_GOT13, 0,2,13,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_GOT13", false,0,0x00001fff,true),
+ HOWTO(R_SPARC_GOT22, 10,2,22,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_GOT22", false,0,0x003fffff,true),
+ HOWTO(R_SPARC_PC10, 0,2,10,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_PC10", false,0,0x000003ff,true),
+ HOWTO(R_SPARC_PC22, 0,2,22,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_PC22", false,0,0x003fffff,true),
+ HOWTO(R_SPARC_WPLT30, 0,0,00,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_WPLT30", false,0,0x00000000,true),
+ HOWTO(R_SPARC_COPY, 0,0,00,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_COPY", false,0,0x00000000,true),
+ HOWTO(R_SPARC_GLOB_DAT,0,0,00,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_GLOB_DAT",false,0,0x00000000,true),
+ HOWTO(R_SPARC_JMP_SLOT,0,0,00,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_JMP_SLOT",false,0,0x00000000,true),
+ HOWTO(R_SPARC_RELATIVE,0,0,00,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_RELATIVE",false,0,0x00000000,true),
+ HOWTO(R_SPARC_UA32, 0,0,00,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_UA32", false,0,0x00000000,true),
+};
+
+struct coff_reloc_map {
+ bfd_reloc_code_real_type bfd_reloc_val;
+ unsigned char coff_reloc_val;
+};
+
+static CONST struct coff_reloc_map sparc_reloc_map[] =
+{
+ { BFD_RELOC_NONE, R_SPARC_NONE, },
+ { BFD_RELOC_16, R_SPARC_16, },
+ { BFD_RELOC_8, R_SPARC_8 },
+ { BFD_RELOC_8_PCREL, R_SPARC_DISP8 },
+ { BFD_RELOC_CTOR, R_SPARC_32 }, /* @@ Assumes 32 bits. */
+ { BFD_RELOC_32, R_SPARC_32 },
+ { BFD_RELOC_32_PCREL, R_SPARC_DISP32 },
+ { BFD_RELOC_HI22, R_SPARC_HI22 },
+ { BFD_RELOC_LO10, R_SPARC_LO10, },
+ { BFD_RELOC_32_PCREL_S2, R_SPARC_WDISP30 },
+ { BFD_RELOC_SPARC22, R_SPARC_22 },
+ { BFD_RELOC_SPARC13, R_SPARC_13 },
+ { BFD_RELOC_SPARC_GOT10, R_SPARC_GOT10 },
+ { BFD_RELOC_SPARC_GOT13, R_SPARC_GOT13 },
+ { BFD_RELOC_SPARC_GOT22, R_SPARC_GOT22 },
+ { BFD_RELOC_SPARC_PC10, R_SPARC_PC10 },
+ { BFD_RELOC_SPARC_PC22, R_SPARC_PC22 },
+ { BFD_RELOC_SPARC_WPLT30, R_SPARC_WPLT30 },
+ { BFD_RELOC_SPARC_COPY, R_SPARC_COPY },
+ { BFD_RELOC_SPARC_GLOB_DAT, R_SPARC_GLOB_DAT },
+ { BFD_RELOC_SPARC_JMP_SLOT, R_SPARC_JMP_SLOT },
+ { BFD_RELOC_SPARC_RELATIVE, R_SPARC_RELATIVE },
+ { BFD_RELOC_SPARC_WDISP22, R_SPARC_WDISP22 },
+ /* { BFD_RELOC_SPARC_UA32, R_SPARC_UA32 }, not used?? */
+};
+
+static reloc_howto_type *
+coff_sparc_reloc_type_lookup (abfd, code)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ bfd_reloc_code_real_type code;
+{
+ unsigned int i;
+ for (i = 0; i < sizeof (sparc_reloc_map) / sizeof (struct coff_reloc_map); i++)
+ {
+ if (sparc_reloc_map[i].bfd_reloc_val == code)
+ return &coff_sparc_howto_table[(int) sparc_reloc_map[i].coff_reloc_val];
+ }
+ return 0;
+}
+#define coff_bfd_reloc_type_lookup coff_sparc_reloc_type_lookup
+
+static void
+rtype2howto (cache_ptr, dst)
+ arelent *cache_ptr;
+ struct internal_reloc *dst;
+{
+ BFD_ASSERT (dst->r_type < (unsigned int) R_SPARC_max);
+ cache_ptr->howto = &coff_sparc_howto_table[dst->r_type];
+}
+
+#define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry)
+
+#define SWAP_IN_RELOC_OFFSET bfd_h_get_32
+#define SWAP_OUT_RELOC_OFFSET bfd_h_put_32
+#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) \
+ cache_ptr->addend = reloc.r_offset;
+
+/* Clear the r_spare field in relocs. */
+#define SWAP_OUT_RELOC_EXTRA(abfd,src,dst) \
+ do { \
+ dst->r_spare[0] = 0; \
+ dst->r_spare[1] = 0; \
+ } while (0)
+
+#define __A_MAGIC_SET__
+
+/* Enable Sparc-specific hacks in coffcode.h. */
+
+#define COFF_SPARC
+
+#include "coffcode.h"
+
+#ifndef TARGET_SYM
+#define TARGET_SYM sparccoff_vec
+#endif
+
+#ifndef TARGET_NAME
+#define TARGET_NAME "coff-sparc"
+#endif
+
+CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, D_PAGED, 0, '_', NULL)
diff --git a/contrib/binutils/bfd/coff-tic30.c b/contrib/binutils/bfd/coff-tic30.c
index 3ff8c5940365..a971f76d7be9 100644
--- a/contrib/binutils/bfd/coff-tic30.c
+++ b/contrib/binutils/bfd/coff-tic30.c
@@ -1,5 +1,5 @@
/* BFD back-end for TMS320C30 coff binaries.
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999 Free Software Foundation, Inc.
Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
This file is part of BFD, the Binary File Descriptor library.
@@ -41,7 +41,7 @@ reloc_howto_type tic30_coff_howto_table[] =
"32", false, 0xFFFFFFFF, 0xFFFFFFFF, false),
HOWTO (R_TIC30_PC16, 2, 1, 16, true, 0, complain_overflow_signed, NULL,
"PCREL", false, 0x0000FFFF, 0x0000FFFF, false),
- {-1}
+ EMPTY_HOWTO (-1)
};
#ifndef coff_bfd_reloc_type_lookup
@@ -52,7 +52,7 @@ reloc_howto_type tic30_coff_howto_table[] =
and coff implementations. */
reloc_howto_type *
tic30_coff_reloc_type_lookup (abfd, code)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
bfd_reloc_code_real_type code;
{
switch (code)
@@ -202,5 +202,7 @@ const bfd_target tic30_coff_vec =
BFD_JUMP_TABLE_LINK (coff),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+ NULL,
+
COFF_SWAP_TABLE
};
diff --git a/contrib/binutils/bfd/coff-z8k.c b/contrib/binutils/bfd/coff-z8k.c
index 04049e89c288..21f29a829690 100644
--- a/contrib/binutils/bfd/coff-z8k.c
+++ b/contrib/binutils/bfd/coff-z8k.c
@@ -237,44 +237,4 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
bfd_coff_reloc16_get_relocated_section_contents
#define coff_bfd_relax_section bfd_coff_reloc16_relax_section
-const bfd_target z8kcoff_vec =
-{
- "coff-z8k", /* name */
- bfd_target_coff_flavour,
- BFD_ENDIAN_BIG, /* data byte order is big */
- BFD_ENDIAN_BIG, /* header byte order is big */
-
- (HAS_RELOC | EXEC_P | /* object flags */
- HAS_LINENO | HAS_DEBUG |
- HAS_SYMS | HAS_LOCALS | WP_TEXT),
-
- (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
- '_', /* leading symbol underscore */
- '/', /* ar_pad_char */
- 15, /* ar_max_namelen */
- bfd_getb64, bfd_getb_signed_64, bfd_putb64,
- bfd_getb32, bfd_getb_signed_32, bfd_putb32,
- bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
- bfd_getb64, bfd_getb_signed_64, bfd_putb64,
- bfd_getb32, bfd_getb_signed_32, bfd_putb32,
- bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
-
- {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
- bfd_generic_archive_p, _bfd_dummy_target},
- {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
- bfd_false},
- {bfd_false, coff_write_object_contents, /* bfd_write_contents */
- _bfd_write_archive_contents, bfd_false},
-
- BFD_JUMP_TABLE_GENERIC (coff),
- BFD_JUMP_TABLE_COPY (coff),
- BFD_JUMP_TABLE_CORE (_bfd_nocore),
- BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
- BFD_JUMP_TABLE_SYMBOLS (coff),
- BFD_JUMP_TABLE_RELOCS (coff),
- BFD_JUMP_TABLE_WRITE (coff),
- BFD_JUMP_TABLE_LINK (coff),
- BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
-
- COFF_SWAP_TABLE,
-};
+CREATE_BIG_COFF_TARGET_VEC (z8kcoff_vec, "coff-z8k", 0, 0, '_', NULL)
diff --git a/contrib/binutils/bfd/coffcode.h b/contrib/binutils/bfd/coffcode.h
index f0514c4d6067..8193a2116ca1 100644
--- a/contrib/binutils/bfd/coffcode.h
+++ b/contrib/binutils/bfd/coffcode.h
@@ -1,5 +1,5 @@
/* Support for the generic parts of most COFF variants, for BFD.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -131,7 +131,7 @@ SUBSUBSECTION
moment. To port BFD, that person will have to add more @code{#defines}.
Three of the bit twiddling routines are exported to
@code{gdb}; @code{coff_swap_aux_in}, @code{coff_swap_sym_in}
- and @code{coff_swap_linno_in}. @code{GDB} reads the symbol
+ and @code{coff_swap_lineno_in}. @code{GDB} reads the symbol
table on its own, but uses BFD to fix things up. More of the
bit twiddlers are exported for @code{gas};
@code{coff_swap_aux_out}, @code{coff_swap_sym_out},
@@ -313,8 +313,12 @@ CODE_FRAGMENT
#define STRING_SIZE_SIZE (4)
static long sec_to_styp_flags PARAMS ((const char *, flagword));
-static flagword styp_to_sec_flags PARAMS ((bfd *, PTR, const char *));
+static flagword styp_to_sec_flags
+ PARAMS ((bfd *, PTR, const char *, asection *));
static boolean coff_bad_format_hook PARAMS ((bfd *, PTR));
+static void coff_set_custom_section_alignment
+ PARAMS ((bfd *, asection *, const struct coff_section_alignment_entry *,
+ const unsigned int));
static boolean coff_new_section_hook PARAMS ((bfd *, asection *));
static boolean coff_set_arch_mach_hook PARAMS ((bfd *, PTR));
static boolean coff_write_relocs PARAMS ((bfd *, int));
@@ -329,6 +333,8 @@ static boolean coff_set_section_contents
static PTR buy_and_read PARAMS ((bfd *, file_ptr, int, size_t));
static boolean coff_slurp_line_table PARAMS ((bfd *, asection *));
static boolean coff_slurp_symbol_table PARAMS ((bfd *));
+static enum coff_symbol_classification coff_classify_symbol
+ PARAMS ((bfd *, struct internal_syment *));
static boolean coff_slurp_reloc_table PARAMS ((bfd *, asection *, asymbol **));
static long coff_canonicalize_reloc
PARAMS ((bfd *, asection *, arelent **, asymbol **));
@@ -338,12 +344,13 @@ static PTR coff_mkobject_hook PARAMS ((bfd *, PTR, PTR));
/* void warning(); */
-/*
- * Return a word with STYP_* (scnhdr.s_flags) flags set to represent the
- * incoming SEC_* flags. The inverse of this function is styp_to_sec_flags().
- * NOTE: If you add to/change this routine, you should mirror the changes
- * in styp_to_sec_flags().
- */
+/* Return a word with STYP_* (scnhdr.s_flags) flags set to represent
+ the incoming SEC_* flags. The inverse of this function is
+ styp_to_sec_flags(). NOTE: If you add to/change this routine, you
+ should probably mirror the changes in styp_to_sec_flags(). */
+
+#ifndef COFF_WITH_PE
+
static long
sec_to_styp_flags (sec_name, sec_flags)
CONST char *sec_name;
@@ -393,12 +400,6 @@ sec_to_styp_flags (sec_name, sec_flags)
{
styp_flags = STYP_INFO;
}
-#ifdef COFF_WITH_PE
- else if (!strcmp (sec_name, ".edata"))
- {
- styp_flags = STYP_DATA;
- }
-#endif
#ifdef RS6000COFF_C
else if (!strcmp (sec_name, _PAD))
{
@@ -440,25 +441,93 @@ sec_to_styp_flags (sec_name, sec_flags)
styp_flags |= STYP_NOLOAD;
#endif
-#ifdef COFF_WITH_PE
- if (sec_flags & SEC_LINK_ONCE)
- styp_flags |= IMAGE_SCN_LNK_COMDAT;
-#endif
+ return styp_flags;
+}
+
+#else /* COFF_WITH_PE */
+
+/* The PE version; see above for the general comments. The non-PE
+ case seems to be more guessing, and breaks PE format; specifically,
+ .rdata is readonly, but it sure ain't text. Really, all this
+ should be set up properly in gas (or whatever assembler is in use),
+ and honor whatever objcopy/strip, etc. sent us as input. */
+
+static long
+sec_to_styp_flags (sec_name, sec_flags)
+ const char *sec_name ATTRIBUTE_UNUSED;
+ flagword sec_flags;
+{
+ long styp_flags = 0;
- return (styp_flags);
+ /* caution: there are at least three groups of symbols that have
+ very similar bits and meanings: IMAGE_SCN*, SEC_*, and STYP_*.
+ SEC_* are the BFD internal flags, used for generic BFD
+ information. STYP_* are the COFF section flags which appear in
+ COFF files. IMAGE_SCN_* are the PE section flags which appear in
+ PE files. The STYP_* flags and the IMAGE_SCN_* flags overlap,
+ but there are more IMAGE_SCN_* flags. */
+
+ /* skip LOAD */
+ /* READONLY later */
+ /* skip RELOC */
+ if ((sec_flags & SEC_CODE) != 0)
+ styp_flags |= IMAGE_SCN_CNT_CODE;
+ if ((sec_flags & SEC_DATA) != 0)
+ styp_flags |= IMAGE_SCN_CNT_INITIALIZED_DATA;
+ if ((sec_flags & SEC_ALLOC) != 0 && (sec_flags & SEC_LOAD) == 0)
+ styp_flags |= IMAGE_SCN_CNT_UNINITIALIZED_DATA; /* ==STYP_BSS */
+ /* skip ROM */
+ /* skip CONSTRUCTOR */
+ /* skip CONTENTS */
+#ifdef STYP_NOLOAD
+ if ((sec_flags & (SEC_NEVER_LOAD | SEC_COFF_SHARED_LIBRARY)) != 0)
+ styp_flags |= STYP_NOLOAD;
+#endif
+ if ((sec_flags & SEC_IS_COMMON) != 0)
+ styp_flags |= IMAGE_SCN_LNK_COMDAT;
+ if ((sec_flags & SEC_DEBUGGING) != 0)
+ styp_flags |= IMAGE_SCN_MEM_DISCARDABLE;
+ if ((sec_flags & SEC_EXCLUDE) != 0)
+ styp_flags |= IMAGE_SCN_LNK_REMOVE;
+ if ((sec_flags & SEC_NEVER_LOAD) != 0)
+ styp_flags |= IMAGE_SCN_LNK_REMOVE;
+ /* skip IN_MEMORY */
+ /* skip SORT */
+ if (sec_flags & SEC_LINK_ONCE)
+ styp_flags |= IMAGE_SCN_LNK_COMDAT;
+ /* skip LINK_DUPLICATES */
+ /* skip LINKER_CREATED */
+
+ /* For now, the read/write bits are mapped onto SEC_READONLY, even
+ though the semantics don't quite match. The bits from the input
+ are retained in pei_section_data(abfd, section)->pe_flags */
+
+ styp_flags |= IMAGE_SCN_MEM_READ; /* always readable. */
+ if ((sec_flags & SEC_READONLY) == 0)
+ styp_flags |= IMAGE_SCN_MEM_WRITE; /* Invert READONLY for write */
+ if (sec_flags & SEC_CODE)
+ styp_flags |= IMAGE_SCN_MEM_EXECUTE; /* CODE->EXECUTE */
+ if (sec_flags & SEC_SHARED)
+ styp_flags |= IMAGE_SCN_MEM_SHARED; /* Shared remains meaningful */
+
+ return styp_flags;
}
-/*
- * Return a word with SEC_* flags set to represent the incoming
- * STYP_* flags (from scnhdr.s_flags). The inverse of this
- * function is sec_to_styp_flags().
- * NOTE: If you add to/change this routine, you should mirror the changes
- * in sec_to_styp_flags().
- */
+
+#endif /* COFF_WITH_PE */
+
+/* Return a word with SEC_* flags set to represent the incoming STYP_*
+ flags (from scnhdr.s_flags). The inverse of this function is
+ sec_to_styp_flags(). NOTE: If you add to/change this routine, you
+ should probably mirror the changes in sec_to_styp_flags(). */
+
+#ifndef COFF_WITH_PE
+
static flagword
-styp_to_sec_flags (abfd, hdr, name)
- bfd *abfd;
+styp_to_sec_flags (abfd, hdr, name, section)
+ bfd *abfd ATTRIBUTE_UNUSED;
PTR hdr;
const char *name;
+ asection *section ATTRIBUTE_UNUSED;
{
struct internal_scnhdr *internal_s = (struct internal_scnhdr *) hdr;
long styp_flags = internal_s->s_flags;
@@ -573,10 +642,99 @@ styp_to_sec_flags (abfd, hdr, name)
}
#endif /* STYP_SDATA */
-#ifdef COFF_WITH_PE
+#if defined (COFF_LONG_SECTION_NAMES) && defined (COFF_SUPPORT_GNU_LINKONCE)
+ /* As a GNU extension, if the name begins with .gnu.linkonce, we
+ only link a single copy of the section. This is used to support
+ g++. g++ will emit each template expansion in its own section.
+ The symbols will be defined as weak, so that multiple definitions
+ are permitted. The GNU linker extension is to actually discard
+ all but one of the sections. */
+ if (strncmp (name, ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) == 0)
+ sec_flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD;
+#endif
+
+ return sec_flags;
+}
+
+#else /* COFF_WITH_PE */
+
+/* The PE version; see above for the general comments.
+
+ Since to set the SEC_LINK_ONCE and associated flags, we have to
+ look at the symbol table anyway, we return the symbol table index
+ of the symbol being used as the COMDAT symbol. This is admittedly
+ ugly, but there's really nowhere else that we have access to the
+ required information. FIXME: Is the COMDAT symbol index used for
+ any purpose other than objdump? */
+
+static flagword
+styp_to_sec_flags (abfd, hdr, name, section)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ PTR hdr;
+ const char *name;
+ asection *section;
+{
+ struct internal_scnhdr *internal_s = (struct internal_scnhdr *) hdr;
+ long styp_flags = internal_s->s_flags;
+ flagword sec_flags = 0;
+
+ if (styp_flags & STYP_DSECT)
+ abort (); /* Don't know what to do */
+#ifdef SEC_NEVER_LOAD
+ if (styp_flags & STYP_NOLOAD)
+ sec_flags |= SEC_NEVER_LOAD;
+#endif
+ if (styp_flags & STYP_GROUP)
+ abort (); /* Don't know what to do */
+ /* skip IMAGE_SCN_TYPE_NO_PAD */
+ if (styp_flags & STYP_COPY)
+ abort (); /* Don't know what to do */
+ if (styp_flags & IMAGE_SCN_CNT_CODE)
+ sec_flags |= SEC_CODE | SEC_ALLOC | SEC_LOAD;
+ if (styp_flags & IMAGE_SCN_CNT_INITIALIZED_DATA)
+ sec_flags |= SEC_DATA | SEC_ALLOC | SEC_LOAD;
+ if (styp_flags & IMAGE_SCN_CNT_UNINITIALIZED_DATA)
+ sec_flags |= SEC_ALLOC;
+ if (styp_flags & IMAGE_SCN_LNK_OTHER)
+ abort (); /* Don't know what to do */
+ if (styp_flags & IMAGE_SCN_LNK_INFO)
+ {
+ /* We mark these as SEC_DEBUGGING, but only if COFF_PAGE_SIZE is
+ defined. coff_compute_section_file_positions uses
+ COFF_PAGE_SIZE to ensure that the low order bits of the
+ section VMA and the file offset match. If we don't know
+ COFF_PAGE_SIZE, we can't ensure the correct correspondence,
+ and demand page loading of the file will fail. */
+#ifdef COFF_PAGE_SIZE
+ sec_flags |= SEC_DEBUGGING;
+#endif
+ }
+ if (styp_flags & STYP_OVER)
+ abort (); /* Don't know what to do */
if (styp_flags & IMAGE_SCN_LNK_REMOVE)
sec_flags |= SEC_EXCLUDE;
+ if (styp_flags & IMAGE_SCN_MEM_SHARED)
+ sec_flags |= SEC_SHARED;
+ /* COMDAT: see below */
+ if (styp_flags & IMAGE_SCN_MEM_DISCARDABLE)
+ sec_flags |= SEC_DEBUGGING;
+ if (styp_flags & IMAGE_SCN_MEM_NOT_CACHED)
+ abort ();/* Don't know what to do */
+ if (styp_flags & IMAGE_SCN_MEM_NOT_PAGED)
+ abort (); /* Don't know what to do */
+
+ /* We infer from the distinct read/write/execute bits the settings
+ of some of the bfd flags; the actual values, should we need them,
+ are also in pei_section_data (abfd, section)->pe_flags. */
+
+ if (styp_flags & IMAGE_SCN_MEM_EXECUTE)
+ sec_flags |= SEC_CODE; /* Probably redundant */
+ /* IMAGE_SCN_MEM_READ is simply ignored, assuming it always to be true. */
+ if ((styp_flags & IMAGE_SCN_MEM_WRITE) == 0)
+ sec_flags |= SEC_READONLY;
+
+ /* COMDAT gets very special treatment. */
if (styp_flags & IMAGE_SCN_LNK_COMDAT)
{
sec_flags |= SEC_LINK_ONCE;
@@ -588,16 +746,30 @@ styp_to_sec_flags (abfd, hdr, name)
can't call slurp_symtab, because the linker doesn't want the
swapped symbols. */
+ /* COMDAT sections are special. The first symbol is the section
+ symbol, which tells what kind of COMDAT section it is. The
+ second symbol is the "comdat symbol" - the one with the
+ unique name. GNU uses the section symbol for the unique
+ name; MS uses ".text" for every comdat section. Sigh. - DJ */
+
+ /* This is not mirrored in sec_to_styp_flags(), but there
+ doesn't seem to be a need to, either, and it would at best be
+ rather messy. */
+
if (_bfd_coff_get_external_symbols (abfd))
{
- bfd_byte *esym, *esymend;
+ bfd_byte *esymstart, *esym, *esymend;
+ int seen_state = 0;
+ char *target_name = NULL;
- esym = (bfd_byte *) obj_coff_external_syms (abfd);
- esymend = esym + obj_raw_syment_count (abfd) * SYMESZ;
+ esymstart = esym = (bfd_byte *) obj_coff_external_syms (abfd);
+ esymend = esym + obj_raw_syment_count (abfd) * bfd_coff_symesz (abfd);
while (esym < esymend)
{
struct internal_syment isym;
+ char buf[SYMNMLEN + 1];
+ const char *symname;
bfd_coff_swap_sym_in (abfd, (PTR) esym, (PTR) &isym);
@@ -608,65 +780,223 @@ styp_to_sec_flags (abfd, hdr, name)
abort ();
}
- if (isym.n_sclass == C_STAT
- && isym.n_type == T_NULL
- && isym.n_numaux == 1)
+ if (isym.n_scnum == section->target_index)
{
- char buf[SYMNMLEN + 1];
- const char *symname;
-
+ /* According to the MSVC documentation, the first
+ TWO entries with the section # are both of
+ interest to us. The first one is the "section
+ symbol" (section name). The second is the comdat
+ symbol name. Here, we've found the first
+ qualifying entry; we distinguish it from the
+ second with a state flag.
+
+ In the case of gas-generated (at least until that
+ is fixed) .o files, it isn't necessarily the
+ second one. It may be some other later symbol.
+
+ Since gas also doesn't follow MS conventions and
+ emits the section similar to .text$<name>, where
+ <something> is the name we're looking for, we
+ distinguish the two as follows:
+
+ If the section name is simply a section name (no
+ $) we presume it's MS-generated, and look at
+ precisely the second symbol for the comdat name.
+ If the section name has a $, we assume it's
+ gas-generated, and look for <something> (whatever
+ follows the $) as the comdat symbol. */
+
+ /* All 3 branches use this */
symname = _bfd_coff_internal_syment_name (abfd, &isym, buf);
+
if (symname == NULL)
abort ();
- if (strcmp (name, symname) == 0)
+ switch (seen_state)
{
- union internal_auxent aux;
+ case 0:
+ {
+ /* The first time we've seen the symbol. */
+ union internal_auxent aux;
+
+ seen_state = 1;
+
+ /* If it isn't the stuff we're expecting, die;
+ The MS documentation is vague, but it
+ appears that the second entry serves BOTH
+ as the comdat symbol and the defining
+ symbol record (either C_STAT or C_EXT,
+ possibly with an aux entry with debug
+ information if it's a function.) It
+ appears the only way to find the second one
+ is to count. (On Intel, they appear to be
+ adjacent, but on Alpha, they have been
+ found separated.)
+
+ Here, we think we've found the first one,
+ but there's some checking we can do to be
+ sure. */
+
+ if (! (isym.n_sclass == C_STAT
+ && isym.n_type == T_NULL
+ && isym.n_value == 0))
+ abort ();
+
+ /* FIXME LATER: MSVC generates section names
+ like .text for comdats. Gas generates
+ names like .text$foo__Fv (in the case of a
+ function). See comment above for more. */
+
+ if (strcmp (name, symname) != 0)
+ abort ();
+
+ /* This is the section symbol. */
+
+ bfd_coff_swap_aux_in (abfd, (PTR) (esym + bfd_coff_symesz (abfd)),
+ isym.n_type, isym.n_sclass,
+ 0, isym.n_numaux, (PTR) &aux);
+
+ target_name = strchr (name, '$');
+ if (target_name != NULL)
+ {
+ /* Gas mode. */
+ seen_state = 2;
+ /* Skip the `$'. */
+ target_name += 1;
+ }
+
+ /* FIXME: Microsoft uses NODUPLICATES and
+ ASSOCIATIVE, but gnu uses ANY and
+ SAME_SIZE. Unfortunately, gnu doesn't do
+ the comdat symbols right. So, until we can
+ fix it to do the right thing, we are
+ temporarily disabling comdats for the MS
+ types (they're used in DLLs and C++, but we
+ don't support *their* C++ libraries anyway
+ - DJ. */
+
+ /* Cygwin does not follow the MS style, and
+ uses ANY and SAME_SIZE where NODUPLICATES
+ and ASSOCIATIVE should be used. For
+ Interix, we just do the right thing up
+ front. */
+
+ switch (aux.x_scn.x_comdat)
+ {
+ case IMAGE_COMDAT_SELECT_NODUPLICATES:
+#ifdef STRICT_PE_FORMAT
+ sec_flags |= SEC_LINK_DUPLICATES_ONE_ONLY;
+#else
+ sec_flags &= ~SEC_LINK_ONCE;
+#endif
+ break;
+
+ case IMAGE_COMDAT_SELECT_ANY:
+ sec_flags |= SEC_LINK_DUPLICATES_DISCARD;
+ break;
+
+ case IMAGE_COMDAT_SELECT_SAME_SIZE:
+ sec_flags |= SEC_LINK_DUPLICATES_SAME_SIZE;
+ break;
+
+ case IMAGE_COMDAT_SELECT_EXACT_MATCH:
+ /* Not yet fully implemented ??? */
+ sec_flags |= SEC_LINK_DUPLICATES_SAME_CONTENTS;
+ break;
+
+ /* debug$S gets this case; other
+ implications ??? */
+
+ /* There may be no symbol... we'll search
+ the whole table... Is this the right
+ place to play this game? Or should we do
+ it when reading it in. */
+ case IMAGE_COMDAT_SELECT_ASSOCIATIVE:
+#ifdef STRICT_PE_FORMAT
+ /* FIXME: This is not currently implemented. */
+ sec_flags |= SEC_LINK_DUPLICATES_DISCARD;
+#else
+ sec_flags &= ~SEC_LINK_ONCE;
+#endif
+ break;
- /* This is the section symbol. */
+ default: /* 0 means "no symbol" */
+ /* debug$F gets this case; other
+ implications ??? */
+ sec_flags |= SEC_LINK_DUPLICATES_DISCARD;
+ break;
+ }
+ }
+ break;
- bfd_coff_swap_aux_in (abfd, (PTR) (esym + SYMESZ),
- isym.n_type, isym.n_sclass,
- 0, isym.n_numaux, (PTR) &aux);
+ case 2:
+ /* Gas mode: the first matching on partial name. */
- switch (aux.x_scn.x_comdat)
+#ifndef TARGET_UNDERSCORE
+#define TARGET_UNDERSCORE 0
+#endif
+ /* Is this the name we're looking for? */
+ if (strcmp (target_name,
+ symname + (TARGET_UNDERSCORE ? 1 : 0)) != 0)
{
- case IMAGE_COMDAT_SELECT_NODUPLICATES:
- sec_flags |= SEC_LINK_DUPLICATES_ONE_ONLY;
- break;
-
- default:
- case IMAGE_COMDAT_SELECT_ANY:
- sec_flags |= SEC_LINK_DUPLICATES_DISCARD;
- break;
-
- case IMAGE_COMDAT_SELECT_SAME_SIZE:
- sec_flags |= SEC_LINK_DUPLICATES_SAME_SIZE;
- break;
-
- case IMAGE_COMDAT_SELECT_EXACT_MATCH:
- sec_flags |= SEC_LINK_DUPLICATES_SAME_CONTENTS;
- break;
-
- case IMAGE_COMDAT_SELECT_ASSOCIATIVE:
- /* FIXME: This is not currently implemented. */
- sec_flags |= SEC_LINK_DUPLICATES_DISCARD;
- break;
+ /* Not the name we're looking for */
+ esym += (isym.n_numaux + 1) * bfd_coff_symesz (abfd);
+ continue;
}
-
- break;
+ /* Fall through. */
+ case 1:
+ /* MSVC mode: the lexically second symbol (or
+ drop through from the above). */
+ {
+ char *newname;
+
+ /* This must the the second symbol with the
+ section #. It is the actual symbol name.
+ Intel puts the two adjacent, but Alpha (at
+ least) spreads them out. */
+
+ section->comdat =
+ bfd_alloc (abfd, sizeof (struct bfd_comdat_info));
+ if (section->comdat == NULL)
+ abort ();
+ section->comdat->symbol =
+ (esym - esymstart) / bfd_coff_symesz (abfd);
+
+ newname = bfd_alloc (abfd, strlen (symname) + 1);
+ if (newname == NULL)
+ abort ();
+
+ strcpy (newname, symname);
+ section->comdat->name = newname;
+
+ }
+
+ goto breakloop;
}
}
- esym += (isym.n_numaux + 1) * SYMESZ;
+ esym += (isym.n_numaux + 1) * bfd_coff_symesz (abfd);
}
+ breakloop:
}
}
+
+#if defined (COFF_LONG_SECTION_NAMES) && defined (COFF_SUPPORT_GNU_LINKONCE)
+ /* As a GNU extension, if the name begins with .gnu.linkonce, we
+ only link a single copy of the section. This is used to support
+ g++. g++ will emit each template expansion in its own section.
+ The symbols will be defined as weak, so that multiple definitions
+ are permitted. The GNU linker extension is to actually discard
+ all but one of the sections. */
+ if (strncmp (name, ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) == 0)
+ sec_flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD;
#endif
- return (sec_flags);
+ return sec_flags;
}
+#endif /* COFF_WITH_PE */
+
#define get_index(symbol) ((symbol)->udata.i)
/*
@@ -675,6 +1005,22 @@ INTERNAL_DEFINITION
CODE_FRAGMENT
+.{* COFF symbol classifications. *}
+.
+.enum coff_symbol_classification
+.{
+. {* Global symbol. *}
+. COFF_SYMBOL_GLOBAL,
+. {* Common symbol. *}
+. COFF_SYMBOL_COMMON,
+. {* Undefined symbol. *}
+. COFF_SYMBOL_UNDEFINED,
+. {* Local symbol. *}
+. COFF_SYMBOL_LOCAL,
+. {* PE section symbol. *}
+. COFF_SYMBOL_PE_SECTION
+.};
+.
Special entry points for gdb to swap in coff symbol table parts:
.typedef struct
.{
@@ -750,6 +1096,7 @@ dependent COFF routines:
. unsigned int _bfd_auxesz;
. unsigned int _bfd_relsz;
. unsigned int _bfd_linesz;
+. unsigned int _bfd_filnmlen;
. boolean _bfd_coff_long_filenames;
. boolean _bfd_coff_long_section_names;
. unsigned int _bfd_coff_default_section_alignment_power;
@@ -782,7 +1129,8 @@ dependent COFF routines:
. flagword (*_bfd_styp_to_sec_flags_hook) PARAMS ((
. bfd *abfd,
. PTR internal_scnhdr,
-. const char *name));
+. const char *name,
+. asection *section));
. void (*_bfd_set_alignment_hook) PARAMS ((
. bfd *abfd,
. asection *sec,
@@ -819,7 +1167,7 @@ dependent COFF routines:
. arelent *r,
. unsigned int shrink,
. struct bfd_link_info *link_info));
-. boolean (*_bfd_coff_sym_is_global) PARAMS ((
+. enum coff_symbol_classification (*_bfd_coff_classify_symbol) PARAMS ((
. bfd *abfd,
. struct internal_syment *));
. boolean (*_bfd_coff_compute_section_file_positions) PARAMS ((
@@ -863,7 +1211,8 @@ dependent COFF routines:
. struct bfd_link_hash_entry **hashp));
.
. boolean (*_bfd_coff_link_output_has_begun) PARAMS ((
-. bfd * abfd ));
+. bfd * abfd,
+. struct coff_final_link_info * pfinfo));
. boolean (*_bfd_coff_final_link_postscript) PARAMS ((
. bfd * abfd,
. struct coff_final_link_info * pfinfo));
@@ -909,6 +1258,7 @@ dependent COFF routines:
.#define bfd_coff_auxesz(abfd) (coff_backend_info (abfd)->_bfd_auxesz)
.#define bfd_coff_relsz(abfd) (coff_backend_info (abfd)->_bfd_relsz)
.#define bfd_coff_linesz(abfd) (coff_backend_info (abfd)->_bfd_linesz)
+.#define bfd_coff_filnmlen(abfd) (coff_backend_info (abfd)->_bfd_filnmlen)
.#define bfd_coff_long_filenames(abfd) (coff_backend_info (abfd)->_bfd_coff_long_filenames)
.#define bfd_coff_long_section_names(abfd) \
. (coff_backend_info (abfd)->_bfd_coff_long_section_names)
@@ -934,8 +1284,9 @@ dependent COFF routines:
.#define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\
. ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook) (abfd, filehdr, aouthdr))
.
-.#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name)\
-. ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook) (abfd, scnhdr, name))
+.#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section)\
+. ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\
+. (abfd, scnhdr, name, section))
.
.#define bfd_coff_set_alignment_hook(abfd, sec, scnhdr)\
. ((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr))
@@ -958,8 +1309,8 @@ dependent COFF routines:
. ((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\
. (abfd, section, reloc, shrink, link_info))
.
-.#define bfd_coff_sym_is_global(abfd, sym)\
-. ((coff_backend_info (abfd)->_bfd_coff_sym_is_global)\
+.#define bfd_coff_classify_symbol(abfd, sym)\
+. ((coff_backend_info (abfd)->_bfd_coff_classify_symbol)\
. (abfd, sym))
.
.#define bfd_coff_compute_section_file_positions(abfd)\
@@ -982,8 +1333,8 @@ dependent COFF routines:
. ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\
. (info, abfd, name, flags, section, value, string, cp, coll, hashp))
.
-.#define bfd_coff_link_output_has_begun(a) \
-. ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a))
+.#define bfd_coff_link_output_has_begun(a,p) \
+. ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a,p))
.#define bfd_coff_final_link_postscript(a,p) \
. ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a,p))
.
@@ -993,7 +1344,7 @@ dependent COFF routines:
static boolean
coff_bad_format_hook (abfd, filehdr)
- bfd * abfd;
+ bfd * abfd ATTRIBUTE_UNUSED;
PTR filehdr;
{
struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
@@ -1011,22 +1362,80 @@ coff_bad_format_hook (abfd, filehdr)
*/
#if defined(M88) || defined(I960)
- if (internal_f->f_opthdr != 0 && AOUTSZ != internal_f->f_opthdr)
+ if (internal_f->f_opthdr != 0 && bfd_coff_aoutsz (abfd) != internal_f->f_opthdr)
return false;
#endif
return true;
}
-/*
- initialize a section structure with information peculiar to this
- particular implementation of coff
-*/
+/* Check whether this section uses an alignment other than the
+ default. */
+
+static void
+coff_set_custom_section_alignment (abfd, section, alignment_table, table_size)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asection *section;
+ const struct coff_section_alignment_entry *alignment_table;
+ const unsigned int table_size;
+{
+ const unsigned int default_alignment = COFF_DEFAULT_SECTION_ALIGNMENT_POWER;
+ unsigned int i;
+
+ for (i = 0; i < table_size; ++i)
+ {
+ const char *secname = bfd_get_section_name (abfd, section);
+ if (alignment_table[i].comparison_length == (unsigned int) -1
+ ? strcmp (alignment_table[i].name, secname) == 0
+ : strncmp (alignment_table[i].name, secname,
+ alignment_table[i].comparison_length) == 0)
+ break;
+ }
+ if (i >= table_size)
+ return;
+
+ if (alignment_table[i].default_alignment_min != COFF_ALIGNMENT_FIELD_EMPTY
+ && default_alignment < alignment_table[i].default_alignment_min)
+ return;
+
+ if (alignment_table[i].default_alignment_max != COFF_ALIGNMENT_FIELD_EMPTY
+ && default_alignment > alignment_table[i].default_alignment_max)
+ return;
+
+ section->alignment_power = alignment_table[i].alignment_power;
+}
+
+/* Custom section alignment records. */
+
+static const struct coff_section_alignment_entry
+coff_section_alignment_table[] =
+{
+#ifdef COFF_SECTION_ALIGNMENT_ENTRIES
+ COFF_SECTION_ALIGNMENT_ENTRIES,
+#endif
+ /* There must not be any gaps between .stabstr sections. */
+ { COFF_SECTION_NAME_PARTIAL_MATCH (".stabstr"),
+ 1, COFF_ALIGNMENT_FIELD_EMPTY, 0 },
+ /* The .stab section must be aligned to 2**2 at most, to avoid gaps. */
+ { COFF_SECTION_NAME_PARTIAL_MATCH (".stab"),
+ 3, COFF_ALIGNMENT_FIELD_EMPTY, 2 },
+ /* Similarly for the .ctors and .dtors sections. */
+ { COFF_SECTION_NAME_EXACT_MATCH (".ctors"),
+ 3, COFF_ALIGNMENT_FIELD_EMPTY, 2 },
+ { COFF_SECTION_NAME_EXACT_MATCH (".dtors"),
+ 3, COFF_ALIGNMENT_FIELD_EMPTY, 2 }
+};
+
+static const unsigned int coff_section_alignment_table_size =
+ sizeof coff_section_alignment_table / sizeof coff_section_alignment_table[0];
+
+/* Initialize a section structure with information peculiar to this
+ particular implementation of COFF. */
static boolean
coff_new_section_hook (abfd, section)
- bfd * abfd;
- asection * section;
+ bfd *abfd;
+ asection *section;
{
combined_entry_type *native;
@@ -1062,22 +1471,9 @@ coff_new_section_hook (abfd, section)
coffsymbol (section->symbol)->native = native;
- /* The .stab section must be aligned to 2**2 at most, because
- otherwise there may be gaps in the section which gdb will not
- know how to interpret. Examining the section name is a hack, but
- that is also how gdb locates the section.
- We need to handle the .ctors and .dtors sections similarly, to
- avoid introducing null words in the tables. */
- if (COFF_DEFAULT_SECTION_ALIGNMENT_POWER > 2
- && (strncmp (section->name, ".stab", 5) == 0
- || strcmp (section->name, ".ctors") == 0
- || strcmp (section->name, ".dtors") == 0))
- section->alignment_power = 2;
-
- /* Similarly, the .stabstr section must be aligned to 2**0 at most. */
- if (COFF_DEFAULT_SECTION_ALIGNMENT_POWER > 0
- && strncmp (section->name, ".stabstr", 8) == 0)
- section->alignment_power = 0;
+ coff_set_custom_section_alignment (abfd, section,
+ coff_section_alignment_table,
+ coff_section_alignment_table_size);
return true;
}
@@ -1090,7 +1486,7 @@ static void coff_set_alignment_hook PARAMS ((bfd *, asection *, PTR));
static void
coff_set_alignment_hook (abfd, section, scnhdr)
- bfd * abfd;
+ bfd * abfd ATTRIBUTE_UNUSED;
asection * section;
PTR scnhdr;
{
@@ -1103,6 +1499,10 @@ coff_set_alignment_hook (abfd, section, scnhdr)
if ((1 << i) >= hdr->s_align)
break;
#endif
+#ifdef TIC80COFF
+ /* TI tools hijack bits 8-11 for the alignment */
+ i = (hdr->s_flags >> 8) & 0xF ;
+#endif
section->alignment_power = i;
}
@@ -1126,7 +1526,7 @@ static void coff_set_alignment_hook PARAMS ((bfd *, asection *, PTR));
static void
coff_set_alignment_hook (abfd, section, scnhdr)
- bfd * abfd;
+ bfd * abfd ATTRIBUTE_UNUSED;
asection * section;
PTR scnhdr;
{
@@ -1140,66 +1540,34 @@ coff_set_alignment_hook (abfd, section, scnhdr)
ELIFALIGN_SET (hdr->s_flags, IMAGE_SCN_ALIGN_2BYTES, 1)
ELIFALIGN_SET (hdr->s_flags, IMAGE_SCN_ALIGN_1BYTES, 0)
-#ifdef POWERPC_LE_PE
- if (strcmp (section->name, ".idata$2") == 0)
- {
- section->alignment_power = 0;
- }
- else if (strcmp (section->name, ".idata$3") == 0)
- {
- section->alignment_power = 0;
- }
- else if (strcmp (section->name, ".idata$4") == 0)
- {
- section->alignment_power = 2;
- }
- else if (strcmp (section->name, ".idata$5") == 0)
- {
- section->alignment_power = 2;
- }
- else if (strcmp (section->name, ".idata$6") == 0)
- {
- section->alignment_power = 1;
- }
- else if (strcmp (section->name, ".reloc") == 0)
- {
- section->alignment_power = 1;
- }
- else if (strncmp (section->name, ".stab", 5) == 0)
- {
- section->alignment_power = 2;
- }
-#endif
-
-#ifdef COFF_IMAGE_WITH_PE
/* In a PE image file, the s_paddr field holds the virtual size of a
- section, while the s_size field holds the raw size. */
- if (hdr->s_paddr != 0)
+ section, while the s_size field holds the raw size. We also keep
+ the original section flag value, since not every bit can be
+ mapped onto a generic BFD section bit. */
+ if (coff_section_data (abfd, section) == NULL)
{
- if (coff_section_data (abfd, section) == NULL)
+ section->used_by_bfd =
+ (PTR) bfd_zalloc (abfd, sizeof (struct coff_section_tdata));
+ if (section->used_by_bfd == NULL)
{
- section->used_by_bfd =
- (PTR) bfd_zalloc (abfd, sizeof (struct coff_section_tdata));
- if (section->used_by_bfd == NULL)
- {
- /* FIXME: Return error. */
- abort ();
- }
+ /* FIXME: Return error. */
+ abort ();
}
- if (pei_section_data (abfd, section) == NULL)
+ }
+ if (pei_section_data (abfd, section) == NULL)
+ {
+ coff_section_data (abfd, section)->tdata =
+ (PTR) bfd_zalloc (abfd, sizeof (struct pei_section_tdata));
+ if (coff_section_data (abfd, section)->tdata == NULL)
{
- coff_section_data (abfd, section)->tdata =
- (PTR) bfd_zalloc (abfd, sizeof (struct pei_section_tdata));
- if (coff_section_data (abfd, section)->tdata == NULL)
- {
- /* FIXME: Return error. */
- abort ();
- }
+ /* FIXME: Return error. */
+ abort ();
}
- pei_section_data (abfd, section)->virt_size = hdr->s_paddr;
}
-#endif
+ pei_section_data (abfd, section)->virt_size = hdr->s_paddr;
+ pei_section_data (abfd, section)->pe_flags = hdr->s_flags;
+ section->lma = hdr->s_vaddr;
}
#undef ALIGN_SET
#undef ELIFALIGN_SET
@@ -1285,7 +1653,7 @@ static PTR
coff_mkobject_hook (abfd, filehdr, aouthdr)
bfd * abfd;
PTR filehdr;
- PTR aouthdr;
+ PTR aouthdr ATTRIBUTE_UNUSED;
{
struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
coff_data_type *coff;
@@ -1304,9 +1672,11 @@ coff_mkobject_hook (abfd, filehdr, aouthdr)
coff->local_n_btshft = N_BTSHFT;
coff->local_n_tmask = N_TMASK;
coff->local_n_tshift = N_TSHIFT;
- coff->local_symesz = SYMESZ;
- coff->local_auxesz = AUXESZ;
- coff->local_linesz = LINESZ;
+ coff->local_symesz = bfd_coff_symesz (abfd);
+ coff->local_auxesz = bfd_coff_auxesz (abfd);
+ coff->local_linesz = bfd_coff_linesz (abfd);
+
+ coff->timestamp = internal_f->f_timdat;
obj_raw_syment_count (abfd) =
obj_conv_table_size (abfd) =
@@ -1315,7 +1685,7 @@ coff_mkobject_hook (abfd, filehdr, aouthdr)
#ifdef RS6000COFF_C
if ((internal_f->f_flags & F_SHROBJ) != 0)
abfd->flags |= DYNAMIC;
- if (aouthdr != NULL && internal_f->f_opthdr >= AOUTSZ)
+ if (aouthdr != NULL && internal_f->f_opthdr >= bfd_coff_aoutsz (abfd))
{
struct internal_aouthdr *internal_a =
(struct internal_aouthdr *) aouthdr;
@@ -1337,10 +1707,17 @@ coff_mkobject_hook (abfd, filehdr, aouthdr)
#ifdef ARM
/* Set the flags field from the COFF header read in */
- if (! coff_arm_bfd_set_private_flags (abfd, internal_f->f_flags))
+ if (! _bfd_coff_arm_set_private_flags (abfd, internal_f->f_flags))
coff->flags = 0;
#endif
+#ifdef COFF_WITH_PE
+ /* FIXME: I'm not sure this is ever executed, since peicode.h
+ defines coff_mkobject_hook. */
+ if ((internal_f->f_flags & IMAGE_FILE_DEBUG_STRIPPED) == 0)
+ abfd->flags |= HAS_DEBUG;
+#endif
+
return (PTR) coff;
}
#endif
@@ -1388,16 +1765,19 @@ coff_set_arch_mach_hook (abfd, filehdr)
#endif
#ifdef ARMMAGIC
case ARMMAGIC:
+ case ARMPEMAGIC:
+ case THUMBPEMAGIC:
arch = bfd_arch_arm;
switch (internal_f->f_flags & F_ARM_ARCHITECTURE_MASK)
{
- case F_ARM_2: machine = bfd_mach_arm_2; break;
- case F_ARM_2a: machine = bfd_mach_arm_2a; break;
- case F_ARM_3: machine = bfd_mach_arm_3; break;
- default:
- case F_ARM_3M: machine = bfd_mach_arm_3M; break;
- case F_ARM_4: machine = bfd_mach_arm_4; break;
- case F_ARM_4T: machine = bfd_mach_arm_4T; break;
+ case F_ARM_2: machine = bfd_mach_arm_2; break;
+ case F_ARM_2a: machine = bfd_mach_arm_2a; break;
+ case F_ARM_3: machine = bfd_mach_arm_3; break;
+ default:
+ case F_ARM_3M: machine = bfd_mach_arm_3M; break;
+ case F_ARM_4: machine = bfd_mach_arm_4; break;
+ case F_ARM_4T: machine = bfd_mach_arm_4T; break;
+ case F_ARM_5: machine = bfd_mach_arm_5; break;
}
break;
#endif
@@ -1502,17 +1882,23 @@ coff_set_arch_mach_hook (abfd, filehdr)
cputype = 0;
else
{
- bfd_byte buf[SYMESZ];
+ bfd_byte *buf;
struct internal_syment sym;
+ buf = (bfd_byte *) bfd_malloc (bfd_coff_symesz (abfd));
if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
- || bfd_read (buf, 1, SYMESZ, abfd) != SYMESZ)
- return false;
+ || (bfd_read (buf, 1, bfd_coff_symesz (abfd), abfd)
+ != bfd_coff_symesz (abfd)))
+ {
+ free (buf);
+ return false;
+ }
coff_swap_sym_in (abfd, (PTR) buf, (PTR) &sym);
if (sym.n_sclass == C_FILE)
cputype = sym.n_type & 0xff;
else
cputype = 0;
+ free (buf);
}
}
@@ -1591,11 +1977,21 @@ coff_set_arch_mach_hook (abfd, filehdr)
#ifdef SH_ARCH_MAGIC_BIG
case SH_ARCH_MAGIC_BIG:
case SH_ARCH_MAGIC_LITTLE:
+#ifdef COFF_WITH_PE
+ case SH_ARCH_MAGIC_WINCE:
+#endif
arch = bfd_arch_sh;
machine = 0;
break;
#endif
+#ifdef MIPS_ARCH_MAGIC_WINCE
+ case MIPS_ARCH_MAGIC_WINCE:
+ arch = bfd_arch_mips;
+ machine = 0;
+ break;
+#endif
+
#ifdef H8500MAGIC
case H8500MAGIC:
arch = bfd_arch_h8500;
@@ -1619,7 +2015,17 @@ coff_set_arch_mach_hook (abfd, filehdr)
break;
#endif
+#ifdef TIC80_ARCH_MAGIC
+ case TIC80_ARCH_MAGIC:
+ arch = bfd_arch_tic80;
+ break;
+#endif
+#ifdef MCOREMAGIC
+ case MCOREMAGIC:
+ arch = bfd_arch_mcore;
+ break;
+#endif
default: /* Unreadable input file type */
arch = bfd_arch_obscure;
break;
@@ -1636,7 +2042,7 @@ static boolean symname_in_debug_hook
static boolean
symname_in_debug_hook (abfd, sym)
- bfd * abfd;
+ bfd * abfd ATTRIBUTE_UNUSED;
struct internal_syment *sym;
{
return SYMNAME_IN_DEBUG (sym) ? true : false;
@@ -1660,7 +2066,7 @@ static boolean coff_pointerize_aux_hook
/*ARGSUSED*/
static boolean
coff_pointerize_aux_hook (abfd, table_base, symbol, indaux, aux)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
combined_entry_type *table_base;
combined_entry_type *symbol;
unsigned int indaux;
@@ -1700,11 +2106,11 @@ static boolean coff_pointerize_aux_hook
/*ARGSUSED*/
static boolean
coff_pointerize_aux_hook (abfd, table_base, symbol, indaux, aux)
- bfd *abfd;
- combined_entry_type *table_base;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ combined_entry_type *table_base ATTRIBUTE_UNUSED;
combined_entry_type *symbol;
unsigned int indaux;
- combined_entry_type *aux;
+ combined_entry_type *aux ATTRIBUTE_UNUSED;
{
/* Return true if we don't want to pointerize this aux entry, which
is the case for the lastfirst aux entry for a C_LEAFPROC symbol. */
@@ -1729,12 +2135,12 @@ static boolean coff_print_aux
static boolean
coff_print_aux (abfd, file, table_base, symbol, aux, indaux)
- bfd *abfd;
- FILE *file;
- combined_entry_type *table_base;
- combined_entry_type *symbol;
- combined_entry_type *aux;
- unsigned int indaux;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ FILE *file ATTRIBUTE_UNUSED;
+ combined_entry_type *table_base ATTRIBUTE_UNUSED;
+ combined_entry_type *symbol ATTRIBUTE_UNUSED;
+ combined_entry_type *aux ATTRIBUTE_UNUSED;
+ unsigned int indaux ATTRIBUTE_UNUSED;
{
#ifdef RS6000COFF_C
if ((symbol->u.syment.n_sclass == C_EXT
@@ -1880,7 +2286,11 @@ coff_write_relocs (abfd, first_undef)
#endif
if (q->sym_ptr_ptr)
{
+#ifdef SECTION_RELATIVE_ABSOLUTE_SYMBOL_P
+ if (SECTION_RELATIVE_ABSOLUTE_SYMBOL_P (q,s))
+#else
if (q->sym_ptr_ptr == bfd_abs_section_ptr->symbol_ptr_ptr)
+#endif
/* This is a relocation relative to the absolute symbol. */
n.r_symndx = -1;
else
@@ -1905,7 +2315,8 @@ coff_write_relocs (abfd, first_undef)
n.r_type = q->howto->type;
#endif
coff_swap_reloc_out (abfd, &n, &dst);
- if (bfd_write ((PTR) & dst, 1, RELSZ, abfd) != RELSZ)
+ if (bfd_write ((PTR) & dst, 1, bfd_coff_relsz (abfd), abfd)
+ != bfd_coff_relsz (abfd))
return false;
}
@@ -1924,8 +2335,8 @@ coff_write_relocs (abfd, first_undef)
static boolean
coff_set_flags (abfd, magicp, flagsp)
bfd * abfd;
- unsigned int *magicp;
- unsigned short *flagsp;
+ unsigned int *magicp ATTRIBUTE_UNUSED;
+ unsigned short *flagsp ATTRIBUTE_UNUSED;
{
switch (bfd_get_arch (abfd))
{
@@ -1996,9 +2407,18 @@ coff_set_flags (abfd, magicp, flagsp)
*magicp = TIC30MAGIC;
return true;
#endif
+#ifdef TIC80_ARCH_MAGIC
+ case bfd_arch_tic80:
+ *magicp = TIC80_ARCH_MAGIC;
+ return true;
+#endif
#ifdef ARMMAGIC
case bfd_arch_arm:
+#ifdef ARM_WINCE
+ * magicp = ARMPEMAGIC;
+#else
* magicp = ARMMAGIC;
+#endif
* flagsp = 0;
if (APCS_SET (abfd))
{
@@ -2021,6 +2441,8 @@ coff_set_flags (abfd, magicp, flagsp)
case bfd_mach_arm_3M: * flagsp |= F_ARM_3M; break;
case bfd_mach_arm_4: * flagsp |= F_ARM_4; break;
case bfd_mach_arm_4T: * flagsp |= F_ARM_4T; break;
+ case bfd_mach_arm_5: * flagsp |= F_ARM_5; break;
+ case bfd_mach_arm_5T: * flagsp |= F_ARM_5; break; /* XXX - we do not have an F_ARM_5T */
}
return true;
#endif
@@ -2091,10 +2513,21 @@ coff_set_flags (abfd, magicp, flagsp)
#ifdef SH_ARCH_MAGIC_BIG
case bfd_arch_sh:
+#ifdef COFF_IMAGE_WITH_PE
+ *magicp = SH_ARCH_MAGIC_WINCE;
+#else
if (bfd_big_endian (abfd))
*magicp = SH_ARCH_MAGIC_BIG;
else
*magicp = SH_ARCH_MAGIC_LITTLE;
+#endif
+ return true;
+ break;
+#endif
+
+#ifdef MIPS_ARCH_MAGIC_WINCE
+ case bfd_arch_mips:
+ *magicp = MIPS_ARCH_MAGIC_WINCE;
return true;
break;
#endif
@@ -2143,6 +2576,12 @@ coff_set_flags (abfd, magicp, flagsp)
break;
#endif
+#ifdef MCOREMAGIC
+ case bfd_arch_mcore:
+ * magicp = MCOREMAGIC;
+ return true;
+#endif
+
default: /* Unknown architecture */
/* return false; -- fall through to "return false" below, to avoid
"statement never reached" errors on the one below. */
@@ -2172,12 +2611,39 @@ coff_set_arch_mach (abfd, arch, machine)
return true; /* We're easy ... */
}
+#ifdef COFF_IMAGE_WITH_PE
+
+/* This is used to sort sections by VMA, as required by PE image
+ files. */
+
+static int sort_by_secaddr PARAMS ((const PTR, const PTR));
+
+static int
+sort_by_secaddr (arg1, arg2)
+ const PTR arg1;
+ const PTR arg2;
+{
+ const asection *a = *(const asection **) arg1;
+ const asection *b = *(const asection **) arg2;
+
+ if (a->vma < b->vma)
+ return -1;
+ else if (a->vma > b->vma)
+ return 1;
+ else
+ return 0;
+}
+
+#endif /* COFF_IMAGE_WITH_PE */
/* Calculate the file position for each section. */
#ifndef I960
#define ALIGN_SECTIONS_IN_FILE
#endif
+#ifdef TIC80COFF
+#undef ALIGN_SECTIONS_IN_FILE
+#endif
static boolean
coff_compute_section_file_positions (abfd)
@@ -2185,9 +2651,8 @@ coff_compute_section_file_positions (abfd)
{
asection *current;
asection *previous = (asection *) NULL;
- file_ptr sofar = FILHSZ;
+ file_ptr sofar = bfd_coff_filhsz (abfd);
boolean align_adjust;
- unsigned int count;
#ifdef ALIGN_SECTIONS_IN_FILE
file_ptr old_sofar;
#endif
@@ -2253,48 +2718,132 @@ coff_compute_section_file_positions (abfd)
}
if (abfd->flags & EXEC_P)
- sofar += AOUTSZ;
+ sofar += bfd_coff_aoutsz (abfd);
#ifdef RS6000COFF_C
else if (xcoff_data (abfd)->full_aouthdr)
- sofar += AOUTSZ;
+ sofar += bfd_coff_aoutsz (abfd);
else
sofar += SMALL_AOUTSZ;
#endif
- sofar += abfd->section_count * SCNHSZ;
+ sofar += abfd->section_count * bfd_coff_scnhsz (abfd);
#ifdef RS6000COFF_C
/* XCOFF handles overflows in the reloc and line number count fields
by allocating a new section header to hold the correct counts. */
for (current = abfd->sections; current != NULL; current = current->next)
if (current->reloc_count >= 0xffff || current->lineno_count >= 0xffff)
- sofar += SCNHSZ;
+ sofar += bfd_coff_scnhsz (abfd);
#endif
+#ifdef COFF_IMAGE_WITH_PE
+ {
+ /* PE requires the sections to be in memory order when listed in
+ the section headers. It also does not like empty loadable
+ sections. The sections apparently do not have to be in the
+ right order in the image file itself, but we do need to get the
+ target_index values right. */
+
+ int count;
+ asection **section_list;
+ int i;
+ int target_index;
+
+ count = 0;
+ for (current = abfd->sections; current != NULL; current = current->next)
+ ++count;
+
+ /* We allocate an extra cell to simplify the final loop. */
+ section_list = bfd_malloc (sizeof (struct asection *) * (count + 1));
+ if (section_list == NULL)
+ return false;
+
+ i = 0;
+ for (current = abfd->sections; current != NULL; current = current->next)
+ {
+ section_list[i] = current;
+ ++i;
+ }
+ section_list[i] = NULL;
+
+ qsort (section_list, count, sizeof (asection *), sort_by_secaddr);
+
+ /* Rethread the linked list into sorted order; at the same time,
+ assign target_index values. */
+ target_index = 1;
+ abfd->sections = section_list[0];
+ for (i = 0; i < count; i++)
+ {
+ current = section_list[i];
+ current->next = section_list[i + 1];
+
+ /* Later, if the section has zero size, we'll be throwing it
+ away, so we don't want to number it now. Note that having
+ a zero size and having real contents are different
+ concepts: .bss has no contents, but (usually) non-zero
+ size. */
+ if (current->_raw_size == 0)
+ {
+ /* Discard. However, it still might have (valid) symbols
+ in it, so arbitrarily set it to section 1 (indexing is
+ 1-based here; usually .text). __end__ and other
+ contents of .endsection really have this happen.
+ FIXME: This seems somewhat dubious. */
+ current->target_index = 1;
+ }
+ else
+ current->target_index = target_index++;
+ }
+
+ free (section_list);
+ }
+#else /* ! COFF_IMAGE_WITH_PE */
+ {
+ /* Set the target_index field. */
+ int target_index;
+
+ target_index = 1;
+ for (current = abfd->sections; current != NULL; current = current->next)
+ current->target_index = target_index++;
+ }
+#endif /* ! COFF_IMAGE_WITH_PE */
+
align_adjust = false;
- for (current = abfd->sections, count = 1;
+ for (current = abfd->sections;
current != (asection *) NULL;
- current = current->next, ++count)
+ current = current->next)
{
#ifdef COFF_IMAGE_WITH_PE
- /* The NT loader does not want empty section headers, so we omit
- them. We don't actually remove the section from the BFD,
- although we probably should. This matches code in
- coff_write_object_contents. */
- if (current->_raw_size == 0)
+ /* With PE we have to pad each section to be a multiple of its
+ page size too, and remember both sizes. */
+ if (coff_section_data (abfd, current) == NULL)
+ {
+ current->used_by_bfd =
+ (PTR) bfd_zalloc (abfd, sizeof (struct coff_section_tdata));
+ if (current->used_by_bfd == NULL)
+ return false;
+ }
+ if (pei_section_data (abfd, current) == NULL)
{
- current->target_index = -1;
- --count;
- continue;
+ coff_section_data (abfd, current)->tdata =
+ (PTR) bfd_zalloc (abfd, sizeof (struct pei_section_tdata));
+ if (coff_section_data (abfd, current)->tdata == NULL)
+ return false;
}
+ if (pei_section_data (abfd, current)->virt_size == 0)
+ pei_section_data (abfd, current)->virt_size = current->_raw_size;
#endif
- current->target_index = count;
-
- /* Only deal with sections which have contents */
+ /* Only deal with sections which have contents. */
if (!(current->flags & SEC_HAS_CONTENTS))
continue;
+#ifdef COFF_IMAGE_WITH_PE
+ /* Make sure we skip empty sections in a PE image. */
+ if (current->_raw_size == 0)
+ continue;
+#endif
+
/* Align the sections in the file to the same boundary on
which they are aligned in virtual memory. I960 doesn't
do this (FIXME) so we can stay in sync with Intel. 960
@@ -2325,26 +2874,7 @@ coff_compute_section_file_positions (abfd)
current->filepos = sofar;
#ifdef COFF_IMAGE_WITH_PE
- /* With PE we have to pad each section to be a multiple of its
- page size too, and remember both sizes. */
-
- if (coff_section_data (abfd, current) == NULL)
- {
- current->used_by_bfd =
- (PTR) bfd_zalloc (abfd, sizeof (struct coff_section_tdata));
- if (current->used_by_bfd == NULL)
- return false;
- }
- if (pei_section_data (abfd, current) == NULL)
- {
- coff_section_data (abfd, current)->tdata =
- (PTR) bfd_zalloc (abfd, sizeof (struct pei_section_tdata));
- if (coff_section_data (abfd, current)->tdata == NULL)
- return false;
- }
- if (pei_section_data (abfd, current)->virt_size == 0)
- pei_section_data (abfd, current)->virt_size = current->_raw_size;
-
+ /* Set the padded size. */
current->_raw_size = (current->_raw_size + page_size -1) & -page_size;
#endif
@@ -2501,6 +3031,7 @@ coff_write_object_contents (abfd)
asection *current;
boolean hasrelocs = false;
boolean haslinno = false;
+ boolean hasdebug = false;
file_ptr scn_base;
file_ptr reloc_base;
file_ptr lineno_base;
@@ -2522,7 +3053,7 @@ coff_write_object_contents (abfd)
/* Make a pass through the symbol table to count line number entries and
put them into the correct asections */
- lnno_size = coff_count_linenumbers (abfd) * LINESZ;
+ lnno_size = coff_count_linenumbers (abfd) * bfd_coff_linesz (abfd);
if (abfd->output_has_begun == false)
{
@@ -2536,7 +3067,7 @@ coff_write_object_contents (abfd)
for (current = abfd->sections; current != NULL; current =
current->next)
- reloc_size += current->reloc_count * RELSZ;
+ reloc_size += current->reloc_count * bfd_coff_relsz (abfd);
lineno_base = reloc_base + reloc_size;
sym_base = lineno_base + lnno_size;
@@ -2549,7 +3080,7 @@ coff_write_object_contents (abfd)
{
current->line_filepos = lineno_base;
current->moving_line_filepos = lineno_base;
- lineno_base += current->lineno_count * LINESZ;
+ lineno_base += current->lineno_count * bfd_coff_linesz (abfd);
}
else
{
@@ -2558,7 +3089,7 @@ coff_write_object_contents (abfd)
if (current->reloc_count)
{
current->rel_filepos = reloc_base;
- reloc_base += current->reloc_count * RELSZ;
+ reloc_base += current->reloc_count * bfd_coff_relsz (abfd);
}
else
{
@@ -2570,13 +3101,13 @@ coff_write_object_contents (abfd)
internal_f.f_nscns = 0;
if ((abfd->flags & EXEC_P) != 0)
- scn_base = FILHSZ + AOUTSZ;
+ scn_base = bfd_coff_filhsz (abfd) + bfd_coff_aoutsz (abfd);
else
{
- scn_base = FILHSZ;
+ scn_base = bfd_coff_filhsz (abfd);
#ifdef RS6000COFF_C
if (xcoff_data (abfd)->full_aouthdr)
- scn_base += AOUTSZ;
+ scn_base += bfd_coff_aoutsz (abfd);
else
scn_base += SMALL_AOUTSZ;
#endif
@@ -2591,25 +3122,24 @@ coff_write_object_contents (abfd)
current = current->next)
{
struct internal_scnhdr section;
-
-#ifdef COFF_WITH_PE
- /* If we've got a .reloc section, remember. */
+ boolean is_reloc_section = false;
#ifdef COFF_IMAGE_WITH_PE
if (strcmp (current->name, ".reloc") == 0)
{
+ is_reloc_section = true;
+ hasrelocs = true;
pe_data (abfd)->has_reloc_section = 1;
}
#endif
-#endif
internal_f.f_nscns++;
strncpy (section.s_name, current->name, SCNNMLEN);
#ifdef COFF_LONG_SECTION_NAMES
/* Handle long section names as in PE. This must be compatible
- with the code in coff_write_symbols. */
+ with the code in coff_write_symbols and _bfd_coff_final_link. */
{
size_t len;
@@ -2664,10 +3194,16 @@ coff_write_object_contents (abfd)
section.s_lnnoptr = current->line_filepos;
section.s_nreloc = current->reloc_count;
section.s_nlnno = current->lineno_count;
+#ifndef COFF_IMAGE_WITH_PE
+ /* In PEI, relocs come in the .reloc section. */
if (current->reloc_count != 0)
hasrelocs = true;
+#endif
if (current->lineno_count != 0)
haslinno = true;
+ if ((current->flags & SEC_DEBUGGING) != 0
+ && ! is_reloc_section)
+ hasdebug = true;
#ifdef RS6000COFF_C
/* Indicate the use of an XCOFF overflow section header. */
@@ -2697,13 +3233,18 @@ coff_write_object_contents (abfd)
section.s_align = (current->alignment_power
? 1 << current->alignment_power
: 0);
+#else
+#ifdef TIC80COFF
+ section.s_flags |= (current->alignment_power & 0xF) << 8;
+#endif
#endif
#ifdef COFF_IMAGE_WITH_PE
- /* suppress output of the sections if they are null. ld includes
- the bss and data sections even if there is no size assigned
- to them. NT loader doesn't like it if these section headers are
- included if the sections themselves are not needed */
+ /* Suppress output of the sections if they are null. ld
+ includes the bss and data sections even if there is no size
+ assigned to them. NT loader doesn't like it if these section
+ headers are included if the sections themselves are not
+ needed. See also coff_compute_section_file_positions. */
if (section.s_size == 0)
internal_f.f_nscns--;
else
@@ -2711,7 +3252,8 @@ coff_write_object_contents (abfd)
{
SCNHDR buff;
if (coff_swap_scnhdr_out (abfd, &section, &buff) == 0
- || bfd_write ((PTR) (&buff), 1, SCNHSZ, abfd) != SCNHSZ)
+ || bfd_write ((PTR) (&buff), 1, bfd_coff_scnhsz (abfd), abfd)
+ != bfd_coff_scnhsz (abfd))
return false;
}
@@ -2832,7 +3374,8 @@ coff_write_object_contents (abfd)
scnhdr.s_nlnno = current->target_index;
scnhdr.s_flags = STYP_OVRFLO;
if (coff_swap_scnhdr_out (abfd, &scnhdr, &buff) == 0
- || bfd_write ((PTR) &buff, 1, SCNHSZ, abfd) != SCNHSZ)
+ || bfd_write ((PTR) &buff, 1, bfd_coff_scnhsz (abfd), abfd)
+ != bfd_coff_scnhsz (abfd))
return false;
}
}
@@ -2853,13 +3396,13 @@ coff_write_object_contents (abfd)
internal_f.f_flags = 0;
if (abfd->flags & EXEC_P)
- internal_f.f_opthdr = AOUTSZ;
+ internal_f.f_opthdr = bfd_coff_aoutsz (abfd);
else
{
internal_f.f_opthdr = 0;
#ifdef RS6000COFF_C
if (xcoff_data (abfd)->full_aouthdr)
- internal_f.f_opthdr = AOUTSZ;
+ internal_f.f_opthdr = bfd_coff_aoutsz (abfd);
else
internal_f.f_opthdr = SMALL_AOUTSZ;
#endif
@@ -2871,13 +3414,21 @@ coff_write_object_contents (abfd)
internal_f.f_flags |= F_LNNO;
if (abfd->flags & EXEC_P)
internal_f.f_flags |= F_EXEC;
+#ifdef COFF_IMAGE_WITH_PE
+ if (! hasdebug)
+ internal_f.f_flags |= IMAGE_FILE_DEBUG_STRIPPED;
+#endif
- /* FIXME: this is wrong for PPC_PE! */
+#ifndef COFF_WITH_PE
if (bfd_little_endian (abfd))
internal_f.f_flags |= F_AR32WR;
else
internal_f.f_flags |= F_AR32W;
+#endif
+#ifdef TIC80_TARGET_ID
+ internal_f.f_target_id = TIC80_TARGET_ID;
+#endif
/*
FIXME, should do something about the other byte orders and
@@ -2916,6 +3467,10 @@ coff_write_object_contents (abfd)
internal_a.magic = NMAGIC; /* Assume separate i/d */
#define __A_MAGIC_SET__
#endif /* A29K */
+#ifdef TIC80COFF
+ internal_a.magic = TIC80_ARCH_MAGIC;
+#define __A_MAGIC_SET__
+#endif /* TIC80 */
#ifdef I860
/* FIXME: What are the a.out magic numbers for the i860? */
internal_a.magic = 0;
@@ -2962,6 +3517,11 @@ coff_write_object_contents (abfd)
internal_a.magic = IMAGE_NT_OPTIONAL_HDR_MAGIC;
#endif
+#if defined MCORE_PE
+#define __A_MAGIC_SET__
+ internal_a.magic = IMAGE_NT_OPTIONAL_HDR_MAGIC;
+#endif
+
#if defined(I386)
#define __A_MAGIC_SET__
#if defined(LYNXOS)
@@ -2985,6 +3545,16 @@ coff_write_object_contents (abfd)
RS6K_AOUTHDR_OMAGIC;
#endif
+#if defined(SH) && defined(COFF_WITH_PE)
+#define __A_MAGIC_SET__
+ internal_a.magic = SH_PE_MAGIC;
+#endif
+
+#if defined(MIPS) && defined(COFF_WITH_PE)
+#define __A_MAGIC_SET__
+ internal_a.magic = MIPS_PE_MAGIC;
+#endif
+
#ifndef __A_MAGIC_SET__
#include "Your aouthdr magic number is not being set!"
#else
@@ -3015,6 +3585,15 @@ coff_write_object_contents (abfd)
if (! coff_write_relocs (abfd, firstundef))
return false;
}
+#ifdef COFF_LONG_SECTION_NAMES
+ else if (long_section_names)
+ {
+ /* If we have long section names we have to write out the string
+ table even if there are no symbols. */
+ if (! coff_write_symbols (abfd))
+ return false;
+ }
+#endif
#ifdef COFF_IMAGE_WITH_PE
#ifdef PPC_PE
else if ((abfd->flags & EXEC_P) != 0)
@@ -3148,19 +3727,41 @@ coff_write_object_contents (abfd)
/* now write them */
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
return false;
+
{
- char buff[FILHSZ];
+ char * buff;
+ bfd_size_type amount;
+
+ buff = bfd_malloc (bfd_coff_filhsz (abfd));
+ if (buff == NULL)
+ return false;
+
coff_swap_filehdr_out (abfd, (PTR) & internal_f, (PTR) buff);
- if (bfd_write ((PTR) buff, 1, FILHSZ, abfd) != FILHSZ)
+ amount = bfd_write ((PTR) buff, 1, bfd_coff_filhsz (abfd), abfd);
+
+ free (buff);
+
+ if (amount != bfd_coff_filhsz (abfd))
return false;
}
+
if (abfd->flags & EXEC_P)
{
/* Note that peicode.h fills in a PEAOUTHDR, not an AOUTHDR.
include/coff/pe.h sets AOUTSZ == sizeof(PEAOUTHDR)) */
- char buff[AOUTSZ];
+ char * buff;
+ bfd_size_type amount;
+
+ buff = bfd_malloc (bfd_coff_aoutsz (abfd));
+ if (buff == NULL)
+ return false;
+
coff_swap_aouthdr_out (abfd, (PTR) & internal_a, (PTR) buff);
- if (bfd_write ((PTR) buff, 1, AOUTSZ, abfd) != AOUTSZ)
+ amount = bfd_write ((PTR) buff, 1, bfd_coff_aoutsz (abfd), abfd);
+
+ free (buff);
+
+ if (amount != bfd_coff_aoutsz (abfd))
return false;
}
#ifdef RS6000COFF_C
@@ -3172,7 +3773,7 @@ coff_write_object_contents (abfd)
/* XCOFF seems to always write at least a small a.out header. */
coff_swap_aouthdr_out (abfd, (PTR) &internal_a, (PTR) &buff);
if (xcoff_data (abfd)->full_aouthdr)
- size = AOUTSZ;
+ size = bfd_coff_aoutsz (abfd);
else
size = SMALL_AOUTSZ;
if (bfd_write ((PTR) &buff, 1, size, abfd) != size)
@@ -3307,6 +3908,9 @@ SUBSUBSECTION
base of the line number information for the table is stored in
the symbol associated with the function.
+ Note: The PE format uses line number 0 for a flag indicating a
+ new source file.
+
The information is copied from the external to the internal
table, and each symbol which marks a function is marked by
pointing its...
@@ -3328,7 +3932,7 @@ coff_slurp_line_table (abfd, asect)
native_lineno = (LINENO *) buy_and_read (abfd,
asect->line_filepos,
SEEK_SET,
- (size_t) (LINESZ *
+ (size_t) (bfd_coff_linesz (abfd) *
asect->lineno_count));
lineno_cache =
(alent *) bfd_alloc (abfd, (size_t) ((asect->lineno_count + 1) * sizeof (alent)));
@@ -3358,7 +3962,7 @@ coff_slurp_line_table (abfd, asect)
|| (unsigned long) symndx >= obj_raw_syment_count (abfd))
{
(*_bfd_error_handler)
- ("%s: warning: illegal symbol index %ld in line numbers",
+ (_("%s: warning: illegal symbol index %ld in line numbers"),
bfd_get_filename (abfd), dst.l_addr.l_symndx);
symndx = 0;
warned = true;
@@ -3372,7 +3976,7 @@ coff_slurp_line_table (abfd, asect)
if (sym->lineno != NULL && ! warned)
{
(*_bfd_error_handler)
- ("%s: warning: duplicate line number information for `%s'",
+ (_("%s: warning: duplicate line number information for `%s'"),
bfd_get_filename (abfd),
bfd_asymbol_name (&sym->symbol));
}
@@ -3396,6 +4000,10 @@ coff_slurp_line_table (abfd, asect)
return true;
}
+/* Slurp in the symbol table, converting it to generic form. Note
+ that if coff_relocate_section is defined, the linker will read
+ symbols via coff_link_add_symbols, rather than via this routine. */
+
static boolean
coff_slurp_symbol_table (abfd)
bfd * abfd;
@@ -3463,6 +4071,7 @@ coff_slurp_symbol_table (abfd)
#endif
case C_EXT:
+ case C_WEAKEXT:
#if defined ARM
case C_THUMBEXT:
case C_THUMBEXTFUNC:
@@ -3474,31 +4083,15 @@ coff_slurp_symbol_table (abfd)
case C_SYSTEM: /* System Wide variable */
#endif
#ifdef COFF_WITH_PE
- /* PE uses storage class 0x68 to denote a section symbol */
+ /* In PE, 0x68 (104) denotes a section symbol */
case C_SECTION:
- /* PE uses storage class 0x67 for a weak external symbol. */
+ /* In PE, 0x69 (105) denotes a weak external symbol. */
case C_NT_WEAK:
#endif
- if ((src->u.syment.n_scnum) == 0)
+ switch (coff_classify_symbol (abfd, &src->u.syment))
{
- if ((src->u.syment.n_value) == 0)
- {
- dst->symbol.section = bfd_und_section_ptr;
- dst->symbol.value = 0;
- }
- else
- {
- dst->symbol.section = bfd_com_section_ptr;
- dst->symbol.value = (src->u.syment.n_value);
- }
- }
- else
- {
- /* Base the value as an index from the base of the
- section */
-
+ case COFF_SYMBOL_GLOBAL:
dst->symbol.flags = BSF_EXPORT | BSF_GLOBAL;
-
#if defined COFF_WITH_PE
/* PE sets the symbol to a value relative to the
start of the section. */
@@ -3507,19 +4100,45 @@ coff_slurp_symbol_table (abfd)
dst->symbol.value = (src->u.syment.n_value
- dst->symbol.section->vma);
#endif
-
if (ISFCN ((src->u.syment.n_type)))
{
/* A function ext does not go at the end of a
file. */
dst->symbol.flags |= BSF_NOT_AT_END | BSF_FUNCTION;
}
+ break;
+
+ case COFF_SYMBOL_COMMON:
+ dst->symbol.section = bfd_com_section_ptr;
+ dst->symbol.value = src->u.syment.n_value;
+ break;
+
+ case COFF_SYMBOL_UNDEFINED:
+ dst->symbol.section = bfd_und_section_ptr;
+ dst->symbol.value = 0;
+ break;
+
+ case COFF_SYMBOL_PE_SECTION:
+ dst->symbol.flags |= BSF_EXPORT | BSF_SECTION_SYM;
+ dst->symbol.value = 0;
+ break;
+
+ case COFF_SYMBOL_LOCAL:
+ dst->symbol.flags = BSF_LOCAL;
+#if defined COFF_WITH_PE
+ /* PE sets the symbol to a value relative to the
+ start of the section. */
+ dst->symbol.value = src->u.syment.n_value;
+#else
+ dst->symbol.value = (src->u.syment.n_value
+ - dst->symbol.section->vma);
+#endif
+ if (ISFCN ((src->u.syment.n_type)))
+ dst->symbol.flags |= BSF_NOT_AT_END | BSF_FUNCTION;
+ break;
}
#ifdef RS6000COFF_C
- /* A C_HIDEXT symbol is not global. */
- if (src->u.syment.n_sclass == C_HIDEXT)
- dst->symbol.flags = BSF_LOCAL;
/* A symbol with a csect entry should not go at the end. */
if (src->u.syment.n_numaux > 0)
dst->symbol.flags |= BSF_NOT_AT_END;
@@ -3528,8 +4147,16 @@ coff_slurp_symbol_table (abfd)
#ifdef COFF_WITH_PE
if (src->u.syment.n_sclass == C_NT_WEAK)
dst->symbol.flags = BSF_WEAK;
+ if (src->u.syment.n_sclass == C_SECTION
+ && src->u.syment.n_scnum > 0)
+ {
+ dst->symbol.flags = BSF_LOCAL;
+ }
#endif
+ if (src->u.syment.n_sclass == C_WEAKEXT)
+ dst->symbol.flags = BSF_WEAK;
+
break;
case C_STAT: /* static */
@@ -3542,7 +4169,7 @@ coff_slurp_symbol_table (abfd)
case C_THUMBSTATFUNC:/* Thumb static function */
#endif
case C_LABEL: /* label */
- if (src->u.syment.n_scnum == -2)
+ if (src->u.syment.n_scnum == N_DEBUG)
dst->symbol.flags = BSF_DEBUGGING;
else
dst->symbol.flags = BSF_LOCAL;
@@ -3573,9 +4200,11 @@ coff_slurp_symbol_table (abfd)
#endif
case C_REGPARM: /* register parameter */
case C_REG: /* register variable */
+#ifndef TIC80COFF
#ifdef C_AUTOARG
case C_AUTOARG: /* 960-specific storage class */
#endif
+#endif
case C_TPDEF: /* type definition */
case C_ARG:
case C_AUTO: /* automatic variable */
@@ -3622,7 +4251,7 @@ coff_slurp_symbol_table (abfd)
for (sec = abfd->sections; sec != NULL; sec = sec->next)
if (sec->line_filepos <= (file_ptr) src->u.syment.n_value
&& ((file_ptr) (sec->line_filepos
- + sec->lineno_count * LINESZ)
+ + sec->lineno_count * bfd_coff_linesz (abfd))
> (file_ptr) src->u.syment.n_value))
break;
if (sec == NULL)
@@ -3632,7 +4261,7 @@ coff_slurp_symbol_table (abfd)
dst->symbol.section = sec;
dst->symbol.value = ((src->u.syment.n_value
- sec->line_filepos)
- / LINESZ);
+ / bfd_coff_linesz (abfd));
src->fix_line = 1;
}
}
@@ -3652,22 +4281,37 @@ coff_slurp_symbol_table (abfd)
#endif
case C_BLOCK: /* ".bb" or ".eb" */
- case C_FCN: /* ".bf" or ".ef" */
+ case C_FCN: /* ".bf" or ".ef" (or PE ".lf") */
case C_EFCN: /* physical end of function */
- dst->symbol.flags = BSF_LOCAL;
#if defined COFF_WITH_PE
/* PE sets the symbol to a value relative to the start
of the section. */
dst->symbol.value = src->u.syment.n_value;
+ if (strcmp (dst->symbol.name, ".bf") != 0)
+ {
+ /* PE uses funny values for .ef and .lf; don't
+ relocate them. */
+ dst->symbol.flags = BSF_DEBUGGING;
+ }
+ else
+ dst->symbol.flags = BSF_DEBUGGING | BSF_DEBUGGING_RELOC;
#else
/* Base the value as an index from the base of the
section. */
+ dst->symbol.flags = BSF_LOCAL;
dst->symbol.value = (src->u.syment.n_value
- dst->symbol.section->vma);
#endif
break;
case C_NULL:
+ /* PE DLLs sometimes have zeroed out symbols for some
+ reason. Just ignore them without a warning. */
+ if (src->u.syment.n_type == 0
+ && src->u.syment.n_value == 0
+ && src->u.syment.n_scnum == 0)
+ break;
+ /* Fall through. */
case C_EXTDEF: /* external definition */
case C_ULABEL: /* undefined label */
case C_USTATIC: /* undefined static */
@@ -3678,10 +4322,16 @@ coff_slurp_symbol_table (abfd)
/* NT uses 0x67 for a weak symbol, not C_ALIAS. */
case C_ALIAS: /* duplicate tag */
#endif
+ /* New storage classes for TIc80 */
+#ifdef TIC80COFF
+ case C_UEXT: /* Tentative external definition */
+#endif
+ case C_STATLAB: /* Static load time label */
+ case C_EXTLAB: /* External load time label */
case C_HIDDEN: /* ext symbol in dmert public lib */
default:
(*_bfd_error_handler)
- ("%s: Unrecognized storage class %d for %s symbol `%s'",
+ (_("%s: Unrecognized storage class %d for %s symbol `%s'"),
bfd_get_filename (abfd), src->u.syment.n_sclass,
dst->symbol.section->name, dst->symbol.name);
dst->symbol.flags = BSF_DEBUGGING;
@@ -3719,46 +4369,106 @@ coff_slurp_symbol_table (abfd)
return true;
} /* coff_slurp_symbol_table() */
-/* Check whether a symbol is globally visible. This is used by the
- COFF backend linker code in cofflink.c, since a couple of targets
- have globally visible symbols which are not class C_EXT. This
- function need not handle the case of n_class == C_EXT. */
-
-#undef OTHER_GLOBAL_CLASS
+/* Classify a COFF symbol. A couple of targets have globally visible
+ symbols which are not class C_EXT, and this handles those. It also
+ recognizes some special PE cases. */
+static enum coff_symbol_classification
+coff_classify_symbol (abfd, syment)
+ bfd *abfd;
+ struct internal_syment *syment;
+{
+ /* FIXME: This partially duplicates the switch in
+ coff_slurp_symbol_table. */
+ switch (syment->n_sclass)
+ {
+ case C_EXT:
+ case C_WEAKEXT:
#ifdef I960
-#define OTHER_GLOBAL_CLASS C_LEAFEXT
+ case C_LEAFEXT:
#endif
-
-#ifdef COFFARM
-#define OTHER_GLOBAL_CLASS C_THUMBEXT || syment->n_sclass == C_THUMBEXTFUNC
-#else
-#ifdef COFF_WITH_PE
-#define OTHER_GLOBAL_CLASS C_SECTION
+#ifdef ARM
+ case C_THUMBEXT:
+ case C_THUMBEXTFUNC:
+#endif
+#ifdef C_SYSTEM
+ case C_SYSTEM:
#endif
+#ifdef COFF_WITH_PE
+ case C_NT_WEAK:
#endif
+ if (syment->n_scnum == 0)
+ {
+ if (syment->n_value == 0)
+ return COFF_SYMBOL_UNDEFINED;
+ else
+ return COFF_SYMBOL_COMMON;
+ }
+ return COFF_SYMBOL_GLOBAL;
+
+ default:
+ break;
+ }
-#ifdef OTHER_GLOBAL_CLASS
+#ifdef COFF_WITH_PE
+ if (syment->n_sclass == C_STAT)
+ {
+ if (syment->n_scnum == 0)
+ {
+ /* The Microsoft compiler sometimes generates these if a
+ small static function is inlined every time it is used.
+ The function is discarded, but the symbol table entry
+ remains. */
+ return COFF_SYMBOL_LOCAL;
+ }
-static boolean coff_sym_is_global PARAMS ((bfd *, struct internal_syment *));
+#ifdef STRICT_PE_FORMAT
+ /* This is correct for Microsoft generated objects, but it
+ breaks gas generated objects. */
-static boolean
-coff_sym_is_global (abfd, syment)
- bfd * abfd;
- struct internal_syment * syment;
-{
- return (syment->n_sclass == OTHER_GLOBAL_CLASS);
-}
+ if (syment->n_value == 0)
+ {
+ asection *sec;
+ char buf[SYMNMLEN + 1];
+
+ sec = coff_section_from_bfd_index (abfd, syment->n_scnum);
+ if (sec != NULL
+ && (strcmp (bfd_get_section_name (abfd, sec),
+ _bfd_coff_internal_syment_name (abfd, syment, buf))
+ == 0))
+ return COFF_SYMBOL_PE_SECTION;
+ }
+#endif
+
+ return COFF_SYMBOL_LOCAL;
+ }
-#undef OTHER_GLOBAL_CLASS
+ if (syment->n_sclass == C_SECTION)
+ {
+ /* In some cases in a DLL generated by the Microsoft linker, the
+ n_value field will contain garbage. FIXME: This should
+ probably be handled by the swapping function instead. */
+ syment->n_value = 0;
+ if (syment->n_scnum == 0)
+ return COFF_SYMBOL_UNDEFINED;
+ return COFF_SYMBOL_PE_SECTION;
+ }
+#endif /* COFF_WITH_PE */
-#else /* ! defined (OTHER_GLOBAL_CLASS) */
+ /* If it is not a global symbol, we presume it is a local symbol. */
-/* sym_is_global should not be defined if it has nothing to do. */
+ if (syment->n_scnum == 0)
+ {
+ char buf[SYMNMLEN + 1];
-#define coff_sym_is_global 0
+ (*_bfd_error_handler)
+ (_("warning: %s: local symbol `%s' has no section"),
+ bfd_get_filename (abfd),
+ _bfd_coff_internal_syment_name (abfd, syment, buf));
+ }
-#endif /* ! defined (OTHER_GLOBAL_CLASS) */
+ return COFF_SYMBOL_LOCAL;
+}
/*
SUBSUBSECTION
@@ -3833,7 +4543,7 @@ coff_slurp_reloc_table (abfd, asect, symbols)
(RELOC *) buy_and_read (abfd,
asect->rel_filepos,
SEEK_SET,
- (size_t) (RELSZ *
+ (size_t) (bfd_coff_relsz (abfd) *
asect->reloc_count));
reloc_cache = (arelent *)
bfd_alloc (abfd, (size_t) (asect->reloc_count * sizeof (arelent)));
@@ -3865,7 +4575,7 @@ coff_slurp_reloc_table (abfd, asect, symbols)
if (dst.r_symndx < 0 || dst.r_symndx >= obj_conv_table_size (abfd))
{
(*_bfd_error_handler)
- ("%s: warning: illegal symbol index %ld in relocs",
+ (_("%s: warning: illegal symbol index %ld in relocs"),
bfd_get_filename (abfd), dst.r_symndx);
cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
ptr = NULL;
@@ -3903,7 +4613,7 @@ coff_slurp_reloc_table (abfd, asect, symbols)
if (cache_ptr->howto == NULL)
{
(*_bfd_error_handler)
- ("%s: illegal relocation type %d at address 0x%lx",
+ (_("%s: illegal relocation type %d at address 0x%lx"),
bfd_get_filename (abfd), dst.r_type, (long) dst.r_vaddr);
bfd_set_error (bfd_error_bad_value);
return false;
@@ -3931,12 +4641,12 @@ static reloc_howto_type *coff_rtype_to_howto
/*ARGSUSED*/
static reloc_howto_type *
coff_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
- bfd *abfd;
- asection *sec;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asection *sec ATTRIBUTE_UNUSED;
struct internal_reloc *rel;
- struct coff_link_hash_entry *h;
- struct internal_syment *sym;
- bfd_vma *addendp;
+ struct coff_link_hash_entry *h ATTRIBUTE_UNUSED;
+ struct internal_syment *sym ATTRIBUTE_UNUSED;
+ bfd_vma *addendp ATTRIBUTE_UNUSED;
{
arelent genrel;
@@ -4010,13 +4720,14 @@ static int dummy_reloc16_estimate
static int
dummy_reloc16_estimate (abfd, input_section, reloc, shrink, link_info)
- bfd *abfd;
- asection *input_section;
- arelent *reloc;
- unsigned int shrink;
- struct bfd_link_info *link_info;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asection *input_section ATTRIBUTE_UNUSED;
+ arelent *reloc ATTRIBUTE_UNUSED;
+ unsigned int shrink ATTRIBUTE_UNUSED;
+ struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
{
abort ();
+ return 0;
}
#endif
@@ -4034,13 +4745,13 @@ static void dummy_reloc16_extra_cases
static void
dummy_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
dst_ptr)
- bfd *abfd;
- struct bfd_link_info *link_info;
- struct bfd_link_order *link_order;
- arelent *reloc;
- bfd_byte *data;
- unsigned int *src_ptr;
- unsigned int *dst_ptr;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
+ struct bfd_link_order *link_order ATTRIBUTE_UNUSED;
+ arelent *reloc ATTRIBUTE_UNUSED;
+ bfd_byte *data ATTRIBUTE_UNUSED;
+ unsigned int *src_ptr ATTRIBUTE_UNUSED;
+ unsigned int *dst_ptr ATTRIBUTE_UNUSED;
{
abort ();
}
@@ -4084,21 +4795,28 @@ dummy_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
#endif
#ifndef coff_link_output_has_begun
-#define coff_link_output_has_begun _coff_link_output_has_begun
+
+static boolean coff_link_output_has_begun
+ PARAMS ((bfd *, struct coff_final_link_info *));
+
static boolean
-_coff_link_output_has_begun (abfd)
+coff_link_output_has_begun (abfd, info)
bfd * abfd;
+ struct coff_final_link_info * info ATTRIBUTE_UNUSED;
{
return abfd->output_has_begun;
}
#endif
#ifndef coff_final_link_postscript
-#define coff_final_link_postscript _coff_final_link_postscript
+
+static boolean coff_final_link_postscript
+ PARAMS ((bfd *, struct coff_final_link_info *));
+
static boolean
-_coff_final_link_postscript (abfd, pfinfo)
- bfd * abfd;
- struct coff_final_link_info * pfinfo;
+coff_final_link_postscript (abfd, pfinfo)
+ bfd * abfd ATTRIBUTE_UNUSED;
+ struct coff_final_link_info * pfinfo ATTRIBUTE_UNUSED;
{
return true;
}
@@ -4147,16 +4865,14 @@ _coff_final_link_postscript (abfd, pfinfo)
#define coff_SWAP_scnhdr_in coff_swap_scnhdr_in
#endif
-
-
-static CONST bfd_coff_backend_data bfd_coff_std_swap_table =
+static const bfd_coff_backend_data bfd_coff_std_swap_table =
{
coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in,
coff_SWAP_aux_out, coff_SWAP_sym_out,
coff_SWAP_lineno_out, coff_SWAP_reloc_out,
coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out,
coff_SWAP_scnhdr_out,
- FILHSZ, AOUTSZ, SCNHSZ, SYMESZ, AUXESZ, RELSZ, LINESZ,
+ FILHSZ, AOUTSZ, SCNHSZ, SYMESZ, AUXESZ, RELSZ, LINESZ, FILNMLEN,
#ifdef COFF_LONG_FILENAMES
true,
#else
@@ -4173,7 +4889,7 @@ static CONST bfd_coff_backend_data bfd_coff_std_swap_table =
coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook,
coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook,
coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate,
- coff_sym_is_global, coff_compute_section_file_positions,
+ coff_classify_symbol, coff_compute_section_file_positions,
coff_start_final_link, coff_relocate_section, coff_rtype_to_howto,
coff_adjust_symndx, coff_link_add_one_symbol,
coff_link_output_has_begun, coff_final_link_postscript
@@ -4241,3 +4957,105 @@ static CONST bfd_coff_backend_data bfd_coff_std_swap_table =
#ifndef coff_bfd_relax_section
#define coff_bfd_relax_section bfd_generic_relax_section
#endif
+
+#ifndef coff_bfd_gc_sections
+#define coff_bfd_gc_sections bfd_generic_gc_sections
+#endif
+
+#define CREATE_BIG_COFF_TARGET_VEC(VAR, NAME, EXTRA_O_FLAGS, EXTRA_S_FLAGS, UNDER, ALTERNATIVE) \
+const bfd_target VAR = \
+{ \
+ NAME , \
+ bfd_target_coff_flavour, \
+ BFD_ENDIAN_BIG, /* data byte order is big */ \
+ BFD_ENDIAN_BIG, /* header byte order is big */ \
+ /* object flags */ \
+ (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | \
+ HAS_SYMS | HAS_LOCALS | WP_TEXT | EXTRA_O_FLAGS), \
+ /* section flags */ \
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | EXTRA_S_FLAGS),\
+ UNDER, /* leading symbol underscore */ \
+ '/', /* ar_pad_char */ \
+ 15, /* ar_max_namelen */ \
+ \
+ /* Data conversion functions. */ \
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64, \
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32, \
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, \
+ \
+ /* Header conversion functions. */ \
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64, \
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32, \
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, \
+ \
+ /* bfd_check_format */ \
+ { _bfd_dummy_target, coff_object_p, bfd_generic_archive_p, \
+ _bfd_dummy_target }, \
+ /* bfd_set_format */ \
+ { bfd_false, coff_mkobject, _bfd_generic_mkarchive, bfd_false }, \
+ /* bfd_write_contents */ \
+ { bfd_false, coff_write_object_contents, _bfd_write_archive_contents, \
+ bfd_false }, \
+ \
+ BFD_JUMP_TABLE_GENERIC (coff), \
+ BFD_JUMP_TABLE_COPY (coff), \
+ BFD_JUMP_TABLE_CORE (_bfd_nocore), \
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), \
+ BFD_JUMP_TABLE_SYMBOLS (coff), \
+ BFD_JUMP_TABLE_RELOCS (coff), \
+ BFD_JUMP_TABLE_WRITE (coff), \
+ BFD_JUMP_TABLE_LINK (coff), \
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), \
+ \
+ ALTERNATIVE, \
+ \
+ COFF_SWAP_TABLE \
+};
+
+#define CREATE_LITTLE_COFF_TARGET_VEC(VAR, NAME, EXTRA_O_FLAGS, EXTRA_S_FLAGS, UNDER, ALTERNATIVE) \
+const bfd_target VAR = \
+{ \
+ NAME , \
+ bfd_target_coff_flavour, \
+ BFD_ENDIAN_LITTLE, /* data byte order is little */ \
+ BFD_ENDIAN_LITTLE, /* header byte order is little */ \
+ /* object flags */ \
+ (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | \
+ HAS_SYMS | HAS_LOCALS | WP_TEXT | EXTRA_O_FLAGS), \
+ /* section flags */ \
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | EXTRA_S_FLAGS),\
+ UNDER, /* leading symbol underscore */ \
+ '/', /* ar_pad_char */ \
+ 15, /* ar_max_namelen */ \
+ \
+ /* Data conversion functions. */ \
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64, \
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32, \
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, \
+ /* Header conversion functions. */ \
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64, \
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32, \
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, \
+ /* bfd_check_format */ \
+ { _bfd_dummy_target, coff_object_p, bfd_generic_archive_p, \
+ _bfd_dummy_target }, \
+ /* bfd_set_format */ \
+ { bfd_false, coff_mkobject, _bfd_generic_mkarchive, bfd_false }, \
+ /* bfd_write_contents */ \
+ { bfd_false, coff_write_object_contents, _bfd_write_archive_contents, \
+ bfd_false }, \
+ \
+ BFD_JUMP_TABLE_GENERIC (coff), \
+ BFD_JUMP_TABLE_COPY (coff), \
+ BFD_JUMP_TABLE_CORE (_bfd_nocore), \
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), \
+ BFD_JUMP_TABLE_SYMBOLS (coff), \
+ BFD_JUMP_TABLE_RELOCS (coff), \
+ BFD_JUMP_TABLE_WRITE (coff), \
+ BFD_JUMP_TABLE_LINK (coff), \
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), \
+ \
+ ALTERNATIVE, \
+ \
+ COFF_SWAP_TABLE \
+};
diff --git a/contrib/binutils/bfd/coffgen.c b/contrib/binutils/bfd/coffgen.c
index b5ecbc926ff4..f2410d919d9a 100644
--- a/contrib/binutils/bfd/coffgen.c
+++ b/contrib/binutils/bfd/coffgen.c
@@ -1,5 +1,5 @@
/* Support for the generic parts of COFF, for BFD.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999, 2000
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -140,9 +140,9 @@ make_a_section_from_file (abfd, hdr, target_index)
return_section->lineno_count = hdr->s_nlnno;
return_section->userdata = NULL;
return_section->next = (asection *) NULL;
- return_section->flags = bfd_coff_styp_to_sec_flags_hook (abfd, hdr, name);
-
return_section->target_index = target_index;
+ return_section->flags = bfd_coff_styp_to_sec_flags_hook (abfd, hdr, name,
+ return_section);
/* At least on i386-coff, the line number count for a shared library
section must be ignored. */
@@ -211,6 +211,11 @@ coff_real_object_p (abfd, nscns, internal_f, internal_a)
if (bfd_read ((PTR) external_sections, 1, readsize, abfd) != readsize)
goto fail;
+ /* Set the arch/mach *before* swapping in sections; section header swapping
+ may depend on arch/mach info. */
+ if (bfd_coff_set_arch_mach_hook (abfd, (PTR) internal_f) == false)
+ goto fail;
+
/* Now copy data as required; construct all asections etc */
if (nscns != 0)
{
@@ -228,9 +233,6 @@ coff_real_object_p (abfd, nscns, internal_f, internal_a)
/* make_abs_section (abfd); */
- if (bfd_coff_set_arch_mach_hook (abfd, (PTR) internal_f) == false)
- goto fail;
-
return abfd->xvec;
fail:
@@ -559,7 +561,7 @@ coff_count_linenumbers (abfd)
/*ARGSUSED*/
coff_symbol_type *
coff_symbol_from (ignore_abfd, symbol)
- bfd *ignore_abfd;
+ bfd *ignore_abfd ATTRIBUTE_UNUSED;
asymbol *symbol;
{
if (bfd_asymbol_flavour (symbol) != bfd_target_coff_flavour)
@@ -585,7 +587,8 @@ fixup_symbol_value (abfd, coff_symbol_ptr, syment)
syment->n_scnum = N_UNDEF;
syment->n_value = coff_symbol_ptr->symbol.value;
}
- else if (coff_symbol_ptr->symbol.flags & BSF_DEBUGGING)
+ else if ((coff_symbol_ptr->symbol.flags & BSF_DEBUGGING) != 0
+ && (coff_symbol_ptr->symbol.flags & BSF_DEBUGGING_RELOC) == 0)
{
syment->n_value = coff_symbol_ptr->symbol.value;
}
@@ -594,6 +597,7 @@ fixup_symbol_value (abfd, coff_symbol_ptr, syment)
syment->n_scnum = N_UNDEF;
syment->n_value = 0;
}
+ /* FIXME: Do we need to handle the absolute section here? */
else
{
if (coff_symbol_ptr->symbol.section)
@@ -658,16 +662,18 @@ coff_renumber_symbols (bfd_ptr, first_undef)
if ((symbol_ptr_ptr[i]->flags & BSF_NOT_AT_END) != 0
|| (!bfd_is_und_section (symbol_ptr_ptr[i]->section)
&& !bfd_is_com_section (symbol_ptr_ptr[i]->section)
- && ((symbol_ptr_ptr[i]->flags & (BSF_GLOBAL | BSF_FUNCTION))
- != BSF_GLOBAL)))
+ && ((symbol_ptr_ptr[i]->flags & BSF_FUNCTION) != 0
+ || ((symbol_ptr_ptr[i]->flags & (BSF_GLOBAL | BSF_WEAK))
+ == 0))))
*newsyms++ = symbol_ptr_ptr[i];
for (i = 0; i < symbol_count; i++)
if ((symbol_ptr_ptr[i]->flags & BSF_NOT_AT_END) == 0
&& !bfd_is_und_section (symbol_ptr_ptr[i]->section)
&& (bfd_is_com_section (symbol_ptr_ptr[i]->section)
- || ((symbol_ptr_ptr[i]->flags & (BSF_GLOBAL | BSF_FUNCTION))
- == BSF_GLOBAL)))
+ || ((symbol_ptr_ptr[i]->flags & BSF_FUNCTION) == 0
+ && ((symbol_ptr_ptr[i]->flags & (BSF_GLOBAL | BSF_WEAK))
+ != 0))))
*newsyms++ = symbol_ptr_ptr[i];
*first_undef = newsyms - bfd_ptr->outsymbols;
@@ -808,14 +814,18 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p,
if (native->u.syment.n_sclass == C_FILE
&& native->u.syment.n_numaux > 0)
{
+ unsigned int filnmlen;
+
strncpy (native->u.syment._n._n_name, ".file", SYMNMLEN);
auxent = &(native + 1)->u.auxent;
+ filnmlen = bfd_coff_filnmlen (abfd);
+
if (bfd_coff_long_filenames (abfd))
{
- if (name_length <= FILNMLEN)
+ if (name_length <= filnmlen)
{
- strncpy (auxent->x_file.x_fname, name, FILNMLEN);
+ strncpy (auxent->x_file.x_fname, name, filnmlen);
}
else
{
@@ -826,11 +836,9 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p,
}
else
{
- strncpy (auxent->x_file.x_fname, name, FILNMLEN);
- if (name_length > FILNMLEN)
- {
- name[FILNMLEN] = '\0';
- }
+ strncpy (auxent->x_file.x_fname, name, filnmlen);
+ if (name_length > filnmlen)
+ name[filnmlen] = '\0';
}
}
else
@@ -1032,6 +1040,8 @@ coff_write_alien_symbol (abfd, symbol, written, string_size_p,
native->u.syment.n_type = 0;
if (symbol->flags & BSF_LOCAL)
native->u.syment.n_sclass = C_STAT;
+ else if (symbol->flags & BSF_WEAK)
+ native->u.syment.n_sclass = obj_pe (abfd) ? C_NT_WEAK : C_WEAKEXT;
else
native->u.syment.n_sclass = C_EXT;
native->u.syment.n_numaux = 0;
@@ -1242,7 +1252,7 @@ coff_write_symbols (abfd)
}
else if (c_symbol->native->u.syment.n_sclass == C_FILE
&& c_symbol->native->u.syment.n_numaux > 0)
- maxlen = FILNMLEN;
+ maxlen = bfd_coff_filnmlen (abfd);
else
maxlen = SYMNMLEN;
@@ -1347,7 +1357,7 @@ coff_write_linenumbers (abfd)
/*ARGSUSED */
alent *
coff_get_lineno (ignore_abfd, symbol)
- bfd *ignore_abfd;
+ bfd *ignore_abfd ATTRIBUTE_UNUSED;
asymbol *symbol;
{
return coffsymbol (symbol)->lineno;
@@ -1600,7 +1610,7 @@ _bfd_coff_read_string_table (abfd)
if (strsize < STRING_SIZE_SIZE)
{
(*_bfd_error_handler)
- ("%s: bad string table size %lu", bfd_get_filename (abfd),
+ (_("%s: bad string table size %lu"), bfd_get_filename (abfd),
(unsigned long) strsize);
bfd_set_error (bfd_error_bad_value);
return NULL;
@@ -1742,10 +1752,26 @@ coff_get_normalized_symtab (abfd)
}
else
{
- /* ordinary short filename, put into memory anyway */
- internal_ptr->u.syment._n._n_n._n_offset = (long)
- copy_name (abfd, (internal_ptr + 1)->u.auxent.x_file.x_fname,
- FILNMLEN);
+ /* Ordinary short filename, put into memory anyway. The
+ Microsoft PE tools sometimes store a filename in
+ multiple AUX entries. */
+ if (internal_ptr->u.syment.n_numaux > 1
+ && coff_data (abfd)->pe)
+ {
+ internal_ptr->u.syment._n._n_n._n_offset =
+ ((long)
+ copy_name (abfd,
+ (internal_ptr + 1)->u.auxent.x_file.x_fname,
+ internal_ptr->u.syment.n_numaux * symesz));
+ }
+ else
+ {
+ internal_ptr->u.syment._n._n_n._n_offset =
+ ((long)
+ copy_name (abfd,
+ (internal_ptr + 1)->u.auxent.x_file.x_fname,
+ bfd_coff_filnmlen (abfd)));
+ }
}
}
else
@@ -1843,8 +1869,8 @@ coff_make_empty_symbol (abfd)
asymbol *
coff_bfd_make_debug_symbol (abfd, ptr, sz)
bfd *abfd;
- PTR ptr;
- unsigned long sz;
+ PTR ptr ATTRIBUTE_UNUSED;
+ unsigned long sz ATTRIBUTE_UNUSED;
{
coff_symbol_type *new = (coff_symbol_type *) bfd_alloc (abfd, sizeof (coff_symbol_type));
if (new == NULL)
@@ -2042,8 +2068,23 @@ coff_print_symbol (abfd, filep, symbol, how)
auxp->u.auxent.x_scn.x_comdat);
break;
}
+ /* else fall through */
+ case C_EXT:
+ if (ISFCN (combined->u.syment.n_type))
+ {
+ fprintf (file,
+ _("AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld"),
+ tagndx,
+ auxp->u.auxent.x_sym.x_misc.x_fsize,
+ auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_lnnoptr,
+ (auxp->fix_end
+ ? ((long)
+ (auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.p
+ - root))
+ : auxp->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.l));
+ break;
+ }
/* else fall through */
-
default:
fprintf (file, "AUX lnno %d size 0x%x tagndx %ld",
auxp->u.auxent.x_sym.x_misc.x_lnsz.x_lnno,
@@ -2091,16 +2132,15 @@ coff_print_symbol (abfd, filep, symbol, how)
boolean
_bfd_coff_is_local_label_name (abfd, name)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
const char *name;
{
return name[0] == '.' && name[1] == 'L';
}
-/* Provided a BFD, a section and an offset into the section, calculate
- and return the name of the source file and the line nearest to the
- wanted location. */
-
+/* Provided a BFD, a section and an offset (in bytes, not octets) into the
+ section, calculate and return the name of the source file and the line
+ nearest to the wanted location. */
/*ARGSUSED*/
boolean
coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
@@ -2186,9 +2226,11 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
}
}
+ /* We use <= MAXDIFF here so that if we get a zero length
+ file, we actually use the next file entry. */
if (p2 < pend
&& offset + sec_vma >= (bfd_vma) p2->u.syment.n_value
- && offset + sec_vma - (bfd_vma) p2->u.syment.n_value < maxdiff)
+ && offset + sec_vma - (bfd_vma) p2->u.syment.n_value <= maxdiff)
{
*filename_ptr = (char *) p->u.syment._n._n_n._n_offset;
maxdiff = offset + sec_vma - p2->u.syment.n_value;
@@ -2225,6 +2267,8 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
if (section->lineno != NULL)
{
+ bfd_vma last_value = 0;
+
l = &section->lineno[i];
for (; i < section->lineno_count; i++)
@@ -2236,6 +2280,7 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
if (coff->symbol.value > offset)
break;
*functionname_ptr = coff->symbol.name;
+ last_value = coff->symbol.value;
if (coff->native)
{
combined_entry_type *s = coff->native;
@@ -2264,6 +2309,20 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
}
l++;
}
+
+ /* If we fell off the end of the loop, then assume that this
+ symbol has no line number info. Otherwise, symbols with no
+ line number info get reported with the line number of the
+ last line of the last symbol which does have line number
+ info. We use 0x100 as a slop to account for cases where the
+ last line has executable code. */
+ if (i >= section->lineno_count
+ && last_value != 0
+ && offset - last_value > 0x100)
+ {
+ *functionname_ptr = NULL;
+ *line_ptr = 0;
+ }
}
/* Cache the results for the next call. */
@@ -2304,3 +2363,71 @@ coff_sizeof_headers (abfd, reloc)
size += abfd->section_count * bfd_coff_scnhsz (abfd);
return size;
}
+
+/* Change the class of a coff symbol held by BFD. */
+boolean
+bfd_coff_set_symbol_class (abfd, symbol, class)
+ bfd * abfd;
+ asymbol * symbol;
+ unsigned int class;
+{
+ coff_symbol_type * csym;
+
+ csym = coff_symbol_from (abfd, symbol);
+ if (csym == NULL)
+ {
+ bfd_set_error (bfd_error_invalid_operation);
+ return false;
+ }
+ else if (csym->native == NULL)
+ {
+ /* This is an alien symbol which no native coff backend data.
+ We cheat here by creating a fake native entry for it and
+ then filling in the class. This code is based on that in
+ coff_write_alien_symbol(). */
+
+ combined_entry_type * native;
+
+ native = (combined_entry_type *) bfd_alloc (abfd, sizeof (* native));
+ if (native == NULL)
+ return false;
+
+ memset (native, 0, sizeof (* native));
+
+ native->u.syment.n_type = T_NULL;
+ native->u.syment.n_sclass = class;
+
+ if (bfd_is_und_section (symbol->section))
+ {
+ native->u.syment.n_scnum = N_UNDEF;
+ native->u.syment.n_value = symbol->value;
+ }
+ else if (bfd_is_com_section (symbol->section))
+ {
+ native->u.syment.n_scnum = N_UNDEF;
+ native->u.syment.n_value = symbol->value;
+ }
+ else
+ {
+ native->u.syment.n_scnum =
+ symbol->section->output_section->target_index;
+ native->u.syment.n_value = (symbol->value
+ + symbol->section->output_offset);
+ if (! obj_pe (abfd))
+ native->u.syment.n_value += symbol->section->output_section->vma;
+
+ /* Copy the any flags from the the file header into the symbol.
+ FIXME: Why? */
+ native->u.syment.n_flags = bfd_asymbol_bfd (& csym->symbol)->flags;
+ }
+
+ csym->native = native;
+ }
+ else
+ {
+ csym->native->u.syment.n_sclass = class;
+ }
+
+ return true;
+}
+
diff --git a/contrib/binutils/bfd/cofflink.c b/contrib/binutils/bfd/cofflink.c
index 7b2b8305dbf0..609f6653e098 100644
--- a/contrib/binutils/bfd/cofflink.c
+++ b/contrib/binutils/bfd/cofflink.c
@@ -1,5 +1,5 @@
/* COFF specific linker code.
- Copyright 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright 1994, 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -40,6 +40,16 @@ static int process_embedded_commands
PARAMS ((bfd *, struct bfd_link_info *, bfd *));
static void mark_relocs PARAMS ((struct coff_final_link_info *, bfd *));
+/* Define macros so that the ISFCN, et. al., macros work correctly.
+ These macros are defined in include/coff/internal.h in terms of
+ N_TMASK, etc. These definitions require a user to define local
+ variables with the appropriate names, and with values from the
+ coff_data (abfd) structure. */
+
+#define N_TMASK n_tmask
+#define N_BTSHFT n_btshft
+#define N_BTMASK n_btmask
+
/* Create an entry in a COFF linker hash table. */
struct bfd_hash_entry *
@@ -225,30 +235,25 @@ coff_link_check_ar_symbols (abfd, info, pneeded)
struct bfd_link_info *info;
boolean *pneeded;
{
- boolean (*sym_is_global) PARAMS ((bfd *, struct internal_syment *));
bfd_size_type symesz;
bfd_byte *esym;
bfd_byte *esym_end;
*pneeded = false;
- sym_is_global = coff_backend_info (abfd)->_bfd_coff_sym_is_global;
-
symesz = bfd_coff_symesz (abfd);
esym = (bfd_byte *) obj_coff_external_syms (abfd);
esym_end = esym + obj_raw_syment_count (abfd) * symesz;
while (esym < esym_end)
{
struct internal_syment sym;
+ enum coff_symbol_classification classification;
bfd_coff_swap_sym_in (abfd, (PTR) esym, (PTR) &sym);
- if ((sym.n_sclass == C_EXT
-#ifdef C_SYSTEM
- || sym.n_sclass == C_SYSTEM
-#endif
- || (sym_is_global && (*sym_is_global) (abfd, &sym)))
- && (sym.n_scnum != 0 || sym.n_value != 0))
+ classification = bfd_coff_classify_symbol (abfd, &sym);
+ if (classification == COFF_SYMBOL_GLOBAL
+ || classification == COFF_SYMBOL_COMMON)
{
const char *name;
char buf[SYMNMLEN + 1];
@@ -290,7 +295,9 @@ coff_link_add_symbols (abfd, info)
bfd *abfd;
struct bfd_link_info *info;
{
- boolean (*sym_is_global) PARAMS ((bfd *, struct internal_syment *));
+ unsigned int n_tmask = coff_data (abfd)->local_n_tmask;
+ unsigned int n_btshft = coff_data (abfd)->local_n_btshft;
+ unsigned int n_btmask = coff_data (abfd)->local_n_btmask;
boolean keep_syms;
boolean default_copy;
bfd_size_type symcount;
@@ -304,8 +311,6 @@ coff_link_add_symbols (abfd, info)
keep_syms = obj_coff_keep_syms (abfd);
obj_coff_keep_syms (abfd) = true;
- sym_is_global = coff_backend_info (abfd)->_bfd_coff_sym_is_global;
-
if (info->keep_memory)
default_copy = false;
else
@@ -332,21 +337,20 @@ coff_link_add_symbols (abfd, info)
while (esym < esym_end)
{
struct internal_syment sym;
+ enum coff_symbol_classification classification;
boolean copy;
bfd_coff_swap_sym_in (abfd, (PTR) esym, (PTR) &sym);
- if (sym.n_sclass == C_EXT
-#ifdef C_SYSTEM
- || sym.n_sclass == C_SYSTEM
-#endif
- || (sym_is_global && (*sym_is_global) (abfd, &sym)))
+ classification = bfd_coff_classify_symbol (abfd, &sym);
+ if (classification != COFF_SYMBOL_LOCAL)
{
const char *name;
char buf[SYMNMLEN + 1];
flagword flags;
asection *section;
bfd_vma value;
+ boolean addit;
/* This symbol is externally visible. */
@@ -363,33 +367,119 @@ coff_link_add_symbols (abfd, info)
value = sym.n_value;
- if (sym.n_scnum == 0)
- {
- if (value == 0)
- {
- flags = 0;
- section = bfd_und_section_ptr;
- }
- else
- {
- flags = BSF_GLOBAL;
- section = bfd_com_section_ptr;
- }
- }
- else
+ switch (classification)
{
+ default:
+ abort ();
+
+ case COFF_SYMBOL_GLOBAL:
flags = BSF_EXPORT | BSF_GLOBAL;
section = coff_section_from_bfd_index (abfd, sym.n_scnum);
if (! obj_pe (abfd))
value -= section->vma;
+ break;
+
+ case COFF_SYMBOL_UNDEFINED:
+ flags = 0;
+ section = bfd_und_section_ptr;
+ break;
+
+ case COFF_SYMBOL_COMMON:
+ flags = BSF_GLOBAL;
+ section = bfd_com_section_ptr;
+ break;
+
+ case COFF_SYMBOL_PE_SECTION:
+ flags = BSF_SECTION_SYM | BSF_GLOBAL;
+ section = coff_section_from_bfd_index (abfd, sym.n_scnum);
+ break;
}
- if (! (bfd_coff_link_add_one_symbol
- (info, abfd, name, flags, section, value,
- (const char *) NULL, copy, false,
- (struct bfd_link_hash_entry **) sym_hash)))
- goto error_return;
+ if (sym.n_sclass == C_WEAKEXT
+ || (obj_pe (abfd) && sym.n_sclass == C_NT_WEAK))
+ flags = BSF_WEAK;
+ addit = true;
+
+ /* In the PE format, section symbols actually refer to the
+ start of the output section. We handle them specially
+ here. */
+ if (obj_pe (abfd) && (flags & BSF_SECTION_SYM) != 0)
+ {
+ *sym_hash = coff_link_hash_lookup (coff_hash_table (info),
+ name, false, copy, false);
+ if (*sym_hash != NULL)
+ {
+ if (((*sym_hash)->coff_link_hash_flags
+ & COFF_LINK_HASH_PE_SECTION_SYMBOL) == 0
+ && (*sym_hash)->root.type != bfd_link_hash_undefined
+ && (*sym_hash)->root.type != bfd_link_hash_undefweak)
+ (*_bfd_error_handler)
+ ("Warning: symbol `%s' is both section and non-section",
+ name);
+
+ addit = false;
+ }
+ }
+
+ /* The Microsoft Visual C compiler does string pooling by
+ hashing the constants to an internal symbol name, and
+ relying on the the linker comdat support to discard
+ duplicate names. However, if one string is a literal and
+ one is a data initializer, one will end up in the .data
+ section and one will end up in the .rdata section. The
+ Microsoft linker will combine them into the .data
+ section, which seems to be wrong since it might cause the
+ literal to change.
+
+ As long as there are no external references to the
+ symbols, which there shouldn't be, we can treat the .data
+ and .rdata instances as separate symbols. The comdat
+ code in the linker will do the appropriate merging. Here
+ we avoid getting a multiple definition error for one of
+ these special symbols.
+
+ FIXME: I don't think this will work in the case where
+ there are two object files which use the constants as a
+ literal and two object files which use it as a data
+ initializer. One or the other of the second object files
+ is going to wind up with an inappropriate reference. */
+ if (obj_pe (abfd)
+ && (classification == COFF_SYMBOL_GLOBAL
+ || classification == COFF_SYMBOL_PE_SECTION)
+ && section->comdat != NULL
+ && strncmp (name, "??_", 3) == 0
+ && strcmp (name, section->comdat->name) == 0)
+ {
+ if (*sym_hash == NULL)
+ *sym_hash = coff_link_hash_lookup (coff_hash_table (info),
+ name, false, copy, false);
+ if (*sym_hash != NULL
+ && (*sym_hash)->root.type == bfd_link_hash_defined
+ && (*sym_hash)->root.u.def.section->comdat != NULL
+ && strcmp ((*sym_hash)->root.u.def.section->comdat->name,
+ section->comdat->name) == 0)
+ addit = false;
+ }
+
+ if (addit)
+ {
+ if (! (bfd_coff_link_add_one_symbol
+ (info, abfd, name, flags, section, value,
+ (const char *) NULL, copy, false,
+ (struct bfd_link_hash_entry **) sym_hash)))
+ goto error_return;
+ }
+
+ if (obj_pe (abfd) && (flags & BSF_SECTION_SYM) != 0)
+ (*sym_hash)->coff_link_hash_flags |=
+ COFF_LINK_HASH_PE_SECTION_SYMBOL;
+
+ /* Limit the alignment of a common symbol to the possible
+ alignment of a section. There is no point to permitting
+ a higher alignment for a common symbol: we can not
+ guarantee it, and it may cause us to allocate extra space
+ in the common section. */
if (section == bfd_com_section_ptr
&& (*sym_hash)->root.type == bfd_link_hash_common
&& ((*sym_hash)->root.u.c.p->alignment_power
@@ -399,24 +489,44 @@ coff_link_add_symbols (abfd, info)
if (info->hash->creator->flavour == bfd_get_flavour (abfd))
{
- if (((*sym_hash)->class == C_NULL
- && (*sym_hash)->type == T_NULL)
- || sym.n_scnum != 0
- || (sym.n_value != 0
- && (*sym_hash)->root.type != bfd_link_hash_defined))
- {
- (*sym_hash)->class = sym.n_sclass;
- if (sym.n_type != T_NULL)
- {
- if ((*sym_hash)->type != T_NULL
- && (*sym_hash)->type != sym.n_type)
- (*_bfd_error_handler)
- ("Warning: type of symbol `%s' changed from %d to %d in %s",
- name, (*sym_hash)->type, sym.n_type,
- bfd_get_filename (abfd));
- (*sym_hash)->type = sym.n_type;
- }
- (*sym_hash)->auxbfd = abfd;
+ /* If we don't have any symbol information currently in
+ the hash table, or if we are looking at a symbol
+ definition, then update the symbol class and type in
+ the hash table. */
+ if (((*sym_hash)->class == C_NULL
+ && (*sym_hash)->type == T_NULL)
+ || sym.n_scnum != 0
+ || (sym.n_value != 0
+ && (*sym_hash)->root.type != bfd_link_hash_defined
+ && (*sym_hash)->root.type != bfd_link_hash_defweak))
+ {
+ (*sym_hash)->class = sym.n_sclass;
+ if (sym.n_type != T_NULL)
+ {
+ /* We want to warn if the type changed, but not
+ if it changed from an unspecified type.
+ Testing the whole type byte may work, but the
+ change from (e.g.) a function of unspecified
+ type to function of known type also wants to
+ skip the warning. */
+ if ((*sym_hash)->type != T_NULL
+ && (*sym_hash)->type != sym.n_type
+ && !(DTYPE ((*sym_hash)->type) == DTYPE (sym.n_type)
+ && (BTYPE ((*sym_hash)->type) == T_NULL
+ || BTYPE (sym.n_type) == T_NULL)))
+ (*_bfd_error_handler)
+ (_("Warning: type of symbol `%s' changed from %d to %d in %s"),
+ name, (*sym_hash)->type, sym.n_type,
+ bfd_get_filename (abfd));
+
+ /* We don't want to change from a meaningful
+ base type to a null one, but if we know
+ nothing, take what little we might now know. */
+ if (BTYPE (sym.n_type) != T_NULL
+ || (*sym_hash)->type == T_NULL)
+ (*sym_hash)->type = sym.n_type;
+ }
+ (*sym_hash)->auxbfd = abfd;
if (sym.n_numaux != 0)
{
union internal_auxent *alloc;
@@ -441,6 +551,26 @@ coff_link_add_symbols (abfd, info)
}
}
}
+
+ if (classification == COFF_SYMBOL_PE_SECTION
+ && (*sym_hash)->numaux != 0)
+ {
+ /* Some PE sections (such as .bss) have a zero size in
+ the section header, but a non-zero size in the AUX
+ record. Correct that here.
+
+ FIXME: This is not at all the right place to do this.
+ For example, it won't help objdump. This needs to be
+ done when we swap in the section header. */
+
+ BFD_ASSERT ((*sym_hash)->numaux == 1);
+ if (section->_raw_size == 0)
+ section->_raw_size = (*sym_hash)->aux[0].x_scn.x_scnlen;
+
+ /* FIXME: We could test whether the section sizes
+ matches the size in the aux entry, but apparently
+ that sometimes fails unexpectedly. */
+ }
}
esym += (sym.n_numaux + 1) * symesz;
@@ -768,7 +898,7 @@ _bfd_coff_final_link (abfd, info)
== bfd_target_coff_flavour))
{
sub = p->u.indirect.section->owner;
- if (! bfd_coff_link_output_has_begun (sub))
+ if (! bfd_coff_link_output_has_begun (sub, & finfo))
{
if (! _bfd_coff_link_input_bfd (&finfo, sub))
goto error_return;
@@ -1060,7 +1190,7 @@ char **dst;
static int
process_embedded_commands (output_bfd, info, abfd)
bfd *output_bfd;
- struct bfd_link_info *info;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
bfd *abfd;
{
asection *sec = bfd_get_section_by_name (abfd, ".drectve");
@@ -1203,15 +1333,17 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
struct coff_final_link_info *finfo;
bfd *input_bfd;
{
- boolean (*sym_is_global) PARAMS ((bfd *, struct internal_syment *));
+ unsigned int n_tmask = coff_data (input_bfd)->local_n_tmask;
+ unsigned int n_btshft = coff_data (input_bfd)->local_n_btshft;
+#if 0
+ unsigned int n_btmask = coff_data (input_bfd)->local_n_btmask;
+#endif
boolean (*adjust_symndx) PARAMS ((bfd *, struct bfd_link_info *, bfd *,
asection *, struct internal_reloc *,
boolean *));
bfd *output_bfd;
const char *strings;
bfd_size_type syment_base;
- unsigned int n_tmask;
- unsigned int n_btshft;
boolean copy, hash;
bfd_size_type isymesz;
bfd_size_type osymesz;
@@ -1229,7 +1361,6 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
/* Move all the symbols to the output file. */
output_bfd = finfo->output_bfd;
- sym_is_global = coff_backend_info (input_bfd)->_bfd_coff_sym_is_global;
strings = NULL;
syment_base = obj_raw_syment_count (output_bfd);
isymesz = bfd_coff_symesz (input_bfd);
@@ -1237,13 +1368,6 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
linesz = bfd_coff_linesz (input_bfd);
BFD_ASSERT (linesz == bfd_coff_linesz (output_bfd));
- n_tmask = coff_data (input_bfd)->local_n_tmask;
- n_btshft = coff_data (input_bfd)->local_n_btshft;
-
- /* Define macros so that ISFCN, et. al., macros work correctly. */
-#define N_TMASK n_tmask
-#define N_BTSHFT n_btshft
-
copy = false;
if (! finfo->info->keep_memory)
copy = true;
@@ -1284,6 +1408,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
while (esym < esym_end)
{
struct internal_syment isym;
+ enum coff_symbol_classification classification;
boolean skip;
boolean global;
boolean dont_skip_symbol;
@@ -1297,14 +1422,22 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
the symbol. */
isym = *isymp;
- if (isym.n_scnum != 0)
- *secpp = coff_section_from_bfd_index (input_bfd, isym.n_scnum);
- else
+ classification = bfd_coff_classify_symbol (input_bfd, &isym);
+ switch (classification)
{
- if (isym.n_value == 0)
- *secpp = bfd_und_section_ptr;
- else
- *secpp = bfd_com_section_ptr;
+ default:
+ abort ();
+ case COFF_SYMBOL_GLOBAL:
+ case COFF_SYMBOL_PE_SECTION:
+ case COFF_SYMBOL_LOCAL:
+ *secpp = coff_section_from_bfd_index (input_bfd, isym.n_scnum);
+ break;
+ case COFF_SYMBOL_COMMON:
+ *secpp = bfd_com_section_ptr;
+ break;
+ case COFF_SYMBOL_UNDEFINED:
+ *secpp = bfd_und_section_ptr;
+ break;
}
/* Extract the flag indicating if this symbol is used by a
@@ -1328,26 +1461,34 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
if (! skip)
{
- if (isym.n_sclass == C_EXT
-#ifdef C_SYSTEM
- || isym.n_sclass == C_SYSTEM
-#endif
- || (sym_is_global && (*sym_is_global) (input_bfd, &isym)))
+ switch (classification)
{
+ default:
+ abort ();
+ case COFF_SYMBOL_GLOBAL:
+ case COFF_SYMBOL_COMMON:
+ case COFF_SYMBOL_PE_SECTION:
/* This is a global symbol. Global symbols come at the
end of the symbol table, so skip them for now.
- Function symbols, however, are an exception, and are
- not moved to the end. */
+ Locally defined function symbols, however, are an
+ exception, and are not moved to the end. */
global = true;
if (! ISFCN (isym.n_type))
skip = true;
- }
- else
- {
+ break;
+
+ case COFF_SYMBOL_UNDEFINED:
+ /* Undefined symbols are left for the end. */
+ global = true;
+ skip = true;
+ break;
+
+ case COFF_SYMBOL_LOCAL:
/* This is a local symbol. Skip it if we are discarding
local symbols. */
if (finfo->info->discard == discard_all && ! dont_skip_symbol)
skip = true;
+ break;
}
}
@@ -1455,7 +1596,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
{
const char *elename;
char elebuf[SYMNMLEN + 1];
- char *copy;
+ char *name_copy;
bfd_coff_swap_sym_in (input_bfd, (PTR) esl, (PTR) islp);
@@ -1470,12 +1611,13 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
if (elename == NULL)
return false;
- copy = (char *) bfd_alloc (input_bfd, strlen (elename) + 1);
- if (copy == NULL)
+ name_copy = (char *) bfd_alloc (input_bfd,
+ strlen (elename) + 1);
+ if (name_copy == NULL)
return false;
- strcpy (copy, elename);
+ strcpy (name_copy, elename);
- (*epp)->name = copy;
+ (*epp)->name = name_copy;
(*epp)->type = islp->n_type;
(*epp)->tagndx = 0;
if (islp->n_numaux >= 1
@@ -1587,31 +1729,76 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
isym._n._n_n._n_offset = STRING_SIZE_SIZE + indx;
}
- if (isym.n_scnum > 0)
+ switch (isym.n_sclass)
{
- isym.n_scnum = (*secpp)->output_section->target_index;
- isym.n_value += (*secpp)->output_offset;
- if (! obj_pe (input_bfd))
- isym.n_value -= (*secpp)->vma;
- if (! obj_pe (finfo->output_bfd))
- isym.n_value += (*secpp)->output_section->vma;
- }
+ case C_AUTO:
+ case C_MOS:
+ case C_EOS:
+ case C_MOE:
+ case C_MOU:
+ case C_UNTAG:
+ case C_STRTAG:
+ case C_ENTAG:
+ case C_TPDEF:
+ case C_ARG:
+ case C_USTATIC:
+ case C_REG:
+ case C_REGPARM:
+ case C_FIELD:
+ /* The symbol value should not be modified. */
+ break;
+
+ case C_FCN:
+ if (obj_pe (input_bfd)
+ && strcmp (isym.n_name, ".bf") != 0
+ && isym.n_scnum > 0)
+ {
+ /* For PE, .lf and .ef get their value left alone,
+ while .bf gets relocated. However, they all have
+ "real" section numbers, and need to be moved into
+ the new section. */
+ isym.n_scnum = (*secpp)->output_section->target_index;
+ break;
+ }
+ /* Fall through. */
+ default:
+ case C_LABEL: /* Not completely sure about these 2 */
+ case C_EXTDEF:
+ case C_BLOCK:
+ case C_EFCN:
+ case C_NULL:
+ case C_EXT:
+ case C_STAT:
+ case C_SECTION:
+ case C_NT_WEAK:
+ /* Compute new symbol location. */
+ if (isym.n_scnum > 0)
+ {
+ isym.n_scnum = (*secpp)->output_section->target_index;
+ isym.n_value += (*secpp)->output_offset;
+ if (! obj_pe (input_bfd))
+ isym.n_value -= (*secpp)->vma;
+ if (! obj_pe (finfo->output_bfd))
+ isym.n_value += (*secpp)->output_section->vma;
+ }
+ break;
+
+ case C_FILE:
+ /* The value of a C_FILE symbol is the symbol index of
+ the next C_FILE symbol. The value of the last C_FILE
+ symbol is the symbol index to the first external
+ symbol (actually, coff_renumber_symbols does not get
+ this right--it just sets the value of the last C_FILE
+ symbol to zero--and nobody has ever complained about
+ it). We try to get this right, below, just before we
+ write the symbols out, but in the general case we may
+ have to write the symbol out twice. */
- /* The value of a C_FILE symbol is the symbol index of the
- next C_FILE symbol. The value of the last C_FILE symbol
- is the symbol index to the first external symbol
- (actually, coff_renumber_symbols does not get this
- right--it just sets the value of the last C_FILE symbol
- to zero--and nobody has ever complained about it). We
- try to get this right, below, just before we write the
- symbols out, but in the general case we may have to write
- the symbol out twice. */
- if (isym.n_sclass == C_FILE)
- {
if (finfo->last_file_index != -1
&& finfo->last_file.n_value != (long) output_index)
{
- /* We must correct the value of the last C_FILE entry. */
+ /* We must correct the value of the last C_FILE
+ entry. */
finfo->last_file.n_value = output_index;
if ((bfd_size_type) finfo->last_file_index >= syment_base)
{
@@ -1643,12 +1830,16 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
finfo->last_file_index = output_index;
finfo->last_file = isym;
+ break;
}
/* If doing task linking, convert normal global function symbols to
static functions. */
- if (finfo->info->task_link && isym.n_sclass == C_EXT)
+ if (finfo->info->task_link
+ && (isym.n_sclass == C_EXT
+ || isym.n_sclass == C_WEAKEXT
+ || (obj_pe (input_bfd) && isym.n_sclass == C_NT_WEAK)))
isym.n_sclass = C_STAT;
/* Output the symbol. */
@@ -1920,6 +2111,8 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
bfd_vma offset;
bfd_byte *eline;
bfd_byte *elineend;
+ bfd_byte *oeline;
+ boolean skipping;
/* FIXME: If SEC_HAS_CONTENTS is not for the section, then
build_link_order in ldwrite.c will not have created a
@@ -1941,7 +2134,9 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
offset = o->output_section->vma + o->output_offset - o->vma;
eline = finfo->linenos;
+ oeline = finfo->linenos;
elineend = eline + linesz * o->lineno_count;
+ skipping = false;
for (; eline < elineend; eline += linesz)
{
struct internal_lineno iline;
@@ -1961,11 +2156,13 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
if (indx < 0)
{
/* These line numbers are attached to a symbol
- which we are stripping. We should really
- just discard the line numbers, but that would
- be a pain because we have already counted
- them. */
- indx = 0;
+ which we are stripping. We must discard the
+ line numbers because reading them back with
+ no associated symbol (or associating them all
+ with symbol #0) will fail. We can't regain
+ the space in the output file, but at least
+ they're dense. */
+ skipping = true;
}
else
{
@@ -2004,23 +2201,32 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
is.n_type, is.n_sclass, 0,
is.n_numaux, auxptr);
}
+
+ skipping = false;
}
iline.l_addr.l_symndx = indx;
}
- bfd_coff_swap_lineno_out (output_bfd, (PTR) &iline, (PTR) eline);
+ if (!skipping)
+ {
+ bfd_coff_swap_lineno_out (output_bfd, (PTR) &iline,
+ (PTR) oeline);
+ oeline += linesz;
+ }
}
if (bfd_seek (output_bfd,
(o->output_section->line_filepos
+ o->output_section->lineno_count * linesz),
SEEK_SET) != 0
- || bfd_write (finfo->linenos, linesz, o->lineno_count,
- output_bfd) != linesz * o->lineno_count)
+ || (bfd_write (finfo->linenos, 1, oeline - finfo->linenos,
+ output_bfd)
+ != (bfd_size_type) (oeline - finfo->linenos)))
return false;
- o->output_section->lineno_count += o->lineno_count;
+ o->output_section->lineno_count +=
+ (oeline - finfo->linenos) / linesz;
}
}
@@ -2076,7 +2282,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
&& o->reloc_count != 0)
{
((*_bfd_error_handler)
- ("%s: relocs in section `%s', but it has no contents",
+ (_("%s: relocs in section `%s', but it has no contents"),
bfd_get_filename (input_bfd),
bfd_get_section_name (input_bfd, o)));
bfd_set_error (bfd_error_no_contents);
@@ -2219,7 +2425,10 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
if (secdata == NULL || secdata->stab_info == NULL)
{
if (! bfd_set_section_contents (output_bfd, o->output_section,
- contents, o->output_offset,
+ contents,
+ (file_ptr)
+ (o->output_offset *
+ bfd_octets_per_byte (output_bfd)),
(o->_cooked_size != 0
? o->_cooked_size
: o->_raw_size)))
@@ -2337,12 +2546,15 @@ _bfd_coff_write_global_sym (h, data)
if (isym.n_sclass == C_NULL)
isym.n_sclass = C_EXT;
- /* If doing task linking and this is the pass where we convert defined globals to
- statics, then do that conversion now. If the symbol is not being converted,
- just ignore it and it will be output during a later pass. */
+ /* If doing task linking and this is the pass where we convert
+ defined globals to statics, then do that conversion now. If the
+ symbol is not being converted, just ignore it and it will be
+ output during a later pass. */
if (finfo->global_to_static)
{
- if (isym.n_sclass != C_EXT)
+ if (isym.n_sclass != C_EXT
+ && isym.n_sclass != C_WEAKEXT
+ && (! obj_pe (output_bfd) || isym.n_sclass != C_NT_WEAK))
{
return true;
}
@@ -2369,11 +2581,64 @@ _bfd_coff_write_global_sym (h, data)
++obj_raw_syment_count (output_bfd);
- /* Write out any associated aux entries. There normally will be
- none. If there are any, I have no idea how to modify them. */
+ /* Write out any associated aux entries. Most of the aux entries
+ will have been modified in _bfd_coff_link_input_bfd. We have to
+ handle section aux entries here, now that we have the final
+ relocation and line number counts. */
for (i = 0; i < isym.n_numaux; i++)
{
- bfd_coff_swap_aux_out (output_bfd, (PTR) (h->aux + i), isym.n_type,
+ union internal_auxent *auxp;
+
+ auxp = h->aux + i;
+
+ /* Look for a section aux entry here using the same tests that
+ coff_swap_aux_out uses. */
+ if (i == 0
+ && (isym.n_sclass == C_STAT
+ || isym.n_sclass == C_HIDDEN)
+ && isym.n_type == T_NULL
+ && (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak))
+ {
+ asection *sec;
+
+ sec = h->root.u.def.section->output_section;
+ if (sec != NULL)
+ {
+ auxp->x_scn.x_scnlen = (sec->_cooked_size != 0
+ ? sec->_cooked_size
+ : sec->_raw_size);
+
+ /* For PE, an overflow on the final link reportedly does
+ not matter. FIXME: Why not? */
+
+ if (sec->reloc_count > 0xffff
+ && (! obj_pe (output_bfd)
+ || finfo->info->relocateable))
+ (*_bfd_error_handler)
+ (_("%s: %s: reloc overflow: 0x%lx > 0xffff"),
+ bfd_get_filename (output_bfd),
+ bfd_get_section_name (output_bfd, sec),
+ sec->reloc_count);
+
+ if (sec->lineno_count > 0xffff
+ && (! obj_pe (output_bfd)
+ || finfo->info->relocateable))
+ (*_bfd_error_handler)
+ (_("%s: warning: %s: line number overflow: 0x%lx > 0xffff"),
+ bfd_get_filename (output_bfd),
+ bfd_get_section_name (output_bfd, sec),
+ sec->lineno_count);
+
+ auxp->x_scn.x_nreloc = sec->reloc_count;
+ auxp->x_scn.x_nlinno = sec->lineno_count;
+ auxp->x_scn.x_checksum = 0;
+ auxp->x_scn.x_associated = 0;
+ auxp->x_scn.x_comdat = 0;
+ }
+ }
+
+ bfd_coff_swap_aux_out (output_bfd, (PTR) auxp, isym.n_type,
isym.n_sclass, i, isym.n_numaux,
(PTR) finfo->outsyms);
if (bfd_write (finfo->outsyms, symesz, 1, output_bfd) != symesz)
@@ -2475,7 +2740,9 @@ _bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order)
break;
}
ok = bfd_set_section_contents (output_bfd, output_section, (PTR) buf,
- (file_ptr) link_order->offset, size);
+ (file_ptr)
+ (link_order->offset *
+ bfd_octets_per_byte (output_bfd)), size);
free (buf);
if (! ok)
return false;
@@ -2586,6 +2853,14 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd,
h = NULL;
sym = NULL;
}
+ else if (symndx < 0
+ || (unsigned long) symndx >= obj_raw_syment_count (input_bfd))
+ {
+ (*_bfd_error_handler)
+ ("%s: illegal symbol index %ld in relocs",
+ bfd_get_filename (input_bfd), symndx);
+ return false;
+ }
else
{
h = obj_coff_sym_hashes (input_bfd)[symndx];
@@ -2658,7 +2933,7 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd,
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ rel->r_vaddr - input_section->vma, true)))
return false;
}
}
@@ -2702,7 +2977,7 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd,
break;
case bfd_reloc_outofrange:
(*_bfd_error_handler)
- ("%s: bad reloc address 0x%lx in section `%s'",
+ (_("%s: bad reloc address 0x%lx in section `%s'"),
bfd_get_filename (input_bfd),
(unsigned long) rel->r_vaddr,
bfd_get_section_name (input_bfd, input_section));
diff --git a/contrib/binutils/bfd/coffswap.h b/contrib/binutils/bfd/coffswap.h
index ff76e9ee08a3..d7d090fd41e1 100644
--- a/contrib/binutils/bfd/coffswap.h
+++ b/contrib/binutils/bfd/coffswap.h
@@ -1,5 +1,6 @@
/* Generic COFF swapping routines, for BFD.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
+ Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -26,10 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
Any file which uses this must first include "coff/internal.h" and
"coff/CPU.h". The functions will then be correct for that CPU. */
-#ifndef IMAGE_BASE
-#define IMAGE_BASE 0
-#endif
-
#define PUTWORD bfd_h_put_32
#define PUTHALF bfd_h_put_16
#define PUTBYTE bfd_h_put_8
@@ -264,7 +261,7 @@ coff_swap_reloc_out (abfd, src, dst)
SWAP_OUT_RELOC_EXTRA(abfd,reloc_src, reloc_dst);
#endif
- return RELSZ;
+ return bfd_coff_relsz (abfd);
}
#endif /* NO_COFF_RELOCS */
@@ -288,6 +285,9 @@ coff_swap_filehdr_in (abfd, src, dst)
filehdr_dst->f_nsyms = bfd_h_get_32(abfd, (bfd_byte *)filehdr_src-> f_nsyms);
filehdr_dst->f_opthdr = bfd_h_get_16(abfd, (bfd_byte *)filehdr_src-> f_opthdr);
filehdr_dst->f_flags = bfd_h_get_16(abfd, (bfd_byte *)filehdr_src-> f_flags);
+#ifdef TIC80_TARGET_ID
+ filehdr_dst->f_target_id = bfd_h_get_16(abfd, (bfd_byte *)filehdr_src-> f_target_id);
+#endif
#ifdef COFF_ADJUST_FILEHDR_IN_POST
COFF_ADJUST_FILEHDR_IN_POST (abfd, src, dst);
@@ -314,11 +314,14 @@ coff_swap_filehdr_out (abfd, in, out)
bfd_h_put_32(abfd, filehdr_in->f_nsyms, (bfd_byte *) filehdr_out->f_nsyms);
bfd_h_put_16(abfd, filehdr_in->f_opthdr, (bfd_byte *) filehdr_out->f_opthdr);
bfd_h_put_16(abfd, filehdr_in->f_flags, (bfd_byte *) filehdr_out->f_flags);
+#ifdef TIC80_TARGET_ID
+ bfd_h_put_16(abfd, filehdr_in->f_target_id, (bfd_byte *) filehdr_out->f_target_id);
+#endif
#ifdef COFF_ADJUST_FILEHDR_OUT_POST
COFF_ADJUST_FILEHDR_OUT_POST (abfd, in, out);
#endif
- return FILHSZ;
+ return bfd_coff_filhsz (abfd);
}
@@ -354,6 +357,9 @@ coff_swap_sym_in (abfd, ext1, in1)
}
in->n_sclass = bfd_h_get_8(abfd, ext->e_sclass);
in->n_numaux = bfd_h_get_8(abfd, ext->e_numaux);
+#ifdef COFF_ADJUST_SYM_IN_POST
+ COFF_ADJUST_SYM_IN_POST (abfd, ext1, in1);
+#endif
}
static unsigned int
@@ -387,6 +393,9 @@ coff_swap_sym_out (abfd, inp, extp)
}
bfd_h_put_8(abfd, in->n_sclass , ext->e_sclass);
bfd_h_put_8(abfd, in->n_numaux , ext->e_numaux);
+#ifdef COFF_ADJUST_SYM_OUT_POST
+ COFF_ADJUST_SYM_OUT_POST (abfd, inp, extp);
+#endif
return SYMESZ;
}
@@ -416,7 +425,16 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1)
#if FILNMLEN != E_FILNMLEN
-> Error, we need to cope with truncating or extending FILNMLEN!;
#else
- memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN);
+ if (numaux > 1)
+ {
+ if (indx == 0)
+ memcpy (in->x_file.x_fname, ext->x_file.x_fname,
+ numaux * sizeof (AUXENT));
+ }
+ else
+ {
+ memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN);
+ }
#endif
}
goto end;
@@ -512,8 +530,8 @@ coff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
PTR inp;
int type;
int class;
- int indx;
- int numaux;
+ int indx ATTRIBUTE_UNUSED;
+ int numaux ATTRIBUTE_UNUSED;
PTR extp;
{
union internal_auxent *in = (union internal_auxent *)inp;
@@ -833,7 +851,7 @@ coff_swap_scnhdr_out (abfd, in, out)
{
struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *)in;
SCNHDR *scnhdr_ext = (SCNHDR *)out;
- unsigned int ret = SCNHSZ;
+ unsigned int ret = bfd_coff_scnhsz (abfd);
#ifdef COFF_ADJUST_SCNHDR_OUT_PRE
COFF_ADJUST_SCNHDR_OUT_PRE (abfd, in, out);
@@ -870,7 +888,7 @@ coff_swap_scnhdr_out (abfd, in, out)
memcpy (buf, scnhdr_int->s_name, sizeof (scnhdr_int->s_name));
buf[sizeof (scnhdr_int->s_name)] = '\0';
(*_bfd_error_handler)
- ("%s: warning: %s: line number overflow: 0x%lx > 0xffff",
+ (_("%s: warning: %s: line number overflow: 0x%lx > 0xffff"),
bfd_get_filename (abfd),
buf, scnhdr_int->s_nlnno);
PUTHALF (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nlnno);
@@ -883,7 +901,7 @@ coff_swap_scnhdr_out (abfd, in, out)
memcpy (buf, scnhdr_int->s_name, sizeof (scnhdr_int->s_name));
buf[sizeof (scnhdr_int->s_name)] = '\0';
- (*_bfd_error_handler) ("%s: %s: reloc overflow: 0x%lx > 0xffff",
+ (*_bfd_error_handler) (_("%s: %s: reloc overflow: 0x%lx > 0xffff"),
bfd_get_filename (abfd),
buf, scnhdr_int->s_nreloc);
bfd_set_error (bfd_error_file_truncated);
diff --git a/contrib/binutils/bfd/config.bfd b/contrib/binutils/bfd/config.bfd
index 589bb8f31275..d8f91d2e161f 100755
--- a/contrib/binutils/bfd/config.bfd
+++ b/contrib/binutils/bfd/config.bfd
@@ -30,16 +30,19 @@ targ_cpu=`echo $targ | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
case "${targ_cpu}" in
alpha*) targ_archs=bfd_alpha_arch ;;
arm*) targ_archs=bfd_arm_arch ;;
-c30*) targ_archs=bfd_tic30_arch ;;
+strongarm*) targ_archs=bfd_arm_arch ;;
thumb*) targ_archs=bfd_arm_arch ;;
+c30*) targ_archs=bfd_tic30_arch ;;
hppa*) targ_archs=bfd_hppa_arch ;;
i[3456]86) targ_archs=bfd_i386_arch ;;
+i370) targ_archs=bfd_i370_arch ;;
m68*) targ_archs=bfd_m68k_arch ;;
m88*) targ_archs=bfd_m88k_arch ;;
mips*) targ_archs=bfd_mips_arch ;;
+pj*) targ_archs="bfd_pj_arch bfd_i386_arch";;
powerpc*) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
rs6000) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
-sparc*) targ_archs=bfd_sparc_arch ;;
+sparc*) targ_archs=bfd_sparc_arch ;;
v850*) targ_archs=bfd_v850_arch ;;
z8k*) targ_archs=bfd_z8k_arch ;;
*) targ_archs=bfd_${targ_cpu}_arch ;;
@@ -54,7 +57,7 @@ esac
case "${targ}" in
# START OF targmatch.h
#ifdef BFD64
- alpha*-*-netbsd*)
+ alpha*-*-netbsd* | alpha*-*-freebsd*)
targ_defvec=bfd_elf64_alpha_vec
targ_selvecs=ecoffalpha_little_vec
;;
@@ -71,7 +74,7 @@ case "${targ}" in
targ_selvecs=ecoffalpha_little_vec
;;
alpha*-*-*vms*)
- targ_defvec=evax_alpha_vec
+ targ_defvec=vms_alpha_vec
;;
alpha*-*-*)
targ_defvec=ecoffalpha_little_vec
@@ -83,9 +86,24 @@ case "${targ}" in
targ_selvecs=bfd_elf32_bigarc_vec
;;
+ arm-*-netbsd*)
+ targ_defvec=armnetbsd_vec
+ targ_underscore=yes
+ ;;
arm-*-riscix*)
targ_defvec=riscix_vec
;;
+ arm-epoc-pe*)
+ targ_defvec=arm_epoc_pe_little_vec
+ targ_selvecs="arm_epoc_pe_little_vec arm_epoc_pe_big_vec arm_epoc_pei_little_vec arm_epoc_pei_big_vec"
+ targ_underscore=no
+ ;;
+ arm-wince-pe | arm-*-wince)
+ targ_defvec=armpe_little_vec
+ targ_selvecs="armpe_little_vec armpe_big_vec armpei_little_vec armpei_big_vec"
+ targ_underscore=no
+ targ_cflags=-DARM_WINCE
+ ;;
arm-*-pe*)
targ_defvec=armpe_little_vec
targ_selvecs="armpe_little_vec armpe_big_vec armpei_little_vec armpei_big_vec"
@@ -104,16 +122,48 @@ case "${targ}" in
targ_selvecs=armcoff_big_vec
targ_underscore=yes
;;
+ arm-*-elf | arm*-*-linux-gnu* | arm*-*-conix*)
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+ arm-*-oabi)
+ targ_defvec=bfd_elf32_littlearm_oabi_vec
+ targ_selvecs=bfd_elf32_bigarm_oabi_vec
+ ;;
+
thumb-*-coff)
targ_defvec=armcoff_little_vec
targ_selvecs=armcoff_big_vec
targ_underscore=yes
;;
+ thumb-*-oabi)
+ targ_defvec=bfd_elf32_littlearm_oabi_vec
+ targ_selvecs=bfd_elf32_bigarm_oabi_vec
+ ;;
+ thumb-*-elf)
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+ thumb-epoc-pe*)
+ targ_defvec=arm_epoc_pe_little_vec
+ targ_selvecs="arm_epoc_pe_little_vec arm_epoc_pe_big_vec arm_epoc_pei_little_vec arm_epoc_pei_big_vec"
+ targ_underscore=no
+ ;;
thumb-*-pe*)
targ_defvec=armpe_little_vec
targ_selvecs="armpe_little_vec armpe_big_vec armpei_little_vec armpei_big_vec"
targ_underscore=yes
;;
+ strongarm-*-elf)
+ targ_defvec=bfd_elf32_littlearm_vec
+ targ_selvecs=bfd_elf32_bigarm_vec
+ ;;
+ strongarm-*-coff)
+ targ_defvec=armcoff_little_vec
+ targ_selvecs=armcoff_big_vec
+ targ_underscore=yes
+ ;;
+
a29k-*-ebmon* | a29k-*-udi* | a29k-*-coff* | a29k-*-sym1* | \
a29k-*-vxworks* | a29k-*-sysv*)
targ_defvec=a29kcoff_big_vec
@@ -125,6 +175,10 @@ case "${targ}" in
targ_underscore=yes
;;
+ avr-*-*)
+ targ_defvec=bfd_elf32_avr_vec
+ ;;
+
c30-*-*aout* | tic30-*-*aout*)
targ_defvec=tic30_aout_vec
;;
@@ -136,6 +190,13 @@ case "${targ}" in
targ_defvec=bfd_elf32_d10v_vec
;;
+ d30v-*-*)
+ targ_defvec=bfd_elf32_d30v_vec
+ ;;
+
+ fr30-*-elf)
+ targ_defvec=bfd_elf32_fr30_vec
+ ;;
h8300*-*-*)
@@ -148,41 +209,60 @@ case "${targ}" in
targ_underscore=yes
;;
- hppa*-*-*elf* | hppa*-*-lites* | hppa*-*-sysv4* | hppa*-*-rtems*)
+#if 0 /* HPPA ELF does not work currently. */
+ hppa*-*-*elf* | hppa*-*-linux-gnu* | hppa*-*-lites* | hppa*-*-sysv4* | hppa*-*-rtems*)
targ_defvec=bfd_elf32_hppa_vec
;;
-#if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF)
+#endif
+#if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) || defined (HOST_HPPAMPEIX)
+#if 0 /* HPPA ELF does not work currently. */
hppa*-*-bsd*)
targ_defvec=som_vec
targ_selvecs=bfd_elf32_hppa_vec
;;
- hppa*-*-hpux* | hppa*-*-hiux*)
+#endif
+ hppa*-*-hpux* | hppa*-*-hiux* | hppa*-*-mpeix*)
targ_defvec=som_vec
;;
+#if 0 /* HPPA ELF does not work currently. */
hppa*-*-osf*)
targ_defvec=som_vec
targ_selvecs=bfd_elf32_hppa_vec
;;
+#endif
#endif /* defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) */
+ i370-*-*)
+ targ_defvec=bfd_elf32_i370_vec
+ targ_selvecs="bfd_elf32_i370_vec"
+ ;;
i[3456]86-*-sco3.2v5*coff)
targ_defvec=i386coff_vec
+ targ_selvecs=bfd_elf32_i386_vec
;;
- i[3456]86-*-sysv4* | i[3456]86-*-unixware | i[3456]86-*-solaris2* | \
- i[3456]86-*-elf | i[3456]86-*-sco3.2v5* | i[3456]86-*-freebsdelf* | \
- i[3456]86-*-dgux*)
+ i[3456]86-*-sysv4* | i[3456]86-*-unixware* | i[3456]86-*-solaris2* | \
+ i[3456]86-*-elf | i[3456]86-*-sco3.2v5* | \
+ i[3456]86-*-dgux* | i[3456]86-*-sysv5*)
targ_defvec=bfd_elf32_i386_vec
targ_selvecs=i386coff_vec
;;
+ i[3456]86-*-rtemself*)
+ targ_defvec=bfd_elf32_i386_vec
+ targ_selvecs="i386coff_vec i386aout_vec"
+ ;;
i[3456]86-*-msdosdjgpp* | i[3456]*-*-go32* | i[3456]86-go32-rtems* )
targ_defvec=go32coff_vec
targ_selvecs="go32stubbedcoff_vec i386aout_vec"
;;
i[3456]86-*-sysv* | i[3456]86-*-isc* | i[3456]86-*-sco* | i[3456]86-*-coff | \
- i[3456]86-*-aix* | i[3456]86*-*-rtems*)
+ i[3456]86-*-aix*)
targ_defvec=i386coff_vec
;;
- i[3456]86-sequent-bsd*)
+ i[3456]86*-*-rtems*)
+ targ_defvec=i386coff_vec
+ targ_selvecs="bfd_elf32_i386_vec i386aout_vec"
+ ;;
+ i[3456]86-sequent-bsd*)
targ_defvec=i386dynix_vec
targ_underscore=yes
;;
@@ -190,11 +270,16 @@ case "${targ}" in
targ_defvec=i386bsd_vec
targ_underscore=yes
;;
- i[3456]86-*-freebsd*)
+ i[3456]86-*-freebsdaout* | i[3456]86-*-freebsd[12].* | \
+ i[3456]86-*-freebsd[12])
targ_defvec=i386freebsd_vec
targ_selvecs=i386bsd_vec
targ_underscore=yes
;;
+ i[3456]86-*-freebsd*)
+ targ_defvec=bfd_elf32_i386_vec
+ targ_selvecs=i386coff_vec
+ ;;
i[3456]86-*-netbsd* | i[3456]86-*-openbsd*)
targ_defvec=i386netbsd_vec
targ_selvecs=i386bsd_vec
@@ -236,16 +321,34 @@ case "${targ}" in
targ_defvec=bfd_elf32_i386_vec
targ_selvecs="i386msdos_vec i386aout_vec"
;;
- i[3456]86-*-mingw32* | i[3456]86-*-cygwin32* | i[3456]86-*-winnt | i[3456]86-*-pe)
+ i[3456]86-*-beospe*)
targ_defvec=i386pe_vec
targ_selvecs="i386pe_vec i386pei_vec"
;;
+ i[3456]86-*-beoself* | i[3456]86-*-beos*)
+ targ_defvec=bfd_elf32_i386_vec
+ targ_selvecs="i386pe_vec i386pei_vec"
+ ;;
+ i[3456]86-*-interix*)
+ targ_defvec=i386pei_vec
+ targ_selvecs="i386pe_vec"
+ # FIXME: This should eventually be checked at runtime.
+ targ_cflags=-DSTRICT_PE_FORMAT
+ ;;
+ i[3456]86-*-mingw32* | i[3456]86-*-cygwin* | i[3456]86-*-winnt | i[3456]86-*-pe)
+ targ_defvec=i386pe_vec
+ targ_selvecs="i386pe_vec i386pei_vec bfd_elf32_i386_vec"
+ ;;
i[3456]86-none-*)
targ_defvec=i386coff_vec
;;
i[3456]86-*-aout* | i[3456]86*-*-vsta*)
targ_defvec=i386aout_vec
;;
+ i[3456]86-*-vxworks*)
+ targ_defvec=i386aout_vec
+ targ_underscore=yes
+ ;;
i860-*-mach3* | i860-*-osf1* | i860-*-coff*)
targ_defvec=i860coff_vec
@@ -269,6 +372,10 @@ case "${targ}" in
targ_selvecs="b_out_vec_big_host icoff_little_vec icoff_big_vec ieee_vec"
targ_underscore=yes
;;
+ i960-*-elf*)
+ targ_defvec=bfd_elf32_i960_vec
+ targ_selvecs="icoff_little_vec icoff_big_vec"
+ ;;
m32r-*-*)
targ_defvec=bfd_elf32_m32r_vec
@@ -290,17 +397,21 @@ case "${targ}" in
;;
m68*-*-aout*)
targ_defvec=aout0_big_vec
- # We include cisco_core_vec here, rather than making a separate cisco
+ # We include cisco_core_big_vec here, rather than making a separate cisco
# configuration, so that cisco-core.c gets routinely tested at
# least for compilation.
- targ_selvecs="cisco_core_vec ieee_vec"
+ targ_selvecs="cisco_core_big_vec ieee_vec"
targ_underscore=yes
;;
m68*-*-elf* | m68*-*-sysv4*)
targ_defvec=bfd_elf32_m68k_vec
targ_selvecs="m68kcoff_vec ieee_vec"
;;
- m68*-*-coff* | m68*-*-sysv* | m68*-*-rtems*)
+ m68*-*-rtems*)
+ targ_defvec=m68kcoff_vec
+ targ_selvecs="m68kcoff_vec versados_vec ieee_vec aout0_big_vec"
+ ;;
+ m68*-*-coff* | m68*-*-sysv*)
targ_defvec=m68kcoff_vec
targ_selvecs="m68kcoff_vec versados_vec ieee_vec"
;;
@@ -317,6 +428,11 @@ case "${targ}" in
targ_defvec=bfd_elf32_m68k_vec
targ_selvecs=m68klinux_vec
;;
+ m68*-*-gnu*)
+ targ_defvec=bfd_elf32_m68k_vec
+ # targ_selvecs=m68kmach3_vec
+ # targ_cflags=-DSTAT_FOR_EXEC
+ ;;
m68*-*-lynxos*)
targ_defvec=m68klynx_coff_vec
targ_selvecs=m68klynx_aout_vec
@@ -367,6 +483,15 @@ case "${targ}" in
targ_underscore=yes
;;
+ mcore-*-elf)
+ targ_defvec=bfd_elf32_mcore_big_vec
+ targ_selvecs="bfd_elf32_mcore_big_vec bfd_elf32_mcore_little_vec"
+ ;;
+ mcore-*-pe)
+ targ_defvec=mcore_pe_big_vec
+ targ_selvecs="mcore_pe_big_vec mcore_pe_little_vec mcore_pei_big_vec mcore_pei_little_vec"
+ ;;
+
mips*-big-*)
targ_defvec=ecoff_big_vec
targ_selvecs=ecoff_little_vec
@@ -415,6 +540,11 @@ case "${targ}" in
targ_defvec=aout_mips_little_vec
targ_cflags=-DSTAT_FOR_EXEC
;;
+ mips*-*-pe*)
+ targ_defvec=mipslpe_vec
+ targ_selvecs="mipslpei_vec mipslpei_vec ecoff_little_vec ecoff_big_vec"
+ targ_underscore=yes
+ ;;
mips*-*-sysv4*)
targ_defvec=bfd_elf32_bigmips_vec
targ_selvecs="bfd_elf32_littlemips_vec ecoff_big_vec ecoff_little_vec"
@@ -423,11 +553,11 @@ case "${targ}" in
targ_defvec=ecoff_big_vec
targ_selvecs=ecoff_little_vec
;;
- mips*el-*-elf*)
+ mips*el-*-elf* | mips*el-*-rtems* | mips*el-*-vxworks*)
targ_defvec=bfd_elf32_littlemips_vec
targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
;;
- mips*-*-elf* | mips*-*-rtems*)
+ mips*-*-elf* | mips*-*-rtems* | mips*-*-vxworks*)
targ_defvec=bfd_elf32_bigmips_vec
targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
;;
@@ -461,13 +591,24 @@ case "${targ}" in
targ_underscore=yes
;;
+ pj-*-*)
+ targ_defvec=bfd_elf32_pj_vec
+ targ_selvecs="bfd_elf32_pj_vec bfd_elf32_pjl_vec"
+ ;;
+
+ pjl-*-*)
+ targ_defvec=bfd_elf32_pjl_vec
+ targ_selvecs="bfd_elf32_pjl_vec bfd_elf32_pj_vec bfd_elf32_i386_vec"
+ ;;
+
powerpc-*-aix* | powerpc-*-beos*)
targ_defvec=rs6000coff_vec
;;
powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems*)
+ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
+ powerpc-*-vxworks*)
targ_defvec=bfd_elf32_powerpc_vec
- targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec bfd_powerpcle_pei_vec bfd_powerpc_pei_vec bfd_powerpcle_pe_vec bfd_powerpc_pe_vec ppcboot_vec"
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
;;
powerpc-*-macos* | powerpc-*-mpw*)
targ_defvec=pmac_xcoff_vec
@@ -477,12 +618,13 @@ case "${targ}" in
targ_selvecs="nlm32_powerpc_vec rs6000coff_vec"
;;
powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
- powerpcle-*-solaris2* | powerpcle-*-linux-gnu*)
+ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
+ powerpcle-*-rtems*)
targ_defvec=bfd_elf32_powerpcle_vec
- targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec bfd_powerpcle_pei_vec bfd_powerpc_pei_vec bfd_powerpcle_pe_vec bfd_powerpc_pe_vec ppcboot_vec"
+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
;;
- powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin32*)
+ powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin*)
targ_defvec=bfd_powerpcle_pe_vec
targ_selvecs="bfd_powerpcle_pei_vec bfd_powerpc_pei_vec bfd_powerpcle_pe_vec bfd_powerpc_pe_vec"
;;
@@ -491,11 +633,16 @@ case "${targ}" in
targ_defvec=rs6000coff_vec
;;
- sh-*-elf*)
+ sh-*-elf* | sh-*-rtemself*)
targ_defvec=bfd_elf32_sh_vec
targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
targ_underscore=yes
;;
+ sh-*-pe)
+ targ_defvec=shlpe_vec
+ targ_selvecs="shlpe_vec shlpei_vec"
+ targ_underscore=yes
+ ;;
sh-*-* | sh-*-rtems*)
targ_defvec=shcoff_vec
targ_selvecs="shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec"
@@ -507,7 +654,11 @@ case "${targ}" in
targ_selvecs=sparcle_aout_vec
targ_underscore=yes
;;
- sparclite-*-elf*)
+ sparc86x-*-aout*)
+ targ_defvec=sunos_big_vec
+ targ_underscore=yes
+ ;;
+ sparclite-*-elf* | sparc86x-*-elf*)
targ_defvec=bfd_elf32_sparc_vec
;;
sparc-*-linux*aout*)
@@ -517,20 +668,35 @@ case "${targ}" in
;;
sparc-*-linux-gnu*)
targ_defvec=bfd_elf32_sparc_vec
- targ_selvecs="sparclinux_vec sunos_big_vec"
+ targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
;;
sparc-*-lynxos*)
targ_defvec=sparclynx_coff_vec
targ_selvecs=sparclynx_aout_vec
;;
- sparc-*-netbsd* | sparc-*-openbsd*)
+ sparc-*-netbsdelf*)
+ targ_defvec=bfd_elf32_sparc_vec
+ targ_selvecs=sparcnetbsd_vec
+ ;;
+ sparc-*-netbsdaout* | sparc-*-netbsd*)
+ targ_defvec=sparcnetbsd_vec
+ targ_selvecs=bfd_elf32_sparc_vec
+ targ_underscore=yes
+ ;;
+ sparc-*-openbsd*)
targ_defvec=sparcnetbsd_vec
targ_underscore=yes
;;
- sparc-*-elf* | sparc-*-solaris2*)
+ sparc-*-elf* | sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*)
targ_defvec=bfd_elf32_sparc_vec
targ_selvecs=sunos_big_vec
;;
+#ifdef BFD64
+ sparc-*-solaris2* | sparcv9-*-solaris2* | sparc64-*-solaris2*)
+ targ_defvec=bfd_elf32_sparc_vec
+ targ_selvecs="bfd_elf64_sparc_vec sunos_big_vec"
+ ;;
+#endif
sparc-*-sysv4*)
targ_defvec=bfd_elf32_sparc_vec
;;
@@ -567,9 +733,21 @@ case "${targ}" in
;;
#endif
+ tic80*-*-*)
+ targ_defvec=tic80coff_vec
+ targ_underscore=yes
+ ;;
+
+
v850-*-*)
targ_defvec=bfd_elf32_v850_vec
;;
+ v850e-*-*)
+ targ_defvec=bfd_elf32_v850_vec
+ ;;
+ v850ea-*-*)
+ targ_defvec=bfd_elf32_v850_vec
+ ;;
#if HAVE_host_aout_vec
vax-*-bsd* | vax-*-ultrix*)
targ_defvec=host_aout_vec
@@ -577,6 +755,10 @@ case "${targ}" in
;;
#endif
+ vax*-*-*vms*)
+ targ_defvec=vms_vax_vec
+ ;;
+
we32k-*-*)
targ_defvec=we32kcoff_vec
;;
@@ -615,3 +797,16 @@ case "${targ}" in
exit 1
;;
esac
+
+# If we support any ELF target, then automatically add support for the
+# generic ELF targets. This permits an objdump with some ELF support
+# to be used on an arbitrary ELF file for anything other than
+# relocation information.
+case "${targ_defvec} ${targ_selvecs}" in
+ *bfd_elf64*)
+ targ_selvecs="${targ_selvecs} bfd_elf64_little_generic_vec bfd_elf64_big_generic_vec bfd_elf32_little_generic_vec bfd_elf32_big_generic_vec"
+ ;;
+ *bfd_elf32*)
+ targ_selvecs="${targ_selvecs} bfd_elf32_little_generic_vec bfd_elf32_big_generic_vec"
+ ;;
+esac
diff --git a/contrib/binutils/bfd/config.in b/contrib/binutils/bfd/config.in
index 8df4887f816a..7383656618bc 100644
--- a/contrib/binutils/bfd/config.in
+++ b/contrib/binutils/bfd/config.in
@@ -1,46 +1,62 @@
/* config.in. Generated automatically from configure.in by autoheader. */
-/* Name of package. */
-#undef PACKAGE
-
-/* Version of package. */
-#undef VERSION
-
-/* Whether strstr must be declared even if <string.h> is included. */
-#undef NEED_DECLARATION_STRSTR
+/* Define if using alloca.c. */
+#undef C_ALLOCA
-/* Whether malloc must be declared even if <stdlib.h> is included. */
-#undef NEED_DECLARATION_MALLOC
+/* Define to empty if the keyword does not work. */
+#undef const
-/* Whether realloc must be declared even if <stdlib.h> is included. */
-#undef NEED_DECLARATION_REALLOC
+/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
+ This function is required for alloca.c support on those systems. */
+#undef CRAY_STACKSEG_END
-/* Whether free must be declared even if <stdlib.h> is included. */
-#undef NEED_DECLARATION_FREE
+/* Define if you have alloca, as a function or macro. */
+#undef HAVE_ALLOCA
-/* Whether getenv must be declared even if <stdlib.h> is included. */
-#undef NEED_DECLARATION_GETENV
+/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
+#undef HAVE_ALLOCA_H
/* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP
+/* Define as __inline if that's what the C compiler calls it. */
+#undef inline
+
+/* Define to `long' if <sys/types.h> doesn't define. */
+#undef off_t
+
/* Define if you need to in order for stat and other things to work. */
#undef _POSIX_SOURCE
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+#undef size_t
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown
+ */
+#undef STACK_DIRECTION
+
+/* Define if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
-/* Do we need to use the b modifier when opening binary files? */
-#undef USE_BINARY_FOPEN
+/* Define if you have the __argz_count function. */
+#undef HAVE___ARGZ_COUNT
-/* Name of host specific header file to include in trad-core.c. */
-#undef TRAD_HEADER
+/* Define if you have the __argz_next function. */
+#undef HAVE___ARGZ_NEXT
-/* Define only if <sys/procfs.h> is available *and* it defines prstatus_t. */
-#undef HAVE_SYS_PROCFS_H
+/* Define if you have the __argz_stringify function. */
+#undef HAVE___ARGZ_STRINGIFY
-/* Do we really want to use mmap if it's available? */
-#undef USE_MMAP
+/* Define if you have the dcgettext function. */
+#undef HAVE_DCGETTEXT
/* Define if you have the fcntl function. */
#undef HAVE_FCNTL
@@ -48,24 +64,75 @@
/* Define if you have the fdopen function. */
#undef HAVE_FDOPEN
+/* Define if you have the getcwd function. */
+#undef HAVE_GETCWD
+
+/* Define if you have the getgid function. */
+#undef HAVE_GETGID
+
/* Define if you have the getpagesize function. */
#undef HAVE_GETPAGESIZE
+/* Define if you have the getuid function. */
+#undef HAVE_GETUID
+
/* Define if you have the madvise function. */
#undef HAVE_MADVISE
/* Define if you have the mprotect function. */
#undef HAVE_MPROTECT
+/* Define if you have the munmap function. */
+#undef HAVE_MUNMAP
+
+/* Define if you have the putenv function. */
+#undef HAVE_PUTENV
+
+/* Define if you have the setenv function. */
+#undef HAVE_SETENV
+
/* Define if you have the setitimer function. */
#undef HAVE_SETITIMER
+/* Define if you have the setlocale function. */
+#undef HAVE_SETLOCALE
+
+/* Define if you have the stpcpy function. */
+#undef HAVE_STPCPY
+
+/* Define if you have the strcasecmp function. */
+#undef HAVE_STRCASECMP
+
+/* Define if you have the strchr function. */
+#undef HAVE_STRCHR
+
/* Define if you have the sysconf function. */
#undef HAVE_SYSCONF
+/* Define if you have the <argz.h> header file. */
+#undef HAVE_ARGZ_H
+
+/* Define if you have the <dirent.h> header file. */
+#undef HAVE_DIRENT_H
+
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
+/* Define if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define if you have the <ndir.h> header file. */
+#undef HAVE_NDIR_H
+
+/* Define if you have the <nl_types.h> header file. */
+#undef HAVE_NL_TYPES_H
+
/* Define if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
@@ -78,9 +145,21 @@
/* Define if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
+/* Define if you have the <sys/dir.h> header file. */
+#undef HAVE_SYS_DIR_H
+
/* Define if you have the <sys/file.h> header file. */
#undef HAVE_SYS_FILE_H
+/* Define if you have the <sys/ndir.h> header file. */
+#undef HAVE_SYS_NDIR_H
+
+/* Define if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define if you have the <sys/procfs.h> header file. */
+#undef HAVE_SYS_PROCFS_H
+
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
@@ -89,3 +168,76 @@
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+
+/* Define if you have the <values.h> header file. */
+#undef HAVE_VALUES_H
+
+/* Name of package */
+#undef PACKAGE
+
+/* Version number of package */
+#undef VERSION
+
+/* Define if you have the stpcpy function */
+#undef HAVE_STPCPY
+
+/* Define if your locale.h file contains LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
+
+/* Define to 1 if NLS is requested */
+#undef ENABLE_NLS
+
+/* Define as 1 if you have gettext and don't want to use GNU gettext. */
+#undef HAVE_GETTEXT
+
+/* Use b modifier when opening binary files? */
+#undef USE_BINARY_FOPEN
+
+/* Define if strstr is not declared in system header files. */
+#undef NEED_DECLARATION_STRSTR
+
+/* Define if malloc is not declared in system header files. */
+#undef NEED_DECLARATION_MALLOC
+
+/* Define if realloc is not declared in system header files. */
+#undef NEED_DECLARATION_REALLOC
+
+/* Define if free is not declared in system header files. */
+#undef NEED_DECLARATION_FREE
+
+/* Define if getenv is not declared in system header files. */
+#undef NEED_DECLARATION_GETENV
+
+/* Define if <sys/procfs.h> has prstatus_t. */
+#undef HAVE_PRSTATUS_T
+
+/* Define if <sys/procfs.h> has prstatus_t.pr_who. */
+#undef HAVE_PRSTATUS_T_PR_WHO
+
+/* Define if <sys/procfs.h> has pstatus_t. */
+#undef HAVE_PSTATUS_T
+
+/* Define if <sys/procfs.h> has prpsinfo_t. */
+#undef HAVE_PRPSINFO_T
+
+/* Define if <sys/procfs.h> has psinfo_t. */
+#undef HAVE_PSINFO_T
+
+/* Define if <sys/procfs.h> has lwpstatus_t. */
+#undef HAVE_LWPSTATUS_T
+
+/* Define if <sys/procfs.h> has lwpstatus_t.pr_context. */
+#undef HAVE_LWPSTATUS_T_PR_CONTEXT
+
+/* Define if <sys/procfs.h> has lwpstatus_t.pr_reg. */
+#undef HAVE_LWPSTATUS_T_PR_REG
+
+/* Define if <sys/procfs.h> has win32_pstatus_t. */
+#undef HAVE_WIN32_PSTATUS_T
+
+/* Name of host specific header file to include in trad-core.c. */
+#undef TRAD_HEADER
+
+/* Use mmap if it's available? */
+#undef USE_MMAP
+
diff --git a/contrib/binutils/bfd/configure b/contrib/binutils/bfd/configure
index a0643a7bae8f..33ca150581b7 100755
--- a/contrib/binutils/bfd/configure
+++ b/contrib/binutils/bfd/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12.1
+# Generated automatically using autoconf version 2.13
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
@@ -12,16 +12,16 @@ ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
- --enable-shared build shared libraries [default=no]
- --enable-shared=PKGS only build shared libraries if the current package
- appears as an element in the PKGS list"
+ --enable-shared[=PKGS] build shared libraries [default=no]"
ac_help="$ac_help
- --enable-static build static libraries [default=yes]
- --enable-static=PKGS only build shared libraries if the current package
- appears as an element in the PKGS list"
+ --enable-static[=PKGS] build static libraries [default=yes]"
+ac_help="$ac_help
+ --enable-fast-install[=PKGS] optimize for fast installation [default=yes]"
ac_help="$ac_help
--with-gnu-ld assume the C compiler uses GNU ld [default=no]"
ac_help="$ac_help
+ --disable-libtool-lock avoid locking (might break parallel builds)"
+ac_help="$ac_help
--enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)"
ac_help="$ac_help
--enable-targets alternative target configurations"
@@ -32,6 +32,10 @@ ac_help="$ac_help
ac_help="$ac_help
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer"
+ac_help="$ac_help
+ --disable-nls do not use Native Language Support"
+ac_help="$ac_help
+ --with-included-gettext use the GNU gettext library included here"
# Initialize some variables set by options.
# The variables have the same names as the options, with
@@ -49,6 +53,7 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
+sitefile=
srcdir=
target=NONE
verbose=
@@ -163,6 +168,7 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
+ --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -333,6 +339,11 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
+ -site-file | --site-file | --site-fil | --site-fi | --site-f)
+ ac_prev=sitefile ;;
+ -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+ sitefile="$ac_optarg" ;;
+
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -354,7 +365,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.12.1"
+ echo "configure generated by autoconf version 2.13"
exit 0 ;;
-with-* | --with-*)
@@ -498,12 +509,16 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+if test -z "$sitefile"; then
+ if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
fi
+else
+ CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -524,9 +539,11 @@ ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
+ac_exeext=
+ac_objext=o
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -588,7 +605,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:592: checking host system type" >&5
+echo "configure:609: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -609,7 +626,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:613: checking target system type" >&5
+echo "configure:630: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -627,7 +644,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:631: checking build system type" >&5
+echo "configure:648: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -652,15 +669,16 @@ test "$host_alias" != "$target_alias" &&
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:656: checking for $ac_word" >&5
+echo "configure:673: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_CC="gcc"
@@ -681,16 +699,17 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:685: checking for $ac_word" >&5
+echo "configure:703: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_prog_rejected=no
- for ac_dir in $PATH; do
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -725,25 +744,61 @@ else
echo "$ac_t""no" 1>&6
fi
+ if test -z "$CC"; then
+ case "`uname -s`" in
+ *win32* | *WIN32*)
+ # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:754: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="cl"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ ;;
+ esac
+ fi
test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:733: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:786: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
-cat > conftest.$ac_ext <<EOF
-#line 743 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 797 "configure"
#include "confdefs.h"
+
main(){return(0);}
EOF
-if { (eval echo configure:747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -757,18 +812,24 @@ else
ac_cv_prog_cc_works=no
fi
rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:767: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:828: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:772: checking whether we are using GNU C" >&5
+echo "configure:833: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -777,7 +838,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:842: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -788,11 +849,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
if test $ac_cv_prog_gcc = yes; then
GCC=yes
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS=
- echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:796: checking whether ${CC-cc} accepts -g" >&5
+else
+ GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:861: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -807,20 +872,24 @@ rm -f conftest*
fi
echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
CFLAGS="-g -O2"
else
- CFLAGS="-O2"
+ CFLAGS="-g"
fi
else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
fi
echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:824: checking for POSIXized ISC" >&5
+echo "configure:893: checking for POSIXized ISC" >&5
if test -d /etc/conf/kconfig.d &&
grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
then
@@ -853,12 +922,12 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:857: checking for a BSD compatible install" >&5
+echo "configure:926: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
for ac_dir in $PATH; do
# Account for people who put trailing slashes in PATH elements.
case "$ac_dir/" in
@@ -901,13 +970,12 @@ echo "$ac_t""$INSTALL" 1>&6
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:911: checking whether build environment is sane" >&5
+echo "configure:979: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
@@ -964,7 +1032,7 @@ test "$program_suffix" != NONE &&
test "$program_transform_name" = "" && program_transform_name="s,x,x,"
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:968: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1036: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -993,7 +1061,7 @@ fi
PACKAGE=bfd
-VERSION=2.9.1
+VERSION=2.9.5
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
{ echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
@@ -1010,7 +1078,7 @@ EOF
missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:1014: checking for working aclocal" >&5
+echo "configure:1082: checking for working aclocal" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1023,7 +1091,7 @@ else
fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:1027: checking for working autoconf" >&5
+echo "configure:1095: checking for working autoconf" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1036,7 +1104,7 @@ else
fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:1040: checking for working automake" >&5
+echo "configure:1108: checking for working automake" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1049,7 +1117,7 @@ else
fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1053: checking for working autoheader" >&5
+echo "configure:1121: checking for working autoheader" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1062,7 +1130,7 @@ else
fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1066: checking for working makeinfo" >&5
+echo "configure:1134: checking for working makeinfo" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1085,15 +1153,16 @@ fi
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
set dummy ${ac_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1089: checking for $ac_word" >&5
+echo "configure:1157: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$AR"; then
ac_cv_prog_AR="$AR" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_AR="${ac_tool_prefix}ar"
@@ -1116,15 +1185,16 @@ fi
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1120: checking for $ac_word" >&5
+echo "configure:1189: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
@@ -1147,15 +1217,16 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1151: checking for $ac_word" >&5
+echo "configure:1221: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_RANLIB="ranlib"
@@ -1226,18 +1297,42 @@ else
enable_static=yes
fi
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+ enableval="$enable_fast_install"
+ p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_fast_install=yes
+fi
+
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1233: checking for $ac_word" >&5
+echo "configure:1327: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_RANLIB="ranlib"
@@ -1263,18 +1358,23 @@ else
with_gnu_ld=no
fi
-
ac_prog=ld
if test "$ac_cv_prog_gcc" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1272: checking for ld used by GCC" >&5
+echo "configure:1366: checking for ld used by GCC" >&5
ac_prog=`($CC -print-prog-name=ld) 2>&5`
case "$ac_prog" in
- # Accept absolute paths.
- /* | [A-Za-z]:\\*)
- test -z "$LD" && LD="$ac_prog"
- ;;
+ # Accept absolute paths.
+ [\\/]* | [A-Za-z]:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
@@ -1286,19 +1386,19 @@ echo "configure:1272: checking for ld used by GCC" >&5
esac
elif test "$with_gnu_ld" = yes; then
echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1290: checking for GNU ld" >&5
+echo "configure:1390: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1293: checking for non-GNU ld" >&5
+echo "configure:1393: checking for non-GNU ld" >&5
fi
if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -z "$LD"; then
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog"; then
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
ac_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
@@ -1306,7 +1406,7 @@ else
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
- test "$with_gnu_ld" != yes && break
+ test "$with_gnu_ld" != yes && break
fi
fi
done
@@ -1323,9 +1423,8 @@ else
echo "$ac_t""no" 1>&6
fi
test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
-
echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1329: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1428: checking if the linker ($LD) is GNU ld" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1341,44 +1440,43 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1345: checking for BSD-compatible nm" >&5
+echo "configure:1444: checking for BSD-compatible nm" >&5
if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- case "$NM" in
-/* | [A-Za-z]:\\*)
- ac_cv_path_NM="$NM" # Let the user override the test with a path.
- ;;
-*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
+ if test -n "$NM"; then
+ # Let the user override the test.
+ ac_cv_path_NM="$NM"
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/nm; then
+ if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -B"
+ ac_cv_path_NM="$ac_dir/nm -B"
+ break
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -p"
+ ac_cv_path_NM="$ac_dir/nm -p"
+ break
else
- ac_cv_path_NM="$ac_dir/nm"
+ ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
fi
- break
fi
done
IFS="$ac_save_ifs"
test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
- ;;
-esac
+fi
fi
NM="$ac_cv_path_NM"
echo "$ac_t""$NM" 1>&6
-
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1382: checking whether ln -s works" >&5
+echo "configure:1480: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1398,24 +1496,37 @@ else
echo "$ac_t""no" 1>&6
fi
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+case "$target" in
+NONE) lt_target="$host" ;;
+*) lt_target="$target" ;;
+esac
# Check for any special flags to pass to ltconfig.
-libtool_flags=
+libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
-test "$silent" = yes && libtool_flags="$libtool_flags --silent"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval="$enable_libtool_lock"
+ :
+fi
+
+test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
+test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
-case "$host" in
+case "$lt_target" in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 1418 "configure"' > conftest.$ac_ext
- if { (eval echo configure:1419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ echo '#line 1529 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:1530: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case "`/usr/bin/file conftest.o`" in
*32-bit*)
LD="${LD-ld} -32"
@@ -1433,17 +1544,122 @@ case "$host" in
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
+ echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
+echo "configure:1551: checking whether the C compiler needs -belf" >&5
+if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1556 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:1563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ lt_cv_cc_needs_belf=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ lt_cv_cc_needs_belf=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
;;
+
+
esac
+
+# Save cache, so that ltconfig can load it
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+
# Actually configure libtool. ac_aux_dir is where install-sh is found.
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
-LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
-${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
-$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
+LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
+DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
+# Reload cache, that may have been modified by ltconfig
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+
# Check whether --enable-64-bit-bfd or --disable-64-bit-bfd was given.
if test "${enable_64_bit_bfd+set}" = set; then
@@ -1515,7 +1731,7 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x,"
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:1519: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:1735: checking whether to enable maintainer-specific portions of Makefiles" >&5
# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then
enableval="$enable_maintainer_mode"
@@ -1525,96 +1741,112 @@ else
fi
echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
- if test $USE_MAINTAINER_MODE = yes; then
- MAINT=
- else
- MAINT='#M#'
- fi
-echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
-echo "configure:1537: checking for Cygwin32 environment" >&5
-if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
+if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
+echo "configure:1758: checking for Cygwin environment" >&5
+if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1542 "configure"
+#line 1763 "configure"
#include "confdefs.h"
int main() {
-return __CYGWIN32__;
+
+#ifndef __CYGWIN__
+#define __CYGWIN__ __CYGWIN32__
+#endif
+return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:1549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
- am_cv_cygwin32=yes
+ ac_cv_cygwin=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- am_cv_cygwin32=no
+ ac_cv_cygwin=no
fi
rm -f conftest*
rm -f conftest*
fi
-echo "$ac_t""$am_cv_cygwin32" 1>&6
-CYGWIN32=
-test "$am_cv_cygwin32" = yes && CYGWIN32=yes
-echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6
-echo "configure:1566: checking for Mingw32 environment" >&5
-if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then
+echo "$ac_t""$ac_cv_cygwin" 1>&6
+CYGWIN=
+test "$ac_cv_cygwin" = yes && CYGWIN=yes
+echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
+echo "configure:1791: checking for mingw32 environment" >&5
+if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1571 "configure"
+#line 1796 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:1578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1803: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
- am_cv_mingw32=yes
+ ac_cv_mingw32=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- am_cv_mingw32=no
+ ac_cv_mingw32=no
fi
rm -f conftest*
rm -f conftest*
fi
-echo "$ac_t""$am_cv_mingw32" 1>&6
+echo "$ac_t""$ac_cv_mingw32" 1>&6
MINGW32=
-test "$am_cv_mingw32" = yes && MINGW32=yes
+test "$ac_cv_mingw32" = yes && MINGW32=yes
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1597: checking for executable suffix" >&5
-if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
+echo "configure:1822: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then
-am_cv_exeext=.exe
+ if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+ ac_cv_exeext=.exe
else
-cat > am_c_test.c << 'EOF'
-int main() {
-/* Nothing needed here */
-}
-EOF
-${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
-am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
-rm -f am_c_test*
+ rm -f conftest*
+ echo 'int main () { return 0; }' > conftest.$ac_ext
+ ac_cv_exeext=
+ if { (eval echo configure:1832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ for file in conftest.*; do
+ case $file in
+ *.c | *.o | *.obj | *.ilk | *.pdb) ;;
+ *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
+ esac
+ done
+ else
+ { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+ fi
+ rm -f conftest*
+ test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
fi
-
-test x"${am_cv_exeext}" = x && am_cv_exeext=no
fi
+
EXEEXT=""
-test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
-echo "$ac_t""${am_cv_exeext}" 1>&6
+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+echo "$ac_t""${ac_cv_exeext}" 1>&6
+ac_exeext=$EXEEXT
host64=false
@@ -1625,15 +1857,16 @@ target64=false
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1629: checking for $ac_word" >&5
+echo "configure:1861: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_CC="gcc"
@@ -1654,16 +1887,17 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1658: checking for $ac_word" >&5
+echo "configure:1891: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_prog_rejected=no
- for ac_dir in $PATH; do
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -1698,25 +1932,61 @@ else
echo "$ac_t""no" 1>&6
fi
+ if test -z "$CC"; then
+ case "`uname -s`" in
+ *win32* | *WIN32*)
+ # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1942: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="cl"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ ;;
+ esac
+ fi
test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1706: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1974: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
-cat > conftest.$ac_ext <<EOF
-#line 1716 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 1985 "configure"
#include "confdefs.h"
+
main(){return(0);}
EOF
-if { (eval echo configure:1720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -1730,18 +2000,24 @@ else
ac_cv_prog_cc_works=no
fi
rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1740: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2016: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1745: checking whether we are using GNU C" >&5
+echo "configure:2021: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1750,7 +2026,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -1761,11 +2037,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
if test $ac_cv_prog_gcc = yes; then
GCC=yes
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS=
- echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1769: checking whether ${CC-cc} accepts -g" >&5
+else
+ GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:2049: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1780,155 +2060,1852 @@ rm -f conftest*
fi
echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
CFLAGS="-g -O2"
else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
CFLAGS="-O2"
+ else
+ CFLAGS=
fi
+fi
+
+
+ALL_LINGUAS=
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:2083: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
+ # This must be in double quotes, not single quotes, because CPP may get
+ # substituted into the Makefile and "${CC-cc}" will confuse make.
+ CPP="${CC-cc} -E"
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp.
+ cat > conftest.$ac_ext <<EOF
+#line 2098 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2104: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -E -traditional-cpp"
+ cat > conftest.$ac_ext <<EOF
+#line 2115 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2121: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -nologo -E"
+ cat > conftest.$ac_ext <<EOF
+#line 2132 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2138: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+ ac_cv_prog_CPP="$CPP"
+fi
+ CPP="$ac_cv_prog_CPP"
+else
+ ac_cv_prog_CPP="$CPP"
fi
+echo "$ac_t""$CPP" 1>&6
+echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:2163: checking for ANSI C header files" >&5
+if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2168 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2176: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ ac_cv_header_stdc=yes
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
-# Permit host specific settings.
-. ${srcdir}/configure.host
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 2193 "configure"
+#include "confdefs.h"
+#include <string.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "memchr" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+fi
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 2211 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "free" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+fi
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+if test "$cross_compiling" = yes; then
+ :
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2232 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
-BFD_HOST_64BIT_LONG=0
-BFD_HOST_64_BIT_DEFINED=0
-BFD_HOST_64_BIT=
-BFD_HOST_U_64_BIT=
-if test "x${HOST_64BIT_TYPE}" = "xlong"; then
- BFD_HOST_64BIT_LONG=1
-elif test "x${HOST_64BIT_TYPE}" != "x"; then
- BFD_HOST_64_BIT_DEFINED=1
- BFD_HOST_64_BIT=${HOST_64BIT_TYPE}
- BFD_HOST_U_64_BIT=${HOST_U_64BIT_TYPE}
+EOF
+if { (eval echo configure:2243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_header_stdc=no
+fi
+rm -fr conftest*
fi
+fi
+fi
+echo "$ac_t""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+ cat >> confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+fi
+echo $ac_n "checking for working const""... $ac_c" 1>&6
+echo "configure:2267: checking for working const" >&5
+if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2272 "configure"
+#include "confdefs.h"
-# Put a plausible default for CC_FOR_BUILD in Makefile.
-if test -z "$CC_FOR_BUILD"; then
- if test "x$cross_compiling" = "xno"; then
- CC_FOR_BUILD='$(CC)'
- else
- CC_FOR_BUILD=gcc
- fi
+int main() {
+
+/* Ultrix mips cc rejects this. */
+typedef int charset[2]; const charset x;
+/* SunOS 4.1.1 cc rejects this. */
+char const *const *ccp;
+char **p;
+/* NEC SVR4.0.2 mips cc rejects this. */
+struct point {int x, y;};
+static struct point const zero = {0,0};
+/* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in an arm
+ of an if-expression whose if-part is not a constant expression */
+const char *g = "string";
+ccp = &g + (g ? g-g : 0);
+/* HPUX 7.0 cc rejects these. */
+++ccp;
+p = (char**) ccp;
+ccp = (char const *const *) p;
+{ /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+}
+{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+}
+{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+}
+{ /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+}
+{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+}
+
+; return 0; }
+EOF
+if { (eval echo configure:2321: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_c_const=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_c_const=no
+fi
+rm -f conftest*
fi
-# Also set EXEEXT_FOR_BUILD.
-if test "x$cross_compiling" = "xno"; then
- EXEEXT_FOR_BUILD='$(EXEEXT)'
+echo "$ac_t""$ac_cv_c_const" 1>&6
+if test $ac_cv_c_const = no; then
+ cat >> confdefs.h <<\EOF
+#define const
+EOF
+
+fi
+
+echo $ac_n "checking for inline""... $ac_c" 1>&6
+echo "configure:2342: checking for inline" >&5
+if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
- echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6
-echo "configure:1835: checking for build system executable suffix" >&5
-if eval "test \"`echo '$''{'bfd_cv_build_exeext'+set}'`\" = set"; then
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat > conftest.$ac_ext <<EOF
+#line 2349 "configure"
+#include "confdefs.h"
+
+int main() {
+} $ac_kw foo() {
+; return 0; }
+EOF
+if { (eval echo configure:2356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_c_inline=$ac_kw; break
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+
+fi
+
+echo "$ac_t""$ac_cv_c_inline" 1>&6
+case "$ac_cv_c_inline" in
+ inline | yes) ;;
+ no) cat >> confdefs.h <<\EOF
+#define inline
+EOF
+ ;;
+ *) cat >> confdefs.h <<EOF
+#define inline $ac_cv_c_inline
+EOF
+ ;;
+esac
+
+echo $ac_n "checking for off_t""... $ac_c" 1>&6
+echo "configure:2382: checking for off_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- cat > ac_c_test.c << 'EOF'
+ cat > conftest.$ac_ext <<EOF
+#line 2387 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_off_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_off_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_off_t" 1>&6
+if test $ac_cv_type_off_t = no; then
+ cat >> confdefs.h <<\EOF
+#define off_t long
+EOF
+
+fi
+
+echo $ac_n "checking for size_t""... $ac_c" 1>&6
+echo "configure:2415: checking for size_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2420 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_size_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_size_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_size_t" 1>&6
+if test $ac_cv_type_size_t = no; then
+ cat >> confdefs.h <<\EOF
+#define size_t unsigned
+EOF
+
+fi
+
+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments. Useless!
+echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
+echo "configure:2450: checking for working alloca.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2455 "configure"
+#include "confdefs.h"
+#include <alloca.h>
+int main() {
+char *p = alloca(2 * sizeof(int));
+; return 0; }
+EOF
+if { (eval echo configure:2462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ac_cv_header_alloca_h=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_alloca_h=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
+if test $ac_cv_header_alloca_h = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_ALLOCA_H 1
+EOF
+
+fi
+
+echo $ac_n "checking for alloca""... $ac_c" 1>&6
+echo "configure:2483: checking for alloca" >&5
+if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2488 "configure"
+#include "confdefs.h"
+
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+#else
+# ifdef _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+# else
+# if HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+char *alloca ();
+# endif
+# endif
+# endif
+# endif
+#endif
+
+int main() {
+char *p = (char *) alloca(1);
+; return 0; }
+EOF
+if { (eval echo configure:2516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ac_cv_func_alloca_works=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_func_alloca_works=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
+if test $ac_cv_func_alloca_works = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_ALLOCA 1
+EOF
+
+fi
+
+if test $ac_cv_func_alloca_works = no; then
+ # The SVR3 libPW and SVR4 libucb both contain incompatible functions
+ # that cause trouble. Some versions do not even contain alloca or
+ # contain a buggy version. If you still want to use their alloca,
+ # use ar to extract alloca.o from them instead of compiling alloca.c.
+ ALLOCA=alloca.${ac_objext}
+ cat >> confdefs.h <<\EOF
+#define C_ALLOCA 1
+EOF
+
+
+echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
+echo "configure:2548: checking whether alloca needs Cray hooks" >&5
+if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2553 "configure"
+#include "confdefs.h"
+#if defined(CRAY) && ! defined(CRAY2)
+webecray
+#else
+wenotbecray
+#endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "webecray" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_os_cray=yes
+else
+ rm -rf conftest*
+ ac_cv_os_cray=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_os_cray" 1>&6
+if test $ac_cv_os_cray = yes; then
+for ac_func in _getb67 GETB67 getb67; do
+ echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2578: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2583 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
int main() {
-/* Nothing needed here */
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<EOF
+#define CRAY_STACKSEG_END $ac_func
+EOF
+
+ break
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+done
+fi
+
+echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
+echo "configure:2633: checking stack direction for C alloca" >&5
+if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_c_stack_direction=0
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2641 "configure"
+#include "confdefs.h"
+find_stack_direction ()
+{
+ static char *addr = 0;
+ auto char dummy;
+ if (addr == 0)
+ {
+ addr = &dummy;
+ return find_stack_direction ();
+ }
+ else
+ return (&dummy > addr) ? 1 : -1;
+}
+main ()
+{
+ exit (find_stack_direction() < 0);
}
EOF
- ${CC_FOR_BUILD} -o ac_c_test am_c_test.c 1>&5 2>&5
- bfd_cv_build_exeext=`echo ac_c_test.* | grep -v ac_c_test.c | sed -e s/ac_c_test//`
- rm -f ac_c_test*
- test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no
+if { (eval echo configure:2660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_c_stack_direction=1
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_c_stack_direction=-1
+fi
+rm -fr conftest*
fi
-echo "$ac_t""$bfd_cv_build_exeext" 1>&6
- EXEEXT_FOR_BUILD=""
- test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
fi
+echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
+cat >> confdefs.h <<EOF
+#define STACK_DIRECTION $ac_cv_c_stack_direction
+EOF
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1857: checking how to run the C preprocessor" >&5
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
fi
-if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+
+for ac_hdr in unistd.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2685: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- # This must be in double quotes, not single quotes, because CPP may get
- # substituted into the Makefile and "${CC-cc}" will confuse make.
- CPP="${CC-cc} -E"
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1872 "configure"
+#line 2690 "configure"
#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2695: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_func in getpagesize
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2724: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2729 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
#include <assert.h>
-Syntax Error
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+echo $ac_n "checking for working mmap""... $ac_c" 1>&6
+echo "configure:2777: checking for working mmap" >&5
+if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_mmap_fixed_mapped=no
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2785 "configure"
+#include "confdefs.h"
+
+/* Thanks to Mike Haertel and Jim Avera for this test.
+ Here is a matrix of mmap possibilities:
+ mmap private not fixed
+ mmap private fixed at somewhere currently unmapped
+ mmap private fixed at somewhere already mapped
+ mmap shared not fixed
+ mmap shared fixed at somewhere currently unmapped
+ mmap shared fixed at somewhere already mapped
+ For private mappings, we should verify that changes cannot be read()
+ back from the file, nor mmap's back from the file at a different
+ address. (There have been systems where private was not correctly
+ implemented like the infamous i386 svr4.0, and systems where the
+ VM page cache was not coherent with the filesystem buffer cache
+ like early versions of FreeBSD and possibly contemporary NetBSD.)
+ For shared mappings, we should conversely verify that changes get
+ propogated back to all the places they're supposed to be.
+
+ Grep wants private fixed already mapped.
+ The main things grep needs to know about mmap are:
+ * does it exist and is it safe to write into the mmap'd area
+ * how to use it (BSD variants) */
+#include <sys/types.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+
+/* This mess was copied from the GNU getpagesize.h. */
+#ifndef HAVE_GETPAGESIZE
+# ifdef HAVE_UNISTD_H
+# include <unistd.h>
+# endif
+
+/* Assume that all systems that can run configure have sys/param.h. */
+# ifndef HAVE_SYS_PARAM_H
+# define HAVE_SYS_PARAM_H 1
+# endif
+
+# ifdef _SC_PAGESIZE
+# define getpagesize() sysconf(_SC_PAGESIZE)
+# else /* no _SC_PAGESIZE */
+# ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+# ifdef EXEC_PAGESIZE
+# define getpagesize() EXEC_PAGESIZE
+# else /* no EXEC_PAGESIZE */
+# ifdef NBPG
+# define getpagesize() NBPG * CLSIZE
+# ifndef CLSIZE
+# define CLSIZE 1
+# endif /* no CLSIZE */
+# else /* no NBPG */
+# ifdef NBPC
+# define getpagesize() NBPC
+# else /* no NBPC */
+# ifdef PAGESIZE
+# define getpagesize() PAGESIZE
+# endif /* PAGESIZE */
+# endif /* no NBPC */
+# endif /* no NBPG */
+# endif /* no EXEC_PAGESIZE */
+# else /* no HAVE_SYS_PARAM_H */
+# define getpagesize() 8192 /* punt totally */
+# endif /* no HAVE_SYS_PARAM_H */
+# endif /* no _SC_PAGESIZE */
+
+#endif /* no HAVE_GETPAGESIZE */
+
+#ifdef __cplusplus
+extern "C" { void *malloc(unsigned); }
+#else
+char *malloc();
+#endif
+
+int
+main()
+{
+ char *data, *data2, *data3;
+ int i, pagesize;
+ int fd;
+
+ pagesize = getpagesize();
+
+ /*
+ * First, make a file with some known garbage in it.
+ */
+ data = malloc(pagesize);
+ if (!data)
+ exit(1);
+ for (i = 0; i < pagesize; ++i)
+ *(data + i) = rand();
+ umask(0);
+ fd = creat("conftestmmap", 0600);
+ if (fd < 0)
+ exit(1);
+ if (write(fd, data, pagesize) != pagesize)
+ exit(1);
+ close(fd);
+
+ /*
+ * Next, try to mmap the file at a fixed address which
+ * already has something else allocated at it. If we can,
+ * also make sure that we see the same garbage.
+ */
+ fd = open("conftestmmap", O_RDWR);
+ if (fd < 0)
+ exit(1);
+ data2 = malloc(2 * pagesize);
+ if (!data2)
+ exit(1);
+ data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
+ if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_FIXED, fd, 0L))
+ exit(1);
+ for (i = 0; i < pagesize; ++i)
+ if (*(data + i) != *(data2 + i))
+ exit(1);
+
+ /*
+ * Finally, make sure that changes to the mapped area
+ * do not percolate back to the file as seen by read().
+ * (This is a bug on some variants of i386 svr4.0.)
+ */
+ for (i = 0; i < pagesize; ++i)
+ *(data2 + i) = *(data2 + i) + 1;
+ data3 = malloc(pagesize);
+ if (!data3)
+ exit(1);
+ if (read(fd, data3, pagesize) != pagesize)
+ exit(1);
+ for (i = 0; i < pagesize; ++i)
+ if (*(data + i) != *(data3 + i))
+ exit(1);
+ close(fd);
+ unlink("conftestmmap");
+ exit(0);
+}
+
+EOF
+if { (eval echo configure:2925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_func_mmap_fixed_mapped=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_func_mmap_fixed_mapped=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
+if test $ac_cv_func_mmap_fixed_mapped = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_MMAP 1
+EOF
+
+fi
+
+
+ for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h string.h \
+unistd.h values.h sys/param.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2953: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2958 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1878: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2963: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
- :
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- CPP="${CC-cc} -E -traditional-cpp"
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \
+__argz_count __argz_stringify __argz_next
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2993: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
cat > conftest.$ac_ext <<EOF
-#line 1889 "configure"
+#line 2998 "configure"
#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
#include <assert.h>
-Syntax Error
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+ if test "${ac_cv_func_stpcpy+set}" != "set"; then
+ for ac_func in stpcpy
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:3050: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3055 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ fi
+ if test "${ac_cv_func_stpcpy}" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_STPCPY 1
+EOF
+
+ fi
+
+ if test $ac_cv_header_locale_h = yes; then
+ echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
+echo "configure:3112: checking for LC_MESSAGES" >&5
+if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3117 "configure"
+#include "confdefs.h"
+#include <locale.h>
+int main() {
+return LC_MESSAGES
+; return 0; }
+EOF
+if { (eval echo configure:3124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ am_cv_val_LC_MESSAGES=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ am_cv_val_LC_MESSAGES=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6
+ if test $am_cv_val_LC_MESSAGES = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_LC_MESSAGES 1
+EOF
+
+ fi
+ fi
+ echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
+echo "configure:3145: checking whether NLS is requested" >&5
+ # Check whether --enable-nls or --disable-nls was given.
+if test "${enable_nls+set}" = set; then
+ enableval="$enable_nls"
+ USE_NLS=$enableval
+else
+ USE_NLS=yes
+fi
+
+ echo "$ac_t""$USE_NLS" 1>&6
+
+
+ USE_INCLUDED_LIBINTL=no
+
+ if test "$USE_NLS" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define ENABLE_NLS 1
+EOF
+
+ echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
+echo "configure:3165: checking whether included gettext is requested" >&5
+ # Check whether --with-included-gettext or --without-included-gettext was given.
+if test "${with_included_gettext+set}" = set; then
+ withval="$with_included_gettext"
+ nls_cv_force_use_gnu_gettext=$withval
+else
+ nls_cv_force_use_gnu_gettext=no
+fi
+
+ echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6
+
+ nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+ if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+ nls_cv_header_intl=
+ nls_cv_header_libgt=
+ CATOBJEXT=NONE
+
+ ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
+echo "configure:3184: checking for libintl.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3189 "configure"
+#include "confdefs.h"
+#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1895: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:3194: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
- :
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- CPP=/lib/cpp
+ eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
+echo "configure:3211: checking for gettext in libc" >&5
+if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3216 "configure"
+#include "confdefs.h"
+#include <libintl.h>
+int main() {
+return (int) gettext ("")
+; return 0; }
+EOF
+if { (eval echo configure:3223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ gt_cv_func_gettext_libc=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gt_cv_func_gettext_libc=no
+fi
rm -f conftest*
- ac_cv_prog_CPP="$CPP"
fi
- CPP="$ac_cv_prog_CPP"
+
+echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
+
+ if test "$gt_cv_func_gettext_libc" != "yes"; then
+ echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
+echo "configure:3239: checking for bindtextdomain in -lintl" >&5
+ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
- ac_cv_prog_CPP="$CPP"
+ ac_save_LIBS="$LIBS"
+LIBS="-lintl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3247 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char bindtextdomain();
+
+int main() {
+bindtextdomain()
+; return 0; }
+EOF
+if { (eval echo configure:3258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
-echo "$ac_t""$CPP" 1>&6
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
+echo "configure:3274: checking for gettext in libintl" >&5
+if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3279 "configure"
+#include "confdefs.h"
+
+int main() {
+return (int) gettext ("")
+; return 0; }
+EOF
+if { (eval echo configure:3286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ gt_cv_func_gettext_libintl=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gt_cv_func_gettext_libintl=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+
+ if test "$gt_cv_func_gettext_libc" = "yes" \
+ || test "$gt_cv_func_gettext_libintl" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_GETTEXT 1
+EOF
+
+ # Extract the first word of "msgfmt", so it can be a program name with args.
+set dummy msgfmt; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3314: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$MSGFMT" in
+ /*)
+ ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
+ ac_cv_path_MSGFMT="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no"
+ ;;
+esac
+fi
+MSGFMT="$ac_cv_path_MSGFMT"
+if test -n "$MSGFMT"; then
+ echo "$ac_t""$MSGFMT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ if test "$MSGFMT" != "no"; then
+ for ac_func in dcgettext
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:3348: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3353 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ # Extract the first word of "gmsgfmt", so it can be a program name with args.
+set dummy gmsgfmt; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3403: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$GMSGFMT" in
+ /*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
+ ;;
+esac
+fi
+GMSGFMT="$ac_cv_path_GMSGFMT"
+if test -n "$GMSGFMT"; then
+ echo "$ac_t""$GMSGFMT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ # Extract the first word of "xgettext", so it can be a program name with args.
+set dummy xgettext; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3439: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$XGETTEXT" in
+ /*)
+ ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
+ ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
+ ;;
+esac
+fi
+XGETTEXT="$ac_cv_path_XGETTEXT"
+if test -n "$XGETTEXT"; then
+ echo "$ac_t""$XGETTEXT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ cat > conftest.$ac_ext <<EOF
+#line 3471 "configure"
+#include "confdefs.h"
+
+int main() {
+extern int _nl_msg_cat_cntr;
+ return _nl_msg_cat_cntr
+; return 0; }
+EOF
+if { (eval echo configure:3479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ CATOBJEXT=.gmo
+ DATADIRNAME=share
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CATOBJEXT=.mo
+ DATADIRNAME=lib
+fi
+rm -f conftest*
+ INSTOBJEXT=.mo
+ fi
+ fi
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+
+ if test "$CATOBJEXT" = "NONE"; then
+ nls_cv_use_gnu_gettext=yes
+ fi
+ fi
+
+ if test "$nls_cv_use_gnu_gettext" = "yes"; then
+ INTLOBJS="\$(GETTOBJS)"
+ # Extract the first word of "msgfmt", so it can be a program name with args.
+set dummy msgfmt; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3511: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$MSGFMT" in
+ /*)
+ ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
+ ac_cv_path_MSGFMT="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="msgfmt"
+ ;;
+esac
+fi
+MSGFMT="$ac_cv_path_MSGFMT"
+if test -n "$MSGFMT"; then
+ echo "$ac_t""$MSGFMT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ # Extract the first word of "gmsgfmt", so it can be a program name with args.
+set dummy gmsgfmt; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3545: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$GMSGFMT" in
+ /*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
+ ;;
+esac
+fi
+GMSGFMT="$ac_cv_path_GMSGFMT"
+if test -n "$GMSGFMT"; then
+ echo "$ac_t""$GMSGFMT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ # Extract the first word of "xgettext", so it can be a program name with args.
+set dummy xgettext; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3581: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$XGETTEXT" in
+ /*)
+ ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
+ ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
+ ;;
+esac
+fi
+XGETTEXT="$ac_cv_path_XGETTEXT"
+if test -n "$XGETTEXT"; then
+ echo "$ac_t""$XGETTEXT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+ USE_INCLUDED_LIBINTL=yes
+ CATOBJEXT=.gmo
+ INSTOBJEXT=.mo
+ DATADIRNAME=share
+ INTLDEPS='$(top_builddir)/../intl/libintl.a'
+ INTLLIBS=$INTLDEPS
+ LIBS=`echo $LIBS | sed -e 's/-lintl//'`
+ nls_cv_header_intl=libintl.h
+ nls_cv_header_libgt=libgettext.h
+ fi
+
+ if test "$XGETTEXT" != ":"; then
+ if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+ : ;
+ else
+ echo "$ac_t""found xgettext programs is not GNU xgettext; ignore it" 1>&6
+ XGETTEXT=":"
+ fi
+ fi
+
+ # We need to process the po/ directory.
+ POSUB=po
+ else
+ DATADIRNAME=share
+ nls_cv_header_intl=libintl.h
+ nls_cv_header_libgt=libgettext.h
+ fi
+
+ # If this is used in GNU gettext we have to set USE_NLS to `yes'
+ # because some of the sources are only built for this goal.
+ if test "$PACKAGE" = gettext; then
+ USE_NLS=yes
+ USE_INCLUDED_LIBINTL=yes
+ fi
+
+ for lang in $ALL_LINGUAS; do
+ GMOFILES="$GMOFILES $lang.gmo"
+ POFILES="$POFILES $lang.po"
+ done
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test "x$CATOBJEXT" != "x"; then
+ if test "x$ALL_LINGUAS" = "x"; then
+ LINGUAS=
+ else
+ echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
+echo "configure:3671: checking for catalogs to be installed" >&5
+ NEW_LINGUAS=
+ for lang in ${LINGUAS=$ALL_LINGUAS}; do
+ case "$ALL_LINGUAS" in
+ *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
+ esac
+ done
+ LINGUAS=$NEW_LINGUAS
+ echo "$ac_t""$LINGUAS" 1>&6
+ fi
+
+ if test -n "$LINGUAS"; then
+ for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+ fi
+ fi
+
+ if test $ac_cv_header_locale_h = yes; then
+ INCLUDE_LOCALE_H="#include <locale.h>"
+ else
+ INCLUDE_LOCALE_H="\
+/* The system does not provide the header <locale.h>. Take care yourself. */"
+ fi
+
+
+ if test -f $srcdir/po2tbl.sed.in; then
+ if test "$CATOBJEXT" = ".cat"; then
+ ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
+echo "configure:3699: checking for linux/version.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3704 "configure"
+#include "confdefs.h"
+#include <linux/version.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ msgformat=linux
+else
+ echo "$ac_t""no" 1>&6
+msgformat=xopen
+fi
+
+
+ sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
+ fi
+ sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
+ $srcdir/po2tbl.sed.in > po2tbl.sed
+ fi
+
+ if test "$PACKAGE" = "gettext"; then
+ GT_NO="#NO#"
+ GT_YES=
+ else
+ GT_NO=
+ GT_YES="#YES#"
+ fi
+
+
+
+ MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
+
+
+ l=
+
+
+ if test -d $srcdir/po; then
+ test -d po || mkdir po
+ if test "x$srcdir" != "x."; then
+ if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
+ posrcprefix="$srcdir/"
+ else
+ posrcprefix="../$srcdir/"
+ fi
+ else
+ posrcprefix="../"
+ fi
+ rm -f po/POTFILES
+ sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
+ < $srcdir/po/POTFILES.in > po/POTFILES
+ fi
+
+
+# Permit host specific settings.
+. ${srcdir}/configure.host
+
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:3787: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
+ for ac_dir in $PATH; do
+ # Account for people who put trailing slashes in PATH elements.
+ case "$ac_dir/" in
+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ if test -f $ac_dir/$ac_prog; then
+ if test $ac_prog = install &&
+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+BFD_HOST_64BIT_LONG=0
+BFD_HOST_64_BIT_DEFINED=0
+BFD_HOST_64_BIT=
+BFD_HOST_U_64_BIT=
+if test "x${HOST_64BIT_TYPE}" = "xlong"; then
+ BFD_HOST_64BIT_LONG=1
+elif test "x${HOST_64BIT_TYPE}" != "x"; then
+ BFD_HOST_64_BIT_DEFINED=1
+ BFD_HOST_64_BIT=${HOST_64BIT_TYPE}
+ BFD_HOST_U_64_BIT=${HOST_U_64BIT_TYPE}
+fi
+
+
+
+
+
+# Put a plausible default for CC_FOR_BUILD in Makefile.
+if test -z "$CC_FOR_BUILD"; then
+ if test "x$cross_compiling" = "xno"; then
+ CC_FOR_BUILD='$(CC)'
+ else
+ CC_FOR_BUILD=gcc
+ fi
+fi
+
+# Also set EXEEXT_FOR_BUILD.
+if test "x$cross_compiling" = "xno"; then
+ EXEEXT_FOR_BUILD='$(EXEEXT)'
+else
+ echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6
+echo "configure:3870: checking for build system executable suffix" >&5
+if eval "test \"`echo '$''{'bfd_cv_build_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ rm -f conftest*
+ echo 'int main () { return 0; }' > conftest.c
+ bfd_cv_build_exeext=
+ ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
+ for file in conftest.*; do
+ case $file in
+ *.c | *.o | *.obj | *.ilk | *.pdb) ;;
+ *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
+ esac
+ done
+ rm -f conftest*
+ test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no
+fi
+
+echo "$ac_t""$bfd_cv_build_exeext" 1>&6
+ EXEEXT_FOR_BUILD=""
+ test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
+fi
+
for ac_hdr in stddef.h string.h strings.h stdlib.h time.h unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1921: checking for $ac_hdr" >&5
+echo "configure:3898: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1926 "configure"
+#line 3903 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1931: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:3908: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
@@ -1957,18 +3934,18 @@ for ac_hdr in fcntl.h sys/file.h sys/time.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1961: checking for $ac_hdr" >&5
+echo "configure:3938: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1966 "configure"
+#line 3943 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1971: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:3948: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
@@ -1994,12 +3971,12 @@ fi
done
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1998: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:3975: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2003 "configure"
+#line 3980 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -2008,7 +3985,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:2012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3989: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -2028,15 +4005,140 @@ EOF
fi
-for ac_func in fcntl getpagesize setitimer sysconf fdopen
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
+echo "configure:4014: checking for $ac_hdr that defines DIR" >&5
+if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4019 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <$ac_hdr>
+int main() {
+DIR *dirp = 0;
+; return 0; }
+EOF
+if { (eval echo configure:4027: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ eval "ac_cv_header_dirent_$ac_safe=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_dirent_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+ ac_header_dirent=$ac_hdr; break
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
+echo "configure:4052: checking for opendir in -ldir" >&5
+ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ldir $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4060 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir();
+
+int main() {
+opendir()
+; return 0; }
+EOF
+if { (eval echo configure:4071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LIBS="$LIBS -ldir"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
+echo "configure:4093: checking for opendir in -lx" >&5
+ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lx $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4101 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir();
+
+int main() {
+opendir()
+; return 0; }
+EOF
+if { (eval echo configure:4112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LIBS="$LIBS -lx"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+for ac_func in fcntl getpagesize setitimer sysconf fdopen getuid getgid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2035: checking for $ac_func" >&5
+echo "configure:4137: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2040 "configure"
+#line 4142 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2059,7 +4161,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2086,7 +4188,7 @@ done
case "${host}" in
-i[345]86-*-msdos* | i[345]86-*-go32* | i[345]86-*-mingw32* | *-*-cygwin32* | *-*-windows)
+*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
cat >> confdefs.h <<\EOF
#define USE_BINARY_FOPEN 1
EOF
@@ -2094,12 +4196,12 @@ EOF
esac
echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:2098: checking whether strstr must be declared" >&5
+echo "configure:4200: checking whether strstr must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2103 "configure"
+#line 4205 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -2120,7 +4222,7 @@ int main() {
char *(*pfn) = (char *(*)) strstr
; return 0; }
EOF
-if { (eval echo configure:2124: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strstr=no
else
@@ -2134,20 +4236,19 @@ fi
echo "$ac_t""$bfd_cv_decl_needed_strstr" 1>&6
if test $bfd_cv_decl_needed_strstr = yes; then
- bfd_tr_decl=NEED_DECLARATION_`echo strstr | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $bfd_tr_decl 1
+ cat >> confdefs.h <<\EOF
+#define NEED_DECLARATION_STRSTR 1
EOF
fi
echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:2146: checking whether malloc must be declared" >&5
+echo "configure:4247: checking whether malloc must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2151 "configure"
+#line 4252 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -2168,7 +4269,7 @@ int main() {
char *(*pfn) = (char *(*)) malloc
; return 0; }
EOF
-if { (eval echo configure:2172: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4273: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_malloc=no
else
@@ -2182,20 +4283,19 @@ fi
echo "$ac_t""$bfd_cv_decl_needed_malloc" 1>&6
if test $bfd_cv_decl_needed_malloc = yes; then
- bfd_tr_decl=NEED_DECLARATION_`echo malloc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $bfd_tr_decl 1
+ cat >> confdefs.h <<\EOF
+#define NEED_DECLARATION_MALLOC 1
EOF
fi
echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:2194: checking whether realloc must be declared" >&5
+echo "configure:4294: checking whether realloc must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2199 "configure"
+#line 4299 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -2216,7 +4316,7 @@ int main() {
char *(*pfn) = (char *(*)) realloc
; return 0; }
EOF
-if { (eval echo configure:2220: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4320: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_realloc=no
else
@@ -2230,20 +4330,19 @@ fi
echo "$ac_t""$bfd_cv_decl_needed_realloc" 1>&6
if test $bfd_cv_decl_needed_realloc = yes; then
- bfd_tr_decl=NEED_DECLARATION_`echo realloc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $bfd_tr_decl 1
+ cat >> confdefs.h <<\EOF
+#define NEED_DECLARATION_REALLOC 1
EOF
fi
echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:2242: checking whether free must be declared" >&5
+echo "configure:4341: checking whether free must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2247 "configure"
+#line 4346 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -2264,7 +4363,7 @@ int main() {
char *(*pfn) = (char *(*)) free
; return 0; }
EOF
-if { (eval echo configure:2268: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4367: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_free=no
else
@@ -2278,20 +4377,19 @@ fi
echo "$ac_t""$bfd_cv_decl_needed_free" 1>&6
if test $bfd_cv_decl_needed_free = yes; then
- bfd_tr_decl=NEED_DECLARATION_`echo free | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $bfd_tr_decl 1
+ cat >> confdefs.h <<\EOF
+#define NEED_DECLARATION_FREE 1
EOF
fi
echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-echo "configure:2290: checking whether getenv must be declared" >&5
+echo "configure:4388: checking whether getenv must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2295 "configure"
+#line 4393 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -2312,7 +4410,7 @@ int main() {
char *(*pfn) = (char *(*)) getenv
; return 0; }
EOF
-if { (eval echo configure:2316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4414: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_getenv=no
else
@@ -2326,9 +4424,8 @@ fi
echo "$ac_t""$bfd_cv_decl_needed_getenv" 1>&6
if test $bfd_cv_decl_needed_getenv = yes; then
- bfd_tr_decl=NEED_DECLARATION_`echo getenv | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $bfd_tr_decl 1
+ cat >> confdefs.h <<\EOF
+#define NEED_DECLARATION_GETENV 1
EOF
fi
@@ -2337,194 +4434,135 @@ fi
# If we are configured native, pick a core file support file.
COREFILE=
COREFLAG=
+TRAD_HEADER=
if test "${target}" = "${host}"; then
case "${host}" in
alpha*-*-linux-gnu*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/alphalinux.h"
-EOF
-
+ TRAD_HEADER='"hosts/alphalinux.h"'
;;
alpha*-*-netbsd*) COREFILE=netbsd-core.lo ;;
alpha*-*-*) COREFILE=osf-core.lo ;;
arm-*-riscix) COREFILE=trad-core.lo ;;
hppa*-*-hpux*) COREFILE=hpux-core.lo ;;
hppa*-*-hiux*) COREFILE=hpux-core.lo ;;
+ hppa*-*-mpeix*) COREFILE=hpux-core.lo ;;
hppa*-*-bsd*) COREFILE="hpux-core.lo hppabsd-core.lo"
COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
- i[3456]86-sequent-bsd*)
- COREFILE=trad-core.lo;
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/symmetry.h"
-EOF
+ i370-*-*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i370linux.h"'
+ ;;
+ i[3456]86-sequent-bsd*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/symmetry.h"'
;;
i[3456]86-sequent-sysv4*) ;;
i[3456]86-sequent-sysv*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/symmetry.h"
-EOF
-
+ TRAD_HEADER='"hosts/symmetry.h"'
;;
i[3456]86-*-bsd* | i[3456]86-*-freebsd*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/i386bsd.h"
-EOF
-
+ TRAD_HEADER='"hosts/i386bsd.h"'
;;
i[3456]86-*-netbsd* | i[3456]86-*-openbsd*)
COREFILE=netbsd-core.lo
;;
i[3456]86-esix-sysv3*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/esix.h"
-EOF
-
+ TRAD_HEADER='"hosts/esix.h"'
+ ;;
+ i[3456]86-*-sco3.2v5*)
+ COREFILE=sco5-core.lo
;;
i[3456]86-*-sco* | i[3456]86-*-isc*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/i386sco.h"
-EOF
-
+ TRAD_HEADER='"hosts/i386sco.h"'
;;
i[3456]86-*-mach3*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/i386mach3.h"
-EOF
-
+ TRAD_HEADER='"hosts/i386mach3.h"'
;;
i[3456]86-*-linux-gnu*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/i386linux.h"
-EOF
-
+ TRAD_HEADER='"hosts/i386linux.h"'
;;
i[3456]86-*-isc*) COREFILE=trad-core.lo ;;
i[3456]86-*-aix*) COREFILE=aix386-core.lo ;;
i860-*-mach3* | i860-*-osf1*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/i860mach3.h"
-EOF
-
+ TRAD_HEADER='"hosts/i860mach3.h"'
;;
mips-dec-bsd*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/mipsbsd.h"
-EOF
-
+ TRAD_HEADER='"hosts/mipsbsd.h"'
;;
mips-dec-mach3*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/mipsmach3.h"
-EOF
-
+ TRAD_HEADER='"hosts/mipsmach3.h"'
;;
mips-*-netbsd* | mips*-*-openbsd*)
COREFILE=netbsd-core.lo
;;
mips-dec-*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/decstation.h"
-EOF
-
+ TRAD_HEADER='"hosts/decstation.h"'
;;
mips-sgi-irix4*) COREFILE=irix-core.lo ;;
mips-sgi-irix5*) COREFILE=irix-core.lo ;;
mips-sgi-irix6*) COREFILE=irix-core.lo ;;
mips-*-mach3*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/mipsmach3.h"
-EOF
-
+ TRAD_HEADER='"hosts/mipsmach3.h"'
;;
mips-*-sysv4*) ;;
mips-*-sysv* | mips-*-riscos*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/riscos.h"
-EOF
-
+ TRAD_HEADER='"hosts/riscos.h"'
;;
mips-sony-bsd*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/news-mips.h"
-EOF
-
+ TRAD_HEADER='"hosts/news-mips.h"'
;;
m68*-bull*-sysv*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/dpx2.h"
-EOF
-
+ TRAD_HEADER='"hosts/dpx2.h"'
;;
m68*-hp-hpux*) COREFILE=hpux-core.lo ;;
m68*-hp-bsd*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/hp300bsd.h"
-EOF
-
+ TRAD_HEADER='"hosts/hp300bsd.h"'
;;
m68*-*-linux-gnu*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/m68klinux.h"
-EOF
-
+ TRAD_HEADER='"hosts/m68klinux.h"'
;;
m68*-motorola-sysv*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/delta68.h"
-EOF
-
+ TRAD_HEADER='"hosts/delta68.h"'
;;
m68*-sony-*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/news.h"
-EOF
-
+ TRAD_HEADER='"hosts/news.h"'
;;
m68*-*-netbsd* | m68*-*-openbsd*)
COREFILE=netbsd-core.lo
;;
m68*-apple-aux*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/m68kaux.h"
-EOF
-
+ TRAD_HEADER='"hosts/m68kaux.h"'
;;
m88*-*-sysv4*) ;;
m88*-motorola-sysv*) COREFILE=ptrace-core.lo ;;
m88*-*-mach3*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/m88kmach3.h"
-EOF
-
+ TRAD_HEADER='"hosts/m88kmach3.h"'
;;
ns32k-pc532-mach)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/pc532mach.h"
-EOF
-
+ TRAD_HEADER='"hosts/pc532mach.h"'
;;
ns32k-*-netbsd* | ns32k-*-openbsd*)
COREFILE=netbsd-core.lo
@@ -2542,31 +4580,19 @@ EOF
;;
tahoe-*-*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/tahoe.h"
-EOF
-
+ TRAD_HEADER='"hosts/tahoe.h"'
;;
vax-*-ultrix2*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/vaxult2.h"
-EOF
-
+ TRAD_HEADER='"hosts/vaxult2.h"'
;;
vax-*-ultrix*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/vaxult2.h"
-EOF
-
+ TRAD_HEADER='"hosts/vaxult2.h"'
;;
vax-*-*)
COREFILE=trad-core.lo
- cat >> confdefs.h <<\EOF
-#define TRAD_HEADER "hosts/vaxbsd.h"
-EOF
-
+ TRAD_HEADER='"hosts/vaxbsd.h"'
;;
esac
@@ -2580,47 +4606,380 @@ EOF
osf-core.lo) COREFLAG=-DOSF_CORE ;;
ptrace-core.lo) COREFLAG=-DPTRACE_CORE ;;
rs6000-core.lo) COREFLAG="$COREFLAG -DAIX_CORE" ;;
+ sco5-core.lo) COREFLAG="$COREFLAG -DSCO5_CORE" ;;
trad-core.lo) COREFLAG="$COREFLAG -DTRAD_CORE" ;;
esac
- # The ELF code uses the native <sys/procfs.h> to handle core files.
- # Define HAVE_SYS_PROCFS_H if the file exists and defines
- # prstatus_t.
- echo $ac_n "checking for sys/procfs.h""... $ac_c" 1>&6
-echo "configure:2591: checking for sys/procfs.h" >&5
- if eval "test \"`echo '$''{'bfd_cv_header_sys_procfs_h'+set}'`\" = set"; then
+ # ELF corefile support has several flavors, but all of
+ # them use something called <sys/procfs.h>
+ for ac_hdr in sys/procfs.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:4620: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4625 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4630: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ if test "$ac_cv_header_sys_procfs_h" = yes; then
+ echo $ac_n "checking for prstatus_t in sys/procfs.h""... $ac_c" 1>&6
+echo "configure:4658: checking for prstatus_t in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2596 "configure"
+#line 4663 "configure"
#include "confdefs.h"
#include <sys/procfs.h>
int main() {
-prstatus_t t;
+prstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:2603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4670: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
- bfd_cv_header_sys_procfs_h=yes
+ bfd_cv_have_sys_procfs_type_prstatus_t=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- bfd_cv_header_sys_procfs_h=no
+ bfd_cv_have_sys_procfs_type_prstatus_t=no
+
fi
rm -f conftest*
fi
- echo "$ac_t""$bfd_cv_header_sys_procfs_h" 1>&6
- if test $bfd_cv_header_sys_procfs_h = yes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_SYS_PROCFS_H 1
+ if test $bfd_cv_have_sys_procfs_type_prstatus_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PRSTATUS_T 1
EOF
- fi
+ fi
+ echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus_t" 1>&6
+
+ echo $ac_n "checking for prstatus_t.pr_who in sys/procfs.h""... $ac_c" 1>&6
+echo "configure:4692: checking for prstatus_t.pr_who in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4697 "configure"
+#include "confdefs.h"
+#include <sys/procfs.h>
+int main() {
+prstatus_t avar; void* aref = (void*) &avar.pr_who
+; return 0; }
+EOF
+if { (eval echo configure:4704: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who=no
+
+fi
+rm -f conftest*
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PRSTATUS_T_PR_WHO 1
+EOF
+
+ fi
+ echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who" 1>&6
+
+ echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6
+echo "configure:4726: checking for pstatus_t in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4731 "configure"
+#include "confdefs.h"
+#include <sys/procfs.h>
+int main() {
+pstatus_t avar
+; return 0; }
+EOF
+if { (eval echo configure:4738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_pstatus_t=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_pstatus_t=no
+
+fi
+rm -f conftest*
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_pstatus_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PSTATUS_T 1
+EOF
+ fi
+ echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6
+
+ echo $ac_n "checking for prpsinfo_t in sys/procfs.h""... $ac_c" 1>&6
+echo "configure:4760: checking for prpsinfo_t in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4765 "configure"
+#include "confdefs.h"
+#include <sys/procfs.h>
+int main() {
+prpsinfo_t avar
+; return 0; }
+EOF
+if { (eval echo configure:4772: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_prpsinfo_t=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_prpsinfo_t=no
+
+fi
+rm -f conftest*
fi
+ if test $bfd_cv_have_sys_procfs_type_prpsinfo_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PRPSINFO_T 1
+EOF
+
+ fi
+ echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo_t" 1>&6
+
+ echo $ac_n "checking for psinfo_t in sys/procfs.h""... $ac_c" 1>&6
+echo "configure:4794: checking for psinfo_t in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4799 "configure"
+#include "confdefs.h"
+#include <sys/procfs.h>
+int main() {
+psinfo_t avar
+; return 0; }
+EOF
+if { (eval echo configure:4806: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_psinfo_t=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_psinfo_t=no
+
+fi
+rm -f conftest*
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_psinfo_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PSINFO_T 1
+EOF
+
+ fi
+ echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo_t" 1>&6
+
+ echo $ac_n "checking for lwpstatus_t in sys/procfs.h""... $ac_c" 1>&6
+echo "configure:4828: checking for lwpstatus_t in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpstatus_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4833 "configure"
+#include "confdefs.h"
+#include <sys/procfs.h>
+int main() {
+lwpstatus_t avar
+; return 0; }
+EOF
+if { (eval echo configure:4840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_lwpstatus_t=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_lwpstatus_t=no
+
+fi
+rm -f conftest*
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_lwpstatus_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_LWPSTATUS_T 1
+EOF
+
+ fi
+ echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpstatus_t" 1>&6
+
+ echo $ac_n "checking for lwpstatus_t.pr_context in sys/procfs.h""... $ac_c" 1>&6
+echo "configure:4862: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4867 "configure"
+#include "confdefs.h"
+#include <sys/procfs.h>
+int main() {
+lwpstatus_t avar; void* aref = (void*) &avar.pr_context
+; return 0; }
+EOF
+if { (eval echo configure:4874: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context=no
+
+fi
+rm -f conftest*
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_LWPSTATUS_T_PR_CONTEXT 1
+EOF
+
+ fi
+ echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context" 1>&6
+
+ echo $ac_n "checking for lwpstatus_t.pr_reg in sys/procfs.h""... $ac_c" 1>&6
+echo "configure:4896: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4901 "configure"
+#include "confdefs.h"
+#include <sys/procfs.h>
+int main() {
+lwpstatus_t avar; void* aref = (void*) &avar.pr_reg
+; return 0; }
+EOF
+if { (eval echo configure:4908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg=no
+
+fi
+rm -f conftest*
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_LWPSTATUS_T_PR_REG 1
+EOF
+
+ fi
+ echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg" 1>&6
+
+ echo $ac_n "checking for win32_pstatus_t in sys/procfs.h""... $ac_c" 1>&6
+echo "configure:4930: checking for win32_pstatus_t in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_win32_pstatus_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4935 "configure"
+#include "confdefs.h"
+#include <sys/procfs.h>
+int main() {
+win32_pstatus_t avar
+; return 0; }
+EOF
+if { (eval echo configure:4942: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_win32_pstatus_t=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_win32_pstatus_t=no
+
+fi
+rm -f conftest*
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_win32_pstatus_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_WIN32_PSTATUS_T 1
+EOF
+
+ fi
+ echo "$ac_t""$bfd_cv_have_sys_procfs_type_win32_pstatus_t" 1>&6
+
+ fi
+fi
+
+
+cat >> confdefs.h <<EOF
+#define TRAD_HEADER $TRAD_HEADER
+EOF
+
+
+# Horrible hacks to build DLLs on Windows.
+WIN32LDFLAGS=
+WIN32LIBADD=
+case "${host}" in
+*-*-cygwin*)
+ if test "$enable_shared" = "yes"; then
+ WIN32LDFLAGS="-no-undefined"
+ WIN32LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin -lkernel32"
+ fi
+ ;;
+esac
+
# target stuff:
@@ -2629,7 +4988,7 @@ fi
if test -n "$enable_targets" ; then
for targ in `echo $enable_targets | sed 's/,/ /g'`
do
- result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null`
+ result=`$ac_config_sub $targ 2>/dev/null`
if test -n "$result" ; then
canon_targets="$canon_targets $result"
else
@@ -2664,7 +5023,7 @@ done
# 64-bit support needs to be compiled in. Currently, it will be included if
# the default or any other explicitly requested target requires it; it
# will not be included on a 32-bit host if no 64-bit target is requested, and
-# no "--with-64-bit-bfd" option is given, even if "--with-targets=all" is
+# no "--with-64-bit-bfd" option is given, even if "--enable-targets=all" is
# used.
# uniq the default and selected vectors in all the configured targets.
@@ -2691,7 +5050,7 @@ selarchs="$f"
# Target backend .o files.
tb=
-elf="elf.lo elflink.lo dwarf2.lo"
+elf="elf.lo elflink.lo dwarf2.lo dwarf1.lo"
for vec in $selvecs
do
@@ -2702,10 +5061,15 @@ do
a_out_adobe_vec) tb="$tb aout-adobe.lo aout32.lo" ;;
armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
- armpe_little_vec) tb="$tb pe-arm.lo coff-arm.lo cofflink.lo " ;;
- armpe_big_vec) tb="$tb pe-arm.lo coff-arm.lo cofflink.lo " ;;
- armpei_little_vec) tb="$tb pei-arm.lo cofflink.lo " ;;
- armpei_big_vec) tb="$tb pei-arm.lo cofflink.lo " ;;
+ armnetbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;;
+ armpe_little_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
+ armpe_big_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
+ armpei_little_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
+ armpei_big_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
+ arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
+ arm_epoc_pe_big_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
+ arm_epoc_pei_little_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
+ arm_epoc_pei_big_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
aout0_big_vec) tb="$tb aout0.lo aout32.lo" ;;
aout_arm_big_vec) tb="$tb aout-arm.lo aout32.lo" ;;
aout_arm_little_vec) tb="$tb aout-arm.lo aout32.lo" ;;
@@ -2716,16 +5080,25 @@ do
b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;;
bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"
target64=true ;;
+ bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;;
bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
+ bfd_elf32_littlearm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
+ bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
+ bfd_elf32_bigarm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
+ bfd_elf32_bigarm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
target64=true ;;
bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
+ bfd_elf32_d30v_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;;
+ bfd_elf32_fr30_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;;
bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
+ bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;;
bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;;
bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
+ bfd_elf32_i960_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;;
bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
@@ -2733,8 +5106,12 @@ do
bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
bfd_elf32_m68k_vec) tb="$tb elf32-m68k.lo elf32.lo $elf" ;;
bfd_elf32_m88k_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;;
+ bfd_elf32_mcore_big_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
+ bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;;
bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;;
+ bfd_elf32_pj_vec) tb="$tb elf32-pj.lo elf32.lo $elf";;
+ bfd_elf32_pjl_vec) tb="$tb elf32-pj.lo elf32.lo $elf";;
bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
@@ -2747,7 +5124,8 @@ do
target64=true ;;
bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elf64.lo $elf"
target64=true ;;
- cisco_core_vec) tb="$tb cisco-core.lo" ;;
+ cisco_core_big_vec) tb="$tb cisco-core.lo" ;;
+ cisco_core_little_vec) tb="$tb cisco-core.lo" ;;
demo_64_vec) tb="$tb demo64.lo aout64.lo"
target64=true ;;
ecoff_big_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
@@ -2757,8 +5135,6 @@ do
target64=true ;;
go32coff_vec) tb="$tb coff-go32.lo cofflink.lo" ;;
go32stubbedcoff_vec) tb="$tb coff-stgo32.lo cofflink.lo" ;;
- evax_alpha_vec) tb="$tb evax-alpha.lo evax-emh.lo evax-egsd.lo evax-etir.lo evax-misc.lo"
- target64=true ;;
h8300coff_vec) tb="$tb coff-h8300.lo reloc16.lo" ;;
h8500coff_vec) tb="$tb coff-h8500.lo reloc16.lo" ;;
host_aout_vec) tb="$tb host-aout.lo aout32.lo" ;;
@@ -2770,8 +5146,8 @@ do
i386dynix_vec) tb="$tb i386dynix.lo aout32.lo" ;;
i386freebsd_vec) tb="$tb i386freebsd.lo aout32.lo" ;;
i386msdos_vec) tb="$tb i386msdos.lo" ;;
- i386pe_vec) tb="$tb pe-i386.lo cofflink.lo " ;;
- i386pei_vec) tb="$tb pei-i386.lo cofflink.lo" ;;
+ i386pe_vec) tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;;
+ i386pei_vec) tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;;
i386linux_vec) tb="$tb i386linux.lo aout32.lo" ;;
i386lynx_aout_vec) tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;;
i386lynx_coff_vec) tb="$tb cf-i386lynx.lo cofflink.lo lynx-core.lo" ;;
@@ -2792,6 +5168,12 @@ do
m68kaux_coff_vec) tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;;
m68ksysvcoff_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;;
m88kbcs_vec) tb="$tb coff-m88k.lo" ;;
+ mipslpe_vec) tb="$tb pe-mips.lo cofflink.lo" ;;
+ mipslpei_vec) tb="$tb pei-mips.lo cofflink.lo" ;;
+ mcore_pe_big_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
+ mcore_pe_little_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
+ mcore_pei_big_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
+ mcore_pei_little_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;;
nlm32_i386_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
nlm32_sparc_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
@@ -2803,15 +5185,17 @@ do
pc532machaout_vec) tb="$tb pc532-mach.lo aout-ns32k.lo" ;;
pmac_xcoff_vec) tb="$tb coff-pmac.lo xcofflink.lo" ;;
rs6000coff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
- bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo cofflink.lo" ;;
- bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo cofflink.lo" ;;
- bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo cofflink.lo" ;;
- bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo cofflink.lo" ;;
+ bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
+ bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
+ bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
+ bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
ppcboot_vec) tb="$tb ppcboot.lo" ;;
shcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
shlcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
shcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
shlcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
+ shlpe_vec) tb="$tb pe-sh.lo coff-sh.lo cofflink.lo" ;;
+ shlpei_vec) tb="$tb pei-sh.lo coff-sh.lo cofflink.lo" ;;
som_vec) tb="$tb som.lo" ;;
sparcle_aout_vec) tb="$tb aout-sparcle.lo aout32.lo" ;;
sparclinux_vec) tb="$tb sparclinux.lo aout32.lo" ;;
@@ -2825,10 +5209,14 @@ do
tekhex_vec) tb="$tb tekhex.lo" ;;
tic30_aout_vec) tb="$tb aout-tic30.lo" ;;
tic30_coff_vec) tb="$tb coff-tic30.lo" ;;
+ tic80coff_vec) tb="$tb coff-tic80.lo cofflink.lo" ;;
+ versados_vec) tb="$tb versados.lo" ;;
+ vms_alpha_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo"
+ target64=true ;;
+ vms_vax_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo" ;;
+ w65_vec) tb="$tb coff-w65.lo reloc16.lo" ;;
we32kcoff_vec) tb="$tb coff-we32k.lo" ;;
z8kcoff_vec) tb="$tb coff-z8k.lo reloc16.lo" ;;
- w65_vec) tb="$tb coff-w65.lo reloc16.lo" ;;
- versados_vec) tb="$tb versados.lo" ;;
"") ;;
*) { echo "configure: error: *** unknown target vector $vec" 1>&2; exit 1; } ;;
@@ -2910,18 +5298,18 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2914: checking for $ac_hdr" >&5
+echo "configure:5302: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2919 "configure"
+#line 5307 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2924: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:5312: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
@@ -2949,12 +5337,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2953: checking for $ac_func" >&5
+echo "configure:5341: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2958 "configure"
+#line 5346 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2977,7 +5365,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3002,7 +5390,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:3006: checking for working mmap" >&5
+echo "configure:5394: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3010,7 +5398,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 3014 "configure"
+#line 5402 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -3150,7 +5538,7 @@ main()
}
EOF
-if { (eval echo configure:3154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -3175,12 +5563,12 @@ fi
for ac_func in madvise mprotect
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3179: checking for $ac_func" >&5
+echo "configure:5567: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3184 "configure"
+#line 5572 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3203,7 +5591,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3258,7 +5646,7 @@ EOF
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
- case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
*ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote substitution
# turns \\\\ into \\, and sed turns \\ into \).
@@ -3325,7 +5713,7 @@ do
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@@ -3336,7 +5724,7 @@ done
ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"
-trap 'rm -fr `echo "Makefile doc/Makefile bfd-in3.h:bfd-in2.h config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
@@ -3349,6 +5737,7 @@ s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
@@ -3384,8 +5773,8 @@ s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
s%@CC@%$CC%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@PACKAGE@%$PACKAGE%g
s%@VERSION@%$VERSION%g
s%@ACLOCAL@%$ACLOCAL%g
@@ -3396,12 +5785,34 @@ s%@MAKEINFO@%$MAKEINFO%g
s%@SET_MAKE@%$SET_MAKE%g
s%@AR@%$AR%g
s%@RANLIB@%$RANLIB%g
-s%@LD@%$LD%g
-s%@NM@%$NM%g
s%@LN_S@%$LN_S%g
s%@LIBTOOL@%$LIBTOOL%g
+s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
+s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
s%@MAINT@%$MAINT%g
s%@EXEEXT@%$EXEEXT%g
+s%@CPP@%$CPP%g
+s%@ALLOCA@%$ALLOCA%g
+s%@USE_NLS@%$USE_NLS%g
+s%@MSGFMT@%$MSGFMT%g
+s%@GMSGFMT@%$GMSGFMT%g
+s%@XGETTEXT@%$XGETTEXT%g
+s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g
+s%@CATALOGS@%$CATALOGS%g
+s%@CATOBJEXT@%$CATOBJEXT%g
+s%@DATADIRNAME@%$DATADIRNAME%g
+s%@GMOFILES@%$GMOFILES%g
+s%@INSTOBJEXT@%$INSTOBJEXT%g
+s%@INTLDEPS@%$INTLDEPS%g
+s%@INTLLIBS@%$INTLLIBS%g
+s%@INTLOBJS@%$INTLOBJS%g
+s%@POFILES@%$POFILES%g
+s%@POSUB@%$POSUB%g
+s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g
+s%@GT_NO@%$GT_NO%g
+s%@GT_YES@%$GT_YES%g
+s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
+s%@l@%$l%g
s%@HDEFINES@%$HDEFINES%g
s%@BFD_HOST_64BIT_LONG@%$BFD_HOST_64BIT_LONG%g
s%@BFD_HOST_64_BIT_DEFINED@%$BFD_HOST_64_BIT_DEFINED%g
@@ -3409,9 +5820,10 @@ s%@BFD_HOST_64_BIT@%$BFD_HOST_64_BIT%g
s%@BFD_HOST_U_64_BIT@%$BFD_HOST_U_64_BIT%g
s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
s%@EXEEXT_FOR_BUILD@%$EXEEXT_FOR_BUILD%g
-s%@CPP@%$CPP%g
s%@COREFILE@%$COREFILE%g
s%@COREFLAG@%$COREFLAG%g
+s%@WIN32LDFLAGS@%$WIN32LDFLAGS%g
+s%@WIN32LIBADD@%$WIN32LIBADD%g
s%@TDEFINES@%$TDEFINES%g
s%@wordsize@%$wordsize%g
s%@all_backends@%$all_backends%g
@@ -3459,7 +5871,7 @@ EOF
cat >> $CONFIG_STATUS <<EOF
-CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile bfd-in3.h:bfd-in2.h"}
+CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
@@ -3632,7 +6044,7 @@ cat >> $CONFIG_STATUS <<EOF
EOF
cat >> $CONFIG_STATUS <<\EOF
test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
-
+sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile
exit 0
EOF
chmod +x $CONFIG_STATUS
diff --git a/contrib/binutils/bfd/configure.host b/contrib/binutils/bfd/configure.host
index 769c0a2a52b0..e24cd600228c 100644
--- a/contrib/binutils/bfd/configure.host
+++ b/contrib/binutils/bfd/configure.host
@@ -23,6 +23,7 @@ alpha*-*-*) host64=true; HOST_64BIT_TYPE=long ;;
hppa*-*-hpux*) HDEFINES=-DHOST_HPPAHPUX ;;
hppa*-*-hiux*) HDEFINES=-DHOST_HPPAHPUX ;;
+hppa*-*-mpeix*) HDEFINES=-DHOST_HPPAMPEIX ;;
hppa*-*-bsd*) HDEFINES=-DHOST_HPPABSD ;;
hppa*-*-osf*) HDEFINES=-DHOST_HPPAOSF ;;
@@ -62,6 +63,8 @@ m68*-hp-hpux*) HDEFINES=-DHOST_HP300HPUX ;;
ac_cv_func_getpagesize=no
ac_cv_func_madvise=no
ac_cv_func_mprotect=no
+ ac_cv_func_getuid=no
+ ac_cv_func_getgid=no
ac_cv_header_sys_file_h=no
ac_cv_header_sys_time_h=no
ac_cv_header_unistd_h=no
diff --git a/contrib/binutils/bfd/configure.in b/contrib/binutils/bfd/configure.in
index f8951e6e40e0..df2b6136d62d 100644
--- a/contrib/binutils/bfd/configure.in
+++ b/contrib/binutils/bfd/configure.in
@@ -1,13 +1,13 @@
dnl Process this file with autoconf to produce a configure script.
dnl
-AC_PREREQ(2.5)
+AC_PREREQ(2.13)
AC_INIT(libbfd.c)
AC_CANONICAL_SYSTEM
AC_ISC_POSIX
-AM_INIT_AUTOMAKE(bfd, 2.9.1)
+AM_INIT_AUTOMAKE(bfd, 2.9.5)
dnl These must be called before AM_PROG_LIBTOOL, because it may want
dnl to call AC_CHECK_PROG.
@@ -58,8 +58,7 @@ fi
AC_ARG_PROGRAM
AM_MAINTAINER_MODE
-AM_CYGWIN32
-AM_EXEEXT
+AC_EXEEXT
host64=false
target64=false
@@ -68,11 +67,14 @@ target64=false
AC_PROG_CC
+ALL_LINGUAS=
+CY_GNU_GETTEXT
+
# Permit host specific settings.
. ${srcdir}/configure.host
AC_SUBST(HDEFINES)
-AM_PROG_INSTALL
+AC_PROG_INSTALL
BFD_HOST_64BIT_LONG=0
BFD_HOST_64_BIT_DEFINED=0
@@ -95,7 +97,8 @@ BFD_CC_FOR_BUILD
AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h)
AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h)
AC_HEADER_TIME
-AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen)
+AC_HEADER_DIRENT
+AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid)
BFD_BINARY_FOPEN
@@ -108,37 +111,44 @@ BFD_NEED_DECLARATION(getenv)
# If we are configured native, pick a core file support file.
COREFILE=
COREFLAG=
+TRAD_HEADER=
if test "${target}" = "${host}"; then
case "${host}" in
alpha*-*-linux-gnu*)
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/alphalinux.h")
+ TRAD_HEADER='"hosts/alphalinux.h"'
;;
alpha*-*-netbsd*) COREFILE=netbsd-core.lo ;;
alpha*-*-*) COREFILE=osf-core.lo ;;
arm-*-riscix) COREFILE=trad-core.lo ;;
hppa*-*-hpux*) COREFILE=hpux-core.lo ;;
hppa*-*-hiux*) COREFILE=hpux-core.lo ;;
+ hppa*-*-mpeix*) COREFILE=hpux-core.lo ;;
hppa*-*-bsd*) COREFILE="hpux-core.lo hppabsd-core.lo"
COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
+ i370-*-*)
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/i370linux.h"'
+ ;;
+
changequote(,)dnl
i[3456]86-sequent-bsd*)
changequote([,])dnl
- COREFILE=trad-core.lo;
- AC_DEFINE(TRAD_HEADER,"hosts/symmetry.h")
+ COREFILE=trad-core.lo
+ TRAD_HEADER='"hosts/symmetry.h"'
;;
changequote(,)dnl
i[3456]86-sequent-sysv4*) ;;
i[3456]86-sequent-sysv*)
changequote([,])dnl
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/symmetry.h")
+ TRAD_HEADER='"hosts/symmetry.h"'
;;
changequote(,)dnl
i[3456]86-*-bsd* | i[3456]86-*-freebsd*)
changequote([,])dnl
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/i386bsd.h")
+ TRAD_HEADER='"hosts/i386bsd.h"'
;;
changequote(,)dnl
i[3456]86-*-netbsd* | i[3456]86-*-openbsd*)
@@ -149,25 +159,30 @@ changequote(,)dnl
i[3456]86-esix-sysv3*)
changequote([,])dnl
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/esix.h")
+ TRAD_HEADER='"hosts/esix.h"'
+ ;;
+changequote(,)dnl
+ i[3456]86-*-sco3.2v5*)
+changequote([,])dnl
+ COREFILE=sco5-core.lo
;;
changequote(,)dnl
i[3456]86-*-sco* | i[3456]86-*-isc*)
changequote([,])dnl
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/i386sco.h")
+ TRAD_HEADER='"hosts/i386sco.h"'
;;
changequote(,)dnl
i[3456]86-*-mach3*)
changequote([,])dnl
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/i386mach3.h")
+ TRAD_HEADER='"hosts/i386mach3.h"'
;;
changequote(,)dnl
i[3456]86-*-linux-gnu*)
changequote([,])dnl
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/i386linux.h")
+ TRAD_HEADER='"hosts/i386linux.h"'
;;
changequote(,)dnl
i[3456]86-*-isc*) COREFILE=trad-core.lo ;;
@@ -175,76 +190,76 @@ changequote(,)dnl
changequote([,])dnl
i860-*-mach3* | i860-*-osf1*)
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/i860mach3.h")
+ TRAD_HEADER='"hosts/i860mach3.h"'
;;
mips-dec-bsd*)
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/mipsbsd.h")
+ TRAD_HEADER='"hosts/mipsbsd.h"'
;;
mips-dec-mach3*)
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/mipsmach3.h")
+ TRAD_HEADER='"hosts/mipsmach3.h"'
;;
mips-*-netbsd* | mips*-*-openbsd*)
COREFILE=netbsd-core.lo
;;
mips-dec-*)
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/decstation.h")
+ TRAD_HEADER='"hosts/decstation.h"'
;;
mips-sgi-irix4*) COREFILE=irix-core.lo ;;
mips-sgi-irix5*) COREFILE=irix-core.lo ;;
mips-sgi-irix6*) COREFILE=irix-core.lo ;;
mips-*-mach3*)
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/mipsmach3.h")
+ TRAD_HEADER='"hosts/mipsmach3.h"'
;;
mips-*-sysv4*) ;;
mips-*-sysv* | mips-*-riscos*)
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/riscos.h")
+ TRAD_HEADER='"hosts/riscos.h"'
;;
mips-sony-bsd*)
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/news-mips.h")
+ TRAD_HEADER='"hosts/news-mips.h"'
;;
m68*-bull*-sysv*)
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/dpx2.h")
+ TRAD_HEADER='"hosts/dpx2.h"'
;;
m68*-hp-hpux*) COREFILE=hpux-core.lo ;;
m68*-hp-bsd*)
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/hp300bsd.h")
+ TRAD_HEADER='"hosts/hp300bsd.h"'
;;
m68*-*-linux-gnu*)
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/m68klinux.h")
+ TRAD_HEADER='"hosts/m68klinux.h"'
;;
m68*-motorola-sysv*)
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER, "hosts/delta68.h")
+ TRAD_HEADER='"hosts/delta68.h"'
;;
m68*-sony-*)
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/news.h")
+ TRAD_HEADER='"hosts/news.h"'
;;
m68*-*-netbsd* | m68*-*-openbsd*)
COREFILE=netbsd-core.lo
;;
m68*-apple-aux*)
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/m68kaux.h")
+ TRAD_HEADER='"hosts/m68kaux.h"'
;;
m88*-*-sysv4*) ;;
m88*-motorola-sysv*) COREFILE=ptrace-core.lo ;;
m88*-*-mach3*)
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/m88kmach3.h")
+ TRAD_HEADER='"hosts/m88kmach3.h"'
;;
ns32k-pc532-mach)
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/pc532mach.h")
+ TRAD_HEADER='"hosts/pc532mach.h"'
;;
ns32k-*-netbsd* | ns32k-*-openbsd*)
COREFILE=netbsd-core.lo
@@ -262,19 +277,19 @@ changequote([,])dnl
;;
tahoe-*-*)
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/tahoe.h")
+ TRAD_HEADER='"hosts/tahoe.h"'
;;
vax-*-ultrix2*)
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/vaxult2.h")
+ TRAD_HEADER='"hosts/vaxult2.h"'
;;
vax-*-ultrix*)
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/vaxult2.h")
+ TRAD_HEADER='"hosts/vaxult2.h"'
;;
vax-*-*)
COREFILE=trad-core.lo
- AC_DEFINE(TRAD_HEADER,"hosts/vaxbsd.h")
+ TRAD_HEADER='"hosts/vaxbsd.h"'
;;
esac
@@ -288,25 +303,43 @@ changequote([,])dnl
osf-core.lo) COREFLAG=-DOSF_CORE ;;
ptrace-core.lo) COREFLAG=-DPTRACE_CORE ;;
rs6000-core.lo) COREFLAG="$COREFLAG -DAIX_CORE" ;;
+ sco5-core.lo) COREFLAG="$COREFLAG -DSCO5_CORE" ;;
trad-core.lo) COREFLAG="$COREFLAG -DTRAD_CORE" ;;
esac
- # The ELF code uses the native <sys/procfs.h> to handle core files.
- # Define HAVE_SYS_PROCFS_H if the file exists and defines
- # prstatus_t.
- AC_MSG_CHECKING([for sys/procfs.h])
- AC_CACHE_VAL(bfd_cv_header_sys_procfs_h,
- [AC_TRY_COMPILE([#include <sys/procfs.h>],
- [prstatus_t t;],
- bfd_cv_header_sys_procfs_h=yes, bfd_cv_header_sys_procfs_h=no)])
- AC_MSG_RESULT($bfd_cv_header_sys_procfs_h)
- if test $bfd_cv_header_sys_procfs_h = yes; then
- AC_DEFINE(HAVE_SYS_PROCFS_H)
+ # ELF corefile support has several flavors, but all of
+ # them use something called <sys/procfs.h>
+ AC_CHECK_HEADERS(sys/procfs.h)
+ if test "$ac_cv_header_sys_procfs_h" = yes; then
+ BFD_HAVE_SYS_PROCFS_TYPE(prstatus_t)
+ BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(prstatus_t, pr_who)
+ BFD_HAVE_SYS_PROCFS_TYPE(pstatus_t)
+ BFD_HAVE_SYS_PROCFS_TYPE(prpsinfo_t)
+ BFD_HAVE_SYS_PROCFS_TYPE(psinfo_t)
+ BFD_HAVE_SYS_PROCFS_TYPE(lwpstatus_t)
+ BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_context)
+ BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_reg)
+ BFD_HAVE_SYS_PROCFS_TYPE(win32_pstatus_t)
fi
-
fi
AC_SUBST(COREFILE)
AC_SUBST(COREFLAG)
+AC_DEFINE_UNQUOTED(TRAD_HEADER, $TRAD_HEADER,
+ [Name of host specific header file to include in trad-core.c.])
+
+# Horrible hacks to build DLLs on Windows.
+WIN32LDFLAGS=
+WIN32LIBADD=
+case "${host}" in
+*-*-cygwin*)
+ if test "$enable_shared" = "yes"; then
+ WIN32LDFLAGS="-no-undefined"
+ WIN32LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin -lkernel32"
+ fi
+ ;;
+esac
+AC_SUBST(WIN32LDFLAGS)
+AC_SUBST(WIN32LIBADD)
# target stuff:
@@ -314,7 +347,7 @@ AC_SUBST(COREFLAG)
if test -n "$enable_targets" ; then
for targ in `echo $enable_targets | sed 's/,/ /g'`
do
- result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null`
+ result=`$ac_config_sub $targ 2>/dev/null`
if test -n "$result" ; then
canon_targets="$canon_targets $result"
else
@@ -349,7 +382,7 @@ AC_SUBST(TDEFINES)
# 64-bit support needs to be compiled in. Currently, it will be included if
# the default or any other explicitly requested target requires it; it
# will not be included on a 32-bit host if no 64-bit target is requested, and
-# no "--with-64-bit-bfd" option is given, even if "--with-targets=all" is
+# no "--with-64-bit-bfd" option is given, even if "--enable-targets=all" is
# used.
# uniq the default and selected vectors in all the configured targets.
@@ -376,7 +409,7 @@ selarchs="$f"
# Target backend .o files.
tb=
-elf="elf.lo elflink.lo dwarf2.lo"
+elf="elf.lo elflink.lo dwarf2.lo dwarf1.lo"
for vec in $selvecs
do
@@ -387,10 +420,15 @@ do
a_out_adobe_vec) tb="$tb aout-adobe.lo aout32.lo" ;;
armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
- armpe_little_vec) tb="$tb pe-arm.lo coff-arm.lo cofflink.lo " ;;
- armpe_big_vec) tb="$tb pe-arm.lo coff-arm.lo cofflink.lo " ;;
- armpei_little_vec) tb="$tb pei-arm.lo cofflink.lo " ;;
- armpei_big_vec) tb="$tb pei-arm.lo cofflink.lo " ;;
+ armnetbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;;
+ armpe_little_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
+ armpe_big_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
+ armpei_little_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
+ armpei_big_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
+ arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
+ arm_epoc_pe_big_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
+ arm_epoc_pei_little_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
+ arm_epoc_pei_big_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
aout0_big_vec) tb="$tb aout0.lo aout32.lo" ;;
aout_arm_big_vec) tb="$tb aout-arm.lo aout32.lo" ;;
aout_arm_little_vec) tb="$tb aout-arm.lo aout32.lo" ;;
@@ -401,16 +439,25 @@ do
b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;;
bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"
target64=true ;;
+ bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;;
bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
+ bfd_elf32_littlearm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
+ bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;;
+ bfd_elf32_bigarm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
+ bfd_elf32_bigarm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
bfd_elf32_bigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
target64=true ;;
bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
+ bfd_elf32_d30v_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;;
+ bfd_elf32_fr30_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;;
bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
+ bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;;
bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;;
bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;;
+ bfd_elf32_i960_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;;
bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;;
bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elf32-mips.lo elf32.lo $elf ecofflink.lo"
@@ -418,8 +465,12 @@ do
bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;;
bfd_elf32_m68k_vec) tb="$tb elf32-m68k.lo elf32.lo $elf" ;;
bfd_elf32_m88k_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;;
+ bfd_elf32_mcore_big_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
+ bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;;
bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;;
bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;;
+ bfd_elf32_pj_vec) tb="$tb elf32-pj.lo elf32.lo $elf";;
+ bfd_elf32_pjl_vec) tb="$tb elf32-pj.lo elf32.lo $elf";;
bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
@@ -432,7 +483,8 @@ do
target64=true ;;
bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elf64.lo $elf"
target64=true ;;
- cisco_core_vec) tb="$tb cisco-core.lo" ;;
+ cisco_core_big_vec) tb="$tb cisco-core.lo" ;;
+ cisco_core_little_vec) tb="$tb cisco-core.lo" ;;
demo_64_vec) tb="$tb demo64.lo aout64.lo"
target64=true ;;
ecoff_big_vec) tb="$tb coff-mips.lo ecoff.lo ecofflink.lo" ;;
@@ -442,8 +494,6 @@ do
target64=true ;;
go32coff_vec) tb="$tb coff-go32.lo cofflink.lo" ;;
go32stubbedcoff_vec) tb="$tb coff-stgo32.lo cofflink.lo" ;;
- evax_alpha_vec) tb="$tb evax-alpha.lo evax-emh.lo evax-egsd.lo evax-etir.lo evax-misc.lo"
- target64=true ;;
h8300coff_vec) tb="$tb coff-h8300.lo reloc16.lo" ;;
h8500coff_vec) tb="$tb coff-h8500.lo reloc16.lo" ;;
host_aout_vec) tb="$tb host-aout.lo aout32.lo" ;;
@@ -455,8 +505,8 @@ do
i386dynix_vec) tb="$tb i386dynix.lo aout32.lo" ;;
i386freebsd_vec) tb="$tb i386freebsd.lo aout32.lo" ;;
i386msdos_vec) tb="$tb i386msdos.lo" ;;
- i386pe_vec) tb="$tb pe-i386.lo cofflink.lo " ;;
- i386pei_vec) tb="$tb pei-i386.lo cofflink.lo" ;;
+ i386pe_vec) tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;;
+ i386pei_vec) tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;;
i386linux_vec) tb="$tb i386linux.lo aout32.lo" ;;
i386lynx_aout_vec) tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;;
i386lynx_coff_vec) tb="$tb cf-i386lynx.lo cofflink.lo lynx-core.lo" ;;
@@ -477,6 +527,12 @@ do
m68kaux_coff_vec) tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;;
m68ksysvcoff_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;;
m88kbcs_vec) tb="$tb coff-m88k.lo" ;;
+ mipslpe_vec) tb="$tb pe-mips.lo cofflink.lo" ;;
+ mipslpei_vec) tb="$tb pei-mips.lo cofflink.lo" ;;
+ mcore_pe_big_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
+ mcore_pe_little_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
+ mcore_pei_big_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
+ mcore_pei_little_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;;
nlm32_i386_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
nlm32_sparc_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
@@ -488,15 +544,17 @@ do
pc532machaout_vec) tb="$tb pc532-mach.lo aout-ns32k.lo" ;;
pmac_xcoff_vec) tb="$tb coff-pmac.lo xcofflink.lo" ;;
rs6000coff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
- bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo cofflink.lo" ;;
- bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo cofflink.lo" ;;
- bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo cofflink.lo" ;;
- bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo cofflink.lo" ;;
+ bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
+ bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
+ bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
+ bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
ppcboot_vec) tb="$tb ppcboot.lo" ;;
shcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
shlcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
shcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
shlcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
+ shlpe_vec) tb="$tb pe-sh.lo coff-sh.lo cofflink.lo" ;;
+ shlpei_vec) tb="$tb pei-sh.lo coff-sh.lo cofflink.lo" ;;
som_vec) tb="$tb som.lo" ;;
sparcle_aout_vec) tb="$tb aout-sparcle.lo aout32.lo" ;;
sparclinux_vec) tb="$tb sparclinux.lo aout32.lo" ;;
@@ -510,10 +568,14 @@ do
tekhex_vec) tb="$tb tekhex.lo" ;;
tic30_aout_vec) tb="$tb aout-tic30.lo" ;;
tic30_coff_vec) tb="$tb coff-tic30.lo" ;;
+ tic80coff_vec) tb="$tb coff-tic80.lo cofflink.lo" ;;
+ versados_vec) tb="$tb versados.lo" ;;
+ vms_alpha_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo"
+ target64=true ;;
+ vms_vax_vec) tb="$tb vms.lo vms-hdr.lo vms-gsd.lo vms-tir.lo vms-misc.lo" ;;
+ w65_vec) tb="$tb coff-w65.lo reloc16.lo" ;;
we32kcoff_vec) tb="$tb coff-we32k.lo" ;;
z8kcoff_vec) tb="$tb coff-z8k.lo reloc16.lo" ;;
- w65_vec) tb="$tb coff-w65.lo reloc16.lo" ;;
- versados_vec) tb="$tb versados.lo" ;;
"") ;;
*) AC_MSG_ERROR(*** unknown target vector $vec) ;;
@@ -595,8 +657,9 @@ dnl AC_CHECK_HEADERS(sys/mman.h)
AC_FUNC_MMAP
AC_CHECK_FUNCS(madvise mprotect)
case ${want_mmap}+${ac_cv_func_mmap_fixed_mapped} in
- true+yes ) AC_DEFINE(USE_MMAP) ;;
+ true+yes ) AC_DEFINE(USE_MMAP, 1, [Use mmap if it's available?]) ;;
esac
rm -f doc/config.status
-AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h)
+AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in,
+[sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile])
diff --git a/contrib/binutils/bfd/cpu-alpha.c b/contrib/binutils/bfd/cpu-alpha.c
index 0d66a8b74e80..b89900be3b72 100644
--- a/contrib/binutils/bfd/cpu-alpha.c
+++ b/contrib/binutils/bfd/cpu-alpha.c
@@ -21,18 +21,31 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysdep.h"
#include "libbfd.h"
+#define N(BITS_WORD, BITS_ADDR, NUMBER, PRINT, DEFAULT, NEXT) \
+ { \
+ BITS_WORD, /* bits in a word */ \
+ BITS_ADDR, /* bits in an address */ \
+ 8, /* 8 bits in a byte */ \
+ bfd_arch_alpha, \
+ NUMBER, \
+ "alpha", \
+ PRINT, \
+ 3, \
+ DEFAULT, \
+ bfd_default_compatible, \
+ bfd_default_scan, \
+ NEXT, \
+ }
+
+#define NN(index) (&arch_info_struct[index])
+
+/* These exist only so that we can resonably disassemble PALcode. */
+static const bfd_arch_info_type arch_info_struct[] =
+{
+ N (64, 64, bfd_mach_alpha_ev4, "alpha:ev4", false, NN(1)),
+ N (64, 64, bfd_mach_alpha_ev5, "alpha:ev5", false, NN(2)),
+ N (64, 64, bfd_mach_alpha_ev6, "alpha:ev6", false, 0),
+};
+
const bfd_arch_info_type bfd_alpha_arch =
- {
- 64, /* 32 bits in a word */
- 64, /* 32 bits in an address */
- 8, /* 8 bits in a byte */
- bfd_arch_alpha,
- 0, /* only 1 machine */
- "alpha",
- "alpha",
- 3,
- true, /* the one and only */
- bfd_default_compatible,
- bfd_default_scan ,
- 0,
- };
+ N (64, 64, 0, "alpha", true, NN(0));
diff --git a/contrib/binutils/bfd/cpu-arm.c b/contrib/binutils/bfd/cpu-arm.c
new file mode 100644
index 000000000000..bda9c4489a66
--- /dev/null
+++ b/contrib/binutils/bfd/cpu-arm.c
@@ -0,0 +1,143 @@
+/* BFD support for the ARM processor
+ Copyright 1994, 95, 97, 1999 Free Software Foundation, Inc.
+ Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+
+static const bfd_arch_info_type *compatible
+ PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
+static boolean scan PARAMS ((const struct bfd_arch_info *, const char *));
+
+/* This routine is provided two arch_infos and works out which ARM
+ machine which would be compatible with both and returns a pointer
+ to its info structure */
+
+static const bfd_arch_info_type *
+compatible (a,b)
+ const bfd_arch_info_type * a;
+ const bfd_arch_info_type * b;
+{
+ /* If a & b are for different architecture we can do nothing */
+ if (a->arch != b->arch)
+ return NULL;
+
+ /* If a & b are for the same machine then all is well */
+ if (a->mach == b->mach)
+ return a;
+
+ /* Otherwise if either a or b is the 'default' machine then
+ it can be polymorphed into the other */
+ if (a->the_default)
+ return b;
+
+ if (b->the_default)
+ return a;
+
+ /* So far all newer ARM architecture cores are supersets of previous cores */
+ if (a->mach < b->mach)
+ return b;
+ else if (a->mach > b->mach)
+ return a;
+
+ /* Never reached! */
+ return NULL;
+}
+
+static struct
+{
+ enum bfd_architecture arch;
+ char * name;
+}
+processors[] =
+{
+ { bfd_mach_arm_2, "arm2" },
+ { bfd_mach_arm_2a, "arm250" },
+ { bfd_mach_arm_2a, "arm3" },
+ { bfd_mach_arm_3, "arm6" },
+ { bfd_mach_arm_3, "arm60" },
+ { bfd_mach_arm_3, "arm600" },
+ { bfd_mach_arm_3, "arm610" },
+ { bfd_mach_arm_3, "arm7" },
+ { bfd_mach_arm_3, "arm710" },
+ { bfd_mach_arm_3, "arm7500" },
+ { bfd_mach_arm_3, "arm7d" },
+ { bfd_mach_arm_3, "arm7di" },
+ { bfd_mach_arm_3M, "arm7dm" },
+ { bfd_mach_arm_3M, "arm7dmi" },
+ { bfd_mach_arm_4T, "arm7tdmi" },
+ { bfd_mach_arm_4, "arm8" },
+ { bfd_mach_arm_4, "arm810" },
+ { bfd_mach_arm_4, "arm9" },
+ { bfd_mach_arm_4, "arm920" },
+ { bfd_mach_arm_4T, "arm920t" },
+ { bfd_mach_arm_4T, "arm9tdmi" },
+ { bfd_mach_arm_4, "sa1" },
+ { bfd_mach_arm_4, "strongarm"},
+ { bfd_mach_arm_4, "strongarm110" },
+ { bfd_mach_arm_4, "strongarm1100" },
+};
+
+static boolean
+scan (info, string)
+ const struct bfd_arch_info * info;
+ const char * string;
+{
+ int i;
+
+ /* First test for an exact match */
+ if (strcasecmp (string, info->printable_name) == 0)
+ return true;
+
+ /* Next check for a processor name instead of an Architecture name */
+ for (i = sizeof (processors) / sizeof (processors[0]); i--;)
+ {
+ if (strcasecmp (string, processors[ i ].name) == 0)
+ break;
+ }
+
+ if (i != -1 && info->arch == processors[ i ].arch)
+ return true;
+
+ /* Finally check for the default architecture */
+ if (strcasecmp (string, "arm") == 0)
+ return info->the_default;
+
+ return false;
+}
+
+
+#define N(number, print, default, next) \
+{ 32, 32, 8, bfd_arch_arm, number, "arm", print, 4, default, compatible, scan, next }
+
+static const bfd_arch_info_type arch_info_struct[] =
+{
+ N( bfd_mach_arm_2, "armv2", false, & arch_info_struct[1] ),
+ N( bfd_mach_arm_2a, "armv2a", false, & arch_info_struct[2] ),
+ N( bfd_mach_arm_3, "armv3", false, & arch_info_struct[3] ),
+ N( bfd_mach_arm_3M, "armv3m", false, & arch_info_struct[4] ),
+ N( bfd_mach_arm_4, "armv4", false, & arch_info_struct[5] ),
+ N( bfd_mach_arm_4T, "armv4t", false, & arch_info_struct[6] ),
+ N( bfd_mach_arm_5, "armv5", false, & arch_info_struct[7] ),
+ N( bfd_mach_arm_5T, "armv5t", false, NULL )
+};
+
+const bfd_arch_info_type bfd_arm_arch =
+ N( 0, "arm", true, & arch_info_struct[0] );
diff --git a/contrib/binutils/bfd/cpu-i386.c b/contrib/binutils/bfd/cpu-i386.c
index 518176d8bcc4..f5b9b181d18d 100644
--- a/contrib/binutils/bfd/cpu-i386.c
+++ b/contrib/binutils/bfd/cpu-i386.c
@@ -21,6 +21,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysdep.h"
#include "libbfd.h"
+const bfd_arch_info_type bfd_i386_arch_intel_syntax =
+{
+ 32, /* 32 bits in a word */
+ 32, /* 32 bits in an address */
+ 8, /* 8 bits in a byte */
+ bfd_arch_i386,
+ bfd_mach_i386_i386_intel_syntax,
+ "i386:intel",
+ "i386:intel",
+ 3,
+ true,
+ bfd_default_compatible,
+ bfd_default_scan ,
+ 0,
+};
static const bfd_arch_info_type i8086_arch =
{
32, /* 32 bits in a word */
@@ -34,7 +49,7 @@ static const bfd_arch_info_type i8086_arch =
false,
bfd_default_compatible,
bfd_default_scan ,
- 0,
+ &bfd_i386_arch_intel_syntax,
};
const bfd_arch_info_type bfd_i386_arch =
@@ -52,3 +67,4 @@ const bfd_arch_info_type bfd_i386_arch =
bfd_default_scan ,
&i8086_arch,
};
+
diff --git a/contrib/binutils/bfd/cpu-mips.c b/contrib/binutils/bfd/cpu-mips.c
index 20a4d2847243..a933b8cd10bc 100644
--- a/contrib/binutils/bfd/cpu-mips.c
+++ b/contrib/binutils/bfd/cpu-mips.c
@@ -44,6 +44,7 @@ I_mips3900,
I_mips4000,
I_mips4010,
I_mips4100,
+I_mips4111,
I_mips4300,
I_mips4400,
I_mips4600,
@@ -65,6 +66,7 @@ static const bfd_arch_info_type arch_info_struct[] =
N (64, 64, bfd_mach_mips4000, "mips:4000", false, NN(I_mips4000)),
N (64, 64, bfd_mach_mips4010, "mips:4010", false, NN(I_mips4010)),
N (64, 64, bfd_mach_mips4100, "mips:4100", false, NN(I_mips4100)),
+ N (64, 64, bfd_mach_mips4111, "mips:4111", false, NN(I_mips4111)),
N (64, 64, bfd_mach_mips4300, "mips:4300", false, NN(I_mips4300)),
N (64, 64, bfd_mach_mips4400, "mips:4400", false, NN(I_mips4400)),
N (64, 64, bfd_mach_mips4600, "mips:4600", false, NN(I_mips4600)),
diff --git a/contrib/binutils/bfd/cpu-powerpc.c b/contrib/binutils/bfd/cpu-powerpc.c
new file mode 100644
index 000000000000..11f0f80af5ab
--- /dev/null
+++ b/contrib/binutils/bfd/cpu-powerpc.c
@@ -0,0 +1,124 @@
+/* BFD PowerPC CPU definition
+ Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+ Contributed by Ian Lance Taylor, Cygnus Support.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+
+/* The common PowerPC architecture is compatible with the RS/6000. */
+
+static const bfd_arch_info_type *powerpc_compatible
+ PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
+
+static const bfd_arch_info_type *
+powerpc_compatible (a,b)
+ const bfd_arch_info_type *a;
+ const bfd_arch_info_type *b;
+{
+ BFD_ASSERT (a->arch == bfd_arch_powerpc);
+ switch (b->arch)
+ {
+ default:
+ return NULL;
+ case bfd_arch_powerpc:
+ return bfd_default_compatible (a, b);
+ case bfd_arch_rs6000:
+ if (a->mach == 0)
+ return a;
+ return NULL;
+ }
+ /*NOTREACHED*/
+}
+
+static const bfd_arch_info_type arch_info_struct[] =
+{
+ {
+ 32, /* 32 bits in a word */
+ 32, /* 32 bits in an address */
+ 8, /* 8 bits in a byte */
+ bfd_arch_powerpc,
+ 603, /* for the mpc603 */
+ "powerpc",
+ "powerpc:603",
+ 3,
+ false, /* not the default */
+ powerpc_compatible,
+ bfd_default_scan,
+ &arch_info_struct[1]
+ },
+ {
+ 32, /* 32 bits in a word */
+ 32, /* 32 bits in an address */
+ 8, /* 8 bits in a byte */
+ bfd_arch_powerpc,
+ 604, /* for the mpc604 */
+ "powerpc",
+ "powerpc:604",
+ 3,
+ false, /* not the default */
+ powerpc_compatible,
+ bfd_default_scan,
+ &arch_info_struct[2]
+ },
+ {
+ 32, /* 32 bits in a word */
+ 32, /* 32 bits in an address */
+ 8, /* 8 bits in a byte */
+ bfd_arch_powerpc,
+ 403, /* for the 403 */
+ "powerpc",
+ "powerpc:403",
+ 3,
+ false, /* not the default */
+ powerpc_compatible,
+ bfd_default_scan,
+ &arch_info_struct[3]
+ },
+ {
+ 32, /* 32 bits in a word */
+ 32, /* 32 bits in an address */
+ 8, /* 8 bits in a byte */
+ bfd_arch_powerpc,
+ 601, /* for the mpc601 */
+ "powerpc",
+ "powerpc:601",
+ 3,
+ false, /* not the default */
+ powerpc_compatible,
+ bfd_default_scan,
+ 0
+ }
+};
+
+const bfd_arch_info_type bfd_powerpc_arch =
+ {
+ 32, /* 32 bits in a word */
+ 32, /* 32 bits in an address */
+ 8, /* 8 bits in a byte */
+ bfd_arch_powerpc,
+ 0, /* for the POWER/PowerPC common architecture */
+ "powerpc",
+ "powerpc:common",
+ 3,
+ true, /* the default */
+ powerpc_compatible,
+ bfd_default_scan,
+ &arch_info_struct[0]
+ };
diff --git a/contrib/binutils/bfd/cpu-sparc.c b/contrib/binutils/bfd/cpu-sparc.c
index 74df2db0fd7e..234bd92bd29c 100644
--- a/contrib/binutils/bfd/cpu-sparc.c
+++ b/contrib/binutils/bfd/cpu-sparc.c
@@ -96,6 +96,20 @@ static const bfd_arch_info_type arch_info_struct[] =
&arch_info_struct[4],
},
{
+ 32, /* bits in a word */
+ 32, /* bits in an address */
+ 8, /* bits in a byte */
+ bfd_arch_sparc,
+ bfd_mach_sparc_sparclite_le,
+ "sparc",
+ "sparc:sparclite_le",
+ 3,
+ false,
+ sparc_compatible,
+ bfd_default_scan,
+ &arch_info_struct[5],
+ },
+ {
64, /* bits in a word */
64, /* bits in an address */
8, /* bits in a byte */
@@ -107,7 +121,7 @@ static const bfd_arch_info_type arch_info_struct[] =
false,
sparc_compatible,
bfd_default_scan,
- &arch_info_struct[5],
+ &arch_info_struct[6],
},
{
64, /* bits in a word */
diff --git a/contrib/binutils/bfd/cpu-v850.c b/contrib/binutils/bfd/cpu-v850.c
index df97bc91ba0d..539413de0223 100644
--- a/contrib/binutils/bfd/cpu-v850.c
+++ b/contrib/binutils/bfd/cpu-v850.c
@@ -69,7 +69,8 @@ scan (info, string)
switch (number)
{
-
+ case bfd_mach_v850e: arch = bfd_arch_v850; break;
+ case bfd_mach_v850ea: arch = bfd_arch_v850; break;
default:
return false;
}
@@ -89,6 +90,14 @@ scan (info, string)
#define NEXT NULL
+static const bfd_arch_info_type arch_info_struct[] =
+{
+ N (bfd_mach_v850e, "v850e", false, &arch_info_struct[1]),
+ N (bfd_mach_v850ea, "v850ea", false, NULL)
+};
+
+#undef NEXT
+#define NEXT &arch_info_struct[0]
const bfd_arch_info_type bfd_v850_arch =
N (bfd_mach_v850, "v850", true, NEXT);
diff --git a/contrib/binutils/bfd/dep-in.sed b/contrib/binutils/bfd/dep-in.sed
index 444dde0c0199..9da181ab8fc1 100644
--- a/contrib/binutils/bfd/dep-in.sed
+++ b/contrib/binutils/bfd/dep-in.sed
@@ -7,7 +7,7 @@ s!\.o:!.lo:!
s! @BFD_H@!!g
s!@INCDIR@!$(INCDIR)!g
s!@SRCDIR@/!!g
-s!hosts/[^ ]*\.h ! !g
+s! hosts/[^ ]*\.h! !g
s/ sysdep.h//g
s! \.\./bfd/sysdep.h!!g
s/ libbfd.h//g
diff --git a/contrib/binutils/bfd/doc/ChangeLog b/contrib/binutils/bfd/doc/ChangeLog
index 871299ce068c..def932ccb2e6 100644
--- a/contrib/binutils/bfd/doc/ChangeLog
+++ b/contrib/binutils/bfd/doc/ChangeLog
@@ -1,3 +1,36 @@
+2000-04-30 Ben Elliston <bje@redhat.com>
+
+ * bfdint.texi (BFD generated files): Fix another typo.
+
+2000-04-17 Ben Elliston <bje@redhat.com>
+
+ * bfdint.texi (BFD_JUMP_TABLE macros): Fix typo.
+
+Thu Feb 4 23:21:36 1999 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in: Rebuild with current autoconf/automake.
+
+Thu Jul 23 09:36:44 1998 Nick Clifton <nickc@cygnus.com>
+
+ * bfdint.texi (BFD ELF processor required): Add paragraph
+ describing the necessity to create "include/elf/CPU.h".
+
+Thu May 7 14:45:43 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.am (chew.o): Add -I options for intl srcdir and
+ objdir.
+ * Makefile.in: Rebuild.
+
+Mon Apr 27 20:19:24 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * bfdint.texi: New file.
+ * Makefile.am (noinst_TEXINFOS): New variable.
+ * Makefile.in: Rebuild.
+
+Mon Apr 13 16:48:56 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in: Rebuild.
+
Mon Apr 6 14:06:55 1998 Ian Lance Taylor <ian@cygnus.com>
* Makefile.am (STAGESTUFF): Remove variable.
diff --git a/contrib/binutils/bfd/doc/Makefile.am b/contrib/binutils/bfd/doc/Makefile.am
index 7588273718c5..0d5268e9608c 100644
--- a/contrib/binutils/bfd/doc/Makefile.am
+++ b/contrib/binutils/bfd/doc/Makefile.am
@@ -51,7 +51,7 @@ $(MKDOC): chew.o
$(CC_FOR_BUILD) -o $(MKDOC) chew.o $(LOADLIBES) $(LDFLAGS)
chew.o: chew.c
- $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
+ $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
protos: libbfd.h libcoff.h bfd.h
@@ -239,6 +239,8 @@ bfd.h: $(srcdir)/../bfd-in.h \
echo "#endif" >>bfd.h
echo "#endif" >>bfd.h
+noinst_TEXINFOS = bfdint.texi
+
MOSTLYCLEANFILES = $(MKDOC) *.o
CLEANFILES = s-* *.p *.ip
diff --git a/contrib/binutils/bfd/doc/Makefile.in b/contrib/binutils/bfd/doc/Makefile.in
index cc1a092782cc..acdc9bf3de52 100644
--- a/contrib/binutils/bfd/doc/Makefile.in
+++ b/contrib/binutils/bfd/doc/Makefile.in
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.2e from Makefile.am
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -32,6 +32,8 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
+DESTDIR =
+
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -44,7 +46,7 @@ AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
@@ -62,30 +64,52 @@ host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
AR = @AR@
+AS = @AS@
BFD_HOST_64BIT_LONG = @BFD_HOST_64BIT_LONG@
BFD_HOST_64_BIT = @BFD_HOST_64_BIT@
BFD_HOST_64_BIT_DEFINED = @BFD_HOST_64_BIT_DEFINED@
BFD_HOST_U_64_BIT = @BFD_HOST_U_64_BIT@
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
CC = @CC@
CC_FOR_BUILD = @CC_FOR_BUILD@
COREFILE = @COREFILE@
COREFLAG = @COREFLAG@
+DATADIRNAME = @DATADIRNAME@
+DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
+GMOFILES = @GMOFILES@
+GMSGFMT = @GMSGFMT@
+GT_NO = @GT_NO@
+GT_YES = @GT_YES@
HDEFINES = @HDEFINES@
-LD = @LD@
+INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
+INSTOBJEXT = @INSTOBJEXT@
+INTLDEPS = @INTLDEPS@
+INTLLIBS = @INTLLIBS@
+INTLOBJS = @INTLOBJS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
-NM = @NM@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
+POFILES = @POFILES@
+POSUB = @POSUB@
RANLIB = @RANLIB@
TDEFINES = @TDEFINES@
+USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
+USE_NLS = @USE_NLS@
VERSION = @VERSION@
+WIN32LDFLAGS = @WIN32LDFLAGS@
+WIN32LIBADD = @WIN32LIBADD@
all_backends = @all_backends@
bfd_backends = @bfd_backends@
bfd_machines = @bfd_machines@
+l = @l@
tdefaults = @tdefaults@
wordsize = @wordsize@
@@ -97,12 +121,14 @@ DOCFILES = aoutx.texi archive.texi archures.texi \
opncls.texi reloc.texi section.texi \
syms.texi targets.texi init.texi hash.texi linker.texi
+
PROTOS = archive.p archures.p bfd.p \
core.p format.p \
libbfd.p opncls.p reloc.p \
section.p syms.p targets.p \
format.p core.p init.p
+
IPROTOS = cache.ip libbfd.ip reloc.ip init.ip archures.ip coffcode.ip
# SRCDOC, SRCPROT, SRCIPROT only used to sidestep Sun Make bug in interaction
@@ -118,6 +144,7 @@ SRCDOC = $(srcdir)/../aoutx.h $(srcdir)/../archive.c \
$(srcdir)/../syms.c $(srcdir)/../targets.c \
$(srcdir)/../hash.c $(srcdir)/../linker.c
+
SRCPROT = $(srcdir)/../archive.c $(srcdir)/../archures.c \
$(srcdir)/../bfd.c $(srcdir)/../coffcode.h $(srcdir)/../corefile.c \
$(srcdir)/../format.c $(srcdir)/../libbfd.c \
@@ -125,17 +152,21 @@ SRCPROT = $(srcdir)/../archive.c $(srcdir)/../archures.c \
$(srcdir)/../section.c $(srcdir)/../syms.c \
$(srcdir)/../targets.c $(srcdir)/../init.c
+
SRCIPROT = $(srcdir)/../cache.c $(srcdir)/../libbfd.c \
$(srcdir)/../reloc.c $(srcdir)/../cpu-h8300.c \
$(srcdir)/../cpu-i960.c $(srcdir)/../archures.c \
$(srcdir)/../init.c
+
TEXIDIR = $(srcdir)/../../texinfo/fsf
info_TEXINFOS = bfd.texinfo
MKDOC = chew$(EXEEXT_FOR_BUILD)
+noinst_TEXINFOS = bfdint.texi
+
MOSTLYCLEANFILES = $(MKDOC) *.o
CLEANFILES = s-* *.p *.ip
@@ -157,15 +188,14 @@ DIST_COMMON = ChangeLog Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
-GZIP = --best
-default: all
-
+GZIP_ENV = --best
+all: all-redirect
.SUFFIXES:
-.SUFFIXES: .dvi .info .ps .texi .texinfo
-$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+.SUFFIXES: .dvi .info .ps .texi .texinfo .txi
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --cygnus doc/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -181,7 +211,7 @@ DVIPS = dvips
$(MAKEINFO) -I $(srcdir) $<
.texi.dvi:
- TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
+ TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.texi:
@@ -197,28 +227,42 @@ DVIPS = dvips
$(MAKEINFO) -I $(srcdir) $<
.texinfo.dvi:
- TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
+ TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi.info:
+ @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+ $(MAKEINFO) -I $(srcdir) $<
+
+.txi.dvi:
+ TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \
+ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi:
+ @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+ $(MAKEINFO) -I $(srcdir) $<
.dvi.ps:
$(DVIPS) $< -o $@
install-info-am: $(INFO_DEPS)
@$(NORMAL_INSTALL)
- $(mkinstalldirs) $(infodir)
- @for file in $(INFO_DEPS); do \
+ $(mkinstalldirs) $(DESTDIR)$(infodir)
+ @list='$(INFO_DEPS)'; \
+ for file in $$list; do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
if test -f $$d/$$ifile; then \
- echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
- $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
+ echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
+ $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
else : ; fi; \
done; \
done
@$(POST_INSTALL)
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
- for file in $(INFO_DEPS); do \
- echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
- install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
+ list='$(INFO_DEPS)'; \
+ for file in $$list; do \
+ echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
+ install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
done; \
else : ; fi
@@ -227,17 +271,20 @@ uninstall-info:
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
ii=yes; \
else ii=; fi; \
- for file in $(INFO_DEPS); do \
+ list='$(INFO_DEPS)'; \
+ for file in $$list; do \
test -z "$ii" \
- || install-info --info-dir=$(infodir) --remove $$file; \
+ || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
done
- $(NORMAL_UNINSTALL)
- for file in $(INFO_DEPS); do \
- (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
+ @$(NORMAL_UNINSTALL)
+ list='$(INFO_DEPS)'; \
+ for file in $$list; do \
+ (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
done
dist-info: $(INFO_DEPS)
- for base in $(INFO_DEPS); do \
+ list='$(INFO_DEPS)'; \
+ for base in $$list; do \
if test -f $$base; then d=.; else d=$(srcdir); fi; \
for file in `cd $$d && eval echo $$base*`; do \
test -f $(distdir)/$$file \
@@ -274,32 +321,40 @@ subdir = doc
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
done
- $(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
-info: $(INFO_DEPS)
-dvi: $(DVIS)
-check:
- $(MAKE)
-installcheck:
+ $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
+info-am: $(INFO_DEPS)
+info: info-am
+dvi-am: $(DVIS)
+dvi: dvi-am
+check-am:
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-info-am:
install-info: install-info-am
-install-exec:
- @$(NORMAL_INSTALL)
-
-install-data:
- @$(NORMAL_INSTALL)
-
-install: install-exec install-data all
- @:
-
-uninstall:
-
-all: Makefile
-
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am:
+uninstall: uninstall-am
+all-am: Makefile
+all-redirect: all-am
install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
@@ -310,39 +365,47 @@ clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean: mostlyclean-aminfo mostlyclean-generic
+mostlyclean-am: mostlyclean-aminfo mostlyclean-generic
+
+mostlyclean: mostlyclean-am
-clean: clean-aminfo clean-generic mostlyclean
+clean-am: clean-aminfo clean-generic mostlyclean-am
-distclean: distclean-aminfo distclean-generic clean
- -rm -f config.status
+clean: clean-am
+
+distclean-am: distclean-aminfo distclean-generic clean-am
-rm -f libtool
-maintainer-clean: maintainer-clean-aminfo maintainer-clean-generic \
- distclean
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-aminfo maintainer-clean-generic \
+ distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
-.PHONY: default install-info-am uninstall-info mostlyclean-aminfo \
-distclean-aminfo clean-aminfo maintainer-clean-aminfo tags distdir info \
-dvi installcheck install-info install-exec install-data install \
-uninstall all installdirs mostlyclean-generic distclean-generic \
-clean-generic maintainer-clean-generic clean mostlyclean distclean \
-maintainer-clean
+maintainer-clean: maintainer-clean-am
+
+.PHONY: install-info-am uninstall-info mostlyclean-aminfo \
+distclean-aminfo clean-aminfo maintainer-clean-aminfo tags distdir \
+info-am info dvi-am dvi check check-am installcheck-am installcheck \
+install-info-am install-info install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
$(MKDOC): chew.o
$(CC_FOR_BUILD) -o $(MKDOC) chew.o $(LOADLIBES) $(LDFLAGS)
chew.o: chew.c
- $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
+ $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
protos: libbfd.h libcoff.h bfd.h
diff --git a/contrib/binutils/bfd/doc/bfd.texinfo b/contrib/binutils/bfd/doc/bfd.texinfo
index dc0f96cc9da1..a302bcf82991 100644
--- a/contrib/binutils/bfd/doc/bfd.texinfo
+++ b/contrib/binutils/bfd/doc/bfd.texinfo
@@ -1,6 +1,6 @@
\input texinfo.tex
@setfilename bfd.info
-@c $Id: bfd.texinfo,v 1.29 1997/07/22 18:47:29 ian Exp $
+@c $Id: bfd.texinfo,v 1.1.1.1 1999/05/03 07:28:58 rth Exp $
@tex
% NOTE LOCAL KLUGE TO AVOID TOO MUCH WHITESPACE
\global\long\def\example{%
@@ -67,7 +67,7 @@ into another language, under the above conditions for modified versions.
@tex
\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$
-\xdef\manvers{\$Revision: 1.29 $} % For use in headers, footers too
+\xdef\manvers{\$Revision: 1.1.1.1 $} % For use in headers, footers too
{\parskip=0pt
\hfill Cygnus Support\par
\hfill sac\@cygnus.com\par
diff --git a/contrib/binutils/bfd/doc/bfdint.texi b/contrib/binutils/bfd/doc/bfdint.texi
new file mode 100644
index 000000000000..39eaacfeaec1
--- /dev/null
+++ b/contrib/binutils/bfd/doc/bfdint.texi
@@ -0,0 +1,1885 @@
+\input texinfo
+@setfilename bfdint.info
+
+@settitle BFD Internals
+@iftex
+@titlepage
+@title{BFD Internals}
+@author{Ian Lance Taylor}
+@author{Cygnus Solutions}
+@page
+@end iftex
+
+@node Top
+@top BFD Internals
+@raisesections
+@cindex bfd internals
+
+This document describes some BFD internal information which may be
+helpful when working on BFD. It is very incomplete.
+
+This document is not updated regularly, and may be out of date. It was
+last modified on $Date: 2000/04/30 15:07:52 $.
+
+The initial version of this document was written by Ian Lance Taylor
+@email{ian@@cygnus.com}.
+
+@menu
+* BFD overview:: BFD overview
+* BFD guidelines:: BFD programming guidelines
+* BFD target vector:: BFD target vector
+* BFD generated files:: BFD generated files
+* BFD multiple compilations:: Files compiled multiple times in BFD
+* BFD relocation handling:: BFD relocation handling
+* BFD ELF support:: BFD ELF support
+* BFD glossary:: Glossary
+* Index:: Index
+@end menu
+
+@node BFD overview
+@section BFD overview
+
+BFD is a library which provides a single interface to read and write
+object files, executables, archive files, and core files in any format.
+
+@menu
+* BFD library interfaces:: BFD library interfaces
+* BFD library users:: BFD library users
+* BFD view:: The BFD view of a file
+* BFD blindness:: BFD loses information
+@end menu
+
+@node BFD library interfaces
+@subsection BFD library interfaces
+
+One way to look at the BFD library is to divide it into four parts by
+type of interface.
+
+The first interface is the set of generic functions which programs using
+the BFD library will call. These generic function normally translate
+directly or indirectly into calls to routines which are specific to a
+particular object file format. Many of these generic functions are
+actually defined as macros in @file{bfd.h}. These functions comprise
+the official BFD interface.
+
+The second interface is the set of functions which appear in the target
+vectors. This is the bulk of the code in BFD. A target vector is a set
+of function pointers specific to a particular object file format. The
+target vector is used to implement the generic BFD functions. These
+functions are always called through the target vector, and are never
+called directly. The target vector is described in detail in @ref{BFD
+target vector}. The set of functions which appear in a particular
+target vector is often referred to as a BFD backend.
+
+The third interface is a set of oddball functions which are typically
+specific to a particular object file format, are not generic functions,
+and are called from outside of the BFD library. These are used as hooks
+by the linker and the assembler when a particular object file format
+requires some action which the BFD generic interface does not provide.
+These functions are typically declared in @file{bfd.h}, but in many
+cases they are only provided when BFD is configured with support for a
+particular object file format. These functions live in a grey area, and
+are not really part of the official BFD interface.
+
+The fourth interface is the set of BFD support functions which are
+called by the other BFD functions. These manage issues like memory
+allocation, error handling, file access, hash tables, swapping, and the
+like. These functions are never called from outside of the BFD library.
+
+@node BFD library users
+@subsection BFD library users
+
+Another way to look at the BFD library is to divide it into three parts
+by the manner in which it is used.
+
+The first use is to read an object file. The object file readers are
+programs like @samp{gdb}, @samp{nm}, @samp{objdump}, and @samp{objcopy}.
+These programs use BFD to view an object file in a generic form. The
+official BFD interface is normally fully adequate for these programs.
+
+The second use is to write an object file. The object file writers are
+programs like @samp{gas} and @samp{objcopy}. These programs use BFD to
+create an object file. The official BFD interface is normally adequate
+for these programs, but for some object file formats the assembler needs
+some additional hooks in order to set particular flags or other
+information. The official BFD interface includes functions to copy
+private information from one object file to another, and these functions
+are used by @samp{objcopy} to avoid information loss.
+
+The third use is to link object files. There is only one object file
+linker, @samp{ld}. Originally, @samp{ld} was an object file reader and
+an object file writer, and it did the link operation using the generic
+BFD structures. However, this turned out to be too slow and too memory
+intensive.
+
+The official BFD linker functions were written to permit specific BFD
+backends to perform the link without translating through the generic
+structures, in the normal case where all the input files and output file
+have the same object file format. Not all of the backends currently
+implement the new interface, and there are default linking functions
+within BFD which use the generic structures and which work with all
+backends.
+
+For several object file formats the linker needs additional hooks which
+are not provided by the official BFD interface, particularly for dynamic
+linking support. These functions are typically called from the linker
+emulation template.
+
+@node BFD view
+@subsection The BFD view of a file
+
+BFD uses generic structures to manage information. It translates data
+into the generic form when reading files, and out of the generic form
+when writing files.
+
+BFD describes a file as a pointer to the @samp{bfd} type. A @samp{bfd}
+is composed of the following elements. The BFD information can be
+displayed using the @samp{objdump} program with various options.
+
+@table @asis
+@item general information
+The object file format, a few general flags, the start address.
+@item architecture
+The architecture, including both a general processor type (m68k, MIPS
+etc.) and a specific machine number (m68000, R4000, etc.).
+@item sections
+A list of sections.
+@item symbols
+A symbol table.
+@end table
+
+BFD represents a section as a pointer to the @samp{asection} type. Each
+section has a name and a size. Most sections also have an associated
+block of data, known as the section contents. Sections also have
+associated flags, a virtual memory address, a load memory address, a
+required alignment, a list of relocations, and other miscellaneous
+information.
+
+BFD represents a relocation as a pointer to the @samp{arelent} type. A
+relocation describes an action which the linker must take to modify the
+section contents. Relocations have a symbol, an address, an addend, and
+a pointer to a howto structure which describes how to perform the
+relocation. For more information, see @ref{BFD relocation handling}.
+
+BFD represents a symbol as a pointer to the @samp{asymbol} type. A
+symbol has a name, a pointer to a section, an offset within that
+section, and some flags.
+
+Archive files do not have any sections or symbols. Instead, BFD
+represents an archive file as a file which contains a list of
+@samp{bfd}s. BFD also provides access to the archive symbol map, as a
+list of symbol names. BFD provides a function to return the @samp{bfd}
+within the archive which corresponds to a particular entry in the
+archive symbol map.
+
+@node BFD blindness
+@subsection BFD loses information
+
+Most object file formats have information which BFD can not represent in
+its generic form, at least as currently defined.
+
+There is often explicit information which BFD can not represent. For
+example, the COFF version stamp, or the ELF program segments. BFD
+provides special hooks to handle this information when copying,
+printing, or linking an object file. The BFD support for a particular
+object file format will normally store this information in private data
+and handle it using the special hooks.
+
+In some cases there is also implicit information which BFD can not
+represent. For example, the MIPS processor distinguishes small and
+large symbols, and requires that all small symbls be within 32K of the
+GP register. This means that the MIPS assembler must be able to mark
+variables as either small or large, and the MIPS linker must know to put
+small symbols within range of the GP register. Since BFD can not
+represent this information, this means that the assembler and linker
+must have information that is specific to a particular object file
+format which is outside of the BFD library.
+
+This loss of information indicates areas where the BFD paradigm breaks
+down. It is not actually possible to represent the myriad differences
+among object file formats using a single generic interface, at least not
+in the manner which BFD does it today.
+
+Nevertheless, the BFD library does greatly simplify the task of dealing
+with object files, and particular problems caused by information loss
+can normally be solved using some sort of relatively constrained hook
+into the library.
+
+
+
+@node BFD guidelines
+@section BFD programming guidelines
+@cindex bfd programming guidelines
+@cindex programming guidelines for bfd
+@cindex guidelines, bfd programming
+
+There is a lot of poorly written and confusing code in BFD. New BFD
+code should be written to a higher standard. Merely because some BFD
+code is written in a particular manner does not mean that you should
+emulate it.
+
+Here are some general BFD programming guidelines:
+
+@itemize @bullet
+@item
+Follow the GNU coding standards.
+
+@item
+Avoid global variables. We ideally want BFD to be fully reentrant, so
+that it can be used in multiple threads. All uses of global or static
+variables interfere with that. Initialized constant variables are OK,
+and they should be explicitly marked with const. Instead of global
+variables, use data attached to a BFD or to a linker hash table.
+
+@item
+All externally visible functions should have names which start with
+@samp{bfd_}. All such functions should be declared in some header file,
+typically @file{bfd.h}. See, for example, the various declarations near
+the end of @file{bfd-in.h}, which mostly declare functions required by
+specific linker emulations.
+
+@item
+All functions which need to be visible from one file to another within
+BFD, but should not be visible outside of BFD, should start with
+@samp{_bfd_}. Although external names beginning with @samp{_} are
+prohibited by the ANSI standard, in practice this usage will always
+work, and it is required by the GNU coding standards.
+
+@item
+Always remember that people can compile using @samp{--enable-targets} to
+build several, or all, targets at once. It must be possible to link
+together the files for all targets.
+
+@item
+BFD code should compile with few or no warnings using @samp{gcc -Wall}.
+Some warnings are OK, like the absence of certain function declarations
+which may or may not be declared in system header files. Warnings about
+ambiguous expressions and the like should always be fixed.
+@end itemize
+
+@node BFD target vector
+@section BFD target vector
+@cindex bfd target vector
+@cindex target vector in bfd
+
+BFD supports multiple object file formats by using the @dfn{target
+vector}. This is simply a set of function pointers which implement
+behaviour that is specific to a particular object file format.
+
+In this section I list all of the entries in the target vector and
+describe what they do.
+
+@menu
+* BFD target vector miscellaneous:: Miscellaneous constants
+* BFD target vector swap:: Swapping functions
+* BFD target vector format:: Format type dependent functions
+* BFD_JUMP_TABLE macros:: BFD_JUMP_TABLE macros
+* BFD target vector generic:: Generic functions
+* BFD target vector copy:: Copy functions
+* BFD target vector core:: Core file support functions
+* BFD target vector archive:: Archive functions
+* BFD target vector symbols:: Symbol table functions
+* BFD target vector relocs:: Relocation support
+* BFD target vector write:: Output functions
+* BFD target vector link:: Linker functions
+* BFD target vector dynamic:: Dynamic linking information functions
+@end menu
+
+@node BFD target vector miscellaneous
+@subsection Miscellaneous constants
+
+The target vector starts with a set of constants.
+
+@table @samp
+@item name
+The name of the target vector. This is an arbitrary string. This is
+how the target vector is named in command line options for tools which
+use BFD, such as the @samp{-oformat} linker option.
+
+@item flavour
+A general description of the type of target. The following flavours are
+currently defined:
+
+@table @samp
+@item bfd_target_unknown_flavour
+Undefined or unknown.
+@item bfd_target_aout_flavour
+a.out.
+@item bfd_target_coff_flavour
+COFF.
+@item bfd_target_ecoff_flavour
+ECOFF.
+@item bfd_target_elf_flavour
+ELF.
+@item bfd_target_ieee_flavour
+IEEE-695.
+@item bfd_target_nlm_flavour
+NLM.
+@item bfd_target_oasys_flavour
+OASYS.
+@item bfd_target_tekhex_flavour
+Tektronix hex format.
+@item bfd_target_srec_flavour
+Motorola S-record format.
+@item bfd_target_ihex_flavour
+Intel hex format.
+@item bfd_target_som_flavour
+SOM (used on HP/UX).
+@item bfd_target_os9k_flavour
+os9000.
+@item bfd_target_versados_flavour
+VERSAdos.
+@item bfd_target_msdos_flavour
+MS-DOS.
+@item bfd_target_evax_flavour
+openVMS.
+@end table
+
+@item byteorder
+The byte order of data in the object file. One of
+@samp{BFD_ENDIAN_BIG}, @samp{BFD_ENDIAN_LITTLE}, or
+@samp{BFD_ENDIAN_UNKNOWN}. The latter would be used for a format such
+as S-records which do not record the architecture of the data.
+
+@item header_byteorder
+The byte order of header information in the object file. Normally the
+same as the @samp{byteorder} field, but there are certain cases where it
+may be different.
+
+@item object_flags
+Flags which may appear in the @samp{flags} field of a BFD with this
+format.
+
+@item section_flags
+Flags which may appear in the @samp{flags} field of a section within a
+BFD with this format.
+
+@item symbol_leading_char
+A character which the C compiler normally puts before a symbol. For
+example, an a.out compiler will typically generate the symbol
+@samp{_foo} for a function named @samp{foo} in the C source, in which
+case this field would be @samp{_}. If there is no such character, this
+field will be @samp{0}.
+
+@item ar_pad_char
+The padding character to use at the end of an archive name. Normally
+@samp{/}.
+
+@item ar_max_namelen
+The maximum length of a short name in an archive. Normally @samp{14}.
+
+@item backend_data
+A pointer to constant backend data. This is used by backends to store
+whatever additional information they need to distinguish similar target
+vectors which use the same sets of functions.
+@end table
+
+@node BFD target vector swap
+@subsection Swapping functions
+
+Every target vector has fuction pointers used for swapping information
+in and out of the target representation. There are two sets of
+functions: one for data information, and one for header information.
+Each set has three sizes: 64-bit, 32-bit, and 16-bit. Each size has
+three actual functions: put, get unsigned, and get signed.
+
+These 18 functions are used to convert data between the host and target
+representations.
+
+@node BFD target vector format
+@subsection Format type dependent functions
+
+Every target vector has three arrays of function pointers which are
+indexed by the BFD format type. The BFD format types are as follows:
+
+@table @samp
+@item bfd_unknown
+Unknown format. Not used for anything useful.
+@item bfd_object
+Object file.
+@item bfd_archive
+Archive file.
+@item bfd_core
+Core file.
+@end table
+
+The three arrays of function pointers are as follows:
+
+@table @samp
+@item bfd_check_format
+Check whether the BFD is of a particular format (object file, archive
+file, or core file) corresponding to this target vector. This is called
+by the @samp{bfd_check_format} function when examining an existing BFD.
+If the BFD matches the desired format, this function will initialize any
+format specific information such as the @samp{tdata} field of the BFD.
+This function must be called before any other BFD target vector function
+on a file opened for reading.
+
+@item bfd_set_format
+Set the format of a BFD which was created for output. This is called by
+the @samp{bfd_set_format} function after creating the BFD with a
+function such as @samp{bfd_openw}. This function will initialize format
+specific information required to write out an object file or whatever of
+the given format. This function must be called before any other BFD
+target vector function on a file opened for writing.
+
+@item bfd_write_contents
+Write out the contents of the BFD in the given format. This is called
+by @samp{bfd_close} function for a BFD opened for writing. This really
+should not be an array selected by format type, as the
+@samp{bfd_set_format} function provides all the required information.
+In fact, BFD will fail if a different format is used when calling
+through the @samp{bfd_set_format} and the @samp{bfd_write_contents}
+arrays; fortunately, since @samp{bfd_close} gets it right, this is a
+difficult error to make.
+@end table
+
+@node BFD_JUMP_TABLE macros
+@subsection @samp{BFD_JUMP_TABLE} macros
+@cindex @samp{BFD_JUMP_TABLE}
+
+Most target vectors are defined using @samp{BFD_JUMP_TABLE} macros.
+These macros take a single argument, which is a prefix applied to a set
+of functions. The macros are then used to initialize the fields in the
+target vector.
+
+For example, the @samp{BFD_JUMP_TABLE_RELOCS} macro defines three
+functions: @samp{_get_reloc_upper_bound}, @samp{_canonicalize_reloc},
+and @samp{_bfd_reloc_type_lookup}. A reference like
+@samp{BFD_JUMP_TABLE_RELOCS (foo)} will expand into three functions
+prefixed with @samp{foo}: @samp{foo_get_reloc_upper_bound}, etc. The
+@samp{BFD_JUMP_TABLE_RELOCS} macro will be placed such that those three
+functions initialize the appropriate fields in the BFD target vector.
+
+This is done because it turns out that many different target vectors can
+share certain classes of functions. For example, archives are similar
+on most platforms, so most target vectors can use the same archive
+functions. Those target vectors all use @samp{BFD_JUMP_TABLE_ARCHIVE}
+with the same argument, calling a set of functions which is defined in
+@file{archive.c}.
+
+Each of the @samp{BFD_JUMP_TABLE} macros is mentioned below along with
+the description of the function pointers which it defines. The function
+pointers will be described using the name without the prefix which the
+@samp{BFD_JUMP_TABLE} macro defines. This name is normally the same as
+the name of the field in the target vector structure. Any differences
+will be noted.
+
+@node BFD target vector generic
+@subsection Generic functions
+@cindex @samp{BFD_JUMP_TABLE_GENERIC}
+
+The @samp{BFD_JUMP_TABLE_GENERIC} macro is used for some catch all
+functions which don't easily fit into other categories.
+
+@table @samp
+@item _close_and_cleanup
+Free any target specific information associated with the BFD. This is
+called when any BFD is closed (the @samp{bfd_write_contents} function
+mentioned earlier is only called for a BFD opened for writing). Most
+targets use @samp{bfd_alloc} to allocate all target specific
+information, and therefore don't have to do anything in this function.
+This function pointer is typically set to
+@samp{_bfd_generic_close_and_cleanup}, which simply returns true.
+
+@item _bfd_free_cached_info
+Free any cached information associated with the BFD which can be
+recreated later if necessary. This is used to reduce the memory
+consumption required by programs using BFD. This is normally called via
+the @samp{bfd_free_cached_info} macro. It is used by the default
+archive routines when computing the archive map. Most targets do not
+do anything special for this entry point, and just set it to
+@samp{_bfd_generic_free_cached_info}, which simply returns true.
+
+@item _new_section_hook
+This is called from @samp{bfd_make_section_anyway} whenever a new
+section is created. Most targets use it to initialize section specific
+information. This function is called whether or not the section
+corresponds to an actual section in an actual BFD.
+
+@item _get_section_contents
+Get the contents of a section. This is called from
+@samp{bfd_get_section_contents}. Most targets set this to
+@samp{_bfd_generic_get_section_contents}, which does a @samp{bfd_seek}
+based on the section's @samp{filepos} field and a @samp{bfd_read}. The
+corresponding field in the target vector is named
+@samp{_bfd_get_section_contents}.
+
+@item _get_section_contents_in_window
+Set a @samp{bfd_window} to hold the contents of a section. This is
+called from @samp{bfd_get_section_contents_in_window}. The
+@samp{bfd_window} idea never really caught on, and I don't think this is
+ever called. Pretty much all targets implement this as
+@samp{bfd_generic_get_section_contents_in_window}, which uses
+@samp{bfd_get_section_contents} to do the right thing. The
+corresponding field in the target vector is named
+@samp{_bfd_get_section_contents_in_window}.
+@end table
+
+@node BFD target vector copy
+@subsection Copy functions
+@cindex @samp{BFD_JUMP_TABLE_COPY}
+
+The @samp{BFD_JUMP_TABLE_COPY} macro is used for functions which are
+called when copying BFDs, and for a couple of functions which deal with
+internal BFD information.
+
+@table @samp
+@item _bfd_copy_private_bfd_data
+This is called when copying a BFD, via @samp{bfd_copy_private_bfd_data}.
+If the input and output BFDs have the same format, this will copy any
+private information over. This is called after all the section contents
+have been written to the output file. Only a few targets do anything in
+this function.
+
+@item _bfd_merge_private_bfd_data
+This is called when linking, via @samp{bfd_merge_private_bfd_data}. It
+gives the backend linker code a chance to set any special flags in the
+output file based on the contents of the input file. Only a few targets
+do anything in this function.
+
+@item _bfd_copy_private_section_data
+This is similar to @samp{_bfd_copy_private_bfd_data}, but it is called
+for each section, via @samp{bfd_copy_private_section_data}. This
+function is called before any section contents have been written. Only
+a few targets do anything in this function.
+
+@item _bfd_copy_private_symbol_data
+This is called via @samp{bfd_copy_private_symbol_data}, but I don't
+think anything actually calls it. If it were defined, it could be used
+to copy private symbol data from one BFD to another. However, most BFDs
+store extra symbol information by allocating space which is larger than
+the @samp{asymbol} structure and storing private information in the
+extra space. Since @samp{objcopy} and other programs copy symbol
+information by copying pointers to @samp{asymbol} structures, the
+private symbol information is automatically copied as well. Most
+targets do not do anything in this function.
+
+@item _bfd_set_private_flags
+This is called via @samp{bfd_set_private_flags}. It is basically a hook
+for the assembler to set magic information. For example, the PowerPC
+ELF assembler uses it to set flags which appear in the e_flags field of
+the ELF header. Most targets do not do anything in this function.
+
+@item _bfd_print_private_bfd_data
+This is called by @samp{objdump} when the @samp{-p} option is used. It
+is called via @samp{bfd_print_private_data}. It prints any interesting
+information about the BFD which can not be otherwise represented by BFD
+and thus can not be printed by @samp{objdump}. Most targets do not do
+anything in this function.
+@end table
+
+@node BFD target vector core
+@subsection Core file support functions
+@cindex @samp{BFD_JUMP_TABLE_CORE}
+
+The @samp{BFD_JUMP_TABLE_CORE} macro is used for functions which deal
+with core files. Obviously, these functions only do something
+interesting for targets which have core file support.
+
+@table @samp
+@item _core_file_failing_command
+Given a core file, this returns the command which was run to produce the
+core file.
+
+@item _core_file_failing_signal
+Given a core file, this returns the signal number which produced the
+core file.
+
+@item _core_file_matches_executable_p
+Given a core file and a BFD for an executable, this returns whether the
+core file was generated by the executable.
+@end table
+
+@node BFD target vector archive
+@subsection Archive functions
+@cindex @samp{BFD_JUMP_TABLE_ARCHIVE}
+
+The @samp{BFD_JUMP_TABLE_ARCHIVE} macro is used for functions which deal
+with archive files. Most targets use COFF style archive files
+(including ELF targets), and these use @samp{_bfd_archive_coff} as the
+argument to @samp{BFD_JUMP_TABLE_ARCHIVE}. Some targets use BSD/a.out
+style archives, and these use @samp{_bfd_archive_bsd}. (The main
+difference between BSD and COFF archives is the format of the archive
+symbol table). Targets with no archive support use
+@samp{_bfd_noarchive}. Finally, a few targets have unusual archive
+handling.
+
+@table @samp
+@item _slurp_armap
+Read in the archive symbol table, storing it in private BFD data. This
+is normally called from the archive @samp{check_format} routine. The
+corresponding field in the target vector is named
+@samp{_bfd_slurp_armap}.
+
+@item _slurp_extended_name_table
+Read in the extended name table from the archive, if there is one,
+storing it in private BFD data. This is normally called from the
+archive @samp{check_format} routine. The corresponding field in the
+target vector is named @samp{_bfd_slurp_extended_name_table}.
+
+@item construct_extended_name_table
+Build and return an extended name table if one is needed to write out
+the archive. This also adjusts the archive headers to refer to the
+extended name table appropriately. This is normally called from the
+archive @samp{write_contents} routine. The corresponding field in the
+target vector is named @samp{_bfd_construct_extended_name_table}.
+
+@item _truncate_arname
+This copies a file name into an archive header, truncating it as
+required. It is normally called from the archive @samp{write_contents}
+routine. This function is more interesting in targets which do not
+support extended name tables, but I think the GNU @samp{ar} program
+always uses extended name tables anyhow. The corresponding field in the
+target vector is named @samp{_bfd_truncate_arname}.
+
+@item _write_armap
+Write out the archive symbol table using calls to @samp{bfd_write}.
+This is normally called from the archive @samp{write_contents} routine.
+The corresponding field in the target vector is named @samp{write_armap}
+(no leading underscore).
+
+@item _read_ar_hdr
+Read and parse an archive header. This handles expanding the archive
+header name into the real file name using the extended name table. This
+is called by routines which read the archive symbol table or the archive
+itself. The corresponding field in the target vector is named
+@samp{_bfd_read_ar_hdr_fn}.
+
+@item _openr_next_archived_file
+Given an archive and a BFD representing a file stored within the
+archive, return a BFD for the next file in the archive. This is called
+via @samp{bfd_openr_next_archived_file}. The corresponding field in the
+target vector is named @samp{openr_next_archived_file} (no leading
+underscore).
+
+@item _get_elt_at_index
+Given an archive and an index, return a BFD for the file in the archive
+corresponding to that entry in the archive symbol table. This is called
+via @samp{bfd_get_elt_at_index}. The corresponding field in the target
+vector is named @samp{_bfd_get_elt_at_index}.
+
+@item _generic_stat_arch_elt
+Do a stat on an element of an archive, returning information read from
+the archive header (modification time, uid, gid, file mode, size). This
+is called via @samp{bfd_stat_arch_elt}. The corresponding field in the
+target vector is named @samp{_bfd_stat_arch_elt}.
+
+@item _update_armap_timestamp
+After the entire contents of an archive have been written out, update
+the timestamp of the archive symbol table to be newer than that of the
+file. This is required for a.out style archives. This is normally
+called by the archive @samp{write_contents} routine. The corresponding
+field in the target vector is named @samp{_bfd_update_armap_timestamp}.
+@end table
+
+@node BFD target vector symbols
+@subsection Symbol table functions
+@cindex @samp{BFD_JUMP_TABLE_SYMBOLS}
+
+The @samp{BFD_JUMP_TABLE_SYMBOLS} macro is used for functions which deal
+with symbols.
+
+@table @samp
+@item _get_symtab_upper_bound
+Return a sensible upper bound on the amount of memory which will be
+required to read the symbol table. In practice most targets return the
+amount of memory required to hold @samp{asymbol} pointers for all the
+symbols plus a trailing @samp{NULL} entry, and store the actual symbol
+information in BFD private data. This is called via
+@samp{bfd_get_symtab_upper_bound}. The corresponding field in the
+target vector is named @samp{_bfd_get_symtab_upper_bound}.
+
+@item _get_symtab
+Read in the symbol table. This is called via
+@samp{bfd_canonicalize_symtab}. The corresponding field in the target
+vector is named @samp{_bfd_canonicalize_symtab}.
+
+@item _make_empty_symbol
+Create an empty symbol for the BFD. This is needed because most targets
+store extra information with each symbol by allocating a structure
+larger than an @samp{asymbol} and storing the extra information at the
+end. This function will allocate the right amount of memory, and return
+what looks like a pointer to an empty @samp{asymbol}. This is called
+via @samp{bfd_make_empty_symbol}. The corresponding field in the target
+vector is named @samp{_bfd_make_empty_symbol}.
+
+@item _print_symbol
+Print information about the symbol. This is called via
+@samp{bfd_print_symbol}. One of the arguments indicates what sort of
+information should be printed:
+
+@table @samp
+@item bfd_print_symbol_name
+Just print the symbol name.
+@item bfd_print_symbol_more
+Print the symbol name and some interesting flags. I don't think
+anything actually uses this.
+@item bfd_print_symbol_all
+Print all information about the symbol. This is used by @samp{objdump}
+when run with the @samp{-t} option.
+@end table
+The corresponding field in the target vector is named
+@samp{_bfd_print_symbol}.
+
+@item _get_symbol_info
+Return a standard set of information about the symbol. This is called
+via @samp{bfd_symbol_info}. The corresponding field in the target
+vector is named @samp{_bfd_get_symbol_info}.
+
+@item _bfd_is_local_label_name
+Return whether the given string would normally represent the name of a
+local label. This is called via @samp{bfd_is_local_label} and
+@samp{bfd_is_local_label_name}. Local labels are normally discarded by
+the assembler. In the linker, this defines the difference between the
+@samp{-x} and @samp{-X} options.
+
+@item _get_lineno
+Return line number information for a symbol. This is only meaningful
+for a COFF target. This is called when writing out COFF line numbers.
+
+@item _find_nearest_line
+Given an address within a section, use the debugging information to find
+the matching file name, function name, and line number, if any. This is
+called via @samp{bfd_find_nearest_line}. The corresponding field in the
+target vector is named @samp{_bfd_find_nearest_line}.
+
+@item _bfd_make_debug_symbol
+Make a debugging symbol. This is only meaningful for a COFF target,
+where it simply returns a symbol which will be placed in the
+@samp{N_DEBUG} section when it is written out. This is called via
+@samp{bfd_make_debug_symbol}.
+
+@item _read_minisymbols
+Minisymbols are used to reduce the memory requirements of programs like
+@samp{nm}. A minisymbol is a cookie pointing to internal symbol
+information which the caller can use to extract complete symbol
+information. This permits BFD to not convert all the symbols into
+generic form, but to instead convert them one at a time. This is called
+via @samp{bfd_read_minisymbols}. Most targets do not implement this,
+and just use generic support which is based on using standard
+@samp{asymbol} structures.
+
+@item _minisymbol_to_symbol
+Convert a minisymbol to a standard @samp{asymbol}. This is called via
+@samp{bfd_minisymbol_to_symbol}.
+@end table
+
+@node BFD target vector relocs
+@subsection Relocation support
+@cindex @samp{BFD_JUMP_TABLE_RELOCS}
+
+The @samp{BFD_JUMP_TABLE_RELOCS} macro is used for functions which deal
+with relocations.
+
+@table @samp
+@item _get_reloc_upper_bound
+Return a sensible upper bound on the amount of memory which will be
+required to read the relocations for a section. In practice most
+targets return the amount of memory required to hold @samp{arelent}
+pointers for all the relocations plus a trailing @samp{NULL} entry, and
+store the actual relocation information in BFD private data. This is
+called via @samp{bfd_get_reloc_upper_bound}.
+
+@item _canonicalize_reloc
+Return the relocation information for a section. This is called via
+@samp{bfd_canonicalize_reloc}. The corresponding field in the target
+vector is named @samp{_bfd_canonicalize_reloc}.
+
+@item _bfd_reloc_type_lookup
+Given a relocation code, return the corresponding howto structure
+(@pxref{BFD relocation codes}). This is called via
+@samp{bfd_reloc_type_lookup}. The corresponding field in the target
+vector is named @samp{reloc_type_lookup}.
+@end table
+
+@node BFD target vector write
+@subsection Output functions
+@cindex @samp{BFD_JUMP_TABLE_WRITE}
+
+The @samp{BFD_JUMP_TABLE_WRITE} macro is used for functions which deal
+with writing out a BFD.
+
+@table @samp
+@item _set_arch_mach
+Set the architecture and machine number for a BFD. This is called via
+@samp{bfd_set_arch_mach}. Most targets implement this by calling
+@samp{bfd_default_set_arch_mach}. The corresponding field in the target
+vector is named @samp{_bfd_set_arch_mach}.
+
+@item _set_section_contents
+Write out the contents of a section. This is called via
+@samp{bfd_set_section_contents}. The corresponding field in the target
+vector is named @samp{_bfd_set_section_contents}.
+@end table
+
+@node BFD target vector link
+@subsection Linker functions
+@cindex @samp{BFD_JUMP_TABLE_LINK}
+
+The @samp{BFD_JUMP_TABLE_LINK} macro is used for functions called by the
+linker.
+
+@table @samp
+@item _sizeof_headers
+Return the size of the header information required for a BFD. This is
+used to implement the @samp{SIZEOF_HEADERS} linker script function. It
+is normally used to align the first section at an efficient position on
+the page. This is called via @samp{bfd_sizeof_headers}. The
+corresponding field in the target vector is named
+@samp{_bfd_sizeof_headers}.
+
+@item _bfd_get_relocated_section_contents
+Read the contents of a section and apply the relocation information.
+This handles both a final link and a relocateable link; in the latter
+case, it adjust the relocation information as well. This is called via
+@samp{bfd_get_relocated_section_contents}. Most targets implement it by
+calling @samp{bfd_generic_get_relocated_section_contents}.
+
+@item _bfd_relax_section
+Try to use relaxation to shrink the size of a section. This is called
+by the linker when the @samp{-relax} option is used. This is called via
+@samp{bfd_relax_section}. Most targets do not support any sort of
+relaxation.
+
+@item _bfd_link_hash_table_create
+Create the symbol hash table to use for the linker. This linker hook
+permits the backend to control the size and information of the elements
+in the linker symbol hash table. This is called via
+@samp{bfd_link_hash_table_create}.
+
+@item _bfd_link_add_symbols
+Given an object file or an archive, add all symbols into the linker
+symbol hash table. Use callbacks to the linker to include archive
+elements in the link. This is called via @samp{bfd_link_add_symbols}.
+
+@item _bfd_final_link
+Finish the linking process. The linker calls this hook after all of the
+input files have been read, when it is ready to finish the link and
+generate the output file. This is called via @samp{bfd_final_link}.
+
+@item _bfd_link_split_section
+I don't know what this is for. Nothing seems to call it. The only
+non-trivial definition is in @file{som.c}.
+@end table
+
+@node BFD target vector dynamic
+@subsection Dynamic linking information functions
+@cindex @samp{BFD_JUMP_TABLE_DYNAMIC}
+
+The @samp{BFD_JUMP_TABLE_DYNAMIC} macro is used for functions which read
+dynamic linking information.
+
+@table @samp
+@item _get_dynamic_symtab_upper_bound
+Return a sensible upper bound on the amount of memory which will be
+required to read the dynamic symbol table. In practice most targets
+return the amount of memory required to hold @samp{asymbol} pointers for
+all the symbols plus a trailing @samp{NULL} entry, and store the actual
+symbol information in BFD private data. This is called via
+@samp{bfd_get_dynamic_symtab_upper_bound}. The corresponding field in
+the target vector is named @samp{_bfd_get_dynamic_symtab_upper_bound}.
+
+@item _canonicalize_dynamic_symtab
+Read the dynamic symbol table. This is called via
+@samp{bfd_canonicalize_dynamic_symtab}. The corresponding field in the
+target vector is named @samp{_bfd_canonicalize_dynamic_symtab}.
+
+@item _get_dynamic_reloc_upper_bound
+Return a sensible upper bound on the amount of memory which will be
+required to read the dynamic relocations. In practice most targets
+return the amount of memory required to hold @samp{arelent} pointers for
+all the relocations plus a trailing @samp{NULL} entry, and store the
+actual relocation information in BFD private data. This is called via
+@samp{bfd_get_dynamic_reloc_upper_bound}. The corresponding field in
+the target vector is named @samp{_bfd_get_dynamic_reloc_upper_bound}.
+
+@item _canonicalize_dynamic_reloc
+Read the dynamic relocations. This is called via
+@samp{bfd_canonicalize_dynamic_reloc}. The corresponding field in the
+target vector is named @samp{_bfd_canonicalize_dynamic_reloc}.
+@end table
+
+@node BFD generated files
+@section BFD generated files
+@cindex generated files in bfd
+@cindex bfd generated files
+
+BFD contains several automatically generated files. This section
+describes them. Some files are created at configure time, when you
+configure BFD. Some files are created at make time, when you build
+BFD. Some files are automatically rebuilt at make time, but only if
+you configure with the @samp{--enable-maintainer-mode} option. Some
+files live in the object directory---the directory from which you run
+configure---and some live in the source directory. All files that live
+in the source directory are checked into the CVS repository.
+
+@table @file
+@item bfd.h
+@cindex @file{bfd.h}
+@cindex @file{bfd-in3.h}
+Lives in the object directory. Created at make time from
+@file{bfd-in2.h} via @file{bfd-in3.h}. @file{bfd-in3.h} is created at
+configure time from @file{bfd-in2.h}. There are automatic dependencies
+to rebuild @file{bfd-in3.h} and hence @file{bfd.h} if @file{bfd-in2.h}
+changes, so you can normally ignore @file{bfd-in3.h}, and just think
+about @file{bfd-in2.h} and @file{bfd.h}.
+
+@file{bfd.h} is built by replacing a few strings in @file{bfd-in2.h}.
+To see them, search for @samp{@@} in @file{bfd-in2.h}. They mainly
+control whether BFD is built for a 32 bit target or a 64 bit target.
+
+@item bfd-in2.h
+@cindex @file{bfd-in2.h}
+Lives in the source directory. Created from @file{bfd-in.h} and several
+other BFD source files. If you configure with the
+@samp{--enable-maintainer-mode} option, @file{bfd-in2.h} is rebuilt
+automatically when a source file changes.
+
+@item elf32-target.h
+@itemx elf64-target.h
+@cindex @file{elf32-target.h}
+@cindex @file{elf64-target.h}
+Live in the object directory. Created from @file{elfxx-target.h}.
+These files are versions of @file{elfxx-target.h} customized for either
+a 32 bit ELF target or a 64 bit ELF target.
+
+@item libbfd.h
+@cindex @file{libbfd.h}
+Lives in the source directory. Created from @file{libbfd-in.h} and
+several other BFD source files. If you configure with the
+@samp{--enable-maintainer-mode} option, @file{libbfd.h} is rebuilt
+automatically when a source file changes.
+
+@item libcoff.h
+@cindex @file{libcoff.h}
+Lives in the source directory. Created from @file{libcoff-in.h} and
+@file{coffcode.h}. If you configure with the
+@samp{--enable-maintainer-mode} option, @file{libcoff.h} is rebuilt
+automatically when a source file changes.
+
+@item targmatch.h
+@cindex @file{targmatch.h}
+Lives in the object directory. Created at make time from
+@file{config.bfd}. This file is used to map configuration triplets into
+BFD target vector variable names at run time.
+@end table
+
+@node BFD multiple compilations
+@section Files compiled multiple times in BFD
+Several files in BFD are compiled multiple times. By this I mean that
+there are header files which contain function definitions. These header
+files are included by other files, and thus the functions are compiled
+once per file which includes them.
+
+Preprocessor macros are used to control the compilation, so that each
+time the files are compiled the resulting functions are slightly
+different. Naturally, if they weren't different, there would be no
+reason to compile them multiple times.
+
+This is a not a particularly good programming technique, and future BFD
+work should avoid it.
+
+@itemize @bullet
+@item
+Since this technique is rarely used, even experienced C programmers find
+it confusing.
+
+@item
+It is difficult to debug programs which use BFD, since there is no way
+to describe which version of a particular function you are looking at.
+
+@item
+Programs which use BFD wind up incorporating two or more slightly
+different versions of the same function, which wastes space in the
+executable.
+
+@item
+This technique is never required nor is it especially efficient. It is
+always possible to use statically initialized structures holding
+function pointers and magic constants instead.
+@end itemize
+
+The following is a list of the files which are compiled multiple times.
+
+@table @file
+@item aout-target.h
+@cindex @file{aout-target.h}
+Describes a few functions and the target vector for a.out targets. This
+is used by individual a.out targets with different definitions of
+@samp{N_TXTADDR} and similar a.out macros.
+
+@item aoutf1.h
+@cindex @file{aoutf1.h}
+Implements standard SunOS a.out files. In principle it supports 64 bit
+a.out targets based on the preprocessor macro @samp{ARCH_SIZE}, but
+since all known a.out targets are 32 bits, this code may or may not
+work. This file is only included by a few other files, and it is
+difficult to justify its existence.
+
+@item aoutx.h
+@cindex @file{aoutx.h}
+Implements basic a.out support routines. This file can be compiled for
+either 32 or 64 bit support. Since all known a.out targets are 32 bits,
+the 64 bit support may or may not work. I believe the original
+intention was that this file would only be included by @samp{aout32.c}
+and @samp{aout64.c}, and that other a.out targets would simply refer to
+the functions it defined. Unfortunately, some other a.out targets
+started including it directly, leading to a somewhat confused state of
+affairs.
+
+@item coffcode.h
+@cindex @file{coffcode.h}
+Implements basic COFF support routines. This file is included by every
+COFF target. It implements code which handles COFF magic numbers as
+well as various hook functions called by the generic COFF functions in
+@file{coffgen.c}. This file is controlled by a number of different
+macros, and more are added regularly.
+
+@item coffswap.h
+@cindex @file{coffswap.h}
+Implements COFF swapping routines. This file is included by
+@file{coffcode.h}, and thus by every COFF target. It implements the
+routines which swap COFF structures between internal and external
+format. The main control for this file is the external structure
+definitions in the files in the @file{include/coff} directory. A COFF
+target file will include one of those files before including
+@file{coffcode.h} and thus @file{coffswap.h}. There are a few other
+macros which affect @file{coffswap.h} as well, mostly describing whether
+certain fields are present in the external structures.
+
+@item ecoffswap.h
+@cindex @file{ecoffswap.h}
+Implements ECOFF swapping routines. This is like @file{coffswap.h}, but
+for ECOFF. It is included by the ECOFF target files (of which there are
+only two). The control is the preprocessor macro @samp{ECOFF_32} or
+@samp{ECOFF_64}.
+
+@item elfcode.h
+@cindex @file{elfcode.h}
+Implements ELF functions that use external structure definitions. This
+file is included by two other files: @file{elf32.c} and @file{elf64.c}.
+It is controlled by the @samp{ARCH_SIZE} macro which is defined to be
+@samp{32} or @samp{64} before including it. The @samp{NAME} macro is
+used internally to give the functions different names for the two target
+sizes.
+
+@item elfcore.h
+@cindex @file{elfcore.h}
+Like @file{elfcode.h}, but for functions that are specific to ELF core
+files. This is included only by @file{elfcode.h}.
+
+@item elflink.h
+@cindex @file{elflink.h}
+Like @file{elfcode.h}, but for functions used by the ELF linker. This
+is included only by @file{elfcode.h}.
+
+@item elfxx-target.h
+@cindex @file{elfxx-target.h}
+This file is the source for the generated files @file{elf32-target.h}
+and @file{elf64-target.h}, one of which is included by every ELF target.
+It defines the ELF target vector.
+
+@item freebsd.h
+@cindex @file{freebsd.h}
+Presumably intended to be included by all FreeBSD targets, but in fact
+there is only one such target, @samp{i386-freebsd}. This defines a
+function used to set the right magic number for FreeBSD, as well as
+various macros, and includes @file{aout-target.h}.
+
+@item netbsd.h
+@cindex @file{netbsd.h}
+Like @file{freebsd.h}, except that there are several files which include
+it.
+
+@item nlm-target.h
+@cindex @file{nlm-target.h}
+Defines the target vector for a standard NLM target.
+
+@item nlmcode.h
+@cindex @file{nlmcode.h}
+Like @file{elfcode.h}, but for NLM targets. This is only included by
+@file{nlm32.c} and @file{nlm64.c}, both of which define the macro
+@samp{ARCH_SIZE} to an appropriate value. There are no 64 bit NLM
+targets anyhow, so this is sort of useless.
+
+@item nlmswap.h
+@cindex @file{nlmswap.h}
+Like @file{coffswap.h}, but for NLM targets. This is included by each
+NLM target, but I think it winds up compiling to the exact same code for
+every target, and as such is fairly useless.
+
+@item peicode.h
+@cindex @file{peicode.h}
+Provides swapping routines and other hooks for PE targets.
+@file{coffcode.h} will include this rather than @file{coffswap.h} for a
+PE target. This defines PE specific versions of the COFF swapping
+routines, and also defines some macros which control @file{coffcode.h}
+itself.
+@end table
+
+@node BFD relocation handling
+@section BFD relocation handling
+@cindex bfd relocation handling
+@cindex relocations in bfd
+
+The handling of relocations is one of the more confusing aspects of BFD.
+Relocation handling has been implemented in various different ways, all
+somewhat incompatible, none perfect.
+
+@menu
+* BFD relocation concepts:: BFD relocation concepts
+* BFD relocation functions:: BFD relocation functions
+* BFD relocation codes:: BFD relocation codes
+* BFD relocation future:: BFD relocation future
+@end menu
+
+@node BFD relocation concepts
+@subsection BFD relocation concepts
+
+A relocation is an action which the linker must take when linking. It
+describes a change to the contents of a section. The change is normally
+based on the final value of one or more symbols. Relocations are
+created by the assembler when it creates an object file.
+
+Most relocations are simple. A typical simple relocation is to set 32
+bits at a given offset in a section to the value of a symbol. This type
+of relocation would be generated for code like @code{int *p = &i;} where
+@samp{p} and @samp{i} are global variables. A relocation for the symbol
+@samp{i} would be generated such that the linker would initialize the
+area of memory which holds the value of @samp{p} to the value of the
+symbol @samp{i}.
+
+Slightly more complex relocations may include an addend, which is a
+constant to add to the symbol value before using it. In some cases a
+relocation will require adding the symbol value to the existing contents
+of the section in the object file. In others the relocation will simply
+replace the contents of the section with the symbol value. Some
+relocations are PC relative, so that the value to be stored in the
+section is the difference between the value of a symbol and the final
+address of the section contents.
+
+In general, relocations can be arbitrarily complex. For example,
+relocations used in dynamic linking systems often require the linker to
+allocate space in a different section and use the offset within that
+section as the value to store. In the IEEE object file format,
+relocations may involve arbitrary expressions.
+
+When doing a relocateable link, the linker may or may not have to do
+anything with a relocation, depending upon the definition of the
+relocation. Simple relocations generally do not require any special
+action.
+
+@node BFD relocation functions
+@subsection BFD relocation functions
+
+In BFD, each section has an array of @samp{arelent} structures. Each
+structure has a pointer to a symbol, an address within the section, an
+addend, and a pointer to a @samp{reloc_howto_struct} structure. The
+howto structure has a bunch of fields describing the reloc, including a
+type field. The type field is specific to the object file format
+backend; none of the generic code in BFD examines it.
+
+Originally, the function @samp{bfd_perform_relocation} was supposed to
+handle all relocations. In theory, many relocations would be simple
+enough to be described by the fields in the howto structure. For those
+that weren't, the howto structure included a @samp{special_function}
+field to use as an escape.
+
+While this seems plausible, a look at @samp{bfd_perform_relocation}
+shows that it failed. The function has odd special cases. Some of the
+fields in the howto structure, such as @samp{pcrel_offset}, were not
+adequately documented.
+
+The linker uses @samp{bfd_perform_relocation} to do all relocations when
+the input and output file have different formats (e.g., when generating
+S-records). The generic linker code, which is used by all targets which
+do not define their own special purpose linker, uses
+@samp{bfd_get_relocated_section_contents}, which for most targets turns
+into a call to @samp{bfd_generic_get_relocated_section_contents}, which
+calls @samp{bfd_perform_relocation}. So @samp{bfd_perform_relocation}
+is still widely used, which makes it difficult to change, since it is
+difficult to test all possible cases.
+
+The assembler used @samp{bfd_perform_relocation} for a while. This
+turned out to be the wrong thing to do, since
+@samp{bfd_perform_relocation} was written to handle relocations on an
+existing object file, while the assembler needed to create relocations
+in a new object file. The assembler was changed to use the new function
+@samp{bfd_install_relocation} instead, and @samp{bfd_install_relocation}
+was created as a copy of @samp{bfd_perform_relocation}.
+
+Unfortunately, the work did not progress any farther, so
+@samp{bfd_install_relocation} remains a simple copy of
+@samp{bfd_perform_relocation}, with all the odd special cases and
+confusing code. This again is difficult to change, because again any
+change can affect any assembler target, and so is difficult to test.
+
+The new linker, when using the same object file format for all input
+files and the output file, does not convert relocations into
+@samp{arelent} structures, so it can not use
+@samp{bfd_perform_relocation} at all. Instead, users of the new linker
+are expected to write a @samp{relocate_section} function which will
+handle relocations in a target specific fashion.
+
+There are two helper functions for target specific relocation:
+@samp{_bfd_final_link_relocate} and @samp{_bfd_relocate_contents}.
+These functions use a howto structure, but they @emph{do not} use the
+@samp{special_function} field. Since the functions are normally called
+from target specific code, the @samp{special_function} field adds
+little; any relocations which require special handling can be handled
+without calling those functions.
+
+So, if you want to add a new target, or add a new relocation to an
+existing target, you need to do the following:
+
+@itemize @bullet
+@item
+Make sure you clearly understand what the contents of the section should
+look like after assembly, after a relocateable link, and after a final
+link. Make sure you clearly understand the operations the linker must
+perform during a relocateable link and during a final link.
+
+@item
+Write a howto structure for the relocation. The howto structure is
+flexible enough to represent any relocation which should be handled by
+setting a contiguous bitfield in the destination to the value of a
+symbol, possibly with an addend, possibly adding the symbol value to the
+value already present in the destination.
+
+@item
+Change the assembler to generate your relocation. The assembler will
+call @samp{bfd_install_relocation}, so your howto structure has to be
+able to handle that. You may need to set the @samp{special_function}
+field to handle assembly correctly. Be careful to ensure that any code
+you write to handle the assembler will also work correctly when doing a
+relocateable link. For example, see @samp{bfd_elf_generic_reloc}.
+
+@item
+Test the assembler. Consider the cases of relocation against an
+undefined symbol, a common symbol, a symbol defined in the object file
+in the same section, and a symbol defined in the object file in a
+different section. These cases may not all be applicable for your
+reloc.
+
+@item
+If your target uses the new linker, which is recommended, add any
+required handling to the target specific relocation function. In simple
+cases this will just involve a call to @samp{_bfd_final_link_relocate}
+or @samp{_bfd_relocate_contents}, depending upon the definition of the
+relocation and whether the link is relocateable or not.
+
+@item
+Test the linker. Test the case of a final link. If the relocation can
+overflow, use a linker script to force an overflow and make sure the
+error is reported correctly. Test a relocateable link, whether the
+symbol is defined or undefined in the relocateable output. For both the
+final and relocateable link, test the case when the symbol is a common
+symbol, when the symbol looked like a common symbol but became a defined
+symbol, when the symbol is defined in a different object file, and when
+the symbol is defined in the same object file.
+
+@item
+In order for linking to another object file format, such as S-records,
+to work correctly, @samp{bfd_perform_relocation} has to do the right
+thing for the relocation. You may need to set the
+@samp{special_function} field to handle this correctly. Test this by
+doing a link in which the output object file format is S-records.
+
+@item
+Using the linker to generate relocateable output in a different object
+file format is impossible in the general case, so you generally don't
+have to worry about that. Linking input files of different object file
+formats together is quite unusual, but if you're really dedicated you
+may want to consider testing this case, both when the output object file
+format is the same as your format, and when it is different.
+@end itemize
+
+@node BFD relocation codes
+@subsection BFD relocation codes
+
+BFD has another way of describing relocations besides the howto
+structures described above: the enum @samp{bfd_reloc_code_real_type}.
+
+Every known relocation type can be described as a value in this
+enumeration. The enumeration contains many target specific relocations,
+but where two or more targets have the same relocation, a single code is
+used. For example, the single value @samp{BFD_RELOC_32} is used for all
+simple 32 bit relocation types.
+
+The main purpose of this relocation code is to give the assembler some
+mechanism to create @samp{arelent} structures. In order for the
+assembler to create an @samp{arelent} structure, it has to be able to
+obtain a howto structure. The function @samp{bfd_reloc_type_lookup},
+which simply calls the target vector entry point
+@samp{reloc_type_lookup}, takes a relocation code and returns a howto
+structure.
+
+The function @samp{bfd_get_reloc_code_name} returns the name of a
+relocation code. This is mainly used in error messages.
+
+Using both howto structures and relocation codes can be somewhat
+confusing. There are many processor specific relocation codes.
+However, the relocation is only fully defined by the howto structure.
+The same relocation code will map to different howto structures in
+different object file formats. For example, the addend handling may be
+different.
+
+Most of the relocation codes are not really general. The assembler can
+not use them without already understanding what sorts of relocations can
+be used for a particular target. It might be possible to replace the
+relocation codes with something simpler.
+
+@node BFD relocation future
+@subsection BFD relocation future
+
+Clearly the current BFD relocation support is in bad shape. A
+wholescale rewrite would be very difficult, because it would require
+thorough testing of every BFD target. So some sort of incremental
+change is required.
+
+My vague thoughts on this would involve defining a new, clearly defined,
+howto structure. Some mechanism would be used to determine which type
+of howto structure was being used by a particular format.
+
+The new howto structure would clearly define the relocation behaviour in
+the case of an assembly, a relocateable link, and a final link. At
+least one special function would be defined as an escape, and it might
+make sense to define more.
+
+One or more generic functions similar to @samp{bfd_perform_relocation}
+would be written to handle the new howto structure.
+
+This should make it possible to write a generic version of the relocate
+section functions used by the new linker. The target specific code
+would provide some mechanism (a function pointer or an initial
+conversion) to convert target specific relocations into howto
+structures.
+
+Ideally it would be possible to use this generic relocate section
+function for the generic linker as well. That is, it would replace the
+@samp{bfd_generic_get_relocated_section_contents} function which is
+currently normally used.
+
+For the special case of ELF dynamic linking, more consideration needs to
+be given to writing ELF specific but ELF target generic code to handle
+special relocation types such as GOT and PLT.
+
+@node BFD ELF support
+@section BFD ELF support
+@cindex elf support in bfd
+@cindex bfd elf support
+
+The ELF object file format is defined in two parts: a generic ABI and a
+processor specific supplement. The ELF support in BFD is split in a
+similar fashion. The processor specific support is largely kept within
+a single file. The generic support is provided by several other files.
+The processor specific support provides a set of function pointers and
+constants used by the generic support.
+
+@menu
+* BFD ELF sections and segments:: ELF sections and segments
+* BFD ELF generic support:: BFD ELF generic support
+* BFD ELF processor specific support:: BFD ELF processor specific support
+* BFD ELF core files:: BFD ELF core files
+* BFD ELF future:: BFD ELF future
+@end menu
+
+@node BFD ELF sections and segments
+@subsection ELF sections and segments
+
+The ELF ABI permits a file to have either sections or segments or both.
+Relocateable object files conventionally have only sections.
+Executables conventionally have both. Core files conventionally have
+only program segments.
+
+ELF sections are similar to sections in other object file formats: they
+have a name, a VMA, file contents, flags, and other miscellaneous
+information. ELF relocations are stored in sections of a particular
+type; BFD automatically converts these sections into internal relocation
+information.
+
+ELF program segments are intended for fast interpretation by a system
+loader. They have a type, a VMA, an LMA, file contents, and a couple of
+other fields. When an ELF executable is run on a Unix system, the
+system loader will examine the program segments to decide how to load
+it. The loader will ignore the section information. Loadable program
+segments (type @samp{PT_LOAD}) are directly loaded into memory. Other
+program segments are interpreted by the loader, and generally provide
+dynamic linking information.
+
+When an ELF file has both program segments and sections, an ELF program
+segment may encompass one or more ELF sections, in the sense that the
+portion of the file which corresponds to the program segment may include
+the portions of the file corresponding to one or more sections. When
+there is more than one section in a loadable program segment, the
+relative positions of the section contents in the file must correspond
+to the relative positions they should hold when the program segment is
+loaded. This requirement should be obvious if you consider that the
+system loader will load an entire program segment at a time.
+
+On a system which supports dynamic paging, such as any native Unix
+system, the contents of a loadable program segment must be at the same
+offset in the file as in memory, modulo the memory page size used on the
+system. This is because the system loader will map the file into memory
+starting at the start of a page. The system loader can easily remap
+entire pages to the correct load address. However, if the contents of
+the file were not correctly aligned within the page, the system loader
+would have to shift the contents around within the page, which is too
+expensive. For example, if the LMA of a loadable program segment is
+@samp{0x40080} and the page size is @samp{0x1000}, then the position of
+the segment contents within the file must equal @samp{0x80} modulo
+@samp{0x1000}.
+
+BFD has only a single set of sections. It does not provide any generic
+way to examine both sections and segments. When BFD is used to open an
+object file or executable, the BFD sections will represent ELF sections.
+When BFD is used to open a core file, the BFD sections will represent
+ELF program segments.
+
+When BFD is used to examine an object file or executable, any program
+segments will be read to set the LMA of the sections. This is because
+ELF sections only have a VMA, while ELF program segments have both a VMA
+and an LMA. Any program segments will be copied by the
+@samp{copy_private} entry points. They will be printed by the
+@samp{print_private} entry point. Otherwise, the program segments are
+ignored. In particular, programs which use BFD currently have no direct
+access to the program segments.
+
+When BFD is used to create an executable, the program segments will be
+created automatically based on the section information. This is done in
+the function @samp{assign_file_positions_for_segments} in @file{elf.c}.
+This function has been tweaked many times, and probably still has
+problems that arise in particular cases.
+
+There is a hook which may be used to explicitly define the program
+segments when creating an executable: the @samp{bfd_record_phdr}
+function in @file{bfd.c}. If this function is called, BFD will not
+create program segments itself, but will only create the program
+segments specified by the caller. The linker uses this function to
+implement the @samp{PHDRS} linker script command.
+
+@node BFD ELF generic support
+@subsection BFD ELF generic support
+
+In general, functions which do not read external data from the ELF file
+are found in @file{elf.c}. They operate on the internal forms of the
+ELF structures, which are defined in @file{include/elf/internal.h}. The
+internal structures are defined in terms of @samp{bfd_vma}, and so may
+be used for both 32 bit and 64 bit ELF targets.
+
+The file @file{elfcode.h} contains functions which operate on the
+external data. @file{elfcode.h} is compiled twice, once via
+@file{elf32.c} with @samp{ARCH_SIZE} defined as @samp{32}, and once via
+@file{elf64.c} with @samp{ARCH_SIZE} defined as @samp{64}.
+@file{elfcode.h} includes functions to swap the ELF structures in and
+out of external form, as well as a few more complex functions.
+
+Linker support is found in @file{elflink.c} and @file{elflink.h}. The
+latter file is compiled twice, for both 32 and 64 bit support. The
+linker support is only used if the processor specific file defines
+@samp{elf_backend_relocate_section}, which is required to relocate the
+section contents. If that macro is not defined, the generic linker code
+is used, and relocations are handled via @samp{bfd_perform_relocation}.
+
+The core file support is in @file{elfcore.h}, which is compiled twice,
+for both 32 and 64 bit support. The more interesting cases of core file
+support only work on a native system which has the @file{sys/procfs.h}
+header file. Without that file, the core file support does little more
+than read the ELF program segments as BFD sections.
+
+The BFD internal header file @file{elf-bfd.h} is used for communication
+among these files and the processor specific files.
+
+The default entries for the BFD ELF target vector are found mainly in
+@file{elf.c}. Some functions are found in @file{elfcode.h}.
+
+The processor specific files may override particular entries in the
+target vector, but most do not, with one exception: the
+@samp{bfd_reloc_type_lookup} entry point is always processor specific.
+
+@node BFD ELF processor specific support
+@subsection BFD ELF processor specific support
+
+By convention, the processor specific support for a particular processor
+will be found in @file{elf@var{nn}-@var{cpu}.c}, where @var{nn} is
+either 32 or 64, and @var{cpu} is the name of the processor.
+
+@menu
+* BFD ELF processor required:: Required processor specific support
+* BFD ELF processor linker:: Processor specific linker support
+* BFD ELF processor other:: Other processor specific support options
+@end menu
+
+@node BFD ELF processor required
+@subsubsection Required processor specific support
+
+When writing a @file{elf@var{nn}-@var{cpu}.c} file, you must do the
+following:
+
+@itemize @bullet
+@item
+Define either @samp{TARGET_BIG_SYM} or @samp{TARGET_LITTLE_SYM}, or
+both, to a unique C name to use for the target vector. This name should
+appear in the list of target vectors in @file{targets.c}, and will also
+have to appear in @file{config.bfd} and @file{configure.in}. Define
+@samp{TARGET_BIG_SYM} for a big-endian processor,
+@samp{TARGET_LITTLE_SYM} for a little-endian processor, and define both
+for a bi-endian processor.
+@item
+Define either @samp{TARGET_BIG_NAME} or @samp{TARGET_LITTLE_NAME}, or
+both, to a string used as the name of the target vector. This is the
+name which a user of the BFD tool would use to specify the object file
+format. It would normally appear in a linker emulation parameters
+file.
+@item
+Define @samp{ELF_ARCH} to the BFD architecture (an element of the
+@samp{bfd_architecture} enum, typically @samp{bfd_arch_@var{cpu}}).
+@item
+Define @samp{ELF_MACHINE_CODE} to the magic number which should appear
+in the @samp{e_machine} field of the ELF header. As of this writing,
+these magic numbers are assigned by SCO; if you want to get a magic
+number for a particular processor, try sending a note to
+@email{registry@@sco.com}. In the BFD sources, the magic numbers are
+found in @file{include/elf/common.h}; they have names beginning with
+@samp{EM_}.
+@item
+Define @samp{ELF_MAXPAGESIZE} to the maximum size of a virtual page in
+memory. This can normally be found at the start of chapter 5 in the
+processor specific supplement. For a processor which will only be used
+in an embedded system, or which has no memory management hardware, this
+can simply be @samp{1}.
+@item
+If the format should use @samp{Rel} rather than @samp{Rela} relocations,
+define @samp{USE_REL}. This is normally defined in chapter 4 of the
+processor specific supplement.
+
+In the absence of a supplement, it's easier to work with @samp{Rela}
+relocations. @samp{Rela} relocations will require more space in object
+files (but not in executables, except when using dynamic linking).
+However, this is outweighed by the simplicity of addend handling when
+using @samp{Rela} relocations. With @samp{Rel} relocations, the addend
+must be stored in the section contents, which makes relocateable links
+more complex.
+
+For example, consider C code like @code{i = a[1000];} where @samp{a} is
+a global array. The instructions which load the value of @samp{a[1000]}
+will most likely use a relocation which refers to the symbol
+representing @samp{a}, with an addend that gives the offset from the
+start of @samp{a} to element @samp{1000}. When using @samp{Rel}
+relocations, that addend must be stored in the instructions themselves.
+If you are adding support for a RISC chip which uses two or more
+instructions to load an address, then the addend may not fit in a single
+instruction, and will have to be somehow split among the instructions.
+This makes linking awkward, particularly when doing a relocateable link
+in which the addend may have to be updated. It can be done---the MIPS
+ELF support does it---but it should be avoided when possible.
+
+It is possible, though somewhat awkward, to support both @samp{Rel} and
+@samp{Rela} relocations for a single target; @file{elf64-mips.c} does it
+by overriding the relocation reading and writing routines.
+@item
+Define howto structures for all the relocation types.
+@item
+Define a @samp{bfd_reloc_type_lookup} routine. This must be named
+@samp{bfd_elf@var{nn}_bfd_reloc_type_lookup}, and may be either a
+function or a macro. It must translate a BFD relocation code into a
+howto structure. This is normally a table lookup or a simple switch.
+@item
+If using @samp{Rel} relocations, define @samp{elf_info_to_howto_rel}.
+If using @samp{Rela} relocations, define @samp{elf_info_to_howto}.
+Either way, this is a macro defined as the name of a function which
+takes an @samp{arelent} and a @samp{Rel} or @samp{Rela} structure, and
+sets the @samp{howto} field of the @samp{arelent} based on the
+@samp{Rel} or @samp{Rela} structure. This is normally uses
+@samp{ELF@var{nn}_R_TYPE} to get the ELF relocation type and uses it as
+an index into a table of howto structures.
+@end itemize
+
+You must also add the magic number for this processor to the
+@samp{prep_headers} function in @file{elf.c}.
+
+You must also create a header file in the @file{include/elf} directory
+called @file{@var{cpu}.h}. This file should define any target specific
+information which may be needed outside of the BFD code. In particular
+it should use the @samp{START_RELOC_NUMBERS}, @samp{RELOC_NUMBER},
+@samp{FAKE_RELOC}, @samp{EMPTY_RELOC} and @samp{END_RELOC_NUMBERS}
+macros to create a table mapping the number used to indentify a
+relocation to a name describing that relocation.
+
+@node BFD ELF processor linker
+@subsubsection Processor specific linker support
+
+The linker will be much more efficient if you define a relocate section
+function. This will permit BFD to use the ELF specific linker support.
+
+If you do not define a relocate section function, BFD must use the
+generic linker support, which requires converting all symbols and
+relocations into BFD @samp{asymbol} and @samp{arelent} structures. In
+this case, relocations will be handled by calling
+@samp{bfd_perform_relocation}, which will use the howto structures you
+have defined. @xref{BFD relocation handling}.
+
+In order to support linking into a different object file format, such as
+S-records, @samp{bfd_perform_relocation} must work correctly with your
+howto structures, so you can't skip that step. However, if you define
+the relocate section function, then in the normal case of linking into
+an ELF file the linker will not need to convert symbols and relocations,
+and will be much more efficient.
+
+To use a relocation section function, define the macro
+@samp{elf_backend_relocate_section} as the name of a function which will
+take the contents of a section, as well as relocation, symbol, and other
+information, and modify the section contents according to the relocation
+information. In simple cases, this is little more than a loop over the
+relocations which computes the value of each relocation and calls
+@samp{_bfd_final_link_relocate}. The function must check for a
+relocateable link, and in that case normally needs to do nothing other
+than adjust the addend for relocations against a section symbol.
+
+The complex cases generally have to do with dynamic linker support. GOT
+and PLT relocations must be handled specially, and the linker normally
+arranges to set up the GOT and PLT sections while handling relocations.
+When generating a shared library, random relocations must normally be
+copied into the shared library, or converted to RELATIVE relocations
+when possible.
+
+@node BFD ELF processor other
+@subsubsection Other processor specific support options
+
+There are many other macros which may be defined in
+@file{elf@var{nn}-@var{cpu}.c}. These macros may be found in
+@file{elfxx-target.h}.
+
+Macros may be used to override some of the generic ELF target vector
+functions.
+
+Several processor specific hook functions which may be defined as
+macros. These functions are found as function pointers in the
+@samp{elf_backend_data} structure defined in @file{elf-bfd.h}. In
+general, a hook function is set by defining a macro
+@samp{elf_backend_@var{name}}.
+
+There are a few processor specific constants which may also be defined.
+These are again found in the @samp{elf_backend_data} structure.
+
+I will not define the various functions and constants here; see the
+comments in @file{elf-bfd.h}.
+
+Normally any odd characteristic of a particular ELF processor is handled
+via a hook function. For example, the special @samp{SHN_MIPS_SCOMMON}
+section number found in MIPS ELF is handled via the hooks
+@samp{section_from_bfd_section}, @samp{symbol_processing},
+@samp{add_symbol_hook}, and @samp{output_symbol_hook}.
+
+Dynamic linking support, which involves processor specific relocations
+requiring special handling, is also implemented via hook functions.
+
+@node BFD ELF core files
+@subsection BFD ELF core files
+@cindex elf core files
+
+On native ELF Unix systems, core files are generated without any
+sections. Instead, they only have program segments.
+
+When BFD is used to read an ELF core file, the BFD sections will
+actually represent program segments. Since ELF program segments do not
+have names, BFD will invent names like @samp{segment@var{n}} where
+@var{n} is a number.
+
+A single ELF program segment may include both an initialized part and an
+uninitialized part. The size of the initialized part is given by the
+@samp{p_filesz} field. The total size of the segment is given by the
+@samp{p_memsz} field. If @samp{p_memsz} is larger than @samp{p_filesz},
+then the extra space is uninitialized, or, more precisely, initialized
+to zero.
+
+BFD will represent such a program segment as two different sections.
+The first, named @samp{segment@var{n}a}, will represent the initialized
+part of the program segment. The second, named @samp{segment@var{n}b},
+will represent the uninitialized part.
+
+ELF core files store special information such as register values in
+program segments with the type @samp{PT_NOTE}. BFD will attempt to
+interpret the information in these segments, and will create additional
+sections holding the information. Some of this interpretation requires
+information found in the host header file @file{sys/procfs.h}, and so
+will only work when BFD is built on a native system.
+
+BFD does not currently provide any way to create an ELF core file. In
+general, BFD does not provide a way to create core files. The way to
+implement this would be to write @samp{bfd_set_format} and
+@samp{bfd_write_contents} routines for the @samp{bfd_core} type; see
+@ref{BFD target vector format}.
+
+@node BFD ELF future
+@subsection BFD ELF future
+
+The current dynamic linking support has too much code duplication.
+While each processor has particular differences, much of the dynamic
+linking support is quite similar for each processor. The GOT and PLT
+are handled in fairly similar ways, the details of -Bsymbolic linking
+are generally similar, etc. This code should be reworked to use more
+generic functions, eliminating the duplication.
+
+Similarly, the relocation handling has too much duplication. Many of
+the @samp{reloc_type_lookup} and @samp{info_to_howto} functions are
+quite similar. The relocate section functions are also often quite
+similar, both in the standard linker handling and the dynamic linker
+handling. Many of the COFF processor specific backends share a single
+relocate section function (@samp{_bfd_coff_generic_relocate_section}),
+and it should be possible to do something like this for the ELF targets
+as well.
+
+The appearance of the processor specific magic number in
+@samp{prep_headers} in @file{elf.c} is somewhat bogus. It should be
+possible to add support for a new processor without changing the generic
+support.
+
+The processor function hooks and constants are ad hoc and need better
+documentation.
+
+When a linker script uses @samp{SIZEOF_HEADERS}, the ELF backend must
+guess at the number of program segments which will be required, in
+@samp{get_program_header_size}. This is because the linker calls
+@samp{bfd_sizeof_headers} before it knows all the section addresses and
+sizes. The ELF backend may later discover, when creating program
+segments, that more program segments are required. This is currently
+reported as an error in @samp{assign_file_positions_for_segments}.
+
+In practice this makes it difficult to use @samp{SIZEOF_HEADERS} except
+with a carefully defined linker script. Unfortunately,
+@samp{SIZEOF_HEADERS} is required for fast program loading on a native
+system, since it permits the initial code section to appear on the same
+page as the program segments, saving a page read when the program starts
+running. Fortunately, native systems permit careful definition of the
+linker script. Still, ideally it would be possible to use relaxation to
+compute the number of program segments.
+
+@node BFD glossary
+@section BFD glossary
+@cindex glossary for bfd
+@cindex bfd glossary
+
+This is a short glossary of some BFD terms.
+
+@table @asis
+@item a.out
+The a.out object file format. The original Unix object file format.
+Still used on SunOS, though not Solaris. Supports only three sections.
+
+@item archive
+A collection of object files produced and manipulated by the @samp{ar}
+program.
+
+@item backend
+The implementation within BFD of a particular object file format. The
+set of functions which appear in a particular target vector.
+
+@item BFD
+The BFD library itself. Also, each object file, archive, or exectable
+opened by the BFD library has the type @samp{bfd *}, and is sometimes
+referred to as a bfd.
+
+@item COFF
+The Common Object File Format. Used on Unix SVR3. Used by some
+embedded targets, although ELF is normally better.
+
+@item DLL
+A shared library on Windows.
+
+@item dynamic linker
+When a program linked against a shared library is run, the dynamic
+linker will locate the appropriate shared library and arrange to somehow
+include it in the running image.
+
+@item dynamic object
+Another name for an ELF shared library.
+
+@item ECOFF
+The Extended Common Object File Format. Used on Alpha Digital Unix
+(formerly OSF/1), as well as Ultrix and Irix 4. A variant of COFF.
+
+@item ELF
+The Executable and Linking Format. The object file format used on most
+modern Unix systems, including GNU/Linux, Solaris, Irix, and SVR4. Also
+used on many embedded systems.
+
+@item executable
+A program, with instructions and symbols, and perhaps dynamic linking
+information. Normally produced by a linker.
+
+@item LMA
+Load Memory Address. This is the address at which a section will be
+loaded. Compare with VMA, below.
+
+@item NLM
+NetWare Loadable Module. Used to describe the format of an object which
+be loaded into NetWare, which is some kind of PC based network server
+program.
+
+@item object file
+A binary file including machine instructions, symbols, and relocation
+information. Normally produced by an assembler.
+
+@item object file format
+The format of an object file. Typically object files and executables
+for a particular system are in the same format, although executables
+will not contain any relocation information.
+
+@item PE
+The Portable Executable format. This is the object file format used for
+Windows (specifically, Win32) object files. It is based closely on
+COFF, but has a few significant differences.
+
+@item PEI
+The Portable Executable Image format. This is the object file format
+used for Windows (specifically, Win32) executables. It is very similar
+to PE, but includes some additional header information.
+
+@item relocations
+Information used by the linker to adjust section contents. Also called
+relocs.
+
+@item section
+Object files and executable are composed of sections. Sections have
+optional data and optional relocation information.
+
+@item shared library
+A library of functions which may be used by many executables without
+actually being linked into each executable. There are several different
+implementations of shared libraries, each having slightly different
+features.
+
+@item symbol
+Each object file and executable may have a list of symbols, often
+referred to as the symbol table. A symbol is basically a name and an
+address. There may also be some additional information like the type of
+symbol, although the type of a symbol is normally something simple like
+function or object, and should be confused with the more complex C
+notion of type. Typically every global function and variable in a C
+program will have an associated symbol.
+
+@item target vector
+A set of functions which implement support for a particular object file
+format. The @samp{bfd_target} structure.
+
+@item Win32
+The current Windows API, implemented by Windows 95 and later and Windows
+NT 3.51 and later, but not by Windows 3.1.
+
+@item XCOFF
+The eXtended Common Object File Format. Used on AIX. A variant of
+COFF, with a completely different symbol table implementation.
+
+@item VMA
+Virtual Memory Address. This is the address a section will have when
+an executable is run. Compare with LMA, above.
+@end table
+
+@node Index
+@unnumberedsec Index
+@printindex cp
+
+@contents
+@bye
diff --git a/contrib/binutils/bfd/dwarf1.c b/contrib/binutils/bfd/dwarf1.c
new file mode 100644
index 000000000000..da184cc70589
--- /dev/null
+++ b/contrib/binutils/bfd/dwarf1.c
@@ -0,0 +1,578 @@
+/* DWARF 1 find nearest line (_bfd_dwarf1_find_nearest_line).
+ Copyright 1998, 1999 Free Software Foundation, Inc.
+
+Written by Gavin Romig-Koch of Cygnus Solutions (gavin@cygnus.com).
+
+This file is part of BFD.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libiberty.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+#include "elf/dwarf.h"
+
+/* dwarf1_debug is the starting point for all dwarf1 info. */
+
+struct dwarf1_debug {
+
+ /* The bfd we are working with. */
+ bfd* abfd;
+
+ /* List of already parsed compilation units. */
+ struct dwarf1_unit* lastUnit;
+
+ /* The buffer for the .debug section.
+ Zero indicates that the .debug section failed to load. */
+ char* debug_section;
+
+ /* Pointer to the end of the .debug_info section memory buffer. */
+ char* debug_section_end;
+
+ /* The buffer for the .line section. */
+ char* line_section;
+
+ /* End of that buffer. */
+ char* line_section_end;
+
+ /* The current or next unread die within the .debug section. */
+ char* currentDie;
+};
+
+/* One dwarf1_unit for each parsed compilation unit die. */
+
+struct dwarf1_unit {
+ /* Linked starting from stash->lastUnit. */
+ struct dwarf1_unit* prev;
+
+ /* Name of the compilation unit. */
+ char* name;
+
+ /* The highest and lowest address used in the compilation unit. */
+ unsigned long low_pc;
+ unsigned long high_pc;
+
+ /* Does this unit have a statement list? */
+ int has_stmt_list;
+
+ /* If any, the offset of the line number table in the .line section. */
+ unsigned long stmt_list_offset;
+
+ /* If non-zero, a pointer to the first child of this unit. */
+ char* first_child;
+
+ /* How many line entries? */
+ unsigned long line_count;
+
+ /* The decoded line number table (line_count entries). */
+ struct linenumber* linenumber_table;
+
+ /* The list of functions in this unit. */
+ struct dwarf1_func* func_list;
+};
+
+
+
+/* One dwarf1_func for each parsed function die. */
+
+struct dwarf1_func {
+ /* Linked starting from aUnit->func_list. */
+ struct dwarf1_func* prev;
+
+ /* Name of function. */
+ char* name;
+
+ /* The highest and lowest address used in the compilation unit. */
+ unsigned long low_pc;
+ unsigned long high_pc;
+};
+
+
+/* Used to return info about a parsed die. */
+struct die_info {
+ unsigned long length;
+ unsigned long sibling;
+ unsigned long low_pc;
+ unsigned long high_pc;
+ unsigned long stmt_list_offset;
+
+ char* name;
+
+ int has_stmt_list;
+
+ unsigned short tag;
+};
+
+
+/* Parsed line number information. */
+struct linenumber {
+ /* First address in the line. */
+ unsigned long addr;
+
+ /* The line number. */
+ unsigned long linenumber;
+};
+
+
+/* Find the form of an attr, from the attr field. */
+#define FORM_FROM_ATTR(attr) ((attr) & 0xF) /* Implicitly specified */
+
+
+/* Return a newly allocated dwarf1_unit. It should be cleared and
+ then attached into the 'stash' at 'stash->lastUnit'. */
+
+static struct dwarf1_unit*
+alloc_dwarf1_unit (stash)
+ struct dwarf1_debug* stash;
+{
+ struct dwarf1_unit* x =
+ (struct dwarf1_unit*) bfd_zalloc (stash->abfd,
+ sizeof (struct dwarf1_unit));
+ x->prev = stash->lastUnit;
+ stash->lastUnit = x;
+
+ return x;
+}
+
+/* Return a newly allocated dwarf1_func. It must be cleared and
+ attached into 'aUnit' at 'aUnit->func_list'. */
+
+static struct dwarf1_func*
+alloc_dwarf1_func (stash, aUnit)
+ struct dwarf1_debug* stash;
+ struct dwarf1_unit* aUnit;
+{
+ struct dwarf1_func* x =
+ (struct dwarf1_func*) bfd_zalloc (stash->abfd,
+ sizeof (struct dwarf1_func));
+ x->prev = aUnit->func_list;
+ aUnit->func_list = x;
+
+ return x;
+}
+
+/* parse_die - parse a Dwarf1 die.
+ Parse the die starting at 'aDiePtr' into 'aDieInfo'.
+ 'abfd' must be the bfd from which the section that 'aDiePtr'
+ points to was pulled from.
+
+ Return false if the die is invalidly formatted; true otherwise. */
+
+static boolean
+parse_die (abfd, aDieInfo, aDiePtr)
+ bfd* abfd;
+ struct die_info* aDieInfo;
+ char* aDiePtr;
+{
+ char* this_die = aDiePtr;
+ char* xptr = this_die;
+
+ memset (aDieInfo,0,sizeof(*aDieInfo));
+
+ /* First comes the length. */
+ aDieInfo->length = bfd_get_32 (abfd, xptr);
+ xptr += 4;
+ if (aDieInfo->length == 0)
+ return false;
+ if (aDieInfo->length < 6)
+ {
+ /* Just padding bytes. */
+ aDieInfo->tag = TAG_padding;
+ return true;
+ }
+
+ /* Then the tag. */
+ aDieInfo->tag = bfd_get_16 (abfd, xptr);
+ xptr += 2;
+
+ /* Then the attributes. */
+ while (xptr < (this_die + aDieInfo->length))
+ {
+ unsigned short attr;
+
+ /* Parse the attribute based on its form. This section
+ must handle all dwarf1 forms, but need only handle the
+ actual attributes that we care about. */
+
+ attr = bfd_get_16 (abfd, xptr);
+ xptr += 2;
+
+ switch (FORM_FROM_ATTR (attr))
+ {
+ case FORM_DATA2:
+ xptr += 2;
+ break;
+ case FORM_DATA4:
+ case FORM_REF:
+ if (attr == AT_sibling)
+ aDieInfo->sibling = bfd_get_32 (abfd, xptr);
+ else if (attr == AT_stmt_list)
+ {
+ aDieInfo->stmt_list_offset = bfd_get_32 (abfd, xptr);
+ aDieInfo->has_stmt_list = 1;
+ }
+ xptr += 4;
+ break;
+ case FORM_DATA8:
+ xptr += 8;
+ break;
+ case FORM_ADDR:
+ if (attr == AT_low_pc)
+ aDieInfo->low_pc = bfd_get_32 (abfd, xptr);
+ else if (attr == AT_high_pc)
+ aDieInfo->high_pc = bfd_get_32 (abfd, xptr);
+ xptr += 4;
+ break;
+ case FORM_BLOCK2:
+ xptr += 2 + bfd_get_16 (abfd, xptr);
+ break;
+ case FORM_BLOCK4:
+ xptr += 4 + bfd_get_32 (abfd, xptr);
+ break;
+ case FORM_STRING:
+ if (attr == AT_name)
+ aDieInfo->name = xptr;
+ xptr += strlen (xptr) + 1;
+ break;
+ }
+ }
+
+ return true;
+}
+
+/* Parse a dwarf1 line number table for 'aUnit->stmt_list_offset'
+ into 'aUnit->linenumber_table'. Return false if an error
+ occurs; true otherwise. */
+
+static boolean
+parse_line_table (stash, aUnit)
+ struct dwarf1_debug* stash;
+ struct dwarf1_unit* aUnit;
+{
+ char* xptr;
+
+ /* Load the ".line" section from the bfd if we haven't already. */
+ if (stash->line_section == 0)
+ {
+ asection *msec;
+ unsigned long size;
+
+ msec = bfd_get_section_by_name (stash->abfd, ".line");
+ if (! msec)
+ return false;
+
+ size = bfd_get_section_size_before_reloc (msec);
+ stash->line_section = (unsigned char*) bfd_alloc (stash->abfd, size);
+
+ if (! stash->line_section)
+ return false;
+
+ if (! bfd_get_section_contents (stash->abfd, msec, stash->line_section, 0, size))
+ {
+ stash->line_section = 0;
+ return false;
+ }
+
+ stash->line_section_end = stash->line_section + size;
+ }
+
+ xptr = stash->line_section + aUnit->stmt_list_offset;
+ if (xptr < stash->line_section_end)
+ {
+ unsigned long eachLine;
+
+ char* tblend;
+ unsigned long base;
+
+ /* First comes the length. */
+ tblend = bfd_get_32 (stash->abfd, xptr) + xptr;
+ xptr += 4;
+
+ /* Then the base address for each address in the table. */
+ base = bfd_get_32 (stash->abfd, xptr);
+ xptr += 4;
+
+ /* How many line entrys?
+ 10 = 4 (line number) + 2 (pos in line) + 4 (address in line) */
+ aUnit->line_count = (tblend - xptr) / 10;
+
+ /* Allocate an array for the entries. */
+ aUnit->linenumber_table = (struct linenumber*)
+ bfd_alloc (stash->abfd,
+ sizeof (struct linenumber) * aUnit->line_count);
+
+ for (eachLine = 0; eachLine < aUnit->line_count; eachLine++)
+ {
+ /* A line number. */
+ aUnit->linenumber_table[eachLine].linenumber
+ = bfd_get_32 (stash->abfd, xptr);
+ xptr += 4;
+
+ /* Skip the position within the line. */
+ xptr += 2;
+
+ /* And finally the address. */
+ aUnit->linenumber_table[eachLine].addr
+ = base + bfd_get_32 (stash->abfd, xptr);
+ xptr += 4;
+ }
+ }
+
+ return true;
+}
+
+/* Parse each function die in a compilation unit 'aUnit'.
+ The first child die of 'aUnit' should be in 'aUnit->first_child',
+ the result is placed in 'aUnit->func_list'.
+ Return false if error; true otherwise. */
+
+static boolean
+parse_functions_in_unit (stash, aUnit)
+ struct dwarf1_debug* stash;
+ struct dwarf1_unit* aUnit;
+{
+ char* eachDie;
+
+ if (aUnit->first_child)
+ for (eachDie = aUnit->first_child;
+ eachDie < stash->debug_section_end;
+ )
+ {
+ struct die_info eachDieInfo;
+
+ if (! parse_die (stash->abfd, &eachDieInfo, eachDie))
+ return false;
+
+ if (eachDieInfo.tag == TAG_global_subroutine
+ || eachDieInfo.tag == TAG_subroutine
+ || eachDieInfo.tag == TAG_inlined_subroutine
+ || eachDieInfo.tag == TAG_entry_point)
+ {
+ struct dwarf1_func* aFunc = alloc_dwarf1_func (stash,aUnit);
+
+ aFunc->name = eachDieInfo.name;
+ aFunc->low_pc = eachDieInfo.low_pc;
+ aFunc->high_pc = eachDieInfo.high_pc;
+ }
+
+ /* Move to next sibling, if none, end loop */
+ if (eachDieInfo.sibling)
+ eachDie = stash->debug_section + eachDieInfo.sibling;
+ else
+ break;
+ }
+
+ return true;
+}
+
+/* Find the nearest line to 'addr' in 'aUnit'.
+ Return whether we found the line (or a function) without error. */
+
+static boolean
+dwarf1_unit_find_nearest_line (stash, aUnit, addr,
+ filename_ptr, functionname_ptr,
+ linenumber_ptr)
+ struct dwarf1_debug* stash;
+ struct dwarf1_unit* aUnit;
+ unsigned long addr;
+ const char **filename_ptr;
+ const char **functionname_ptr;
+ unsigned int *linenumber_ptr;
+{
+ int line_p = false;
+ int func_p = false;
+
+ if (aUnit->low_pc <= addr && addr < aUnit->high_pc)
+ {
+ if (aUnit->has_stmt_list)
+ {
+ unsigned long i;
+ struct dwarf1_func* eachFunc;
+
+ if (! aUnit->linenumber_table)
+ {
+ if (! parse_line_table (stash, aUnit))
+ return false;
+ }
+
+ if (! aUnit->func_list)
+ {
+ if (! parse_functions_in_unit (stash, aUnit))
+ return false;
+ }
+
+ for (i = 0; i < aUnit->line_count; i++)
+ {
+ if (aUnit->linenumber_table[i].addr <= addr
+ && addr < aUnit->linenumber_table[i+1].addr)
+ {
+ *filename_ptr = aUnit->name;
+ *linenumber_ptr = aUnit->linenumber_table[i].linenumber;
+ line_p = true;
+ break;
+ }
+ }
+
+ for (eachFunc = aUnit->func_list;
+ eachFunc;
+ eachFunc = eachFunc->prev)
+ {
+ if (eachFunc->low_pc <= addr
+ && addr < eachFunc->high_pc)
+ {
+ *functionname_ptr = eachFunc->name;
+ func_p = true;
+ break;
+ }
+ }
+ }
+ }
+
+ return line_p || func_p;
+}
+
+
+
+
+/* The DWARF 1 version of find_nearest line.
+ Return true if the line is found without error. */
+
+boolean
+_bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset,
+ filename_ptr, functionname_ptr, linenumber_ptr)
+ bfd *abfd;
+ asection *section;
+ asymbol **symbols ATTRIBUTE_UNUSED;
+ bfd_vma offset;
+ const char **filename_ptr;
+ const char **functionname_ptr;
+ unsigned int *linenumber_ptr;
+{
+ struct dwarf1_debug *stash = elf_tdata (abfd)->dwarf1_find_line_info;
+
+ struct dwarf1_unit* eachUnit;
+
+ /* What address are we looking for? */
+ bfd_vma addr = offset + section->vma;
+
+ *filename_ptr = NULL;
+ *functionname_ptr = NULL;
+ *linenumber_ptr = 0;
+
+
+ if (! stash)
+ {
+ asection *msec;
+ unsigned long size;
+
+ stash = elf_tdata (abfd)->dwarf1_find_line_info =
+ (struct dwarf1_debug*) bfd_zalloc (abfd, sizeof (struct dwarf1_debug));
+
+ if (! stash)
+ return false;
+
+ msec = bfd_get_section_by_name (abfd, ".debug");
+ if (! msec)
+ {
+ /* No dwarf1 info. Note that at this point the stash
+ has been allocated, but contains zeros, this lets
+ future calls to this function fail quicker. */
+ return false;
+ }
+
+ size = bfd_get_section_size_before_reloc (msec);
+ stash->debug_section = (unsigned char*) bfd_alloc (abfd, size);
+
+ if (! stash->debug_section)
+ return false;
+
+ if (! bfd_get_section_contents (abfd, msec, stash->debug_section, 0, size))
+ {
+ stash->debug_section = 0;
+ return false;
+ }
+
+ stash->debug_section_end = stash->debug_section + size;
+ stash->currentDie = stash->debug_section;
+ stash->abfd = abfd;
+ }
+
+ /* A null debug_section indicates that there was no dwarf1 info
+ or that an error occured while setting up the stash. */
+
+ if (! stash->debug_section)
+ return false;
+
+
+ /* Look at the previously parsed units to see if any contain
+ the addr. */
+ for (eachUnit = stash->lastUnit; eachUnit; eachUnit = eachUnit->prev)
+ {
+ if (eachUnit->low_pc <= addr && addr < eachUnit->high_pc)
+ return dwarf1_unit_find_nearest_line (stash, eachUnit, addr,
+ filename_ptr,
+ functionname_ptr,
+ linenumber_ptr);
+ }
+
+ while (stash->currentDie < stash->debug_section_end)
+ {
+ struct die_info aDieInfo;
+
+ if (! parse_die (stash->abfd, &aDieInfo, stash->currentDie))
+ return false;
+
+ if (aDieInfo.tag == TAG_compile_unit)
+ {
+ struct dwarf1_unit* aUnit
+ = alloc_dwarf1_unit (stash);
+
+ aUnit->name = aDieInfo.name;
+ aUnit->low_pc = aDieInfo.low_pc;
+ aUnit->high_pc = aDieInfo.high_pc;
+ aUnit->has_stmt_list = aDieInfo.has_stmt_list;
+ aUnit->stmt_list_offset = aDieInfo.stmt_list_offset;
+
+ /* A die has a child if it's followed by a die that is
+ not it's sibling. */
+ if (aDieInfo.sibling
+ && stash->currentDie + aDieInfo.length
+ < stash->debug_section_end
+ && stash->currentDie + aDieInfo.length
+ != stash->debug_section + aDieInfo.sibling)
+ aUnit->first_child = stash->currentDie + aDieInfo.length;
+ else
+ aUnit->first_child = 0;
+
+ if (aUnit->low_pc <= addr && addr < aUnit->high_pc)
+ return dwarf1_unit_find_nearest_line (stash, aUnit, addr,
+ filename_ptr,
+ functionname_ptr,
+ linenumber_ptr);
+ }
+
+ if (aDieInfo.sibling != 0)
+ stash->currentDie = stash->debug_section + aDieInfo.sibling;
+ else
+ stash->currentDie += aDieInfo.length;
+ }
+
+ return false;
+}
+
+
+/* EOF */
diff --git a/contrib/binutils/bfd/dwarf2.c b/contrib/binutils/bfd/dwarf2.c
index ed2ba13af9d0..b6de26121896 100644
--- a/contrib/binutils/bfd/dwarf2.c
+++ b/contrib/binutils/bfd/dwarf2.c
@@ -1,5 +1,5 @@
/* DWARF 2 support.
- Copyright 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright 1994, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
Adapted from gdb/dwarf2read.c by Gavin Koch of Cygnus Solutions
(gavin@cygnus.com).
@@ -99,18 +99,78 @@ struct dwarf2_debug {
/* Length of the loaded .debug_abbrev section. */
unsigned long dwarf_abbrev_size;
+
+ /* Buffer for decode_line_info. */
+ char *dwarf_line_buffer;
+};
+
+struct arange {
+ struct arange *next;
+ bfd_vma low;
+ bfd_vma high;
+};
+
+
+/* A minimal decoding of DWARF2 compilation units. We only decode
+ what's needed to get to the line number information. */
+
+struct comp_unit {
+
+ /* Chain the previously read compilation units. */
+ struct comp_unit* next_unit;
+
+ /* Keep the bdf convenient (for memory allocation). */
+ bfd* abfd;
+
+ /* The lowest and higest addresses contained in this compilation
+ unit as specified in the compilation unit header. */
+ struct arange arange;
+
+ /* The DW_AT_name attribute (for error messages). */
+ char* name;
+
+ /* The abbrev hash table. */
+ struct abbrev_info** abbrevs;
+
+ /* Note that an error was found by comp_unit_find_nearest_line. */
+ int error;
+
+ /* The DW_AT_comp_dir attribute */
+ char* comp_dir;
+
+ /* True if there is a line number table associated with this comp. unit. */
+ int stmtlist;
+
+ /* The offset into .debug_line of the line number table. */
+ unsigned long line_offset;
+
+ /* Pointer to the first child die for the comp unit. */
+ char *first_child_die_ptr;
+
+ /* The end of the comp unit. */
+ char *end_ptr;
+
+ /* The decoded line number, NULL if not yet decoded. */
+ struct line_info_table* line_table;
+
+ /* A list of the functions found in this comp. unit. */
+ struct funcinfo* function_table;
+
+ /* Address size for this unit - from unit header */
+ unsigned char addr_size;
};
-/* VERBATUM
- The following function up to the END VERBATUM mark are
+
+/* VERBATIM
+ The following function up to the END VERBATIM mark are
copied directly from dwarf2read.c. */
/* read dwarf information from a buffer */
static unsigned int
read_1_byte (abfd, buf)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
char *buf;
{
return bfd_get_8 (abfd, (bfd_byte *) buf);
@@ -118,7 +178,7 @@ read_1_byte (abfd, buf)
static int
read_1_signed_byte (abfd, buf)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
char *buf;
{
return bfd_get_signed_8 (abfd, (bfd_byte *) buf);
@@ -178,9 +238,9 @@ read_8_bytes (abfd, buf)
static char *
read_n_bytes (abfd, buf, size)
- bfd * abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
char *buf;
- unsigned int size;
+ unsigned int size ATTRIBUTE_UNUSED;
{
/* If the size of a host char is 8 bits, we can return a pointer
to the buffer, otherwise we have to copy the data to a buffer
@@ -190,7 +250,7 @@ read_n_bytes (abfd, buf, size)
static char *
read_string (abfd, buf, bytes_read_ptr)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
char *buf;
unsigned int *bytes_read_ptr;
{
@@ -208,86 +268,85 @@ read_string (abfd, buf, bytes_read_ptr)
static unsigned int
read_unsigned_leb128 (abfd, buf, bytes_read_ptr)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
char *buf;
unsigned int *bytes_read_ptr;
{
- unsigned int result, num_read;
- int i, shift;
+ unsigned int result;
+ unsigned int num_read;
+ int shift;
unsigned char byte;
- result = 0;
- shift = 0;
+ result = 0;
+ shift = 0;
num_read = 0;
- i = 0;
- while (1)
+
+ do
{
byte = bfd_get_8 (abfd, (bfd_byte *) buf);
- buf++;
- num_read++;
- result |= ((byte & 127) << shift);
- if ((byte & 128) == 0)
- {
- break;
- }
+ buf ++;
+ num_read ++;
+ result |= ((byte & 0x7f) << shift);
shift += 7;
}
- *bytes_read_ptr = num_read;
+ while (byte & 0x80);
+
+ * bytes_read_ptr = num_read;
+
return result;
}
static int
read_signed_leb128 (abfd, buf, bytes_read_ptr)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
char *buf;
- unsigned int *bytes_read_ptr;
+ unsigned int * bytes_read_ptr;
{
- int result;
- int i, shift, size, num_read;
+ int result;
+ int shift;
+ int num_read;
unsigned char byte;
result = 0;
shift = 0;
- size = 32;
num_read = 0;
- i = 0;
- while (1)
+
+ do
{
byte = bfd_get_8 (abfd, (bfd_byte *) buf);
- buf++;
- num_read++;
- result |= ((byte & 127) << shift);
+ buf ++;
+ num_read ++;
+ result |= ((byte & 0x7f) << shift);
shift += 7;
- if ((byte & 128) == 0)
- {
- break;
- }
- }
- if ((shift < size) && (byte & 0x40))
- {
- result |= -(1 << shift);
}
- *bytes_read_ptr = num_read;
+ while (byte & 0x80);
+
+ if ((shift < 32) && (byte & 0x40))
+ result |= -(1 << shift);
+
+ * bytes_read_ptr = num_read;
+
return result;
}
-/* END VERBATUM */
-
+/* END VERBATIM */
static bfd_vma
-read_address (abfd, buf)
- bfd *abfd;
+read_address (unit, buf)
+ struct comp_unit* unit;
char *buf;
{
- bfd_vma retval = 0;
-
- if (sizeof(retval) == 4)
+ switch (unit->addr_size)
{
- retval = bfd_get_32 (abfd, (bfd_byte *) buf);
- } else {
- retval = bfd_get_64 (abfd, (bfd_byte *) buf);
+ case 8:
+ return bfd_get_64 (unit->abfd, (bfd_byte *) buf);
+ case 4:
+ return bfd_get_32 (unit->abfd, (bfd_byte *) buf);
+ case 2:
+ return bfd_get_16 (unit->abfd, (bfd_byte *) buf);
+ default:
+ abort ();
}
- return retval;
}
@@ -367,13 +426,13 @@ read_abbrevs (abfd, offset)
msec = bfd_get_section_by_name (abfd, ".debug_abbrev");
if (! msec)
{
- (*_bfd_error_handler) ("Dwarf Error: Can't find .debug_abbrev section.");
+ (*_bfd_error_handler) (_("Dwarf Error: Can't find .debug_abbrev section."));
bfd_set_error (bfd_error_bad_value);
return 0;
}
- stash->dwarf_abbrev_size = bfd_get_section_size_before_reloc (msec);
- stash->dwarf_abbrev_buffer = (unsigned char*) bfd_alloc (abfd, stash->dwarf_abbrev_size);
+ stash->dwarf_abbrev_size = msec->_raw_size;
+ stash->dwarf_abbrev_buffer = (char*) bfd_alloc (abfd, stash->dwarf_abbrev_size);
if (! stash->dwarf_abbrev_buffer)
return 0;
@@ -385,7 +444,7 @@ read_abbrevs (abfd, offset)
if (offset > stash->dwarf_abbrev_size)
{
- (*_bfd_error_handler) ("Dwarf Error: Abbrev offset (%u) bigger than abbrev size (%u).",
+ (*_bfd_error_handler) (_("Dwarf Error: Abbrev offset (%u) bigger than abbrev size (%u)."),
offset, stash->dwarf_abbrev_size );
bfd_set_error (bfd_error_bad_value);
return 0;
@@ -459,12 +518,13 @@ read_abbrevs (abfd, offset)
/* Read an attribute described by an abbreviated attribute. */
static char *
-read_attribute (attr, abbrev, abfd, info_ptr)
- struct attribute *attr;
+read_attribute (attr, abbrev, unit, info_ptr)
+ struct attribute *attr;
struct attr_abbrev *abbrev;
- bfd *abfd;
- char *info_ptr;
+ struct comp_unit *unit;
+ char *info_ptr;
{
+ bfd *abfd = unit->abfd;
unsigned int bytes_read;
struct dwarf_block *blk;
@@ -474,8 +534,8 @@ read_attribute (attr, abbrev, abfd, info_ptr)
{
case DW_FORM_addr:
case DW_FORM_ref_addr:
- DW_ADDR (attr) = read_address (abfd, info_ptr);
- info_ptr += sizeof(bfd_vma);
+ DW_ADDR (attr) = read_address (unit, info_ptr);
+ info_ptr += unit->addr_size;
break;
case DW_FORM_block2:
blk = (struct dwarf_block *) bfd_alloc (abfd, sizeof (struct dwarf_block));
@@ -553,6 +613,10 @@ read_attribute (attr, abbrev, abfd, info_ptr)
DW_UNSND (attr) = read_4_bytes (abfd, info_ptr);
info_ptr += 4;
break;
+ case DW_FORM_ref8:
+ DW_UNSND (attr) = read_8_bytes (abfd, info_ptr);
+ info_ptr += 8;
+ break;
case DW_FORM_ref_udata:
DW_UNSND (attr) = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
info_ptr += bytes_read;
@@ -560,7 +624,7 @@ read_attribute (attr, abbrev, abfd, info_ptr)
case DW_FORM_strp:
case DW_FORM_indirect:
default:
- (*_bfd_error_handler) ("Dwarf Error: Invalid or unhandled FORM value: %d.",
+ (*_bfd_error_handler) (_("Dwarf Error: Invalid or unhandled FORM value: %d."),
abbrev->form);
bfd_set_error (bfd_error_bad_value);
}
@@ -580,6 +644,7 @@ struct line_info {
char* filename;
unsigned int line;
unsigned int column;
+ int end_sequence; /* end of (sequential) code sequence */
};
struct fileinfo {
@@ -602,12 +667,13 @@ struct line_info_table {
};
static void
-add_line_info (table, address, filename, line, column)
+add_line_info (table, address, filename, line, column, end_sequence)
struct line_info_table* table;
bfd_vma address;
char* filename;
unsigned int line;
unsigned int column;
+ int end_sequence;
{
struct line_info* info = (struct line_info*)
bfd_alloc (table->abfd, sizeof (struct line_info));
@@ -619,6 +685,7 @@ add_line_info (table, address, filename, line, column)
info->filename = filename;
info->line = line;
info->column = column;
+ info->end_sequence = end_sequence;
}
static char*
@@ -626,7 +693,16 @@ concat_filename (table, file)
struct line_info_table* table;
unsigned int file;
{
- char* filename = table->files[file - 1].name;
+ char* filename;
+
+ if (file - 1 >= table->num_files)
+ {
+ (*_bfd_error_handler)
+ (_("Dwarf Error: mangled line number section (bad file number)."));
+ return "<unknown>";
+ }
+
+ filename = table->files[file - 1].name;
if (*filename == '/')
return filename;
@@ -639,17 +715,59 @@ concat_filename (table, file)
}
}
-/* Decode the line number information for the compilation unit whose
- line number info is at OFFSET in the .debug_line section.
- The compilation directory of the file is passed in COMP_DIR. */
+static void
+arange_add (unit, low_pc, high_pc)
+ struct comp_unit *unit;
+ bfd_vma low_pc;
+ bfd_vma high_pc;
+{
+ struct arange *arange;
+
+ /* first see if we can cheaply extend an existing range: */
+ arange = &unit->arange;
+ do
+ {
+ if (low_pc == arange->high)
+ {
+ arange->high = high_pc;
+ return;
+ }
+ if (high_pc == arange->low)
+ {
+ arange->low = low_pc;
+ return;
+ }
+ arange = arange->next;
+ }
+ while (arange);
+
+ if (unit->arange.high == 0)
+ {
+ /* this is the first address range: store it in unit->arange: */
+ unit->arange.next = 0;
+ unit->arange.low = low_pc;
+ unit->arange.high = high_pc;
+ return;
+ }
+
+ /* need to allocate a new arange and insert it into the arange list: */
+ arange = bfd_zalloc (unit->abfd, sizeof (*arange));
+ arange->low = low_pc;
+ arange->high = high_pc;
+
+ arange->next = unit->arange.next;
+ unit->arange.next = arange;
+}
+
+/* Decode the line number information for UNIT. */
static struct line_info_table*
-decode_line_info (abfd, offset, comp_dir)
- bfd *abfd;
- unsigned int offset;
- char *comp_dir;
+decode_line_info (unit)
+ struct comp_unit *unit;
{
- static char* dwarf_line_buffer = 0;
+ bfd *abfd = unit->abfd;
+
+ struct dwarf2_debug *stash;
struct line_info_table* table;
@@ -660,7 +778,9 @@ decode_line_info (abfd, offset, comp_dir)
char *cur_file, *cur_dir;
unsigned char op_code, extended_op, adj_opcode;
- if (! dwarf_line_buffer)
+ stash = elf_tdata (abfd)->dwarf2_find_line_info;
+
+ if (! stash->dwarf_line_buffer)
{
asection *msec;
unsigned long size;
@@ -668,26 +788,29 @@ decode_line_info (abfd, offset, comp_dir)
msec = bfd_get_section_by_name (abfd, ".debug_line");
if (! msec)
{
- (*_bfd_error_handler) ("Dwarf Error: Can't find .debug_line section.");
+ (*_bfd_error_handler) (_("Dwarf Error: Can't find .debug_line section."));
bfd_set_error (bfd_error_bad_value);
return 0;
}
- size = bfd_get_section_size_before_reloc (msec);
- dwarf_line_buffer = (unsigned char*) bfd_alloc (abfd, size);
- if (! dwarf_line_buffer)
+ size = msec->_raw_size;
+ stash->dwarf_line_buffer = (char *) bfd_alloc (abfd, size);
+ if (! stash->dwarf_line_buffer)
return 0;
if (! bfd_get_section_contents (abfd, msec,
- dwarf_line_buffer, 0,
+ stash->dwarf_line_buffer, 0,
size))
return 0;
+
+ /* FIXME: We ought to apply the relocs against this section before
+ we process it.... */
}
table = (struct line_info_table*) bfd_alloc (abfd,
sizeof (struct line_info_table));
table->abfd = abfd;
- table->comp_dir = comp_dir;
+ table->comp_dir = unit->comp_dir;
table->num_files = 0;
table->files = NULL;
@@ -695,7 +818,10 @@ decode_line_info (abfd, offset, comp_dir)
table->num_dirs = 0;
table->dirs = NULL;
- line_ptr = dwarf_line_buffer + offset;
+ table->files = NULL;
+ table->last_line = NULL;
+
+ line_ptr = stash->dwarf_line_buffer + unit->line_offset;
/* read in the prologue */
lh.total_length = read_4_bytes (abfd, line_ptr);
@@ -778,7 +904,8 @@ decode_line_info (abfd, offset, comp_dir)
unsigned int column = 0;
int is_stmt = lh.default_is_stmt;
int basic_block = 0;
- int end_sequence = 0;
+ int end_sequence = 0, need_low_pc = 1;
+ bfd_vma low_pc = 0;
/* Decode the table. */
while (! end_sequence)
@@ -795,12 +922,18 @@ decode_line_info (abfd, offset, comp_dir)
{
case DW_LNE_end_sequence:
end_sequence = 1;
- add_line_info (table, address, filename, line, column);
+ add_line_info (table, address, filename, line, column,
+ end_sequence);
+ if (need_low_pc)
+ {
+ need_low_pc = 0;
+ low_pc = address;
+ }
+ arange_add (unit, low_pc, address);
break;
case DW_LNE_set_address:
- address = read_address (abfd, line_ptr);
- address &= 0xffffffff;
- line_ptr += sizeof (bfd_vma);
+ address = read_address (unit, line_ptr);
+ line_ptr += unit->addr_size;
break;
case DW_LNE_define_file:
cur_file = read_string (abfd, line_ptr, &bytes_read);
@@ -827,14 +960,19 @@ decode_line_info (abfd, offset, comp_dir)
table->num_files++;
break;
default:
- (*_bfd_error_handler) ("Dwarf Error: mangled line number section.");
+ (*_bfd_error_handler) (_("Dwarf Error: mangled line number section."));
bfd_set_error (bfd_error_bad_value);
return 0;
}
break;
case DW_LNS_copy:
- add_line_info (table, address, filename, line, column);
+ add_line_info (table, address, filename, line, column, 0);
basic_block = 0;
+ if (need_low_pc)
+ {
+ need_low_pc = 0;
+ low_pc = address;
+ }
break;
case DW_LNS_advance_pc:
address += lh.minimum_instruction_length
@@ -867,7 +1005,8 @@ decode_line_info (abfd, offset, comp_dir)
basic_block = 1;
break;
case DW_LNS_const_add_pc:
- address += (255 - lh.opcode_base) / lh.line_range;
+ address += lh.minimum_instruction_length
+ * ((255 - lh.opcode_base) / lh.line_range);
break;
case DW_LNS_fixed_advance_pc:
address += read_2_bytes (abfd, line_ptr);
@@ -879,8 +1018,13 @@ decode_line_info (abfd, offset, comp_dir)
* lh.minimum_instruction_length;
line += lh.line_base + (adj_opcode % lh.line_range);
/* append row to matrix using current values */
- add_line_info (table, address, filename, line, column);
+ add_line_info (table, address, filename, line, column, 0);
basic_block = 1;
+ if (need_low_pc)
+ {
+ need_low_pc = 0;
+ low_pc = address;
+ }
}
}
}
@@ -903,21 +1047,25 @@ lookup_address_in_line_info_table (table,
const char **filename_ptr;
unsigned int *linenumber_ptr;
{
+ struct line_info* next_line = table->last_line;
struct line_info* each_line;
- struct line_info* next_line;
- for (next_line = 0, each_line = table->last_line;
- each_line;
- next_line = each_line, each_line = each_line->prev_line)
+ if (!next_line)
+ return false;
+
+ each_line = next_line->prev_line;
+
+ while (each_line && next_line)
{
- if (addr >= each_line->address
- && (next_line == 0
- || addr < next_line->address))
+ if (!each_line->end_sequence
+ && addr >= each_line->address && addr < next_line->address)
{
*filename_ptr = each_line->filename;
*linenumber_ptr = each_line->line;
return true;
}
+ next_line = each_line;
+ each_line = each_line->prev_line;
}
return false;
@@ -953,8 +1101,7 @@ lookup_address_in_function_table (table,
each_func;
each_func = each_func->prev_func)
{
- if (addr >= (each_func->low & 0xffffffff)
- && addr < (each_func->high & 0xffffffff))
+ if (addr >= each_func->low && addr < each_func->high)
{
*functionname_ptr = each_func->name;
return true;
@@ -970,56 +1117,6 @@ lookup_address_in_function_table (table,
/* DWARF2 Compilation unit functions. */
-/* A minimal decoding of DWARF2 compilation units. We only decode
- what's needed to get to the line number information. */
-
-struct comp_unit {
-
- /* Chain the previously read compilation units. */
- struct comp_unit* next_unit;
-
- /* Keep the bdf convenient (for memory allocation). */
- bfd* abfd;
-
- /* The lowest and higest addresses contained in this compilation
- unit as specified in the compilation unit header. */
- bfd_vma low;
- bfd_vma high;
-
- /* The DW_AT_name attribute (for error messages). */
- char* name;
-
- /* The abbrev hash table. */
- struct abbrev_info** abbrevs;
-
- /* Note that an error was found by comp_unit_find_nearest_line. */
- int error;
-
- /* The DW_AT_comp_dir attribute */
- char* comp_dir;
-
- /* True if there is a line number table associated with this comp. unit. */
- int stmtlist;
-
- /* The offset into .debug_line of the line number table. */
- unsigned long line_offset;
-
- /* Pointer to the first child die for the comp unit. */
- char *first_child_die_ptr;
-
- /* The end of the comp unit. */
- char *end_ptr;
-
- /* The decoded line number, NULL if not yet decoded. */
- struct line_info_table* line_table;
-
- /* A list of the functions found in this comp. unit. */
- struct funcinfo* function_table;
-
-};
-
-
-
/* Scan over each die in a comp. unit looking for functions to add
to the function table. */
@@ -1051,7 +1148,7 @@ scan_unit_for_functions (unit)
abbrev = lookup_abbrev (abbrev_number,unit->abbrevs);
if (! abbrev)
{
- (*_bfd_error_handler) ("Dwarf Error: Could not find abbrev number %d.",
+ (*_bfd_error_handler) (_("Dwarf Error: Could not find abbrev number %d."),
abbrev_number);
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1068,7 +1165,7 @@ scan_unit_for_functions (unit)
for (i = 0; i < abbrev->num_attrs; ++i)
{
- info_ptr = read_attribute (&attr, &abbrev->attrs[i], abfd, info_ptr);
+ info_ptr = read_attribute (&attr, &abbrev->attrs[i], unit, info_ptr);
if (func)
{
@@ -1125,25 +1222,27 @@ scan_unit_for_functions (unit)
-/* Parse a DWARF2 compilation unit starting at INFO_PTR. This includes
- the compilation unit header that proceeds the DIE's, but does not
- include the length field that preceeds each compilation unit header.
- END_PTR points one past the end of this comp unit.
+/* Parse a DWARF2 compilation unit starting at INFO_PTR. This
+ includes the compilation unit header that proceeds the DIE's, but
+ does not include the length field that preceeds each compilation
+ unit header. END_PTR points one past the end of this comp unit.
+ If ABBREV_LENGTH is 0, then the length of the abbreviation offset
+ is assumed to be four bytes. Otherwise, it it is the size given.
This routine does not read the whole compilation unit; only enough
- to get to the line number information for the compilation unit.
- */
+ to get to the line number information for the compilation unit. */
-static struct comp_unit*
-parse_comp_unit (abfd, info_ptr, end_ptr)
+static struct comp_unit *
+parse_comp_unit (abfd, info_ptr, end_ptr, abbrev_length)
bfd* abfd;
char* info_ptr;
char* end_ptr;
+ unsigned int abbrev_length;
{
struct comp_unit* unit;
unsigned short version;
- unsigned int abbrev_offset;
+ unsigned int abbrev_offset = 0;
unsigned char addr_size;
struct abbrev_info** abbrevs;
@@ -1153,30 +1252,40 @@ parse_comp_unit (abfd, info_ptr, end_ptr)
version = read_2_bytes (abfd, info_ptr);
info_ptr += 2;
- abbrev_offset = read_4_bytes (abfd, info_ptr);
- info_ptr += 4;
+ BFD_ASSERT (abbrev_length == 0
+ || abbrev_length == 4
+ || abbrev_length == 8);
+ if (abbrev_length == 0 || abbrev_length == 4)
+ abbrev_offset = read_4_bytes (abfd, info_ptr);
+ else if (abbrev_length == 8)
+ abbrev_offset = read_8_bytes (abfd, info_ptr);
+ info_ptr += abbrev_length;
addr_size = read_1_byte (abfd, info_ptr);
info_ptr += 1;
if (version != 2)
{
- (*_bfd_error_handler) ("Dwarf Error: found dwarf version '%hu' in compilation unit '%s', this reader only handles version 2 information.",
- version,
- unit->name);
+ (*_bfd_error_handler) (_("Dwarf Error: found dwarf version '%hu', this reader only handles version 2 information."), version );
bfd_set_error (bfd_error_bad_value);
return 0;
}
- if (addr_size != sizeof (bfd_vma))
+ if (addr_size > sizeof (bfd_vma))
{
- (*_bfd_error_handler) ("Dwarf Error: found address size '%u' in compilation unit '%s', this readers only handles address size '%u'.",
+ (*_bfd_error_handler) (_("Dwarf Error: found address size '%u', this reader can not handle sizes greater than '%u'."),
addr_size,
- unit->name,
sizeof (bfd_vma));
bfd_set_error (bfd_error_bad_value);
return 0;
}
+ if (addr_size != 2 && addr_size != 4 && addr_size != 8)
+ {
+ (*_bfd_error_handler) ("Dwarf Error: found address size '%u', this reader can only handle address sizes '2', '4' and '8'.", addr_size );
+ bfd_set_error (bfd_error_bad_value);
+ return 0;
+ }
+
/* Read the abbrevs for this compilation unit into a table */
abbrevs = read_abbrevs (abfd, abbrev_offset);
if (! abbrevs)
@@ -1186,7 +1295,7 @@ parse_comp_unit (abfd, info_ptr, end_ptr)
info_ptr += bytes_read;
if (! abbrev_number)
{
- (*_bfd_error_handler) ("Dwarf Error: Bad abbrev number: %d.",
+ (*_bfd_error_handler) (_("Dwarf Error: Bad abbrev number: %d."),
abbrev_number);
bfd_set_error (bfd_error_bad_value);
return 0;
@@ -1195,7 +1304,7 @@ parse_comp_unit (abfd, info_ptr, end_ptr)
abbrev = lookup_abbrev (abbrev_number, abbrevs);
if (! abbrev)
{
- (*_bfd_error_handler) ("Dwarf Error: Could not find abbrev number %d.",
+ (*_bfd_error_handler) (_("Dwarf Error: Could not find abbrev number %d."),
abbrev_number);
bfd_set_error (bfd_error_bad_value);
return 0;
@@ -1203,12 +1312,13 @@ parse_comp_unit (abfd, info_ptr, end_ptr)
unit = (struct comp_unit*) bfd_zalloc (abfd, sizeof (struct comp_unit));
unit->abfd = abfd;
+ unit->addr_size = addr_size;
unit->abbrevs = abbrevs;
unit->end_ptr = end_ptr;
for (i = 0; i < abbrev->num_attrs; ++i)
{
- info_ptr = read_attribute (&attr, &abbrev->attrs[i], abfd, info_ptr);
+ info_ptr = read_attribute (&attr, &abbrev->attrs[i], unit, info_ptr);
/* Store the data if it is of an attribute we want to keep in a
partial symbol table. */
@@ -1224,11 +1334,11 @@ parse_comp_unit (abfd, info_ptr, end_ptr)
break;
case DW_AT_low_pc:
- unit->low = DW_ADDR (&attr);
+ unit->arange.low = DW_ADDR (&attr);
break;
case DW_AT_high_pc:
- unit->high = DW_ADDR (&attr);
+ unit->arange.high = DW_ADDR (&attr);
break;
case DW_AT_comp_dir:
@@ -1267,9 +1377,20 @@ comp_unit_contains_address (unit, addr)
struct comp_unit* unit;
bfd_vma addr;
{
- return ! unit->error
- && ( addr >= (unit->low & 0xffffffff)
- && addr <= (unit->high & 0xffffffff));
+ struct arange *arange;
+
+ if (unit->error)
+ return 0;
+
+ arange = &unit->arange;
+ do
+ {
+ if (addr >= arange->low && addr < arange->high)
+ return 1;
+ arange = arange->next;
+ }
+ while (arange);
+ return 0;
}
@@ -1304,9 +1425,7 @@ comp_unit_find_nearest_line (unit, addr,
return false;
}
- unit->line_table = decode_line_info (unit->abfd,
- unit->line_offset,
- unit->comp_dir);
+ unit->line_table = decode_line_info (unit);
if (! unit->line_table)
{
@@ -1331,19 +1450,25 @@ comp_unit_find_nearest_line (unit, addr,
return line_p || func_p;
}
-/* The DWARF2 version of find_nearest line.
- Return true if the line is found without error. */
+/* The DWARF2 version of find_nearest line. Return true if the line
+ is found without error. ADDR_SIZE is the number of bytes in the
+ initial .debug_info length field and in the abbreviation offset.
+ You may use zero to indicate that the default value should be
+ used. */
boolean
_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
- filename_ptr, functionname_ptr, linenumber_ptr)
+ filename_ptr, functionname_ptr,
+ linenumber_ptr,
+ addr_size)
bfd *abfd;
asection *section;
- asymbol **symbols;
+ asymbol **symbols ATTRIBUTE_UNUSED;
bfd_vma offset;
const char **filename_ptr;
const char **functionname_ptr;
unsigned int *linenumber_ptr;
+ unsigned int addr_size;
{
/* Read each compilation unit from the section .debug_info, and check
to see if it contains the address we are searching for. If yes,
@@ -1366,6 +1491,13 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
*functionname_ptr = NULL;
*linenumber_ptr = 0;
+ /* The DWARF2 spec says that the initial length field, and the
+ offset of the abbreviation table, should both be 4-byte values.
+ However, some compilers do things differently. */
+ if (addr_size == 0)
+ addr_size = 4;
+ BFD_ASSERT (addr_size == 4 || addr_size == 8);
+
if (! stash)
{
asection *msec;
@@ -1386,8 +1518,11 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
return false;
}
- size = bfd_get_section_size_before_reloc (msec);
- stash->info_ptr = (unsigned char*) bfd_alloc (abfd, size);
+ size = msec->_raw_size;
+ if (size == 0)
+ return false;
+
+ stash->info_ptr = (char *) bfd_alloc (abfd, size);
if (! stash->info_ptr)
return false;
@@ -1399,8 +1534,22 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
}
stash->info_ptr_end = stash->info_ptr + size;
- }
+ /* FIXME: There is a problem with the contents of the
+ .debug_info section. The 'low' and 'high' addresses of the
+ comp_units are computed by relocs against symbols in the
+ .text segment. We need these addresses in order to determine
+ the nearest line number, and so we have to resolve the
+ relocs. There is a similar problem when the .debug_line
+ section is processed as well (e.g., there may be relocs
+ against the operand of the DW_LNE_set_address operator).
+
+ Unfortunately getting hold of the reloc information is hard...
+
+ For now, this means that disassembling object files (as
+ opposed to fully executables) does not always work as well as
+ we would like. */
+ }
/* A null info_ptr indicates that there is no dwarf2 info
(or that an error occured while setting up the stash). */
@@ -1408,45 +1557,60 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
if (! stash->info_ptr)
return false;
-
-
/* Check the previously read comp. units first. */
for (each = stash->all_comp_units; each; each = each->next_unit)
- {
- if (comp_unit_contains_address (each, addr))
- return comp_unit_find_nearest_line (each, addr,
- filename_ptr,
- functionname_ptr,
- linenumber_ptr);
- }
-
+ if (comp_unit_contains_address (each, addr))
+ return comp_unit_find_nearest_line (each, addr, filename_ptr,
+ functionname_ptr, linenumber_ptr);
/* Read each remaining comp. units checking each as they are read. */
while (stash->info_ptr < stash->info_ptr_end)
{
struct comp_unit* each;
- unsigned int length;
+ bfd_vma length;
+ boolean found;
- length = read_4_bytes (abfd, stash->info_ptr);
- stash->info_ptr += 4;
+ if (addr_size == 4)
+ length = read_4_bytes (abfd, stash->info_ptr);
+ else
+ length = read_8_bytes (abfd, stash->info_ptr);
+ stash->info_ptr += addr_size;
if (length > 0)
{
each = parse_comp_unit (abfd, stash->info_ptr,
- stash->info_ptr + length);
+ stash->info_ptr + length,
+ addr_size);
stash->info_ptr += length;
if (each)
{
each->next_unit = stash->all_comp_units;
stash->all_comp_units = each;
-
- if (comp_unit_contains_address (each, addr))
- return comp_unit_find_nearest_line (each, addr,
- filename_ptr,
- functionname_ptr,
- linenumber_ptr);
+
+ /* DW_AT_low_pc and DW_AT_high_pc are optional for
+ compilation units. If we don't have them (i.e.,
+ unit->high == 0), we need to consult the line info
+ table to see if a compilation unit contains the given
+ address. */
+ if (each->arange.high > 0)
+ {
+ if (comp_unit_contains_address (each, addr))
+ return comp_unit_find_nearest_line (each, addr,
+ filename_ptr,
+ functionname_ptr,
+ linenumber_ptr);
+ }
+ else
+ {
+ found = comp_unit_find_nearest_line (each, addr,
+ filename_ptr,
+ functionname_ptr,
+ linenumber_ptr);
+ if (found)
+ return true;
+ }
}
}
}
diff --git a/contrib/binutils/bfd/ecoff.c b/contrib/binutils/bfd/ecoff.c
index 274baefc03b1..4b136ee1f885 100644
--- a/contrib/binutils/bfd/ecoff.c
+++ b/contrib/binutils/bfd/ecoff.c
@@ -1,5 +1,5 @@
/* Generic ECOFF (Extended-COFF) routines.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Free Software Foundation, Inc.
Original version by Per Bothner.
Full support added by Ian Lance Taylor, ian@cygnus.com.
@@ -72,7 +72,23 @@ static unsigned int ecoff_armap_hash PARAMS ((CONST char *s,
/* This stuff is somewhat copied from coffcode.h. */
-static asection bfd_debug_section = { "*DEBUG*" };
+static asection bfd_debug_section =
+{
+ /* name, index, next, flags, set_vma, reloc_done, linker_mark, gc_mark */
+ "*DEBUG*", 0, 0, 0, 0, 0, 0, 0,
+ /* vma, lma, _cooked_size, _raw_size, output_offset, output_section, */
+ 0, 0, 0, 0, 0, NULL,
+ /* alig, reloc..., orel..., reloc_count, filepos, rel_..., line_... */
+ 0, 0, 0, 0, 0, 0, 0,
+ /* userdata, contents, lineno, lineno_count */
+ 0, 0, 0, 0,
+ /* comdat_info, moving_line_filepos, target_index, used_by_bfd, */
+ NULL, 0, 0, 0,
+ /* cons, owner, symbol */
+ 0, 0, (struct symbol_cache_entry *) NULL,
+ /* symbol_ptr_ptr, link_order_head, ..._tail */
+ (struct symbol_cache_entry **) NULL, NULL, NULL
+};
/* Create an ECOFF object. */
@@ -138,7 +154,7 @@ _bfd_ecoff_mkobject_hook (abfd, filehdr, aouthdr)
boolean
_bfd_ecoff_new_section_hook (abfd, section)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
asection *section;
{
section->alignment_power = 4;
@@ -349,10 +365,11 @@ ecoff_sec_to_styp_flags (name, flags)
/*ARGSUSED*/
flagword
-_bfd_ecoff_styp_to_sec_flags (abfd, hdr, name)
- bfd *abfd;
+_bfd_ecoff_styp_to_sec_flags (abfd, hdr, name, section)
+ bfd *abfd ATTRIBUTE_UNUSED;
PTR hdr;
- const char *name;
+ const char *name ATTRIBUTE_UNUSED;
+ asection *section ATTRIBUTE_UNUSED;
{
struct internal_scnhdr *internal_s = (struct internal_scnhdr *) hdr;
long styp_flags = internal_s->s_flags;
@@ -496,7 +513,7 @@ ecoff_slurp_symbolic_header (abfd)
boolean
_bfd_ecoff_slurp_symbolic_info (abfd, ignore, debug)
bfd *abfd;
- asection *ignore;
+ asection *ignore ATTRIBUTE_UNUSED;
struct ecoff_debug_info *debug;
{
const struct ecoff_backend_data * const backend = ecoff_backend (abfd);
@@ -1305,7 +1322,7 @@ ecoff_type_to_string (abfd, fdr, indx)
break;
default:
- sprintf (p1, "Unknown basic type %d", (int) basic_type);
+ sprintf (p1, _("Unknown basic type %d"), (int) basic_type);
break;
}
@@ -1433,7 +1450,7 @@ ecoff_type_to_string (abfd, fdr, indx)
/*ARGSUSED*/
void
_bfd_ecoff_get_symbol_info (abfd, symbol, ret)
- bfd *abfd; /* Ignored. */
+ bfd *abfd ATTRIBUTE_UNUSED;
asymbol *symbol;
symbol_info *ret;
{
@@ -1445,7 +1462,7 @@ _bfd_ecoff_get_symbol_info (abfd, symbol, ret)
/*ARGSUSED*/
boolean
_bfd_ecoff_bfd_is_local_label_name (abfd, name)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
const char *name;
{
return name[0] == '$';
@@ -1577,17 +1594,17 @@ _bfd_ecoff_print_symbol (abfd, filep, symbol, how)
case stFile:
case stBlock:
- fprintf (file, "\n End+1 symbol: %ld",
+ fprintf (file, _("\n End+1 symbol: %ld"),
(long) (indx + sym_base));
break;
case stEnd:
if (ecoff_ext.asym.sc == scText
|| ecoff_ext.asym.sc == scInfo)
- fprintf (file, "\n First symbol: %ld",
+ fprintf (file, _("\n First symbol: %ld"),
(long) (indx + sym_base));
else
- fprintf (file, "\n First symbol: %ld",
+ fprintf (file, _("\n First symbol: %ld"),
((long)
(AUX_GET_ISYM (bigendian,
&aux_base[ecoff_ext.asym.index])
@@ -1599,14 +1616,14 @@ _bfd_ecoff_print_symbol (abfd, filep, symbol, how)
if (ECOFF_IS_STAB (&ecoff_ext.asym))
;
else if (ecoffsymbol (symbol)->local)
- fprintf (file, "\n End+1 symbol: %-7ld Type: %s",
+ fprintf (file, _("\n End+1 symbol: %-7ld Type: %s"),
((long)
(AUX_GET_ISYM (bigendian,
&aux_base[ecoff_ext.asym.index])
+ sym_base)),
ecoff_type_to_string (abfd, fdr, indx + 1));
else
- fprintf (file, "\n Local symbol: %ld",
+ fprintf (file, _("\n Local symbol: %ld"),
((long) indx
+ (long) sym_base
+ (ecoff_data (abfd)
@@ -1614,23 +1631,23 @@ _bfd_ecoff_print_symbol (abfd, filep, symbol, how)
break;
case stStruct:
- fprintf (file, "\n struct; End+1 symbol: %ld",
+ fprintf (file, _("\n struct; End+1 symbol: %ld"),
(long) (indx + sym_base));
break;
case stUnion:
- fprintf (file, "\n union; End+1 symbol: %ld",
+ fprintf (file, _("\n union; End+1 symbol: %ld"),
(long) (indx + sym_base));
break;
case stEnum:
- fprintf (file, "\n enum; End+1 symbol: %ld",
+ fprintf (file, _("\n enum; End+1 symbol: %ld"),
(long) (indx + sym_base));
break;
default:
if (! ECOFF_IS_STAB (&ecoff_ext.asym))
- fprintf (file, "\n Type: %s",
+ fprintf (file, _("\n Type: %s"),
ecoff_type_to_string (abfd, fdr, indx));
break;
}
@@ -1801,7 +1818,7 @@ _bfd_ecoff_find_nearest_line (abfd, section, ignore_symbols, offset,
filename_ptr, functionname_ptr, retline_ptr)
bfd *abfd;
asection *section;
- asymbol **ignore_symbols;
+ asymbol **ignore_symbols ATTRIBUTE_UNUSED;
bfd_vma offset;
CONST char **filename_ptr;
CONST char **functionname_ptr;
@@ -1971,7 +1988,7 @@ _bfd_ecoff_set_arch_mach (abfd, arch, machine)
int
_bfd_ecoff_sizeof_headers (abfd, reloc)
bfd *abfd;
- boolean reloc;
+ boolean reloc ATTRIBUTE_UNUSED;
{
asection *current;
int c;
@@ -3181,7 +3198,14 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx)
armap. */
hdr.ar_uid[0] = '0';
hdr.ar_gid[0] = '0';
+#if 0
hdr.ar_mode[0] = '0';
+#else
+ /* Building gcc ends up extracting the armap as a file - twice. */
+ hdr.ar_mode[0] = '6';
+ hdr.ar_mode[1] = '4';
+ hdr.ar_mode[2] = '4';
+#endif
sprintf (hdr.ar_size, "%-10d", (int) mapsize);
diff --git a/contrib/binutils/bfd/ecofflink.c b/contrib/binutils/bfd/ecofflink.c
index a120a2be7c58..25fc9664d2cb 100644
--- a/contrib/binutils/bfd/ecofflink.c
+++ b/contrib/binutils/bfd/ecofflink.c
@@ -1,5 +1,5 @@
/* Routines to link ECOFF debugging information.
- Copyright 1993, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1993, 94, 95, 96, 97, 1999 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
@@ -491,9 +491,9 @@ add_memory_shuffle (ainfo, head, tail, data, size)
/*ARGSUSED*/
PTR
bfd_ecoff_debug_init (output_bfd, output_debug, output_swap, info)
- bfd *output_bfd;
+ bfd *output_bfd ATTRIBUTE_UNUSED;
struct ecoff_debug_info *output_debug;
- const struct ecoff_debug_swap *output_swap;
+ const struct ecoff_debug_swap *output_swap ATTRIBUTE_UNUSED;
struct bfd_link_info *info;
{
struct accumulate *ainfo;
@@ -551,9 +551,9 @@ bfd_ecoff_debug_init (output_bfd, output_debug, output_swap, info)
void
bfd_ecoff_debug_free (handle, output_bfd, output_debug, output_swap, info)
PTR handle;
- bfd *output_bfd;
- struct ecoff_debug_info *output_debug;
- const struct ecoff_debug_swap *output_swap;
+ bfd *output_bfd ATTRIBUTE_UNUSED;
+ struct ecoff_debug_info *output_debug ATTRIBUTE_UNUSED;
+ const struct ecoff_debug_swap *output_swap ATTRIBUTE_UNUSED;
struct bfd_link_info *info;
{
struct accumulate *ainfo = (struct accumulate *) handle;
@@ -1412,7 +1412,7 @@ bfd_ecoff_debug_one_external (abfd, debug, swap, name, esym)
/*ARGSUSED*/
static void
ecoff_align_debug (abfd, debug, swap)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
struct ecoff_debug_info *debug;
const struct ecoff_debug_swap *swap;
{
diff --git a/contrib/binutils/bfd/elf-bfd.h b/contrib/binutils/bfd/elf-bfd.h
index 571998a9e905..0dcecdf58847 100644
--- a/contrib/binutils/bfd/elf-bfd.h
+++ b/contrib/binutils/bfd/elf-bfd.h
@@ -1,5 +1,6 @@
/* BFD back-end data structures for ELF files.
- Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999, 2000 Free Software
+ Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -85,6 +86,16 @@ struct elf_link_hash_entry
/* Symbol index as a dynamic symbol. Initialized to -1, and remains
-1 if this is not a dynamic symbol. */
+ /* ??? Note that this is consistently used as a synonym for tests
+ against whether we can perform various simplifying transformations
+ to the code. (E.g. changing a pc-relative jump to a PLT entry
+ into a pc-relative jump to the target function.) That test, which
+ is often relatively complex, and someplaces wrong or incomplete,
+ should really be replaced by a predicate in elflink.c.
+
+ End result: this field -1 does not indicate that the symbol is
+ not in the dynamic symbol table, but rather that the symbol is
+ not visible outside this DSO. */
long dynindx;
/* String table index in .dynstr if this is a dynamic symbol. */
@@ -96,17 +107,24 @@ struct elf_link_hash_entry
struct elf_link_hash_entry *weakdef;
/* If this symbol requires an entry in the global offset table, the
- processor specific backend uses this field to hold the offset
- into the .got section. If this field is -1, then the symbol does
- not require a global offset table entry. */
- bfd_vma got_offset;
-
- /* If this symbol requires an entry in the procedure linkage table,
- the processor specific backend uses these two fields to hold the
- offset into the procedure linkage section and the offset into the
- .got section. If plt_offset is -1, then the symbol does not
- require an entry in the procedure linkage table. */
- bfd_vma plt_offset;
+ processor specific backend uses this field to track usage and
+ final offset. We use a union and two names primarily to document
+ the intent of any particular piece of code. The field should be
+ used as a count until size_dynamic_sections, at which point the
+ contents of the .got is fixed. Afterward, if this field is -1,
+ then the symbol does not require a global offset table entry. */
+ union
+ {
+ bfd_signed_vma refcount;
+ bfd_vma offset;
+ } got;
+
+ /* Same, but tracks a procedure linkage table entry. */
+ union
+ {
+ bfd_signed_vma refcount;
+ bfd_vma offset;
+ } plt;
/* If this symbol is used in the linker created sections, the processor
specific backend uses this field to map the field into the offset
@@ -126,12 +144,25 @@ struct elf_link_hash_entry
struct bfd_elf_version_tree *vertree;
} verinfo;
+ /* Virtual table entry use information. This array is nominally of size
+ size/sizeof(target_void_pointer), though we have to be able to assume
+ and track a size while the symbol is still undefined. It is indexed
+ via offset/sizeof(target_void_pointer). */
+ size_t vtable_entries_size;
+ boolean *vtable_entries_used;
+
+ /* Virtual table derivation info. */
+ struct elf_link_hash_entry *vtable_parent;
+
/* Symbol type (STT_NOTYPE, STT_OBJECT, etc.). */
char type;
- /* Symbol st_other value. */
+ /* Symbol st_other value, symbol visibility. */
unsigned char other;
+ /* Hash value of the name computed using the ELF hash function. */
+ unsigned long elf_hash_value;
+
/* Some flags; legal values follow. */
unsigned short elf_link_hash_flags;
/* Symbol is referenced by a non-shared object. */
@@ -142,18 +173,44 @@ struct elf_link_hash_entry
#define ELF_LINK_HASH_REF_DYNAMIC 04
/* Symbol is defined by a shared object. */
#define ELF_LINK_HASH_DEF_DYNAMIC 010
+ /* Symbol has a non-weak reference from a non-shared object. */
+#define ELF_LINK_HASH_REF_REGULAR_NONWEAK 020
/* Dynamic symbol has been adjustd. */
-#define ELF_LINK_HASH_DYNAMIC_ADJUSTED 020
+#define ELF_LINK_HASH_DYNAMIC_ADJUSTED 040
/* Symbol needs a copy reloc. */
-#define ELF_LINK_HASH_NEEDS_COPY 040
+#define ELF_LINK_HASH_NEEDS_COPY 0100
/* Symbol needs a procedure linkage table entry. */
-#define ELF_LINK_HASH_NEEDS_PLT 0100
+#define ELF_LINK_HASH_NEEDS_PLT 0200
/* Symbol appears in a non-ELF input file. */
-#define ELF_LINK_NON_ELF 0200
+#define ELF_LINK_NON_ELF 0400
/* Symbol should be marked as hidden in the version information. */
-#define ELF_LINK_HIDDEN 0400
+#define ELF_LINK_HIDDEN 01000
/* Symbol was forced to local scope due to a version script file. */
-#define ELF_LINK_FORCED_LOCAL 01000
+#define ELF_LINK_FORCED_LOCAL 02000
+ /* Symbol was marked during garbage collection. */
+#define ELF_LINK_HASH_MARK 04000
+ /* Symbol is referenced by a non-GOT/non-PLT relocation. This is
+ not currently set by all the backends. */
+#define ELF_LINK_NON_GOT_REF 010000
+};
+
+/* Records local symbols to be emitted in the dynamic symbol table. */
+
+struct elf_link_local_dynamic_entry
+{
+ struct elf_link_local_dynamic_entry *next;
+
+ /* The input bfd this symbol came from. */
+ bfd *input_bfd;
+
+ /* The index of the local symbol being copied. */
+ long input_indx;
+
+ /* The index in the outgoing dynamic symbol table. */
+ long dynindx;
+
+ /* A copy of the input symbol. */
+ Elf_Internal_Sym isym;
};
/* ELF linker hash table. */
@@ -184,6 +241,8 @@ struct elf_link_hash_table
struct elf_link_hash_entry *hgot;
/* A pointer to information used to link stabs in sections. */
PTR stab_info;
+ /* A linked list of local symbols to be added to .dynsym. */
+ struct elf_link_local_dynamic_entry *dynlocal;
};
/* Look up an entry in an ELF linker hash table. */
@@ -211,6 +270,13 @@ struct elf_size_info {
unsigned char sizeof_ehdr, sizeof_phdr, sizeof_shdr;
unsigned char sizeof_rel, sizeof_rela, sizeof_sym, sizeof_dyn, sizeof_note;
+ /* The size of entries in the .hash section. */
+ unsigned char sizeof_hash_entry;
+
+ /* The number of internal relocations to allocate per external
+ relocation entry. */
+ unsigned char int_rels_per_ext_rel;
+
unsigned char arch_size, file_align;
unsigned char elfclass, ev_current;
int (*write_out_phdrs) PARAMS ((bfd *, const Elf_Internal_Phdr *, int));
@@ -221,6 +287,32 @@ struct elf_size_info {
PARAMS ((bfd *, asection *, asymbol **, boolean));
long (*slurp_symbol_table) PARAMS ((bfd *, asymbol **, boolean));
void (*swap_dyn_in) PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *));
+ void (*swap_dyn_out) PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR));
+
+ /* This function, if defined, is called to swap in a REL
+ relocation. If an external relocation corresponds to more than
+ one internal relocation, then all relocations are swapped in at
+ once. */
+ void (*swap_reloc_in)
+ PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rel *));
+
+ /* This function, if defined, is called to swap out a REL
+ relocation. */
+ void (*swap_reloc_out)
+ PARAMS ((bfd *, const Elf_Internal_Rel *, bfd_byte *));
+
+ /* This function, if defined, is called to swap in a RELA
+ relocation. If an external relocation corresponds to more than
+ one internal relocation, then all relocations are swapped in at
+ once. */
+ void (*swap_reloca_in)
+ PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
+
+ /* This function, if defined, is called to swap out a RELA
+ relocation. */
+ void (*swap_reloca_out)
+ PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
+
};
#define elf_symbol_from(ABFD,S) \
@@ -231,11 +323,6 @@ struct elf_size_info {
struct elf_backend_data
{
- /* Whether the backend uses REL or RELA relocations. FIXME: some
- ELF backends use both. When we need to support one, this whole
- approach will need to be changed. */
- int use_rela_p;
-
/* The architecture for this backend. */
enum bfd_architecture arch;
@@ -245,18 +332,6 @@ struct elf_backend_data
/* The maximum page size for this backend. */
bfd_vma maxpagesize;
- /* This is true if the linker should act like collect and gather
- global constructors and destructors by name. This is true for
- MIPS ELF because the Irix 5 tools can not handle the .init
- section. */
- boolean collect;
-
- /* This is true if the linker should ignore changes to the type of a
- symbol. This is true for MIPS ELF because some Irix 5 objects
- record undefined functions as STT_OBJECT although the definitions
- are STT_FUNC. */
- boolean type_change_ok;
-
/* A function to translate an ELF RELA relocation to a BFD arelent
structure. */
void (*elf_info_to_howto) PARAMS ((bfd *, arelent *,
@@ -296,6 +371,10 @@ struct elf_backend_data
elf_symbol_type *,
unsigned int));
+ /* A function to set the type of the info field. Processor-specific
+ types should be handled here. */
+ int (*elf_backend_get_symbol_type) PARAMS (( Elf_Internal_Sym *, int));
+
/* A function to do additional processing on the ELF section header
just before writing it out. This is used to set the flags and
type fields for some sections, or to actually write out data for
@@ -309,6 +388,12 @@ struct elf_backend_data
Elf32_Internal_Shdr *,
char *));
+ /* A function to handle unusual program segment types when creating BFD
+ sections from ELF program segments. */
+ boolean (*elf_backend_section_from_phdr) PARAMS ((bfd *,
+ Elf32_Internal_Phdr *,
+ int));
+
/* A function to set up the ELF section header for a BFD section in
preparation for writing it out. This is where the flags and type
fields are set for unusual sections. */
@@ -473,6 +558,51 @@ struct elf_backend_data
backend specific fashion. */
boolean (*elf_backend_modify_segment_map) PARAMS ((bfd *));
+ /* This function is called during section gc to discover the section a
+ particular relocation refers to. It need not be defined for hosts
+ that have no queer relocation types. */
+ asection * (*gc_mark_hook)
+ PARAMS ((bfd *abfd, struct bfd_link_info *, Elf_Internal_Rela *,
+ struct elf_link_hash_entry *h, Elf_Internal_Sym *));
+
+ /* This function, if defined, is called during the sweep phase of gc
+ in order that a backend might update any data structures it might
+ be maintaining. */
+ boolean (*gc_sweep_hook)
+ PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *o,
+ const Elf_Internal_Rela *relocs));
+
+ /* This function, if defined, is called after the ELF headers have
+ been created. This allows for things like the OS and ABI versions
+ to be changed. */
+ void (*elf_backend_post_process_headers)
+ PARAMS ((bfd *, struct bfd_link_info *));
+
+ /* This function, if defined, prints a symbol to file and returns the
+ name of the symbol to be printed. It should return NULL to fall
+ back to default symbol printing. */
+ const char *(*elf_backend_print_symbol_all)
+ PARAMS ((bfd *, PTR, asymbol *));
+
+ /* This function, if defined, is called after all local symbols and
+ global symbols converted to locals are emited into the symtab
+ section. It allows the backend to emit special global symbols
+ not handled in the hash table. */
+ boolean (*elf_backend_output_arch_syms)
+ PARAMS ((bfd *, struct bfd_link_info *, PTR,
+ boolean (*) PARAMS ((PTR, const char *,
+ Elf_Internal_Sym *, asection *))));
+
+ /* Copy any information related to dynamic linking from a pre-existing
+ symbol IND to a newly created symbol DIR. */
+ void (*elf_backend_copy_indirect_symbol)
+ PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *));
+
+ /* Modify any information related to dynamic linking such that the
+ symbol is not exported. */
+ void (*elf_backend_hide_symbol)
+ PARAMS ((struct elf_link_hash_entry *));
+
/* The swapping table to use when dealing with ECOFF information.
Used for the MIPS ELF .mdebug section. */
const struct ecoff_debug_swap *elf_backend_ecoff_debug_swap;
@@ -487,11 +617,51 @@ struct elf_backend_data
.got section */
bfd_vma got_symbol_offset;
+ /* The size in bytes of the headers for the GOT and PLT. This includes
+ the so-called reserved entries on some systems. */
+ bfd_vma got_header_size;
+ bfd_vma plt_header_size;
+
+ /* This is true if the linker should act like collect and gather
+ global constructors and destructors by name. This is true for
+ MIPS ELF because the Irix 5 tools can not handle the .init
+ section. */
+ unsigned collect : 1;
+
+ /* This is true if the linker should ignore changes to the type of a
+ symbol. This is true for MIPS ELF because some Irix 5 objects
+ record undefined functions as STT_OBJECT although the definitions
+ are STT_FUNC. */
+ unsigned type_change_ok : 1;
+
+ /* Whether the backend may use REL relocations. (Some backends use
+ both REL and RELA relocations, and this flag is set for those
+ backends.) */
+ unsigned may_use_rel_p : 1;
+
+ /* Whether the backend may use RELA relocations. (Some backends use
+ both REL and RELA relocations, and this flag is set for those
+ backends.) */
+ unsigned may_use_rela_p : 1;
+
+ /* Whether the default relocation type is RELA. If a backend with
+ this flag set wants REL relocations for a particular section,
+ it must note that explicitly. Similarly, if this flag is clear,
+ and the backend wants RELA relocations for a particular
+ section. */
+ unsigned default_use_rela_p : 1;
+
+ /* True if addresses "naturally" sign extend. This is used when
+ swapping in from Elf32 when BFD64. */
+ unsigned sign_extend_vma : 1;
+
unsigned want_got_plt : 1;
unsigned plt_readonly : 1;
unsigned want_plt_sym : 1;
unsigned plt_not_loaded : 1;
unsigned plt_alignment : 4;
+ unsigned can_gc_sections : 1;
+ unsigned want_dynbss : 1;
};
/* Information stored for each BFD section in an ELF file. This
@@ -507,12 +677,19 @@ struct bfd_elf_section_data
/* If there is a second reloc section associated with this section,
as can happen on Irix 6, this field points to the header. */
Elf_Internal_Shdr *rel_hdr2;
+ /* The number of relocations currently assigned to REL_HDR. */
+ unsigned int rel_count;
+ /* The number of relocations currently assigned to REL_HDR2. */
+ unsigned int rel_count2;
/* The ELF section number of this section. Only used for an output
file. */
int this_idx;
- /* The ELF section number of the reloc section associated with this
- section, if any. Only used for an output file. */
+ /* The ELF section number of the reloc section indicated by
+ REL_HDR if any. Only used for an output file. */
int rel_idx;
+ /* The ELF section number of the reloc section indicated by
+ REL_HDR2 if any. Only used for an output file. */
+ int rel_idx2;
/* Used by the backend linker to store the symbol hash table entries
associated with relocs against global symbols. */
struct elf_link_hash_entry **rel_hashes;
@@ -522,12 +699,15 @@ struct bfd_elf_section_data
Elf_Internal_Rela *relocs;
/* Used by the backend linker when generating a shared library to
record the dynamic symbol index for a section symbol
- corresponding to this section. */
+ corresponding to this section. A value of 0 means that there is
+ no dynamic symbol for this section. */
long dynindx;
/* A pointer used for .stab linking optimizations. */
PTR stab_info;
/* A pointer available for the processor specific ELF backend. */
PTR tdata;
+ /* Nonzero if this section uses RELA relocations, rather than REL. */
+ unsigned int use_rela_p:1;
};
#define elf_section_data(sec) ((struct bfd_elf_section_data*)sec->used_by_bfd)
@@ -606,11 +786,22 @@ struct elf_obj_tdata
unsigned int strtab_section, dynsymtab_section;
unsigned int dynversym_section, dynverdef_section, dynverref_section;
file_ptr next_file_pos;
+#if 0
+ /* we don't need these inside bfd anymore, and I think
+ these weren't used outside bfd. */
void *prstatus; /* The raw /proc prstatus structure */
void *prpsinfo; /* The raw /proc prpsinfo structure */
+#endif
bfd_vma gp; /* The gp value (MIPS only, for now) */
unsigned int gp_size; /* The gp size (MIPS only, for now) */
+ /* Information grabbed from an elf core file. */
+ int core_signal;
+ int core_pid;
+ int core_lwpid;
+ char* core_program;
+ char* core_command;
+
/* This is set to true if the object was created by the backend
linker. */
boolean linker;
@@ -621,8 +812,17 @@ struct elf_obj_tdata
struct elf_link_hash_entry **sym_hashes;
/* A mapping from local symbols to offsets into the global offset
- table, used when linking. This is indexed by the symbol index. */
- bfd_vma *local_got_offsets;
+ table, used when linking. This is indexed by the symbol index.
+ Like for the globals, we use a union and two names primarily to
+ document the intent of any particular piece of code. The field
+ should be used as a count until size_dynamic_sections, at which
+ point the contents of the .got is fixed. Afterward, if an entry
+ is -1, then the symbol does not require a global offset table entry. */
+ union
+ {
+ bfd_signed_vma *refcounts;
+ bfd_vma *offsets;
+ } local_got;
/* A mapping from local symbols to offsets into the various linker
sections added. This is index by the symbol index. */
@@ -657,6 +857,9 @@ struct elf_obj_tdata
find_nearest_line. */
struct mips_elf_find_line *find_line_info;
+ /* A place to stash dwarf1 info for this bfd. */
+ struct dwarf1_debug *dwarf1_find_line_info;
+
/* A place to stash dwarf2 info for this bfd. */
struct dwarf2_debug *dwarf2_find_line_info;
@@ -701,7 +904,8 @@ struct elf_obj_tdata
#define elf_gp(bfd) (elf_tdata(bfd) -> gp)
#define elf_gp_size(bfd) (elf_tdata(bfd) -> gp_size)
#define elf_sym_hashes(bfd) (elf_tdata(bfd) -> sym_hashes)
-#define elf_local_got_offsets(bfd) (elf_tdata(bfd) -> local_got_offsets)
+#define elf_local_got_refcounts(bfd) (elf_tdata(bfd) -> local_got.refcounts)
+#define elf_local_got_offsets(bfd) (elf_tdata(bfd) -> local_got.offsets)
#define elf_local_ptr_offsets(bfd) (elf_tdata(bfd) -> linker_section_pointers)
#define elf_dt_name(bfd) (elf_tdata(bfd) -> dt_name)
#define elf_bad_symtab(bfd) (elf_tdata(bfd) -> bad_symtab)
@@ -743,7 +947,7 @@ extern void bfd_elf_print_symbol PARAMS ((bfd *, PTR, asymbol *,
#define bfd_elf32_print_symbol bfd_elf_print_symbol
#define bfd_elf64_print_symbol bfd_elf_print_symbol
-extern unsigned long bfd_elf_hash PARAMS ((CONST unsigned char *));
+extern unsigned long bfd_elf_hash PARAMS ((const char *));
extern bfd_reloc_status_type bfd_elf_generic_reloc PARAMS ((bfd *,
arelent *,
@@ -753,13 +957,20 @@ extern bfd_reloc_status_type bfd_elf_generic_reloc PARAMS ((bfd *,
bfd *,
char **));
extern boolean bfd_elf_mkobject PARAMS ((bfd *));
+extern boolean bfd_elf_mkcorefile PARAMS ((bfd *));
extern Elf_Internal_Shdr *bfd_elf_find_section PARAMS ((bfd *, char *));
extern boolean _bfd_elf_make_section_from_shdr
PARAMS ((bfd *abfd, Elf_Internal_Shdr *hdr, const char *name));
+extern boolean _bfd_elf_make_section_from_phdr
+ PARAMS ((bfd *abfd, Elf_Internal_Phdr *hdr, int index, const char *typename));
extern struct bfd_hash_entry *_bfd_elf_link_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
extern struct bfd_link_hash_table *_bfd_elf_link_hash_table_create
PARAMS ((bfd *));
+extern void _bfd_elf_link_hash_copy_indirect
+ PARAMS ((struct elf_link_hash_entry *, struct elf_link_hash_entry *));
+extern void _bfd_elf_link_hash_hide_symbol
+ PARAMS ((struct elf_link_hash_entry *));
extern boolean _bfd_elf_link_hash_table_init
PARAMS ((struct elf_link_hash_table *, bfd *,
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
@@ -772,6 +983,7 @@ extern boolean _bfd_elf_copy_private_symbol_data
extern boolean _bfd_elf_copy_private_section_data
PARAMS ((bfd *, asection *, bfd *, asection *));
extern boolean _bfd_elf_write_object_contents PARAMS ((bfd *));
+extern boolean _bfd_elf_write_corefile_contents PARAMS ((bfd *));
extern boolean _bfd_elf_set_section_contents PARAMS ((bfd *, sec_ptr, PTR,
file_ptr,
bfd_size_type));
@@ -801,6 +1013,8 @@ extern boolean _bfd_elf_find_nearest_line PARAMS ((bfd *, asection *,
#define _bfd_elf_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
extern int _bfd_elf_sizeof_headers PARAMS ((bfd *, boolean));
extern boolean _bfd_elf_new_section_hook PARAMS ((bfd *, asection *));
+extern boolean _bfd_elf_init_reloc_shdr
+ PARAMS ((bfd *, Elf_Internal_Shdr *, asection *, boolean));
/* If the target doesn't have reloc handling written yet: */
extern void _bfd_elf_no_info_to_howto PARAMS ((bfd *, arelent *,
@@ -818,6 +1032,9 @@ struct bfd_strtab_hash *_bfd_elf_stringtab_init PARAMS ((void));
boolean
_bfd_elf_link_record_dynamic_symbol PARAMS ((struct bfd_link_info *,
struct elf_link_hash_entry *));
+long
+_bfd_elf_link_lookup_local_dynindx PARAMS ((struct bfd_link_info *,
+ bfd *, long));
boolean
_bfd_elf_compute_section_file_positions PARAMS ((bfd *,
struct bfd_link_info *));
@@ -832,6 +1049,8 @@ boolean _bfd_elf_create_dynamic_sections PARAMS ((bfd *,
struct bfd_link_info *));
boolean _bfd_elf_create_got_section PARAMS ((bfd *,
struct bfd_link_info *));
+unsigned long _bfd_elf_link_renumber_dynsyms PARAMS ((bfd *,
+ struct bfd_link_info *));
elf_linker_section_t *_bfd_elf_create_linker_section
PARAMS ((bfd *abfd,
@@ -883,6 +1102,9 @@ boolean _bfd_elf_make_linker_section_rela
elf_linker_section_t *lsect,
int alignment));
+boolean _bfd_elfcore_section_from_phdr
+ PARAMS ((bfd *, Elf_Internal_Phdr *, int));
+
extern const bfd_target *bfd_elf32_object_p PARAMS ((bfd *));
extern const bfd_target *bfd_elf32_core_file_p PARAMS ((bfd *));
extern char *bfd_elf32_core_file_failing_command PARAMS ((bfd *));
@@ -914,7 +1136,7 @@ extern void bfd_elf32_swap_phdr_out
extern void bfd_elf32_swap_dyn_in
PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *));
extern void bfd_elf32_swap_dyn_out
- PARAMS ((bfd *, const Elf_Internal_Dyn *, Elf32_External_Dyn *));
+ PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR));
extern long bfd_elf32_slurp_symbol_table
PARAMS ((bfd *, asymbol **, boolean));
extern boolean bfd_elf32_write_shdrs_and_ehdr PARAMS ((bfd *));
@@ -957,7 +1179,7 @@ extern void bfd_elf64_swap_phdr_out
extern void bfd_elf64_swap_dyn_in
PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *));
extern void bfd_elf64_swap_dyn_out
- PARAMS ((bfd *, const Elf_Internal_Dyn *, Elf64_External_Dyn *));
+ PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR));
extern long bfd_elf64_slurp_symbol_table
PARAMS ((bfd *, asymbol **, boolean));
extern boolean bfd_elf64_write_shdrs_and_ehdr PARAMS ((bfd *));
@@ -970,16 +1192,48 @@ extern boolean bfd_elf64_link_create_dynamic_sections
extern Elf_Internal_Rela *_bfd_elf64_link_read_relocs
PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, boolean));
-#define bfd_elf32_link_record_dynamic_symbol _bfd_elf_link_record_dynamic_symbol
-#define bfd_elf64_link_record_dynamic_symbol _bfd_elf_link_record_dynamic_symbol
+#define bfd_elf32_link_record_dynamic_symbol \
+ _bfd_elf_link_record_dynamic_symbol
+#define bfd_elf64_link_record_dynamic_symbol \
+ _bfd_elf_link_record_dynamic_symbol
+
+boolean _bfd_elf32_link_record_local_dynamic_symbol
+ PARAMS ((struct bfd_link_info *, bfd *, long));
+boolean _bfd_elf64_link_record_local_dynamic_symbol
+ PARAMS ((struct bfd_link_info *, bfd *, long));
extern boolean _bfd_elf_close_and_cleanup PARAMS ((bfd *));
+extern bfd_reloc_status_type _bfd_elf_rel_vtable_reloc_fn
+ PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR,
+ asection *, bfd *, char **));
+
+boolean _bfd_elf32_gc_sections
+ PARAMS ((bfd *abfd, struct bfd_link_info *info));
+boolean _bfd_elf32_gc_common_finalize_got_offsets
+ PARAMS ((bfd *abfd, struct bfd_link_info *info));
+boolean _bfd_elf32_gc_common_final_link
+ PARAMS ((bfd *, struct bfd_link_info *));
+boolean _bfd_elf32_gc_record_vtinherit
+ PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma));
+boolean _bfd_elf32_gc_record_vtentry
+ PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma));
+
+boolean _bfd_elf64_gc_sections
+ PARAMS ((bfd *abfd, struct bfd_link_info *info));
+boolean _bfd_elf64_gc_common_finalize_got_offsets
+ PARAMS ((bfd *abfd, struct bfd_link_info *info));
+boolean _bfd_elf64_gc_common_final_link
+ PARAMS ((bfd *, struct bfd_link_info *));
+boolean _bfd_elf64_gc_record_vtinherit
+ PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma));
+boolean _bfd_elf64_gc_record_vtentry
+ PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma));
/* MIPS ELF specific routines. */
extern boolean _bfd_mips_elf_object_p PARAMS ((bfd *));
extern boolean _bfd_mips_elf_section_from_shdr
- PARAMS ((bfd *, Elf_Internal_Shdr *, const char *));
+ PARAMS ((bfd *, Elf_Internal_Shdr *, char *));
extern boolean _bfd_mips_elf_fake_sections
PARAMS ((bfd *, Elf_Internal_Shdr *, asection *));
extern boolean _bfd_mips_elf_section_from_bfd_section
@@ -1008,5 +1262,48 @@ extern boolean _bfd_mips_elf_find_nearest_line
const char **, unsigned int *));
extern boolean _bfd_mips_elf_set_section_contents
PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
+extern boolean _bfd_mips_elf_create_dynamic_sections
+ PARAMS ((bfd *, struct bfd_link_info *));
+extern boolean _bfd_mips_elf_add_symbol_hook
+ PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
+ const char **, flagword *, asection **, bfd_vma *));
+extern boolean _bfd_mips_elf_adjust_dynamic_symbol
+ PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
+extern boolean _bfd_mips_elf_finish_dynamic_symbol
+ PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
+ Elf_Internal_Sym *));
+extern boolean _bfd_mips_elf_finish_dynamic_sections
+ PARAMS ((bfd *, struct bfd_link_info *));
+extern asection * _bfd_mips_elf_gc_mark_hook
+ PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *,
+ struct elf_link_hash_entry *, Elf_Internal_Sym *));
+extern boolean _bfd_mips_elf_gc_sweep_hook
+ PARAMS ((bfd *, struct bfd_link_info *, asection *,
+ const Elf_Internal_Rela *));
+extern boolean _bfd_mips_elf_always_size_sections
+ PARAMS ((bfd *, struct bfd_link_info *));
+extern boolean _bfd_mips_elf_size_dynamic_sections
+ PARAMS ((bfd *, struct bfd_link_info *));
+extern boolean _bfd_mips_elf_check_relocs
+ PARAMS ((bfd *, struct bfd_link_info *, asection *,
+ const Elf_Internal_Rela *));
+extern struct bfd_link_hash_table *_bfd_mips_elf_link_hash_table_create
+ PARAMS ((bfd *));
+extern boolean _bfd_mips_elf_print_private_bfd_data
+ PARAMS ((bfd *, PTR));
+extern boolean _bfd_mips_elf_link_output_symbol_hook
+ PARAMS ((bfd *, struct bfd_link_info *, const char *, Elf_Internal_Sym *,
+ asection *));
+extern boolean _bfd_mips_elf_final_link
+ PARAMS ((bfd *, struct bfd_link_info *));
+extern int _bfd_mips_elf_additional_program_headers PARAMS ((bfd *));
+extern boolean _bfd_mips_elf_modify_segment_map PARAMS ((bfd *));
+extern boolean _bfd_mips_elf_relocate_section
+ PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
+ Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
+
+/* SH ELF specific routine. */
+
+extern boolean _sh_elf_set_mach_from_flags PARAMS ((bfd *));
#endif /* _LIBELF_H_ */
diff --git a/contrib/binutils/bfd/elf.c b/contrib/binutils/bfd/elf.c
index 2d8e160233a3..c210638befff 100644
--- a/contrib/binutils/bfd/elf.c
+++ b/contrib/binutils/bfd/elf.c
@@ -1,5 +1,5 @@
/* ELF executable support for BFD.
- Copyright 1993, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+ Copyright 1993, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -45,7 +45,7 @@ static int elf_sort_sections PARAMS ((const PTR, const PTR));
static boolean assign_file_positions_for_segments PARAMS ((bfd *));
static boolean assign_file_positions_except_relocs PARAMS ((bfd *));
static boolean prep_headers PARAMS ((bfd *));
-static boolean swap_out_syms PARAMS ((bfd *, struct bfd_strtab_hash **));
+static boolean swap_out_syms PARAMS ((bfd *, struct bfd_strtab_hash **, int));
static boolean copy_private_bfd_data PARAMS ((bfd *, bfd *));
static char *elf_read PARAMS ((bfd *, long, unsigned int));
static void elf_fake_sections PARAMS ((bfd *, asection *, PTR));
@@ -53,6 +53,7 @@ static boolean assign_section_numbers PARAMS ((bfd *));
static INLINE int sym_is_global PARAMS ((bfd *, asymbol *));
static boolean elf_map_symbols PARAMS ((bfd *));
static bfd_size_type get_program_header_size PARAMS ((bfd *));
+static boolean elfcore_read_notes PARAMS ((bfd *, bfd_vma, bfd_vma));
/* Swap version information in and out. The version information is
currently size independent. If that ever changes, this code will
@@ -199,12 +200,13 @@ _bfd_elf_swap_versym_out (abfd, src, dst)
}
/* Standard ELF hash function. Do not change this function; you will
- cause invalid hash tables to be generated. (Well, you would if this
- were being used yet.) */
+ cause invalid hash tables to be generated. */
+
unsigned long
-bfd_elf_hash (name)
- CONST unsigned char *name;
+bfd_elf_hash (namearg)
+ const char *namearg;
{
+ const unsigned char *name = (const unsigned char *) namearg;
unsigned long h = 0;
unsigned long g;
int ch;
@@ -215,7 +217,9 @@ bfd_elf_hash (name)
if ((g = (h & 0xf0000000)) != 0)
{
h ^= g >> 24;
- h &= ~g;
+ /* The ELF ABI says `h &= ~g', but this is equivalent in
+ this case and on some machines one insn instead of two. */
+ h ^= g;
}
}
return h;
@@ -262,6 +266,14 @@ bfd_elf_mkobject (abfd)
return true;
}
+boolean
+bfd_elf_mkcorefile (abfd)
+ bfd * abfd;
+{
+ /* I think this can be done just like an object file. */
+ return bfd_elf_mkobject (abfd);
+}
+
char *
bfd_elf_get_str_section (abfd, shindex)
bfd * abfd;
@@ -308,7 +320,7 @@ bfd_elf_string_from_elf_section (abfd, shindex, strindex)
if (strindex >= hdr->sh_size)
{
(*_bfd_error_handler)
- ("%s: invalid string offset %u >= %lu for section `%s'",
+ (_("%s: invalid string offset %u >= %lu for section `%s'"),
bfd_get_filename (abfd), strindex, (unsigned long) hdr->sh_size,
((shindex == elf_elfheader(abfd)->e_shstrndx
&& strindex == hdr->sh_name)
@@ -391,22 +403,33 @@ _bfd_elf_make_section_from_shdr (abfd, hdr, name)
Elf_Internal_Phdr *phdr;
unsigned int i;
- /* Look through the phdrs to see if we need to adjust the lma. */
+ /* Look through the phdrs to see if we need to adjust the lma.
+ If all the p_paddr fields are zero, we ignore them, since
+ some ELF linkers produce such output. */
phdr = elf_tdata (abfd)->phdr;
for (i = 0; i < elf_elfheader (abfd)->e_phnum; i++, phdr++)
{
- if (phdr->p_type == PT_LOAD
- && phdr->p_paddr != 0
- && phdr->p_vaddr != phdr->p_paddr
- && phdr->p_vaddr <= hdr->sh_addr
- && phdr->p_vaddr + phdr->p_memsz >= hdr->sh_addr + hdr->sh_size
- && ((flags & SEC_LOAD) == 0
- || (phdr->p_offset <= (bfd_vma) hdr->sh_offset
- && (phdr->p_offset + phdr->p_filesz
- >= hdr->sh_offset + hdr->sh_size))))
+ if (phdr->p_paddr != 0)
+ break;
+ }
+ if (i < elf_elfheader (abfd)->e_phnum)
+ {
+ phdr = elf_tdata (abfd)->phdr;
+ for (i = 0; i < elf_elfheader (abfd)->e_phnum; i++, phdr++)
{
- newsect->lma += phdr->p_paddr - phdr->p_vaddr;
- break;
+ if (phdr->p_type == PT_LOAD
+ && phdr->p_vaddr != phdr->p_paddr
+ && phdr->p_vaddr <= hdr->sh_addr
+ && (phdr->p_vaddr + phdr->p_memsz
+ >= hdr->sh_addr + hdr->sh_size)
+ && ((flags & SEC_LOAD) == 0
+ || (phdr->p_offset <= (bfd_vma) hdr->sh_offset
+ && (phdr->p_offset + phdr->p_filesz
+ >= hdr->sh_offset + hdr->sh_size))))
+ {
+ newsect->lma += phdr->p_paddr - phdr->p_vaddr;
+ break;
+ }
}
}
}
@@ -445,7 +468,8 @@ bfd_elf_find_section (abfd, name)
i_shdrp = elf_elfsections (abfd);
if (i_shdrp != NULL)
{
- shstrtab = bfd_elf_get_str_section (abfd, elf_elfheader (abfd)->e_shstrndx);
+ shstrtab = bfd_elf_get_str_section
+ (abfd, elf_elfheader (abfd)->e_shstrndx);
if (shstrtab != NULL)
{
max = elf_elfheader (abfd)->e_shnum;
@@ -482,13 +506,13 @@ bfd_elf_generic_reloc (abfd,
input_section,
output_bfd,
error_message)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
arelent *reloc_entry;
asymbol *symbol;
- PTR data;
+ PTR data ATTRIBUTE_UNUSED;
asection *input_section;
bfd *output_bfd;
- char **error_message;
+ char **error_message ATTRIBUTE_UNUSED;
{
if (output_bfd != (bfd *) NULL
&& (symbol->flags & BSF_SECTION_SYM) == 0
@@ -519,7 +543,7 @@ _bfd_elf_print_private_bfd_data (abfd, farg)
{
unsigned int i, c;
- fprintf (f, "\nProgram Header:\n");
+ fprintf (f, _("\nProgram Header:\n"));
c = elf_elfheader (abfd)->e_phnum;
for (i = 0; i < c; i++, p++)
{
@@ -567,7 +591,7 @@ _bfd_elf_print_private_bfd_data (abfd, farg)
size_t extdynsize;
void (*swap_dyn_in) PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *));
- fprintf (f, "\nDynamic Section:\n");
+ fprintf (f, _("\nDynamic Section:\n"));
dynbuf = (bfd_byte *) bfd_malloc (s->_raw_size);
if (dynbuf == NULL)
@@ -669,7 +693,7 @@ _bfd_elf_print_private_bfd_data (abfd, farg)
{
Elf_Internal_Verdef *t;
- fprintf (f, "\nVersion definitions:\n");
+ fprintf (f, _("\nVersion definitions:\n"));
for (t = elf_tdata (abfd)->verdef; t != NULL; t = t->vd_nextdef)
{
fprintf (f, "%d 0x%2.2x 0x%8.8lx %s\n", t->vd_ndx,
@@ -692,12 +716,12 @@ _bfd_elf_print_private_bfd_data (abfd, farg)
{
Elf_Internal_Verneed *t;
- fprintf (f, "\nVersion References:\n");
+ fprintf (f, _("\nVersion References:\n"));
for (t = elf_tdata (abfd)->verref; t != NULL; t = t->vn_nextref)
{
Elf_Internal_Vernaux *a;
- fprintf (f, " required from %s:\n", t->vn_filename);
+ fprintf (f, _(" required from %s:\n"), t->vn_filename);
for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr)
fprintf (f, " 0x%8.8lx 0x%2.2x %2.2d %s\n", a->vna_hash,
a->vna_flags, a->vna_other, a->vna_nodename);
@@ -735,8 +759,22 @@ bfd_elf_print_symbol (abfd, filep, symbol, how)
case bfd_print_symbol_all:
{
CONST char *section_name;
+ CONST char *name = NULL;
+ struct elf_backend_data *bed;
+ unsigned char st_other;
+
section_name = symbol->section ? symbol->section->name : "(*none*)";
- bfd_print_symbol_vandf ((PTR) file, symbol);
+
+ bed = get_elf_backend_data (abfd);
+ if (bed->elf_backend_print_symbol_all)
+ name = (*bed->elf_backend_print_symbol_all) (abfd, filep, symbol);
+
+ if (name == NULL)
+ {
+ name = symbol->name;
+ bfd_print_symbol_vandf ((PTR) file, symbol);
+ }
+
fprintf (file, " %s\t", section_name);
/* Print the "other" value for a symbol. For common symbols,
we've already printed the size; now print the alignment.
@@ -799,12 +837,21 @@ bfd_elf_print_symbol (abfd, filep, symbol, how)
}
/* If the st_other field is not zero, print it. */
- if (((elf_symbol_type *) symbol)->internal_elf_sym.st_other != 0)
- fprintf (file, " 0x%02x",
- ((unsigned int)
- ((elf_symbol_type *) symbol)->internal_elf_sym.st_other));
+ st_other = ((elf_symbol_type *) symbol)->internal_elf_sym.st_other;
+
+ switch (st_other)
+ {
+ case 0: break;
+ case STV_INTERNAL: fprintf (file, " .internal"); break;
+ case STV_HIDDEN: fprintf (file, " .hidden"); break;
+ case STV_PROTECTED: fprintf (file, " .protected"); break;
+ default:
+ /* Some other non-defined flags are also present, so print
+ everything hex. */
+ fprintf (file, " 0x%02x", (unsigned int) st_other);
+ }
- fprintf (file, " %s", symbol->name);
+ fprintf (file, " %s", name);
}
break;
}
@@ -840,10 +887,13 @@ _bfd_elf_link_hash_newfunc (entry, table, string)
ret->dynindx = -1;
ret->dynstr_index = 0;
ret->weakdef = NULL;
- ret->got_offset = (bfd_vma) -1;
- ret->plt_offset = (bfd_vma) -1;
+ ret->got.offset = (bfd_vma) -1;
+ ret->plt.offset = (bfd_vma) -1;
ret->linker_section_pointer = (elf_linker_section_pointers_t *)0;
ret->verinfo.verdef = NULL;
+ ret->vtable_entries_used = NULL;
+ ret->vtable_entries_size = 0;
+ ret->vtable_parent = NULL;
ret->type = STT_NOTYPE;
ret->other = 0;
/* Assume that we have been called by a non-ELF symbol reader.
@@ -856,6 +906,58 @@ _bfd_elf_link_hash_newfunc (entry, table, string)
return (struct bfd_hash_entry *) ret;
}
+/* Copy data from an indirect symbol to its direct symbol, hiding the
+ old indirect symbol. */
+
+void
+_bfd_elf_link_hash_copy_indirect (dir, ind)
+ struct elf_link_hash_entry *dir, *ind;
+{
+ /* Copy down any references that we may have already seen to the
+ symbol which just became indirect. */
+
+ dir->elf_link_hash_flags |=
+ (ind->elf_link_hash_flags
+ & (ELF_LINK_HASH_REF_DYNAMIC
+ | ELF_LINK_HASH_REF_REGULAR
+ | ELF_LINK_HASH_REF_REGULAR_NONWEAK
+ | ELF_LINK_NON_GOT_REF));
+
+ /* Copy over the global and procedure linkage table offset entries.
+ These may have been already set up by a check_relocs routine. */
+ if (dir->got.offset == (bfd_vma) -1)
+ {
+ dir->got.offset = ind->got.offset;
+ ind->got.offset = (bfd_vma) -1;
+ }
+ BFD_ASSERT (ind->got.offset == (bfd_vma) -1);
+
+ if (dir->plt.offset == (bfd_vma) -1)
+ {
+ dir->plt.offset = ind->plt.offset;
+ ind->plt.offset = (bfd_vma) -1;
+ }
+ BFD_ASSERT (ind->plt.offset == (bfd_vma) -1);
+
+ if (dir->dynindx == -1)
+ {
+ dir->dynindx = ind->dynindx;
+ dir->dynstr_index = ind->dynstr_index;
+ ind->dynindx = -1;
+ ind->dynstr_index = 0;
+ }
+ BFD_ASSERT (ind->dynindx == -1);
+}
+
+void
+_bfd_elf_link_hash_hide_symbol(h)
+ struct elf_link_hash_entry *h;
+{
+ h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
+ h->dynindx = -1;
+ h->plt.offset = (bfd_vma) -1;
+}
+
/* Initialize an ELF linker hash table. */
boolean
@@ -916,11 +1018,11 @@ bfd_elf_set_dt_needed_name (abfd, name)
}
/* Get the list of DT_NEEDED entries for a link. This is a hook for
- the ELF emulation code. */
+ the linker ELF emulation code. */
struct bfd_link_needed_list *
bfd_elf_get_needed_list (abfd, info)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
struct bfd_link_info *info;
{
if (info->hash->creator->flavour != bfd_target_elf_flavour)
@@ -1177,6 +1279,15 @@ bfd_section_from_shdr (abfd, shindex)
asection *target_sect;
Elf_Internal_Shdr *hdr2;
+ /* Check for a bogus link to avoid crashing. */
+ if (hdr->sh_link >= ehdr->e_shnum)
+ {
+ ((*_bfd_error_handler)
+ (_("%s: invalid link %lu for reloc section %s (index %u)"),
+ bfd_get_filename (abfd), hdr->sh_link, name, shindex));
+ return _bfd_elf_make_section_from_shdr (abfd, hdr, name);
+ }
+
/* For some incomprehensible reason Oracle distributes
libraries for Solaris in which some of the objects have
bogus sh_link fields. It would be nice if we could just
@@ -1241,6 +1352,11 @@ bfd_section_from_shdr (abfd, shindex)
target_sect->flags |= SEC_RELOC;
target_sect->relocation = NULL;
target_sect->rel_filepos = hdr->sh_offset;
+ /* In the section to which the relocations apply, mark whether
+ its relocations are of the REL or RELA variety. */
+ if (hdr->sh_size != 0)
+ elf_section_data (target_sect)->use_rela_p
+ = (hdr->sh_type == SHT_RELA);
abfd->flags |= HAS_RELOC;
return true;
}
@@ -1300,11 +1416,15 @@ _bfd_elf_new_section_hook (abfd, sec)
{
struct bfd_elf_section_data *sdata;
- sdata = (struct bfd_elf_section_data *) bfd_alloc (abfd, sizeof (*sdata));
+ sdata = (struct bfd_elf_section_data *) bfd_zalloc (abfd, sizeof (*sdata));
if (!sdata)
return false;
sec->used_by_bfd = (PTR) sdata;
- memset (sdata, 0, sizeof (*sdata));
+
+ /* Indicate whether or not this section should use RELA relocations. */
+ sdata->use_rela_p
+ = get_elf_backend_data (abfd)->default_use_rela_p;
+
return true;
}
@@ -1331,20 +1451,21 @@ _bfd_elf_new_section_hook (abfd, sec)
*/
boolean
-bfd_section_from_phdr (abfd, hdr, index)
+_bfd_elf_make_section_from_phdr (abfd, hdr, index, typename)
bfd *abfd;
Elf_Internal_Phdr *hdr;
int index;
+ const char *typename;
{
asection *newsect;
char *name;
char namebuf[64];
int split;
- split = ((hdr->p_memsz > 0) &&
- (hdr->p_filesz > 0) &&
- (hdr->p_memsz > hdr->p_filesz));
- sprintf (namebuf, split ? "segment%da" : "segment%d", index);
+ split = ((hdr->p_memsz > 0)
+ && (hdr->p_filesz > 0)
+ && (hdr->p_memsz > hdr->p_filesz));
+ sprintf (namebuf, "%s%d%s", typename, index, split ? "a" : "");
name = bfd_alloc (abfd, strlen (namebuf) + 1);
if (!name)
return false;
@@ -1375,7 +1496,7 @@ bfd_section_from_phdr (abfd, hdr, index)
if (split)
{
- sprintf (namebuf, "segment%db", index);
+ sprintf (namebuf, "%s%db", typename, index);
name = bfd_alloc (abfd, strlen (namebuf) + 1);
if (!name)
return false;
@@ -1399,6 +1520,89 @@ bfd_section_from_phdr (abfd, hdr, index)
return true;
}
+boolean
+bfd_section_from_phdr (abfd, hdr, index)
+ bfd *abfd;
+ Elf_Internal_Phdr *hdr;
+ int index;
+{
+ struct elf_backend_data *bed;
+
+ switch (hdr->p_type)
+ {
+ case PT_NULL:
+ return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "null");
+
+ case PT_LOAD:
+ return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "load");
+
+ case PT_DYNAMIC:
+ return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "dynamic");
+
+ case PT_INTERP:
+ return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "interp");
+
+ case PT_NOTE:
+ if (! _bfd_elf_make_section_from_phdr (abfd, hdr, index, "note"))
+ return false;
+ if (! elfcore_read_notes (abfd, hdr->p_offset, hdr->p_filesz))
+ return false;
+ return true;
+
+ case PT_SHLIB:
+ return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "shlib");
+
+ case PT_PHDR:
+ return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "phdr");
+
+ default:
+ /* Check for any processor-specific program segment types.
+ If no handler for them, default to making "segment" sections. */
+ bed = get_elf_backend_data (abfd);
+ if (bed->elf_backend_section_from_phdr)
+ return (*bed->elf_backend_section_from_phdr) (abfd, hdr, index);
+ else
+ return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "segment");
+ }
+}
+
+/* Initialize REL_HDR, the section-header for new section, containing
+ relocations against ASECT. If USE_RELA_P is true, we use RELA
+ relocations; otherwise, we use REL relocations. */
+
+boolean
+_bfd_elf_init_reloc_shdr (abfd, rel_hdr, asect, use_rela_p)
+ bfd *abfd;
+ Elf_Internal_Shdr *rel_hdr;
+ asection *asect;
+ boolean use_rela_p;
+{
+ char *name;
+ struct elf_backend_data *bed;
+
+ bed = get_elf_backend_data (abfd);
+ name = bfd_alloc (abfd, sizeof ".rela" + strlen (asect->name));
+ if (name == NULL)
+ return false;
+ sprintf (name, "%s%s", use_rela_p ? ".rela" : ".rel", asect->name);
+ rel_hdr->sh_name =
+ (unsigned int) _bfd_stringtab_add (elf_shstrtab (abfd), name,
+ true, false);
+ if (rel_hdr->sh_name == (unsigned int) -1)
+ return false;
+ rel_hdr->sh_type = use_rela_p ? SHT_RELA : SHT_REL;
+ rel_hdr->sh_entsize = (use_rela_p
+ ? bed->s->sizeof_rela
+ : bed->s->sizeof_rel);
+ rel_hdr->sh_addralign = bed->s->file_align;
+ rel_hdr->sh_flags = 0;
+ rel_hdr->sh_addr = 0;
+ rel_hdr->sh_size = 0;
+ rel_hdr->sh_offset = 0;
+
+ return true;
+}
+
/* Set up an ELF internal section header for a section. */
/*ARGSUSED*/
@@ -1454,7 +1658,7 @@ elf_fake_sections (abfd, asect, failedptrarg)
else if (strcmp (asect->name, ".hash") == 0)
{
this_hdr->sh_type = SHT_HASH;
- this_hdr->sh_entsize = bed->s->arch_size / 8;
+ this_hdr->sh_entsize = bed->s->sizeof_hash_entry;
}
else if (strcmp (asect->name, ".dynsym") == 0)
{
@@ -1467,13 +1671,13 @@ elf_fake_sections (abfd, asect, failedptrarg)
this_hdr->sh_entsize = bed->s->sizeof_dyn;
}
else if (strncmp (asect->name, ".rela", 5) == 0
- && get_elf_backend_data (abfd)->use_rela_p)
+ && get_elf_backend_data (abfd)->may_use_rela_p)
{
this_hdr->sh_type = SHT_RELA;
this_hdr->sh_entsize = bed->s->sizeof_rela;
}
else if (strncmp (asect->name, ".rel", 4) == 0
- && ! get_elf_backend_data (abfd)->use_rela_p)
+ && get_elf_backend_data (abfd)->may_use_rel_p)
{
this_hdr->sh_type = SHT_REL;
this_hdr->sh_entsize = bed->s->sizeof_rel;
@@ -1534,47 +1738,19 @@ elf_fake_sections (abfd, asect, failedptrarg)
this_hdr->sh_flags |= SHF_EXECINSTR;
/* Check for processor-specific section types. */
- {
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
-
- if (bed->elf_backend_fake_sections)
- (*bed->elf_backend_fake_sections) (abfd, this_hdr, asect);
- }
+ if (bed->elf_backend_fake_sections)
+ (*bed->elf_backend_fake_sections) (abfd, this_hdr, asect);
/* If the section has relocs, set up a section header for the
- SHT_REL[A] section. */
- if ((asect->flags & SEC_RELOC) != 0)
- {
- Elf_Internal_Shdr *rela_hdr;
- int use_rela_p = get_elf_backend_data (abfd)->use_rela_p;
- char *name;
-
- rela_hdr = &elf_section_data (asect)->rel_hdr;
- name = bfd_alloc (abfd, sizeof ".rela" + strlen (asect->name));
- if (name == NULL)
- {
- *failedptr = true;
- return;
- }
- sprintf (name, "%s%s", use_rela_p ? ".rela" : ".rel", asect->name);
- rela_hdr->sh_name =
- (unsigned int) _bfd_stringtab_add (elf_shstrtab (abfd), name,
- true, false);
- if (rela_hdr->sh_name == (unsigned int) -1)
- {
- *failedptr = true;
- return;
- }
- rela_hdr->sh_type = use_rela_p ? SHT_RELA : SHT_REL;
- rela_hdr->sh_entsize = (use_rela_p
- ? bed->s->sizeof_rela
- : bed->s->sizeof_rel);
- rela_hdr->sh_addralign = bed->s->file_align;
- rela_hdr->sh_flags = 0;
- rela_hdr->sh_addr = 0;
- rela_hdr->sh_size = 0;
- rela_hdr->sh_offset = 0;
- }
+ SHT_REL[A] section. If two relocation sections are required for
+ this section, it is up to the processor-specific back-end to
+ create the other. */
+ if ((asect->flags & SEC_RELOC) != 0
+ && !_bfd_elf_init_reloc_shdr (abfd,
+ &elf_section_data (asect)->rel_hdr,
+ asect,
+ elf_section_data (asect)->use_rela_p))
+ *failedptr = true;
}
/* Assign all ELF section numbers. The dummy first section is handled here
@@ -1602,13 +1778,18 @@ assign_section_numbers (abfd)
d->rel_idx = 0;
else
d->rel_idx = section_number++;
+
+ if (d->rel_hdr2)
+ d->rel_idx2 = section_number++;
+ else
+ d->rel_idx2 = 0;
}
t->shstrtab_section = section_number++;
elf_elfheader (abfd)->e_shstrndx = t->shstrtab_section;
t->shstrtab_hdr.sh_size = _bfd_stringtab_size (elf_shstrtab (abfd));
- if (abfd->symcount > 0)
+ if (bfd_get_symcount (abfd) > 0)
{
t->symtab_section = section_number++;
t->strtab_section = section_number++;
@@ -1635,7 +1816,7 @@ assign_section_numbers (abfd)
elf_elfsections (abfd) = i_shdrp;
i_shdrp[t->shstrtab_section] = &t->shstrtab_hdr;
- if (abfd->symcount > 0)
+ if (bfd_get_symcount (abfd) > 0)
{
i_shdrp[t->symtab_section] = &t->symtab_hdr;
i_shdrp[t->strtab_section] = &t->strtab_hdr;
@@ -1650,6 +1831,8 @@ assign_section_numbers (abfd)
i_shdrp[d->this_idx] = &d->this_hdr;
if (d->rel_idx != 0)
i_shdrp[d->rel_idx] = &d->rel_hdr;
+ if (d->rel_idx2 != 0)
+ i_shdrp[d->rel_idx2] = d->rel_hdr2;
/* Fill in the sh_link and sh_info fields while we're at it. */
@@ -1661,6 +1844,11 @@ assign_section_numbers (abfd)
d->rel_hdr.sh_link = t->symtab_section;
d->rel_hdr.sh_info = d->this_idx;
}
+ if (d->rel_idx2 != 0)
+ {
+ d->rel_hdr2->sh_link = t->symtab_section;
+ d->rel_hdr2->sh_info = d->this_idx;
+ }
switch (d->this_hdr.sh_type)
{
@@ -1777,6 +1965,7 @@ elf_map_symbols (abfd)
int idx;
asection *asect;
asymbol **new_syms;
+ asymbol *sym;
#ifdef DEBUG
fprintf (stderr, "elf_map_symbols\n");
@@ -1799,19 +1988,36 @@ elf_map_symbols (abfd)
for (idx = 0; idx < symcount; idx++)
{
- if ((syms[idx]->flags & BSF_SECTION_SYM) != 0
- && (syms[idx]->value + syms[idx]->section->vma) == 0)
+ sym = syms[idx];
+
+ if ((sym->flags & BSF_SECTION_SYM) != 0
+ && sym->value == 0)
{
asection *sec;
- sec = syms[idx]->section;
+ sec = sym->section;
+
if (sec->owner != NULL)
{
if (sec->owner != abfd)
{
if (sec->output_offset != 0)
continue;
+
sec = sec->output_section;
+
+ /* Empty sections in the input files may have had a section
+ symbol created for them. (See the comment near the end of
+ _bfd_generic_link_output_symbols in linker.c). If the linker
+ script discards such sections then we will reach this point.
+ Since we know that we cannot avoid this case, we detect it
+ and skip the abort and the assignment to the sect_syms array.
+ To reproduce this particular case try running the linker
+ testsuite test ld-scripts/weak.exp for an ELF port that uses
+ the generic linker. */
+ if (sec->owner == NULL)
+ continue;
+
BFD_ASSERT (sec->owner == abfd);
}
sect_syms[sec->index] = syms[idx];
@@ -1821,8 +2027,6 @@ elf_map_symbols (abfd)
for (asect = abfd->sections; asect; asect = asect->next)
{
- asymbol *sym;
-
if (sect_syms[asect->index] != NULL)
continue;
@@ -1839,7 +2043,7 @@ elf_map_symbols (abfd)
num_sections++;
#ifdef DEBUG
fprintf (stderr,
- "creating section symbol, name = %s, value = 0x%.8lx, index = %d, section = 0x%.8lx\n",
+ _("creating section symbol, name = %s, value = 0x%.8lx, index = %d, section = 0x%.8lx\n"),
asect->name, (long) asect->vma, asect->index, (long) asect);
#endif
}
@@ -1971,6 +2175,10 @@ _bfd_elf_compute_section_file_positions (abfd, link_info)
if (! prep_headers (abfd))
return false;
+ /* Post process the headers if necessary. */
+ if (bed->elf_backend_post_process_headers)
+ (*bed->elf_backend_post_process_headers) (abfd, link_info);
+
failed = false;
bfd_map_over_sections (abfd, elf_fake_sections, &failed);
if (failed)
@@ -1980,9 +2188,12 @@ _bfd_elf_compute_section_file_positions (abfd, link_info)
return false;
/* The backend linker builds symbol table information itself. */
- if (link_info == NULL && abfd->symcount > 0)
+ if (link_info == NULL && bfd_get_symcount (abfd) > 0)
{
- if (! swap_out_syms (abfd, &strtab))
+ /* Non-zero if doing a relocatable link. */
+ int relocatable_p = ! (abfd->flags & (EXEC_P | DYNAMIC));
+
+ if (! swap_out_syms (abfd, &strtab, relocatable_p))
return false;
}
@@ -2001,7 +2212,7 @@ _bfd_elf_compute_section_file_positions (abfd, link_info)
if (!assign_file_positions_except_relocs (abfd))
return false;
- if (link_info == NULL && abfd->symcount > 0)
+ if (link_info == NULL && bfd_get_symcount (abfd) > 0)
{
file_ptr off;
Elf_Internal_Shdr *hdr;
@@ -2082,7 +2293,7 @@ map_sections_to_segments (abfd)
unsigned int phdr_index;
bfd_vma maxpagesize;
asection **hdrpp;
- boolean phdr_in_section = true;
+ boolean phdr_in_segment = true;
boolean writable;
asection *dynsec;
@@ -2175,8 +2386,9 @@ map_sections_to_segments (abfd)
if (phdr_size == 0)
phdr_size = get_elf_backend_data (abfd)->s->sizeof_phdr;
if ((abfd->flags & D_PAGED) == 0
+ || sections[0]->lma < phdr_size
|| sections[0]->lma % maxpagesize < phdr_size % maxpagesize)
- phdr_in_section = false;
+ phdr_in_segment = false;
}
for (i = 0, hdrpp = sections; i < count; i++, hdrpp++)
@@ -2254,7 +2466,7 @@ map_sections_to_segments (abfd)
/* We need a new program segment. We must create a new program
header holding all the sections from phdr_index until hdr. */
- m = make_mapping (abfd, sections, phdr_index, i, phdr_in_section);
+ m = make_mapping (abfd, sections, phdr_index, i, phdr_in_segment);
if (m == NULL)
goto error_return;
@@ -2268,13 +2480,13 @@ map_sections_to_segments (abfd)
last_hdr = hdr;
phdr_index = i;
- phdr_in_section = false;
+ phdr_in_segment = false;
}
/* Create a final PT_LOAD program segment. */
if (last_hdr != NULL)
{
- m = make_mapping (abfd, sections, phdr_index, i, phdr_in_section);
+ m = make_mapping (abfd, sections, phdr_index, i, phdr_in_segment);
if (m == NULL)
goto error_return;
@@ -2334,7 +2546,7 @@ map_sections_to_segments (abfd)
return false;
}
-/* Sort sections by VMA. */
+/* Sort sections by address. */
static int
elf_sort_sections (arg1, arg2)
@@ -2344,16 +2556,18 @@ elf_sort_sections (arg1, arg2)
const asection *sec1 = *(const asection **) arg1;
const asection *sec2 = *(const asection **) arg2;
- if (sec1->vma < sec2->vma)
+ /* Sort by LMA first, since this is the address used to
+ place the section into a segment. */
+ if (sec1->lma < sec2->lma)
return -1;
- else if (sec1->vma > sec2->vma)
+ else if (sec1->lma > sec2->lma)
return 1;
- /* Sort by LMA. Normally the LMA and the VMA will be the same, and
- this will do nothing. */
- if (sec1->lma < sec2->lma)
+ /* Then sort by VMA. Normally the LMA and the VMA will be
+ the same, and this will do nothing. */
+ if (sec1->vma < sec2->vma)
return -1;
- else if (sec1->lma > sec2->lma)
+ else if (sec1->vma > sec2->vma)
return 1;
/* Put !SEC_LOAD sections after SEC_LOAD ones. */
@@ -2364,7 +2578,7 @@ elf_sort_sections (arg1, arg2)
{
if (TOEND (sec2))
return sec1->target_index - sec2->target_index;
- else
+ else
return 1;
}
@@ -2432,7 +2646,7 @@ assign_file_positions_for_segments (abfd)
if (alloc != 0 && count > alloc)
{
((*_bfd_error_handler)
- ("%s: Not enough room for program headers (allocated %u, need %u)",
+ (_("%s: Not enough room for program headers (allocated %u, need %u)"),
bfd_get_filename (abfd), alloc, count));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -2453,6 +2667,7 @@ assign_file_positions_for_segments (abfd)
filehdr_paddr = 0;
phdrs_vaddr = 0;
phdrs_paddr = 0;
+
for (m = elf_tdata (abfd)->segment_map, p = phdrs;
m != NULL;
m = m->next, p++)
@@ -2467,11 +2682,7 @@ assign_file_positions_for_segments (abfd)
elf_sort_sections);
p->p_type = m->p_type;
-
- if (m->p_flags_valid)
- p->p_flags = m->p_flags;
- else
- p->p_flags = 0;
+ p->p_flags = m->p_flags;
if (p->p_type == PT_LOAD
&& m->count > 0
@@ -2480,8 +2691,21 @@ assign_file_positions_for_segments (abfd)
if ((abfd->flags & D_PAGED) != 0)
off += (m->sections[0]->vma - off) % bed->maxpagesize;
else
- off += ((m->sections[0]->vma - off)
- % (1 << bfd_get_section_alignment (abfd, m->sections[0])));
+ {
+ bfd_size_type align;
+
+ align = 0;
+ for (i = 0, secpp = m->sections; i < m->count; i++, secpp++)
+ {
+ bfd_size_type secalign;
+
+ secalign = bfd_get_section_alignment (abfd, *secpp);
+ if (secalign > align)
+ align = secalign;
+ }
+
+ off += (m->sections[0]->vma - off) % (1 << align);
+ }
}
if (m->count == 0)
@@ -2521,12 +2745,12 @@ assign_file_positions_for_segments (abfd)
if (p->p_vaddr < (bfd_vma) off)
{
- _bfd_error_handler ("%s: Not enough room for program headers, try linking with -N",
+ _bfd_error_handler (_("%s: Not enough room for program headers, try linking with -N"),
bfd_get_filename (abfd));
bfd_set_error (bfd_error_bad_value);
return false;
}
-
+
p->p_vaddr -= off;
if (! m->p_paddr_valid)
p->p_paddr -= off;
@@ -2542,6 +2766,7 @@ assign_file_positions_for_segments (abfd)
{
if (! m->p_flags_valid)
p->p_flags |= PF_R;
+
if (m->includes_filehdr)
{
if (p->p_type == PT_LOAD)
@@ -2553,6 +2778,7 @@ assign_file_positions_for_segments (abfd)
else
{
p->p_offset = bed->s->sizeof_ehdr;
+
if (m->count > 0)
{
BFD_ASSERT (p->p_type == PT_LOAD);
@@ -2560,17 +2786,22 @@ assign_file_positions_for_segments (abfd)
if (! m->p_paddr_valid)
p->p_paddr -= off - p->p_offset;
}
+
if (p->p_type == PT_LOAD)
{
phdrs_vaddr = p->p_vaddr;
phdrs_paddr = p->p_paddr;
}
+ else
+ phdrs_vaddr = bed->maxpagesize + bed->s->sizeof_ehdr;
}
+
p->p_filesz += alloc * bed->s->sizeof_phdr;
p->p_memsz += alloc * bed->s->sizeof_phdr;
}
- if (p->p_type == PT_LOAD)
+ if (p->p_type == PT_LOAD
+ || (p->p_type == PT_NOTE && bfd_get_format (abfd) == bfd_core))
{
if (! m->includes_filehdr && ! m->includes_phdrs)
p->p_offset = off;
@@ -2585,6 +2816,7 @@ assign_file_positions_for_segments (abfd)
}
voff = off;
+
for (i = 0, secpp = m->sections; i < m->count; i++, secpp++)
{
asection *sec;
@@ -2595,12 +2827,30 @@ assign_file_positions_for_segments (abfd)
flags = sec->flags;
align = 1 << bfd_get_section_alignment (abfd, sec);
+ /* The section may have artificial alignment forced by a
+ link script. Notice this case by the gap between the
+ cumulative phdr vma and the section's vma. */
+ if (p->p_vaddr + p->p_memsz < sec->vma)
+ {
+ bfd_vma adjust = sec->vma - (p->p_vaddr + p->p_memsz);
+
+ p->p_memsz += adjust;
+ off += adjust;
+ voff += adjust;
+ if ((flags & SEC_LOAD) != 0)
+ p->p_filesz += adjust;
+ }
+
if (p->p_type == PT_LOAD)
{
- bfd_vma adjust;
+ bfd_signed_vma adjust;
if ((flags & SEC_LOAD) != 0)
- adjust = sec->lma - (p->p_paddr + p->p_memsz);
+ {
+ adjust = sec->lma - (p->p_paddr + p->p_memsz);
+ if (adjust < 0)
+ adjust = 0;
+ }
else if ((flags & SEC_ALLOC) != 0)
{
/* The section VMA must equal the file position
@@ -2619,7 +2869,16 @@ assign_file_positions_for_segments (abfd)
if (adjust != 0)
{
if (i == 0)
- abort ();
+ {
+ (* _bfd_error_handler)
+ (_("Error: First section in segment (%s) starts at 0x%x"),
+ bfd_section_name (abfd, sec), sec->lma);
+ (* _bfd_error_handler)
+ (_(" whereas segment starts at 0x%x"),
+ p->p_paddr);
+
+ return false;
+ }
p->p_memsz += adjust;
off += adjust;
voff += adjust;
@@ -2636,17 +2895,40 @@ assign_file_positions_for_segments (abfd)
if ((flags & SEC_LOAD) != 0
|| (flags & SEC_HAS_CONTENTS) != 0)
off += sec->_raw_size;
+
if ((flags & SEC_ALLOC) != 0)
voff += sec->_raw_size;
}
- p->p_memsz += sec->_raw_size;
+ if (p->p_type == PT_NOTE && bfd_get_format (abfd) == bfd_core)
+ {
+ if (i == 0) /* the actual "note" segment */
+ { /* this one actually contains everything. */
+ sec->filepos = off;
+ p->p_filesz = sec->_raw_size;
+ off += sec->_raw_size;
+ voff = off;
+ }
+ else /* fake sections -- don't need to be written */
+ {
+ sec->filepos = 0;
+ sec->_raw_size = 0;
+ flags = sec->flags = 0; /* no contents */
+ }
+ p->p_memsz = 0;
+ p->p_align = 1;
+ }
+ else
+ {
+ p->p_memsz += sec->_raw_size;
- if ((flags & SEC_LOAD) != 0)
- p->p_filesz += sec->_raw_size;
+ if ((flags & SEC_LOAD) != 0)
+ p->p_filesz += sec->_raw_size;
- if (align > p->p_align)
- p->p_align = align;
+ if (align > p->p_align
+ && (p->p_type != PT_LOAD || (abfd->flags & D_PAGED) == 0))
+ p->p_align = align;
+ }
if (! m->p_flags_valid)
{
@@ -2806,7 +3088,8 @@ assign_file_positions_except_relocs (abfd)
file_ptr off;
struct elf_backend_data *bed = get_elf_backend_data (abfd);
- if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0)
+ if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0
+ && bfd_get_format (abfd) != bfd_core)
{
Elf_Internal_Shdr **hdrpp;
unsigned int i;
@@ -2833,7 +3116,7 @@ assign_file_positions_except_relocs (abfd)
hdr->sh_offset = -1;
continue;
}
-
+
off = _bfd_elf_assign_file_position_for_section (hdr, off, true);
}
}
@@ -2861,7 +3144,7 @@ assign_file_positions_except_relocs (abfd)
else if ((hdr->sh_flags & SHF_ALLOC) != 0)
{
((*_bfd_error_handler)
- ("%s: warning: allocated section `%s' not in segment",
+ (_("%s: warning: allocated section `%s' not in segment"),
bfd_get_filename (abfd),
(hdr->bfd_section == NULL
? "*unknown*"
@@ -2880,7 +3163,7 @@ assign_file_positions_except_relocs (abfd)
hdr->sh_offset = -1;
else
off = _bfd_elf_assign_file_position_for_section (hdr, off, true);
- }
+ }
}
/* Place the section headers. */
@@ -2898,7 +3181,7 @@ prep_headers (abfd)
bfd *abfd;
{
Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form */
- Elf_Internal_Phdr *i_phdrp = 0; /* Program header table, internal form */
+ Elf_Internal_Phdr *i_phdrp = 0; /* Program header table, internal form */
Elf_Internal_Shdr **i_shdrp; /* Section header table, internal form */
int count;
struct bfd_strtab_hash *shstrtab;
@@ -2923,6 +3206,9 @@ prep_headers (abfd)
bfd_big_endian (abfd) ? ELFDATA2MSB : ELFDATA2LSB;
i_ehdrp->e_ident[EI_VERSION] = bed->s->ev_current;
+ i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_SYSV;
+ i_ehdrp->e_ident[EI_ABIVERSION] = 0;
+
for (count = EI_PAD; count < EI_NIDENT; count++)
i_ehdrp->e_ident[count] = 0;
@@ -2930,6 +3216,8 @@ prep_headers (abfd)
i_ehdrp->e_type = ET_DYN;
else if ((abfd->flags & EXEC_P) != 0)
i_ehdrp->e_type = ET_EXEC;
+ else if (bfd_get_format (abfd) == bfd_core)
+ i_ehdrp->e_type = ET_CORE;
else
i_ehdrp->e_type = ET_REL;
@@ -2940,10 +3228,13 @@ prep_headers (abfd)
break;
case bfd_arch_sparc:
if (bed->s->arch_size == 64)
- i_ehdrp->e_machine = EM_SPARC64;
+ i_ehdrp->e_machine = EM_SPARCV9;
else
i_ehdrp->e_machine = EM_SPARC;
break;
+ case bfd_arch_i370:
+ i_ehdrp->e_machine = EM_S370;
+ break;
case bfd_arch_i386:
i_ehdrp->e_machine = EM_386;
break;
@@ -2956,6 +3247,9 @@ prep_headers (abfd)
case bfd_arch_i860:
i_ehdrp->e_machine = EM_860;
break;
+ case bfd_arch_i960:
+ i_ehdrp->e_machine = EM_960;
+ break;
case bfd_arch_mips: /* MIPS Rxxxx */
i_ehdrp->e_machine = EM_MIPS; /* only MIPS R3000 */
break;
@@ -2974,6 +3268,18 @@ prep_headers (abfd)
case bfd_arch_d10v:
i_ehdrp->e_machine = EM_CYGNUS_D10V;
break;
+ case bfd_arch_d30v:
+ i_ehdrp->e_machine = EM_CYGNUS_D30V;
+ break;
+ case bfd_arch_fr30:
+ i_ehdrp->e_machine = EM_CYGNUS_FR30;
+ break;
+ case bfd_arch_mcore:
+ i_ehdrp->e_machine = EM_MCORE;
+ break;
+ case bfd_arch_avr:
+ i_ehdrp->e_machine = EM_AVR;
+ break;
case bfd_arch_v850:
switch (bfd_get_mach (abfd))
{
@@ -2984,6 +3290,9 @@ prep_headers (abfd)
case bfd_arch_arc:
i_ehdrp->e_machine = EM_CYGNUS_ARC;
break;
+ case bfd_arch_arm:
+ i_ehdrp->e_machine = EM_ARM;
+ break;
case bfd_arch_m32r:
i_ehdrp->e_machine = EM_CYGNUS_M32R;
break;
@@ -2993,6 +3302,9 @@ prep_headers (abfd)
case bfd_arch_mn10300:
i_ehdrp->e_machine = EM_CYGNUS_MN10300;
break;
+ case bfd_arch_pj:
+ i_ehdrp->e_machine = EM_PJ;
+ break;
/* also note that EM_M32, AT&T WE32100 is unknown to bfd */
default:
i_ehdrp->e_machine = EM_NONE;
@@ -3083,8 +3395,8 @@ _bfd_elf_write_object_contents (abfd)
unsigned int count;
if (! abfd->output_has_begun
- && ! _bfd_elf_compute_section_file_positions (abfd,
- (struct bfd_link_info *) NULL))
+ && ! _bfd_elf_compute_section_file_positions
+ (abfd, (struct bfd_link_info *) NULL))
return false;
i_shdrp = elf_elfsections (abfd);
@@ -3094,6 +3406,7 @@ _bfd_elf_write_object_contents (abfd)
bfd_map_over_sections (abfd, bed->s->write_relocs, &failed);
if (failed)
return false;
+
_bfd_elf_assign_file_positions_for_relocs (abfd);
/* After writing the headers, we need to write the sections too... */
@@ -3123,6 +3436,13 @@ _bfd_elf_write_object_contents (abfd)
return bed->s->write_shdrs_and_ehdr (abfd);
}
+boolean
+_bfd_elf_write_corefile_contents (abfd)
+ bfd *abfd;
+{
+ /* Hopefully this can be done just like an object file. */
+ return _bfd_elf_write_object_contents (abfd);
+}
/* given a section, search the header to find them... */
int
_bfd_elf_section_from_bfd_section (abfd, asect)
@@ -3163,6 +3483,8 @@ _bfd_elf_section_from_bfd_section (abfd, asect)
if (bfd_is_und_section (asect))
return SHN_UNDEF;
+ bfd_set_error (bfd_error_nonrepresentable_section);
+
return -1;
}
@@ -3204,7 +3526,7 @@ _bfd_elf_symbol_from_bfd_symbol (abfd, asym_ptr_ptr)
/* This case can occur when using --strip-symbol on a symbol
which is used in a relocation entry. */
(*_bfd_error_handler)
- ("%s: symbol `%s' required but not present",
+ (_("%s: symbol `%s' required but not present"),
bfd_get_filename (abfd), bfd_asymbol_name (asym_ptr));
bfd_set_error (bfd_error_no_symbols);
return -1;
@@ -3213,7 +3535,7 @@ _bfd_elf_symbol_from_bfd_symbol (abfd, asym_ptr_ptr)
#if DEBUG & 4
{
fprintf (stderr,
- "elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = 0x%.8lx%s\n",
+ _("elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = 0x%.8lx%s\n"),
(long) asym_ptr, asym_ptr->name, idx, flags,
elf_symbol_flags (flags));
fflush (stderr);
@@ -3235,7 +3557,9 @@ copy_private_bfd_data (ibfd, obfd)
struct elf_segment_map **pm;
struct elf_segment_map *m;
Elf_Internal_Phdr *p;
- unsigned int i, c;
+ unsigned int i;
+ unsigned int num_segments;
+ boolean phdr_included = false;
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
@@ -3249,32 +3573,68 @@ copy_private_bfd_data (ibfd, obfd)
mfirst = NULL;
pm = &mfirst;
- c = elf_elfheader (ibfd)->e_phnum;
- for (i = 0, p = elf_tdata (ibfd)->phdr; i < c; i++, p++)
+ num_segments = elf_elfheader (ibfd)->e_phnum;
+
+#define IS_CONTAINED_BY(addr, len, bottom, phdr) \
+ ((addr) >= (bottom) \
+ && ( ((addr) + (len)) <= ((bottom) + (phdr)->p_memsz) \
+ || ((addr) + (len)) <= ((bottom) + (phdr)->p_filesz)))
+
+ /* Special case: corefile "NOTE" section containing regs, prpsinfo etc. */
+
+#define IS_COREFILE_NOTE(p, s) \
+ (p->p_type == PT_NOTE \
+ && bfd_get_format (ibfd) == bfd_core \
+ && s->vma == 0 && s->lma == 0 \
+ && (bfd_vma) s->filepos >= p->p_offset \
+ && (bfd_vma) s->filepos + s->_raw_size \
+ <= p->p_offset + p->p_filesz)
+
+ /* The complicated case when p_vaddr is 0 is to handle the Solaris
+ linker, which generates a PT_INTERP section with p_vaddr and
+ p_memsz set to 0. */
+
+#define IS_SOLARIS_PT_INTERP(p, s) \
+ (p->p_vaddr == 0 \
+ && p->p_filesz > 0 \
+ && (s->flags & SEC_HAS_CONTENTS) != 0 \
+ && s->_raw_size > 0 \
+ && (bfd_vma) s->filepos >= p->p_offset \
+ && ((bfd_vma) s->filepos + s->_raw_size \
+ <= p->p_offset + p->p_filesz))
+
+ /* Scan through the segments specified in the program header
+ of the input BFD. */
+ for (i = 0, p = elf_tdata (ibfd)->phdr; i < num_segments; i++, p++)
{
unsigned int csecs;
asection *s;
+ asection **sections;
+ asection *os;
unsigned int isec;
-
+ bfd_vma matching_lma;
+ bfd_vma suggested_lma;
+ unsigned int j;
+
+ /* For each section in the input BFD, decide if it should be
+ included in the current segment. A section will be included
+ if it is within the address space of the segment, and it is
+ an allocated segment, and there is an output section
+ associated with it. */
csecs = 0;
-
- /* The complicated case when p_vaddr is 0 is to handle the
- Solaris linker, which generates a PT_INTERP section with
- p_vaddr and p_memsz set to 0. */
for (s = ibfd->sections; s != NULL; s = s->next)
- if (((s->vma >= p->p_vaddr
- && (s->vma + s->_raw_size <= p->p_vaddr + p->p_memsz
- || s->vma + s->_raw_size <= p->p_vaddr + p->p_filesz))
- || (p->p_vaddr == 0
- && p->p_filesz > 0
- && (s->flags & SEC_HAS_CONTENTS) != 0
- && (bfd_vma) s->filepos >= p->p_offset
- && ((bfd_vma) s->filepos + s->_raw_size
- <= p->p_offset + p->p_filesz)))
- && (s->flags & SEC_ALLOC) != 0
- && s->output_section != NULL)
- ++csecs;
+ if (s->output_section != NULL)
+ {
+ if ((IS_CONTAINED_BY (s->vma, s->_raw_size, p->p_vaddr, p)
+ || IS_SOLARIS_PT_INTERP (p, s))
+ && (s->flags & SEC_ALLOC) != 0)
+ ++csecs;
+ else if (IS_COREFILE_NOTE (p, s))
+ ++csecs;
+ }
+ /* Allocate a segment map big enough to contain all of the
+ sections we have selected. */
m = ((struct elf_segment_map *)
bfd_alloc (obfd,
(sizeof (struct elf_segment_map)
@@ -3282,45 +3642,288 @@ copy_private_bfd_data (ibfd, obfd)
if (m == NULL)
return false;
- m->next = NULL;
- m->p_type = p->p_type;
- m->p_flags = p->p_flags;
+ /* Initialise the fields of the segment map. Default to
+ using the physical address of the segment in the input BFD. */
+ m->next = NULL;
+ m->p_type = p->p_type;
+ m->p_flags = p->p_flags;
m->p_flags_valid = 1;
- m->p_paddr = p->p_paddr;
+ m->p_paddr = p->p_paddr;
m->p_paddr_valid = 1;
+ /* Determine if this segment contains the ELF file header
+ and if it contains the program headers themselves. */
m->includes_filehdr = (p->p_offset == 0
&& p->p_filesz >= iehdr->e_ehsize);
- m->includes_phdrs = (p->p_offset <= (bfd_vma) iehdr->e_phoff
- && (p->p_offset + p->p_filesz
- >= ((bfd_vma) iehdr->e_phoff
- + iehdr->e_phnum * iehdr->e_phentsize)));
+ m->includes_phdrs = 0;
+
+ if (! phdr_included || p->p_type != PT_LOAD)
+ {
+ m->includes_phdrs =
+ (p->p_offset <= (bfd_vma) iehdr->e_phoff
+ && (p->p_offset + p->p_filesz
+ >= ((bfd_vma) iehdr->e_phoff
+ + iehdr->e_phnum * iehdr->e_phentsize)));
+ if (p->p_type == PT_LOAD && m->includes_phdrs)
+ phdr_included = true;
+ }
+
+ if (csecs == 0)
+ {
+ /* Special segments, such as the PT_PHDR segment, may contain
+ no sections, but ordinary, loadable segments should contain
+ something. */
+
+ if (p->p_type == PT_LOAD)
+ _bfd_error_handler
+ (_("%s: warning: Empty loadable segment detected\n"),
+ bfd_get_filename (ibfd));
+
+ m->count = 0;
+ *pm = m;
+ pm = &m->next;
+
+ continue;
+ }
+
+ /* Now scan the sections in the input BFD again and attempt
+ to add their corresponding output sections to the segment map.
+ The problem here is how to handle an output section which has
+ been moved (ie had its LMA changed). There are four possibilities:
+
+ 1. None of the sections have been moved.
+ In this case we can continue to use the segment LMA from the
+ input BFD.
+
+ 2. All of the sections have been moved by the same amount.
+ In this case we can change the segment's LMA to match the LMA
+ of the first section.
+
+ 3. Some of the sections have been moved, others have not.
+ In this case those sections which have not been moved can be
+ placed in the current segment which will have to have its size,
+ and possibly its LMA changed, and a new segment or segments will
+ have to be created to contain the other sections.
+
+ 4. The sections have been moved, but not be the same amount.
+ In this case we can change the segment's LMA to match the LMA
+ of the first section and we will have to create a new segment
+ or segments to contain the other sections.
+
+ In order to save time, we allocate an array to hold the section
+ pointers that we are interested in. As these sections get assigned
+ to a segment, they are removed from this array. */
+
+ sections = (asection **) bfd_malloc (sizeof (asection *) * csecs);
+ if (sections == NULL)
+ return false;
+
+ /* Step One: Scan for segment vs section LMA conflicts.
+ Also add the sections to the section array allocated above.
+ Also add the sections to the current segment. In the common
+ case, where the sections have not been moved, this means that
+ we have completely filled the segment, and there is nothing
+ more to do. */
isec = 0;
- for (s = ibfd->sections; s != NULL; s = s->next)
+ matching_lma = 0;
+ suggested_lma = 0;
+
+ for (j = 0, s = ibfd->sections; s != NULL; s = s->next)
{
- if (((s->vma >= p->p_vaddr
- && (s->vma + s->_raw_size <= p->p_vaddr + p->p_memsz
- || s->vma + s->_raw_size <= p->p_vaddr + p->p_filesz))
- || (p->p_vaddr == 0
- && p->p_filesz > 0
- && (s->flags & SEC_HAS_CONTENTS) != 0
- && (bfd_vma) s->filepos >= p->p_offset
- && ((bfd_vma) s->filepos + s->_raw_size
- <= p->p_offset + p->p_filesz)))
- && (s->flags & SEC_ALLOC) != 0
- && s->output_section != NULL)
+ os = s->output_section;
+
+ if ((((IS_CONTAINED_BY (s->vma, s->_raw_size, p->p_vaddr, p)
+ || IS_SOLARIS_PT_INTERP (p, s))
+ && (s->flags & SEC_ALLOC) != 0)
+ || IS_COREFILE_NOTE (p, s))
+ && os != NULL)
{
- m->sections[isec] = s->output_section;
- ++isec;
+ sections[j++] = s;
+
+ /* The Solaris native linker always sets p_paddr to 0.
+ We try to catch that case here, and set it to the
+ correct value. */
+ if (p->p_paddr == 0
+ && p->p_vaddr != 0
+ && isec == 0
+ && os->lma != 0
+ && (os->vma == (p->p_vaddr
+ + (m->includes_filehdr
+ ? iehdr->e_ehsize
+ : 0)
+ + (m->includes_phdrs
+ ? iehdr->e_phnum * iehdr->e_phentsize
+ : 0))))
+ m->p_paddr = p->p_vaddr;
+
+ /* Match up the physical address of the segment with the
+ LMA address of the output section. */
+ if (IS_CONTAINED_BY (os->lma, os->_raw_size, m->p_paddr, p)
+ || IS_COREFILE_NOTE (p, s))
+ {
+ if (matching_lma == 0)
+ matching_lma = os->lma;
+
+ /* We assume that if the section fits within the segment
+ that it does not overlap any other section within that
+ segment. */
+ m->sections[isec++] = os;
+ }
+ else if (suggested_lma == 0)
+ suggested_lma = os->lma;
}
}
- BFD_ASSERT (isec == csecs);
- m->count = csecs;
- *pm = m;
- pm = &m->next;
+ BFD_ASSERT (j == csecs);
+
+ /* Step Two: Adjust the physical address of the current segment,
+ if necessary. */
+ if (isec == csecs)
+ {
+ /* All of the sections fitted within the segment as currently
+ specified. This is the default case. Add the segment to
+ the list of built segments and carry on to process the next
+ program header in the input BFD. */
+ m->count = csecs;
+ *pm = m;
+ pm = &m->next;
+
+ free (sections);
+ continue;
+ }
+ else
+ {
+ if (matching_lma != 0)
+ {
+ /* At least one section fits inside the current segment.
+ Keep it, but modify its physical address to match the
+ LMA of the first section that fitted. */
+
+ m->p_paddr = matching_lma;
+ }
+ else
+ {
+ /* None of the sections fitted inside the current segment.
+ Change the current segment's physical address to match
+ the LMA of the first section. */
+
+ m->p_paddr = suggested_lma;
+ }
+
+ /* Offset the segment physical address from the lma to allow
+ for space taken up by elf headers. */
+ if (m->includes_filehdr)
+ m->p_paddr -= iehdr->e_ehsize;
+
+ if (m->includes_phdrs)
+ m->p_paddr -= iehdr->e_phnum * iehdr->e_phentsize;
+ }
+
+ /* Step Three: Loop over the sections again, this time assigning
+ those that fit to the current segment and remvoing them from the
+ sections array; but making sure not to leave large gaps. Once all
+ possible sections have been assigned to the current segment it is
+ added to the list of built segments and if sections still remain
+ to be assigned, a new segment is constructed before repeating
+ the loop. */
+ isec = 0;
+ do
+ {
+ m->count = 0;
+ suggested_lma = 0;
+
+ /* Fill the current segment with sections that fit. */
+ for (j = 0; j < csecs; j++)
+ {
+ s = sections[j];
+
+ if (s == NULL)
+ continue;
+
+ os = s->output_section;
+
+ if (IS_CONTAINED_BY (os->lma, os->_raw_size, m->p_paddr, p)
+ || IS_COREFILE_NOTE (p, s))
+ {
+ if (m->count == 0)
+ {
+ /* If the first section in a segment does not start at
+ the beginning of the segment, then something is wrong. */
+ if (os->lma != (m->p_paddr
+ + (m->includes_filehdr
+ ? iehdr->e_ehsize : 0)
+ + (m->includes_phdrs
+ ? iehdr->e_phnum * iehdr->e_phentsize
+ : 0)))
+ abort ();
+ }
+ else
+ {
+ asection * prev_sec;
+ bfd_vma maxpagesize;
+
+ prev_sec = m->sections[m->count - 1];
+ maxpagesize = get_elf_backend_data (obfd)->maxpagesize;
+
+ /* If the gap between the end of the previous section
+ and the start of this section is more than maxpagesize
+ then we need to start a new segment. */
+ if (BFD_ALIGN (prev_sec->lma + prev_sec->_raw_size, maxpagesize)
+ < BFD_ALIGN (os->lma, maxpagesize))
+ {
+ if (suggested_lma == 0)
+ suggested_lma = os->lma;
+
+ continue;
+ }
+ }
+
+ m->sections[m->count++] = os;
+ ++isec;
+ sections[j] = NULL;
+ }
+ else if (suggested_lma == 0)
+ suggested_lma = os->lma;
+ }
+
+ BFD_ASSERT (m->count > 0);
+
+ /* Add the current segment to the list of built segments. */
+ *pm = m;
+ pm = &m->next;
+
+ if (isec < csecs)
+ {
+ /* We still have not allocated all of the sections to
+ segments. Create a new segment here, initialise it
+ and carry on looping. */
+
+ m = ((struct elf_segment_map *)
+ bfd_alloc (obfd,
+ (sizeof (struct elf_segment_map)
+ + ((size_t) csecs - 1) * sizeof (asection *))));
+ if (m == NULL)
+ return false;
+
+ /* Initialise the fields of the segment map. Set the physical
+ physical address to the LMA of the first section that has
+ not yet been assigned. */
+
+ m->next = NULL;
+ m->p_type = p->p_type;
+ m->p_flags = p->p_flags;
+ m->p_flags_valid = 1;
+ m->p_paddr = suggested_lma;
+ m->p_paddr_valid = 1;
+ m->includes_filehdr = 0;
+ m->includes_phdrs = 0;
+ }
+ }
+ while (isec < csecs);
+
+ free (sections);
}
/* The Solaris linker creates program headers in which all the
@@ -3338,6 +3941,33 @@ copy_private_bfd_data (ibfd, obfd)
elf_tdata (obfd)->segment_map = mfirst;
+#if 0
+ /* Final Step: Sort the segments into ascending order of physical address. */
+ if (mfirst != NULL)
+ {
+ struct elf_segment_map* prev;
+
+ prev = mfirst;
+ for (m = mfirst->next; m != NULL; prev = m, m = m->next)
+ {
+ /* Yes I know - its a bubble sort....*/
+ if (m->next != NULL && (m->next->p_paddr < m->p_paddr))
+ {
+ /* swap m and m->next */
+ prev->next = m->next;
+ m->next = m->next->next;
+ prev->next->next = m;
+
+ /* restart loop. */
+ m = mfirst;
+ }
+ }
+ }
+#endif
+
+#undef IS_CONTAINED_BY
+#undef IS_SOLARIS_PT_INTERP
+#undef IS_COREFILE_NOTE
return true;
}
@@ -3392,6 +4022,9 @@ _bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec)
|| ihdr->sh_type == SHT_GNU_verdef)
ohdr->sh_info = ihdr->sh_info;
+ elf_section_data (osec)->use_rela_p
+ = elf_section_data (isec)->use_rela_p;
+
return true;
}
@@ -3446,9 +4079,10 @@ _bfd_elf_copy_private_symbol_data (ibfd, isymarg, obfd, osymarg)
/* Swap out the symbols. */
static boolean
-swap_out_syms (abfd, sttp)
+swap_out_syms (abfd, sttp, relocatable_p)
bfd *abfd;
struct bfd_strtab_hash **sttp;
+ int relocatable_p;
{
struct elf_backend_data *bed = get_elf_backend_data (abfd);
@@ -3520,7 +4154,8 @@ swap_out_syms (abfd, sttp)
type_ptr = elf_symbol_from (abfd, syms[idx]);
- if (bfd_is_com_section (syms[idx]->section))
+ if ((flags & BSF_SECTION_SYM) == 0
+ && bfd_is_com_section (syms[idx]->section))
{
/* ELF common symbols put the alignment into the `value' field,
and the size into the `size' field. This is backwards from
@@ -3531,8 +4166,8 @@ swap_out_syms (abfd, sttp)
sym.st_value = value >= 16 ? 16 : (1 << bfd_log2 (value));
else
sym.st_value = type_ptr->internal_elf_sym.st_value;
- sym.st_shndx = _bfd_elf_section_from_bfd_section (abfd,
- syms[idx]->section);
+ sym.st_shndx = _bfd_elf_section_from_bfd_section
+ (abfd, syms[idx]->section);
}
else
{
@@ -3544,7 +4179,9 @@ swap_out_syms (abfd, sttp)
value += sec->output_offset;
sec = sec->output_section;
}
- value += sec->vma;
+ /* Don't add in the section vma for relocatable output. */
+ if (! relocatable_p)
+ value += sec->vma;
sym.st_value = value;
sym.st_size = type_ptr ? type_ptr->internal_elf_sym.st_size : 0;
@@ -3606,15 +4243,20 @@ swap_out_syms (abfd, sttp)
else
type = STT_NOTYPE;
- if (bfd_is_com_section (syms[idx]->section))
+ /* Processor-specific types */
+ if (type_ptr != NULL
+ && bed->elf_backend_get_symbol_type)
+ type = (*bed->elf_backend_get_symbol_type) (&type_ptr->internal_elf_sym, type);
+
+ if (flags & BSF_SECTION_SYM)
+ sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
+ else if (bfd_is_com_section (syms[idx]->section))
sym.st_info = ELF_ST_INFO (STB_GLOBAL, type);
else if (bfd_is_und_section (syms[idx]->section))
sym.st_info = ELF_ST_INFO (((flags & BSF_WEAK)
? STB_WEAK
: STB_GLOBAL),
type);
- else if (flags & BSF_SECTION_SYM)
- sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
else if (flags & BSF_FILE)
sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_FILE);
else
@@ -3697,7 +4339,7 @@ _bfd_elf_get_dynamic_symtab_upper_bound (abfd)
long
_bfd_elf_get_reloc_upper_bound (abfd, asect)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
sec_ptr asect;
{
return (asect->reloc_count + 1) * sizeof (arelent *);
@@ -3735,7 +4377,8 @@ _bfd_elf_get_symtab (abfd, alocation)
bfd *abfd;
asymbol **alocation;
{
- long symcount = get_elf_backend_data (abfd)->s->slurp_symbol_table (abfd, alocation, false);
+ long symcount = get_elf_backend_data (abfd)->s->slurp_symbol_table
+ (abfd, alocation, false);
if (symcount >= 0)
bfd_get_symcount (abfd) = symcount;
@@ -3747,7 +4390,8 @@ _bfd_elf_canonicalize_dynamic_symtab (abfd, alocation)
bfd *abfd;
asymbol **alocation;
{
- return get_elf_backend_data (abfd)->s->slurp_symbol_table (abfd, alocation, true);
+ return get_elf_backend_data (abfd)->s->slurp_symbol_table
+ (abfd, alocation, true);
}
/* Return the size required for the dynamic reloc entries. Any
@@ -4026,7 +4670,7 @@ _bfd_elf_make_empty_symbol (abfd)
void
_bfd_elf_get_symbol_info (ignore_abfd, symbol, ret)
- bfd *ignore_abfd;
+ bfd *ignore_abfd ATTRIBUTE_UNUSED;
asymbol *symbol;
symbol_info *ret;
{
@@ -4039,7 +4683,7 @@ _bfd_elf_get_symbol_info (ignore_abfd, symbol, ret)
boolean
_bfd_elf_is_local_label_name (abfd, name)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
const char *name;
{
/* Normal local symbols start with ``.L''. */
@@ -4065,8 +4709,8 @@ _bfd_elf_is_local_label_name (abfd, name)
alent *
_bfd_elf_get_lineno (ignore_abfd, symbol)
- bfd *ignore_abfd;
- asymbol *symbol;
+ bfd *ignore_abfd ATTRIBUTE_UNUSED;
+ asymbol *symbol ATTRIBUTE_UNUSED;
{
abort ();
return NULL;
@@ -4113,11 +4757,16 @@ _bfd_elf_find_nearest_line (abfd,
bfd_vma low_func;
asymbol **p;
- if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
+ if (_bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset,
filename_ptr, functionname_ptr,
line_ptr))
return true;
+ if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
+ filename_ptr, functionname_ptr,
+ line_ptr, 0))
+ return true;
+
if (! _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset,
&found, filename_ptr,
functionname_ptr, line_ptr,
@@ -4149,6 +4798,7 @@ _bfd_elf_find_nearest_line (abfd,
case STT_FILE:
filename = bfd_asymbol_name (&q->symbol);
break;
+ case STT_NOTYPE:
case STT_FUNC:
if (q->symbol.section == section
&& q->symbol.value >= low_func
@@ -4194,8 +4844,8 @@ _bfd_elf_set_section_contents (abfd, section, location, offset, count)
Elf_Internal_Shdr *hdr;
if (! abfd->output_has_begun
- && ! _bfd_elf_compute_section_file_positions (abfd,
- (struct bfd_link_info *) NULL))
+ && ! _bfd_elf_compute_section_file_positions
+ (abfd, (struct bfd_link_info *) NULL))
return false;
hdr = &elf_section_data (section)->this_hdr;
@@ -4210,9 +4860,9 @@ _bfd_elf_set_section_contents (abfd, section, location, offset, count)
void
_bfd_elf_no_info_to_howto (abfd, cache_ptr, dst)
- bfd *abfd;
- arelent *cache_ptr;
- Elf_Internal_Rela *dst;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *cache_ptr ATTRIBUTE_UNUSED;
+ Elf_Internal_Rela *dst ATTRIBUTE_UNUSED;
{
abort ();
}
@@ -4237,11 +4887,11 @@ _bfd_elf_validate_reloc (abfd, areloc)
{
/* Check whether we really have an ELF howto. */
- if ((*areloc->sym_ptr_ptr)->the_bfd->xvec != abfd->xvec)
+ if ((*areloc->sym_ptr_ptr)->the_bfd->xvec != abfd->xvec)
{
bfd_reloc_code_real_type code;
reloc_howto_type *howto;
-
+
/* Alien reloc: Try to determine its type to replace it with an
equivalent ELF reloc. */
@@ -4250,22 +4900,22 @@ _bfd_elf_validate_reloc (abfd, areloc)
switch (areloc->howto->bitsize)
{
case 8:
- code = BFD_RELOC_8_PCREL;
+ code = BFD_RELOC_8_PCREL;
break;
case 12:
- code = BFD_RELOC_12_PCREL;
+ code = BFD_RELOC_12_PCREL;
break;
case 16:
- code = BFD_RELOC_16_PCREL;
+ code = BFD_RELOC_16_PCREL;
break;
case 24:
- code = BFD_RELOC_24_PCREL;
+ code = BFD_RELOC_24_PCREL;
break;
case 32:
- code = BFD_RELOC_32_PCREL;
+ code = BFD_RELOC_32_PCREL;
break;
case 64:
- code = BFD_RELOC_64_PCREL;
+ code = BFD_RELOC_64_PCREL;
break;
default:
goto fail;
@@ -4286,22 +4936,22 @@ _bfd_elf_validate_reloc (abfd, areloc)
switch (areloc->howto->bitsize)
{
case 8:
- code = BFD_RELOC_8;
+ code = BFD_RELOC_8;
break;
case 14:
- code = BFD_RELOC_14;
+ code = BFD_RELOC_14;
break;
case 16:
- code = BFD_RELOC_16;
+ code = BFD_RELOC_16;
break;
case 26:
- code = BFD_RELOC_26;
+ code = BFD_RELOC_26;
break;
case 32:
- code = BFD_RELOC_32;
+ code = BFD_RELOC_32;
break;
case 64:
- code = BFD_RELOC_64;
+ code = BFD_RELOC_64;
break;
default:
goto fail;
@@ -4320,7 +4970,7 @@ _bfd_elf_validate_reloc (abfd, areloc)
fail:
(*_bfd_error_handler)
- ("%s: unsupported relocation type %s",
+ (_("%s: unsupported relocation type %s"),
bfd_get_filename (abfd), areloc->howto->name);
bfd_set_error (bfd_error_bad_value);
return false;
@@ -4338,3 +4988,626 @@ _bfd_elf_close_and_cleanup (abfd)
return _bfd_generic_close_and_cleanup (abfd);
}
+
+/* For Rel targets, we encode meaningful data for BFD_RELOC_VTABLE_ENTRY
+ in the relocation's offset. Thus we cannot allow any sort of sanity
+ range-checking to interfere. There is nothing else to do in processing
+ this reloc. */
+
+bfd_reloc_status_type
+_bfd_elf_rel_vtable_reloc_fn (abfd, re, symbol, data, is, obfd, errmsg)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *re ATTRIBUTE_UNUSED;
+ struct symbol_cache_entry *symbol ATTRIBUTE_UNUSED;
+ PTR data ATTRIBUTE_UNUSED;
+ asection *is ATTRIBUTE_UNUSED;
+ bfd *obfd ATTRIBUTE_UNUSED;
+ char **errmsg ATTRIBUTE_UNUSED;
+{
+ return bfd_reloc_ok;
+}
+
+
+/* Elf core file support. Much of this only works on native
+ toolchains, since we rely on knowing the
+ machine-dependent procfs structure in order to pick
+ out details about the corefile. */
+
+#ifdef HAVE_SYS_PROCFS_H
+# include <sys/procfs.h>
+#endif
+
+
+/* Define offsetof for those systems which lack it. */
+
+#ifndef offsetof
+# define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
+#endif
+
+
+/* FIXME: this is kinda wrong, but it's what gdb wants. */
+
+static int
+elfcore_make_pid (abfd)
+ bfd* abfd;
+{
+ return ((elf_tdata (abfd)->core_lwpid << 16)
+ + (elf_tdata (abfd)->core_pid));
+}
+
+
+/* If there isn't a section called NAME, make one, using
+ data from SECT. Note, this function will generate a
+ reference to NAME, so you shouldn't deallocate or
+ overwrite it. */
+
+static boolean
+elfcore_maybe_make_sect (abfd, name, sect)
+ bfd* abfd;
+ char* name;
+ asection* sect;
+{
+ asection* sect2;
+
+ if (bfd_get_section_by_name (abfd, name) != NULL)
+ return true;
+
+ sect2 = bfd_make_section (abfd, name);
+ if (sect2 == NULL)
+ return false;
+
+ sect2->_raw_size = sect->_raw_size;
+ sect2->filepos = sect->filepos;
+ sect2->flags = sect->flags;
+ sect2->alignment_power = sect->alignment_power;
+ return true;
+}
+
+
+/* prstatus_t exists on:
+ solaris 2.[567]
+ linux 2.[01] + glibc
+ unixware 4.2
+*/
+
+#if defined (HAVE_PRSTATUS_T)
+static boolean
+elfcore_grok_prstatus (abfd, note)
+ bfd* abfd;
+ Elf_Internal_Note* note;
+{
+ prstatus_t prstat;
+ char buf[100];
+ char* name;
+ asection* sect;
+
+ if (note->descsz != sizeof (prstat))
+ return true;
+
+ memcpy (&prstat, note->descdata, sizeof (prstat));
+
+ elf_tdata (abfd)->core_signal = prstat.pr_cursig;
+ elf_tdata (abfd)->core_pid = prstat.pr_pid;
+
+ /* pr_who exists on:
+ solaris 2.[567]
+ unixware 4.2
+ pr_who doesn't exist on:
+ linux 2.[01]
+ */
+#if defined (HAVE_PRSTATUS_T_PR_WHO)
+ elf_tdata (abfd)->core_lwpid = prstat.pr_who;
+#endif
+
+ /* Make a ".reg/999" section. */
+
+ sprintf (buf, ".reg/%d", elfcore_make_pid (abfd));
+ name = bfd_alloc (abfd, strlen (buf) + 1);
+ if (name == NULL)
+ return false;
+ strcpy (name, buf);
+
+ sect = bfd_make_section (abfd, name);
+ if (sect == NULL)
+ return false;
+ sect->_raw_size = sizeof (prstat.pr_reg);
+ sect->filepos = note->descpos + offsetof (prstatus_t, pr_reg);
+ sect->flags = SEC_HAS_CONTENTS;
+ sect->alignment_power = 2;
+
+ if (! elfcore_maybe_make_sect (abfd, ".reg", sect))
+ return false;
+
+ return true;
+}
+#endif /* defined (HAVE_PRSTATUS_T) */
+
+
+/* Create a pseudosection containing the exact contents of NOTE. This
+ actually creates up to two pseudosections:
+ - For the single-threaded case, a section named NAME, unless
+ such a section already exists.
+ - For the multi-threaded case, a section named "NAME/PID", where
+ PID is elfcore_make_pid (abfd).
+ Both pseudosections have identical contents: the contents of NOTE. */
+
+static boolean
+elfcore_make_note_pseudosection (abfd, name, note)
+ bfd* abfd;
+ char *name;
+ Elf_Internal_Note* note;
+{
+ char buf[100];
+ char *threaded_name;
+ asection* sect;
+
+ /* Build the section name. */
+
+ sprintf (buf, "%s/%d", name, elfcore_make_pid (abfd));
+ threaded_name = bfd_alloc (abfd, strlen (buf) + 1);
+ if (threaded_name == NULL)
+ return false;
+ strcpy (threaded_name, buf);
+
+ sect = bfd_make_section (abfd, threaded_name);
+ if (sect == NULL)
+ return false;
+ sect->_raw_size = note->descsz;
+ sect->filepos = note->descpos;
+ sect->flags = SEC_HAS_CONTENTS;
+ sect->alignment_power = 2;
+
+ if (! elfcore_maybe_make_sect (abfd, name, sect))
+ return false;
+
+ return true;
+}
+
+
+/* There isn't a consistent prfpregset_t across platforms,
+ but it doesn't matter, because we don't have to pick this
+ data structure apart. */
+static boolean
+elfcore_grok_prfpreg (abfd, note)
+ bfd* abfd;
+ Elf_Internal_Note* note;
+{
+ return elfcore_make_note_pseudosection (abfd, ".reg2", note);
+}
+
+
+/* Linux dumps the Intel SSE regs in a note named "LINUX" with a note
+ type of 5 (NT_PRXFPREG). Just include the whole note's contents
+ literally. */
+static boolean
+elfcore_grok_prxfpreg (abfd, note)
+ bfd* abfd;
+ Elf_Internal_Note* note;
+{
+ return elfcore_make_note_pseudosection (abfd, ".reg-xfp", note);
+}
+
+
+#if defined (HAVE_PRPSINFO_T)
+# define elfcore_psinfo_t prpsinfo_t
+#endif
+
+#if defined (HAVE_PSINFO_T)
+# define elfcore_psinfo_t psinfo_t
+#endif
+
+
+#if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T)
+
+/* return a malloc'ed copy of a string at START which is at
+ most MAX bytes long, possibly without a terminating '\0'.
+ the copy will always have a terminating '\0'. */
+
+static char*
+elfcore_strndup (abfd, start, max)
+ bfd* abfd;
+ char* start;
+ int max;
+{
+ char* dup;
+ char* end = memchr (start, '\0', max);
+ int len;
+
+ if (end == NULL)
+ len = max;
+ else
+ len = end - start;
+
+ dup = bfd_alloc (abfd, len + 1);
+ if (dup == NULL)
+ return NULL;
+
+ memcpy (dup, start, len);
+ dup[len] = '\0';
+
+ return dup;
+}
+
+static boolean
+elfcore_grok_psinfo (abfd, note)
+ bfd* abfd;
+ Elf_Internal_Note* note;
+{
+ elfcore_psinfo_t psinfo;
+
+ if (note->descsz != sizeof (elfcore_psinfo_t))
+ return true;
+
+ memcpy (&psinfo, note->descdata, note->descsz);
+
+ elf_tdata (abfd)->core_program
+ = elfcore_strndup (abfd, psinfo.pr_fname, sizeof (psinfo.pr_fname));
+
+ elf_tdata (abfd)->core_command
+ = elfcore_strndup (abfd, psinfo.pr_psargs, sizeof (psinfo.pr_psargs));
+
+ /* Note that for some reason, a spurious space is tacked
+ onto the end of the args in some (at least one anyway)
+ implementations, so strip it off if it exists. */
+
+ {
+ char* command = elf_tdata (abfd)->core_command;
+ int n = strlen (command);
+
+ if (0 < n && command[n - 1] == ' ')
+ command[n - 1] = '\0';
+ }
+
+ return true;
+}
+#endif /* defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T) */
+
+
+#if defined (HAVE_PSTATUS_T)
+static boolean
+elfcore_grok_pstatus (abfd, note)
+ bfd* abfd;
+ Elf_Internal_Note* note;
+{
+ pstatus_t pstat;
+
+ if (note->descsz != sizeof (pstat))
+ return true;
+
+ memcpy (&pstat, note->descdata, sizeof (pstat));
+
+ elf_tdata (abfd)->core_pid = pstat.pr_pid;
+
+ /* Could grab some more details from the "representative"
+ lwpstatus_t in pstat.pr_lwp, but we'll catch it all in an
+ NT_LWPSTATUS note, presumably. */
+
+ return true;
+}
+#endif /* defined (HAVE_PSTATUS_T) */
+
+
+#if defined (HAVE_LWPSTATUS_T)
+static boolean
+elfcore_grok_lwpstatus (abfd, note)
+ bfd* abfd;
+ Elf_Internal_Note* note;
+{
+ lwpstatus_t lwpstat;
+ char buf[100];
+ char* name;
+ asection* sect;
+
+ if (note->descsz != sizeof (lwpstat))
+ return true;
+
+ memcpy (&lwpstat, note->descdata, sizeof (lwpstat));
+
+ elf_tdata (abfd)->core_lwpid = lwpstat.pr_lwpid;
+ elf_tdata (abfd)->core_signal = lwpstat.pr_cursig;
+
+ /* Make a ".reg/999" section. */
+
+ sprintf (buf, ".reg/%d", elfcore_make_pid (abfd));
+ name = bfd_alloc (abfd, strlen (buf) + 1);
+ if (name == NULL)
+ return false;
+ strcpy (name, buf);
+
+ sect = bfd_make_section (abfd, name);
+ if (sect == NULL)
+ return false;
+
+#if defined (HAVE_LWPSTATUS_T_PR_CONTEXT)
+ sect->_raw_size = sizeof (lwpstat.pr_context.uc_mcontext.gregs);
+ sect->filepos = note->descpos
+ + offsetof (lwpstatus_t, pr_context.uc_mcontext.gregs);
+#endif
+
+#if defined (HAVE_LWPSTATUS_T_PR_REG)
+ sect->_raw_size = sizeof (lwpstat.pr_reg);
+ sect->filepos = note->descpos + offsetof (lwpstatus_t, pr_reg);
+#endif
+
+ sect->flags = SEC_HAS_CONTENTS;
+ sect->alignment_power = 2;
+
+ if (!elfcore_maybe_make_sect (abfd, ".reg", sect))
+ return false;
+
+ /* Make a ".reg2/999" section */
+
+ sprintf (buf, ".reg2/%d", elfcore_make_pid (abfd));
+ name = bfd_alloc (abfd, strlen (buf) + 1);
+ if (name == NULL)
+ return false;
+ strcpy (name, buf);
+
+ sect = bfd_make_section (abfd, name);
+ if (sect == NULL)
+ return false;
+
+#if defined (HAVE_LWPSTATUS_T_PR_CONTEXT)
+ sect->_raw_size = sizeof (lwpstat.pr_context.uc_mcontext.fpregs);
+ sect->filepos = note->descpos
+ + offsetof (lwpstatus_t, pr_context.uc_mcontext.fpregs);
+#endif
+
+#if defined (HAVE_LWPSTATUS_T_PR_FPREG)
+ sect->_raw_size = sizeof (lwpstat.pr_fpreg);
+ sect->filepos = note->descpos + offsetof (lwpstatus_t, pr_fpreg);
+#endif
+
+ sect->flags = SEC_HAS_CONTENTS;
+ sect->alignment_power = 2;
+
+ if (!elfcore_maybe_make_sect (abfd, ".reg2", sect))
+ return false;
+
+ return true;
+}
+#endif /* defined (HAVE_LWPSTATUS_T) */
+
+#if defined (HAVE_WIN32_PSTATUS_T)
+static boolean
+elfcore_grok_win32pstatus (abfd, note)
+ bfd * abfd;
+ Elf_Internal_Note * note;
+{
+ char buf[30];
+ char * name;
+ asection * sect;
+ win32_pstatus_t pstatus;
+
+ if (note->descsz < sizeof (pstatus))
+ return true;
+
+ memcpy (& pstatus, note->descdata, note->descsz);
+
+ switch (pstatus.data_type)
+ {
+ case NOTE_INFO_PROCESS:
+ /* FIXME: need to add ->core_command. */
+ elf_tdata (abfd)->core_signal = pstatus.data.process_info.signal;
+ elf_tdata (abfd)->core_pid = pstatus.data.process_info.pid;
+ break ;
+
+ case NOTE_INFO_THREAD:
+ /* Make a ".reg/999" section. */
+ sprintf (buf, ".reg/%d", pstatus.data.thread_info.tid);
+
+ name = bfd_alloc (abfd, strlen (buf) + 1);
+ if (name == NULL)
+ return false;
+
+ strcpy (name, buf);
+
+ sect = bfd_make_section (abfd, name);
+ if (sect == NULL)
+ return false;
+
+ sect->_raw_size = sizeof (pstatus.data.thread_info.thread_context);
+ sect->filepos = note->descpos + offsetof (struct win32_pstatus,
+ data.thread_info.thread_context);
+ sect->flags = SEC_HAS_CONTENTS;
+ sect->alignment_power = 2;
+
+ if (pstatus.data.thread_info.is_active_thread)
+ if (! elfcore_maybe_make_sect (abfd, ".reg", sect))
+ return false;
+ break;
+
+ case NOTE_INFO_MODULE:
+ /* Make a ".module/xxxxxxxx" section. */
+ sprintf (buf, ".module/%08x" , pstatus.data.module_info.base_address);
+
+ name = bfd_alloc (abfd, strlen (buf) + 1);
+ if (name == NULL)
+ return false;
+
+ strcpy (name, buf);
+
+ sect = bfd_make_section (abfd, name);
+
+ if (sect == NULL)
+ return false;
+
+ sect->_raw_size = note->descsz;
+ sect->filepos = note->descpos;
+ sect->flags = SEC_HAS_CONTENTS;
+ sect->alignment_power = 2;
+ break;
+
+ default:
+ return true;
+ }
+
+ return true;
+}
+#endif /* HAVE_WIN32_PSTATUS_T */
+
+static boolean
+elfcore_grok_note (abfd, note)
+ bfd* abfd;
+ Elf_Internal_Note* note;
+{
+ switch (note->type)
+ {
+ default:
+ return true;
+
+#if defined (HAVE_PRSTATUS_T)
+ case NT_PRSTATUS:
+ return elfcore_grok_prstatus (abfd, note);
+#endif
+
+#if defined (HAVE_PSTATUS_T)
+ case NT_PSTATUS:
+ return elfcore_grok_pstatus (abfd, note);
+#endif
+
+#if defined (HAVE_LWPSTATUS_T)
+ case NT_LWPSTATUS:
+ return elfcore_grok_lwpstatus (abfd, note);
+#endif
+
+ case NT_FPREGSET: /* FIXME: rename to NT_PRFPREG */
+ return elfcore_grok_prfpreg (abfd, note);
+
+#if defined (HAVE_WIN32_PSTATUS_T)
+ case NT_WIN32PSTATUS:
+ return elfcore_grok_win32pstatus (abfd, note);
+#endif
+
+ case NT_PRXFPREG: /* Linux SSE extension */
+ if (note->namesz == 5
+ && ! strcmp (note->namedata, "LINUX"))
+ return elfcore_grok_prxfpreg (abfd, note);
+ else
+ return true;
+
+#if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T)
+ case NT_PRPSINFO:
+ case NT_PSINFO:
+ return elfcore_grok_psinfo (abfd, note);
+#endif
+ }
+}
+
+
+static boolean
+elfcore_read_notes (abfd, offset, size)
+ bfd* abfd;
+ bfd_vma offset;
+ bfd_vma size;
+{
+ char* buf;
+ char* p;
+
+ if (size <= 0)
+ return true;
+
+ if (bfd_seek (abfd, offset, SEEK_SET) == -1)
+ return false;
+
+ buf = bfd_malloc ((size_t) size);
+ if (buf == NULL)
+ return false;
+
+ if (bfd_read (buf, size, 1, abfd) != size)
+ {
+ error:
+ free (buf);
+ return false;
+ }
+
+ p = buf;
+ while (p < buf + size)
+ {
+ /* FIXME: bad alignment assumption. */
+ Elf_External_Note* xnp = (Elf_External_Note*) p;
+ Elf_Internal_Note in;
+
+ in.type = bfd_h_get_32 (abfd, (bfd_byte *) xnp->type);
+
+ in.namesz = bfd_h_get_32 (abfd, (bfd_byte *) xnp->namesz);
+ in.namedata = xnp->name;
+
+ in.descsz = bfd_h_get_32 (abfd, (bfd_byte *) xnp->descsz);
+ in.descdata = in.namedata + BFD_ALIGN (in.namesz, 4);
+ in.descpos = offset + (in.descdata - buf);
+
+ if (! elfcore_grok_note (abfd, &in))
+ goto error;
+
+ p = in.descdata + BFD_ALIGN (in.descsz, 4);
+ }
+
+ free (buf);
+ return true;
+}
+
+
+/* FIXME: This function is now unnecessary. Callers can just call
+ bfd_section_from_phdr directly. */
+
+boolean
+_bfd_elfcore_section_from_phdr (abfd, phdr, sec_num)
+ bfd* abfd;
+ Elf_Internal_Phdr* phdr;
+ int sec_num;
+{
+ if (! bfd_section_from_phdr (abfd, phdr, sec_num))
+ return false;
+
+ return true;
+}
+
+
+
+/* Providing external access to the ELF program header table. */
+
+/* Return an upper bound on the number of bytes required to store a
+ copy of ABFD's program header table entries. Return -1 if an error
+ occurs; bfd_get_error will return an appropriate code. */
+long
+bfd_get_elf_phdr_upper_bound (abfd)
+ bfd *abfd;
+{
+ if (abfd->xvec->flavour != bfd_target_elf_flavour)
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return -1;
+ }
+
+ return (elf_elfheader (abfd)->e_phnum
+ * sizeof (Elf_Internal_Phdr));
+}
+
+
+/* Copy ABFD's program header table entries to *PHDRS. The entries
+ will be stored as an array of Elf_Internal_Phdr structures, as
+ defined in include/elf/internal.h. To find out how large the
+ buffer needs to be, call bfd_get_elf_phdr_upper_bound.
+
+ Return the number of program header table entries read, or -1 if an
+ error occurs; bfd_get_error will return an appropriate code. */
+int
+bfd_get_elf_phdrs (abfd, phdrs)
+ bfd *abfd;
+ void *phdrs;
+{
+ int num_phdrs;
+
+ if (abfd->xvec->flavour != bfd_target_elf_flavour)
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return -1;
+ }
+
+ num_phdrs = elf_elfheader (abfd)->e_phnum;
+ memcpy (phdrs, elf_tdata (abfd)->phdr,
+ num_phdrs * sizeof (Elf_Internal_Phdr));
+
+ return num_phdrs;
+}
diff --git a/contrib/binutils/bfd/elf32-arc.c b/contrib/binutils/bfd/elf32-arc.c
index 81fafd54ce62..318dc704e06c 100644
--- a/contrib/binutils/bfd/elf32-arc.c
+++ b/contrib/binutils/bfd/elf32-arc.c
@@ -1,5 +1,5 @@
/* ARC-specific support for 32-bit ELF
- Copyright (C) 1994, 1995, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 1997, 1999 Free Software Foundation, Inc.
Contributed by Doug Evans (dje@cygnus.com).
This file is part of BFD, the Binary File Descriptor library.
@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "elf/arc.h"
static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
- PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
+ PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
static void arc_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *));
static boolean arc_elf_object_p PARAMS ((bfd *));
@@ -103,7 +103,7 @@ static reloc_howto_type elf_arc_howto_table[] =
struct arc_reloc_map
{
- unsigned char bfd_reloc_val;
+ bfd_reloc_code_real_type bfd_reloc_val;
unsigned char elf_reloc_val;
};
@@ -118,7 +118,7 @@ static const struct arc_reloc_map arc_reloc_map[] =
static reloc_howto_type *
bfd_elf32_bfd_reloc_type_lookup (abfd, code)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
bfd_reloc_code_real_type code;
{
unsigned int i;
@@ -138,7 +138,7 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code)
static void
arc_info_to_howto_rel (abfd, cache_ptr, dst)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr;
Elf32_Internal_Rel *dst;
{
@@ -178,7 +178,7 @@ arc_elf_object_p (abfd)
static void
arc_elf_final_write_processing (abfd, linker)
bfd *abfd;
- boolean linker;
+ boolean linker ATTRIBUTE_UNUSED;
{
int mach;
unsigned long val;
diff --git a/contrib/binutils/bfd/elf32-arm.h b/contrib/binutils/bfd/elf32-arm.h
new file mode 100644
index 000000000000..eaaf9763b408
--- /dev/null
+++ b/contrib/binutils/bfd/elf32-arm.h
@@ -0,0 +1,3239 @@
+/* 32-bit ELF support for ARM
+ Copyright 1998, 1999 Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+
+typedef unsigned long int insn32;
+typedef unsigned short int insn16;
+
+static boolean elf32_arm_set_private_flags
+ PARAMS ((bfd *, flagword));
+static boolean elf32_arm_copy_private_bfd_data
+ PARAMS ((bfd *, bfd *));
+static boolean elf32_arm_merge_private_bfd_data
+ PARAMS ((bfd *, bfd *));
+static boolean elf32_arm_print_private_bfd_data
+ PARAMS ((bfd *, PTR));
+static int elf32_arm_get_symbol_type
+ PARAMS (( Elf_Internal_Sym *, int));
+static struct bfd_link_hash_table *elf32_arm_link_hash_table_create
+ PARAMS ((bfd *));
+static bfd_reloc_status_type elf32_arm_final_link_relocate
+ PARAMS ((reloc_howto_type *, bfd *, bfd *, asection *, bfd_byte *,
+ Elf_Internal_Rela *, bfd_vma, struct bfd_link_info *, asection *,
+ const char *, unsigned char, struct elf_link_hash_entry *));
+
+static insn32 insert_thumb_branch
+ PARAMS ((insn32, int));
+static struct elf_link_hash_entry *find_thumb_glue
+ PARAMS ((struct bfd_link_info *, CONST char *, bfd *));
+static struct elf_link_hash_entry *find_arm_glue
+ PARAMS ((struct bfd_link_info *, CONST char *, bfd *));
+static void record_arm_to_thumb_glue
+ PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
+static void record_thumb_to_arm_glue
+ PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
+static void elf32_arm_post_process_headers
+ PARAMS ((bfd *, struct bfd_link_info *));
+static int elf32_arm_to_thumb_stub
+ PARAMS ((struct bfd_link_info *, const char *, bfd *, bfd *, asection *,
+ bfd_byte *, asection *, bfd_vma, bfd_signed_vma, bfd_vma));
+static int elf32_thumb_to_arm_stub
+ PARAMS ((struct bfd_link_info *, const char *, bfd *, bfd *, asection *,
+ bfd_byte *, asection *, bfd_vma, bfd_signed_vma, bfd_vma));
+
+/* The linker script knows the section names for placement.
+ The entry_names are used to do simple name mangling on the stubs.
+ Given a function name, and its type, the stub can be found. The
+ name can be changed. The only requirement is the %s be present.
+ */
+
+#define INTERWORK_FLAG( abfd ) (elf_elfheader (abfd)->e_flags & EF_INTERWORK)
+
+#define THUMB2ARM_GLUE_SECTION_NAME ".glue_7t"
+#define THUMB2ARM_GLUE_ENTRY_NAME "__%s_from_thumb"
+
+#define ARM2THUMB_GLUE_SECTION_NAME ".glue_7"
+#define ARM2THUMB_GLUE_ENTRY_NAME "__%s_from_arm"
+
+/* The name of the dynamic interpreter. This is put in the .interp
+ section. */
+#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
+
+/* The size in bytes of an entry in the procedure linkage table. */
+
+#define PLT_ENTRY_SIZE 16
+
+/* The first entry in a procedure linkage table looks like
+ this. It is set up so that any shared library function that is
+ called before the relocation has been set up calls the dynamic
+ linker first */
+
+static const bfd_byte elf32_arm_plt0_entry [PLT_ENTRY_SIZE] =
+{
+ 0x04, 0xe0, 0x2d, 0xe5, /* str lr, [sp, #-4]! */
+ 0x10, 0xe0, 0x9f, 0xe5, /* ldr lr, [pc, #16] */
+ 0x0e, 0xe0, 0x8f, 0xe0, /* adr lr, pc, lr */
+ 0x08, 0xf0, 0xbe, 0xe5 /* ldr pc, [lr, #8]! */
+};
+
+/* Subsequent entries in a procedure linkage table look like
+ this. */
+
+static const bfd_byte elf32_arm_plt_entry [PLT_ENTRY_SIZE] =
+{
+ 0x04, 0xc0, 0x9f, 0xe5, /* ldr ip, [pc, #4] */
+ 0x0c, 0xc0, 0x8f, 0xe0, /* add ip, pc, ip */
+ 0x00, 0xf0, 0x9c, 0xe5, /* ldr pc, [ip] */
+ 0x00, 0x00, 0x00, 0x00 /* offset to symbol in got */
+};
+
+
+/* The ARM linker needs to keep track of the number of relocs that it
+ decides to copy in check_relocs for each symbol. This is so that
+ it can discard PC relative relocs if it doesn't need them when
+ linking with -Bsymbolic. We store the information in a field
+ extending the regular ELF linker hash table. */
+
+/* This structure keeps track of the number of PC relative relocs we
+ have copied for a given symbol. */
+
+struct elf32_arm_pcrel_relocs_copied
+{
+ /* Next section. */
+ struct elf32_arm_pcrel_relocs_copied * next;
+ /* A section in dynobj. */
+ asection * section;
+ /* Number of relocs copied in this section. */
+ bfd_size_type count;
+};
+
+/* Arm ELF linker hash entry. */
+
+struct elf32_arm_link_hash_entry
+{
+ struct elf_link_hash_entry root;
+
+ /* Number of PC relative relocs copied for this symbol. */
+ struct elf32_arm_pcrel_relocs_copied * pcrel_relocs_copied;
+};
+
+/* Declare this now that the above structures are defined. */
+
+static boolean elf32_arm_discard_copies
+ PARAMS ((struct elf32_arm_link_hash_entry *, PTR));
+
+/* Traverse an arm ELF linker hash table. */
+
+#define elf32_arm_link_hash_traverse(table, func, info) \
+ (elf_link_hash_traverse \
+ (&(table)->root, \
+ (boolean (*) PARAMS ((struct elf_link_hash_entry *, PTR))) (func), \
+ (info)))
+
+/* Get the ARM elf linker hash table from a link_info structure. */
+#define elf32_arm_hash_table(info) \
+ ((struct elf32_arm_link_hash_table *) ((info)->hash))
+
+/* ARM ELF linker hash table */
+struct elf32_arm_link_hash_table
+ {
+ /* The main hash table. */
+ struct elf_link_hash_table root;
+
+ /* The size in bytes of the section containg the Thumb-to-ARM glue. */
+ long int thumb_glue_size;
+
+ /* The size in bytes of the section containg the ARM-to-Thumb glue. */
+ long int arm_glue_size;
+
+ /* An arbitary input BFD chosen to hold the glue sections. */
+ bfd * bfd_of_glue_owner;
+
+ /* A boolean indicating whether knowledge of the ARM's pipeline
+ length should be applied by the linker. */
+ int no_pipeline_knowledge;
+ };
+
+
+/* Create an entry in an ARM ELF linker hash table. */
+
+static struct bfd_hash_entry *
+elf32_arm_link_hash_newfunc (entry, table, string)
+ struct bfd_hash_entry * entry;
+ struct bfd_hash_table * table;
+ const char * string;
+{
+ struct elf32_arm_link_hash_entry * ret =
+ (struct elf32_arm_link_hash_entry *) entry;
+
+ /* Allocate the structure if it has not already been allocated by a
+ subclass. */
+ if (ret == (struct elf32_arm_link_hash_entry *) NULL)
+ ret = ((struct elf32_arm_link_hash_entry *)
+ bfd_hash_allocate (table,
+ sizeof (struct elf32_arm_link_hash_entry)));
+ if (ret == (struct elf32_arm_link_hash_entry *) NULL)
+ return (struct bfd_hash_entry *) ret;
+
+ /* Call the allocation method of the superclass. */
+ ret = ((struct elf32_arm_link_hash_entry *)
+ _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret,
+ table, string));
+ if (ret != (struct elf32_arm_link_hash_entry *) NULL)
+ ret->pcrel_relocs_copied = NULL;
+
+ return (struct bfd_hash_entry *) ret;
+}
+
+/* Create an ARM elf linker hash table */
+
+static struct bfd_link_hash_table *
+elf32_arm_link_hash_table_create (abfd)
+ bfd *abfd;
+{
+ struct elf32_arm_link_hash_table *ret;
+
+ ret = ((struct elf32_arm_link_hash_table *)
+ bfd_alloc (abfd, sizeof (struct elf32_arm_link_hash_table)));
+ if (ret == (struct elf32_arm_link_hash_table *) NULL)
+ return NULL;
+
+ if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
+ elf32_arm_link_hash_newfunc))
+ {
+ bfd_release (abfd, ret);
+ return NULL;
+ }
+
+ ret->thumb_glue_size = 0;
+ ret->arm_glue_size = 0;
+ ret->bfd_of_glue_owner = NULL;
+ ret->no_pipeline_knowledge = 0;
+
+ return &ret->root.root;
+}
+
+static struct elf_link_hash_entry *
+find_thumb_glue (link_info, name, input_bfd)
+ struct bfd_link_info *link_info;
+ CONST char *name;
+ bfd *input_bfd;
+{
+ char *tmp_name;
+ struct elf_link_hash_entry *hash;
+ struct elf32_arm_link_hash_table *hash_table;
+
+ /* We need a pointer to the armelf specific hash table. */
+ hash_table = elf32_arm_hash_table (link_info);
+
+
+ tmp_name = ((char *)
+ bfd_malloc (strlen (name) + strlen (THUMB2ARM_GLUE_ENTRY_NAME) + 1));
+
+ BFD_ASSERT (tmp_name);
+
+ sprintf (tmp_name, THUMB2ARM_GLUE_ENTRY_NAME, name);
+
+ hash = elf_link_hash_lookup
+ (&(hash_table)->root, tmp_name, false, false, true);
+
+ if (hash == NULL)
+ /* xgettext:c-format */
+ _bfd_error_handler (_ ("%s: unable to find THUMB glue '%s' for `%s'"),
+ bfd_get_filename (input_bfd), tmp_name, name);
+
+ free (tmp_name);
+
+ return hash;
+}
+
+static struct elf_link_hash_entry *
+find_arm_glue (link_info, name, input_bfd)
+ struct bfd_link_info *link_info;
+ CONST char *name;
+ bfd *input_bfd;
+{
+ char *tmp_name;
+ struct elf_link_hash_entry *myh;
+ struct elf32_arm_link_hash_table *hash_table;
+
+ /* We need a pointer to the elfarm specific hash table. */
+ hash_table = elf32_arm_hash_table (link_info);
+
+ tmp_name = ((char *)
+ bfd_malloc (strlen (name) + strlen (ARM2THUMB_GLUE_ENTRY_NAME) + 1));
+
+ BFD_ASSERT (tmp_name);
+
+ sprintf (tmp_name, ARM2THUMB_GLUE_ENTRY_NAME, name);
+
+ myh = elf_link_hash_lookup
+ (&(hash_table)->root, tmp_name, false, false, true);
+
+ if (myh == NULL)
+ /* xgettext:c-format */
+ _bfd_error_handler (_ ("%s: unable to find ARM glue '%s' for `%s'"),
+ bfd_get_filename (input_bfd), tmp_name, name);
+
+ free (tmp_name);
+
+ return myh;
+}
+
+/*
+ ARM->Thumb glue:
+
+ .arm
+ __func_from_arm:
+ ldr r12, __func_addr
+ bx r12
+ __func_addr:
+ .word func @ behave as if you saw a ARM_32 reloc
+ */
+
+#define ARM2THUMB_GLUE_SIZE 12
+static const insn32 a2t1_ldr_insn = 0xe59fc000;
+static const insn32 a2t2_bx_r12_insn = 0xe12fff1c;
+static const insn32 a2t3_func_addr_insn = 0x00000001;
+
+/*
+ Thumb->ARM: Thumb->(non-interworking aware) ARM
+
+ .thumb .thumb
+ .align 2 .align 2
+ __func_from_thumb: __func_from_thumb:
+ bx pc push {r6, lr}
+ nop ldr r6, __func_addr
+ .arm mov lr, pc
+ __func_change_to_arm: bx r6
+ b func .arm
+ __func_back_to_thumb:
+ ldmia r13! {r6, lr}
+ bx lr
+ __func_addr:
+ .word func
+ */
+
+#define THUMB2ARM_GLUE_SIZE 8
+static const insn16 t2a1_bx_pc_insn = 0x4778;
+static const insn16 t2a2_noop_insn = 0x46c0;
+static const insn32 t2a3_b_insn = 0xea000000;
+
+static const insn16 t2a1_push_insn = 0xb540;
+static const insn16 t2a2_ldr_insn = 0x4e03;
+static const insn16 t2a3_mov_insn = 0x46fe;
+static const insn16 t2a4_bx_insn = 0x4730;
+static const insn32 t2a5_pop_insn = 0xe8bd4040;
+static const insn32 t2a6_bx_insn = 0xe12fff1e;
+
+boolean
+bfd_elf32_arm_allocate_interworking_sections (info)
+ struct bfd_link_info * info;
+{
+ asection * s;
+ bfd_byte * foo;
+ struct elf32_arm_link_hash_table * globals;
+
+ globals = elf32_arm_hash_table (info);
+
+ BFD_ASSERT (globals != NULL);
+
+ if (globals->arm_glue_size != 0)
+ {
+ BFD_ASSERT (globals->bfd_of_glue_owner != NULL);
+
+ s = bfd_get_section_by_name
+ (globals->bfd_of_glue_owner, ARM2THUMB_GLUE_SECTION_NAME);
+
+ BFD_ASSERT (s != NULL);
+
+ foo = (bfd_byte *) bfd_alloc
+ (globals->bfd_of_glue_owner, globals->arm_glue_size);
+
+ s->_raw_size = s->_cooked_size = globals->arm_glue_size;
+ s->contents = foo;
+ }
+
+ if (globals->thumb_glue_size != 0)
+ {
+ BFD_ASSERT (globals->bfd_of_glue_owner != NULL);
+
+ s = bfd_get_section_by_name
+ (globals->bfd_of_glue_owner, THUMB2ARM_GLUE_SECTION_NAME);
+
+ BFD_ASSERT (s != NULL);
+
+ foo = (bfd_byte *) bfd_alloc
+ (globals->bfd_of_glue_owner, globals->thumb_glue_size);
+
+ s->_raw_size = s->_cooked_size = globals->thumb_glue_size;
+ s->contents = foo;
+ }
+
+ return true;
+}
+
+static void
+record_arm_to_thumb_glue (link_info, h)
+ struct bfd_link_info * link_info;
+ struct elf_link_hash_entry * h;
+{
+ const char * name = h->root.root.string;
+ register asection * s;
+ char * tmp_name;
+ struct elf_link_hash_entry * myh;
+ struct elf32_arm_link_hash_table * globals;
+
+ globals = elf32_arm_hash_table (link_info);
+
+ BFD_ASSERT (globals != NULL);
+ BFD_ASSERT (globals->bfd_of_glue_owner != NULL);
+
+ s = bfd_get_section_by_name
+ (globals->bfd_of_glue_owner, ARM2THUMB_GLUE_SECTION_NAME);
+
+
+ BFD_ASSERT (s != NULL);
+
+ tmp_name = ((char *)
+ bfd_malloc (strlen (name) + strlen (ARM2THUMB_GLUE_ENTRY_NAME) + 1));
+
+ BFD_ASSERT (tmp_name);
+
+ sprintf (tmp_name, ARM2THUMB_GLUE_ENTRY_NAME, name);
+
+ myh = elf_link_hash_lookup
+ (&(globals)->root, tmp_name, false, false, true);
+
+ if (myh != NULL)
+ {
+ free (tmp_name);
+ return; /* we've already seen this guy */
+ }
+
+ /* The only trick here is using hash_table->arm_glue_size as the value. Even
+ though the section isn't allocated yet, this is where we will be putting
+ it. */
+
+ _bfd_generic_link_add_one_symbol (link_info, globals->bfd_of_glue_owner, tmp_name,
+ BSF_GLOBAL,
+ s, globals->arm_glue_size + 1,
+ NULL, true, false,
+ (struct bfd_link_hash_entry **) &myh);
+
+ free (tmp_name);
+
+ globals->arm_glue_size += ARM2THUMB_GLUE_SIZE;
+
+ return;
+}
+
+static void
+record_thumb_to_arm_glue (link_info, h)
+ struct bfd_link_info *link_info;
+ struct elf_link_hash_entry *h;
+{
+ const char *name = h->root.root.string;
+ register asection *s;
+ char *tmp_name;
+ struct elf_link_hash_entry *myh;
+ struct elf32_arm_link_hash_table *hash_table;
+ char bind;
+
+ hash_table = elf32_arm_hash_table (link_info);
+
+ BFD_ASSERT (hash_table != NULL);
+ BFD_ASSERT (hash_table->bfd_of_glue_owner != NULL);
+
+ s = bfd_get_section_by_name
+ (hash_table->bfd_of_glue_owner, THUMB2ARM_GLUE_SECTION_NAME);
+
+ BFD_ASSERT (s != NULL);
+
+ tmp_name = (char *) bfd_malloc (strlen (name) + strlen (THUMB2ARM_GLUE_ENTRY_NAME) + 1);
+
+ BFD_ASSERT (tmp_name);
+
+ sprintf (tmp_name, THUMB2ARM_GLUE_ENTRY_NAME, name);
+
+ myh = elf_link_hash_lookup
+ (&(hash_table)->root, tmp_name, false, false, true);
+
+ if (myh != NULL)
+ {
+ free (tmp_name);
+ return; /* we've already seen this guy */
+ }
+
+ _bfd_generic_link_add_one_symbol (link_info, hash_table->bfd_of_glue_owner, tmp_name,
+ BSF_GLOBAL, s, hash_table->thumb_glue_size + 1,
+ NULL, true, false,
+ (struct bfd_link_hash_entry **) &myh);
+
+ /* If we mark it 'thumb', the disassembler will do a better job. */
+ bind = ELF_ST_BIND (myh->type);
+ myh->type = ELF_ST_INFO (bind, STT_ARM_TFUNC);
+
+ free (tmp_name);
+
+ /* Allocate another symbol to mark where we switch to arm mode. */
+
+#define CHANGE_TO_ARM "__%s_change_to_arm"
+#define BACK_FROM_ARM "__%s_back_from_arm"
+
+ tmp_name = (char *) bfd_malloc (strlen (name) + strlen (CHANGE_TO_ARM) + 1);
+
+ BFD_ASSERT (tmp_name);
+
+ sprintf (tmp_name, CHANGE_TO_ARM, name);
+
+ myh = NULL;
+
+ _bfd_generic_link_add_one_symbol (link_info, hash_table->bfd_of_glue_owner, tmp_name,
+ BSF_LOCAL, s, hash_table->thumb_glue_size + 4,
+ NULL, true, false,
+ (struct bfd_link_hash_entry **) &myh);
+
+ free (tmp_name);
+
+ hash_table->thumb_glue_size += THUMB2ARM_GLUE_SIZE;
+
+ return;
+}
+
+/* Select a BFD to be used to hold the sections used by the glue code.
+ This function is called from the linker scripts in ld/emultempl/
+ {armelf/pe}.em */
+boolean
+bfd_elf32_arm_get_bfd_for_interworking (abfd, info)
+ bfd *abfd;
+ struct bfd_link_info *info;
+{
+ struct elf32_arm_link_hash_table *globals;
+ flagword flags;
+ asection *sec;
+
+ /* If we are only performing a partial link do not bother
+ getting a bfd to hold the glue. */
+ if (info->relocateable)
+ return true;
+
+ globals = elf32_arm_hash_table (info);
+
+ BFD_ASSERT (globals != NULL);
+
+ if (globals->bfd_of_glue_owner != NULL)
+ return true;
+
+ sec = bfd_get_section_by_name (abfd, ARM2THUMB_GLUE_SECTION_NAME);
+
+ if (sec == NULL)
+ {
+ /* Note: we do not include the flag SEC_LINKER_CREATED, as this
+ will prevent elf_link_input_bfd() from processing the contents
+ of this section. */
+ flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE | SEC_READONLY;
+
+ sec = bfd_make_section (abfd, ARM2THUMB_GLUE_SECTION_NAME);
+
+ if (sec == NULL
+ || !bfd_set_section_flags (abfd, sec, flags)
+ || !bfd_set_section_alignment (abfd, sec, 2))
+ return false;
+
+ /* Set the gc mark to prevent the section from being removed by garbage
+ collection, despite the fact that no relocs refer to this section. */
+ sec->gc_mark = 1;
+ }
+
+ sec = bfd_get_section_by_name (abfd, THUMB2ARM_GLUE_SECTION_NAME);
+
+ if (sec == NULL)
+ {
+ flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE | SEC_READONLY;
+
+ sec = bfd_make_section (abfd, THUMB2ARM_GLUE_SECTION_NAME);
+
+ if (sec == NULL
+ || !bfd_set_section_flags (abfd, sec, flags)
+ || !bfd_set_section_alignment (abfd, sec, 2))
+ return false;
+
+ sec->gc_mark = 1;
+ }
+
+ /* Save the bfd for later use. */
+ globals->bfd_of_glue_owner = abfd;
+
+ return true;
+}
+
+boolean
+bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge)
+ bfd *abfd;
+ struct bfd_link_info *link_info;
+ int no_pipeline_knowledge;
+{
+ Elf_Internal_Shdr *symtab_hdr;
+ Elf_Internal_Rela *free_relocs = NULL;
+ Elf_Internal_Rela *irel, *irelend;
+ bfd_byte *contents = NULL;
+ bfd_byte *free_contents = NULL;
+ Elf32_External_Sym *extsyms = NULL;
+ Elf32_External_Sym *free_extsyms = NULL;
+
+ asection *sec;
+ struct elf32_arm_link_hash_table *globals;
+
+ /* If we are only performing a partial link do not bother
+ to construct any glue. */
+ if (link_info->relocateable)
+ return true;
+
+ /* Here we have a bfd that is to be included on the link. We have a hook
+ to do reloc rummaging, before section sizes are nailed down. */
+
+ globals = elf32_arm_hash_table (link_info);
+
+ BFD_ASSERT (globals != NULL);
+ BFD_ASSERT (globals->bfd_of_glue_owner != NULL);
+
+ globals->no_pipeline_knowledge = no_pipeline_knowledge;
+
+ /* Rummage around all the relocs and map the glue vectors. */
+ sec = abfd->sections;
+
+ if (sec == NULL)
+ return true;
+
+ for (; sec != NULL; sec = sec->next)
+ {
+ if (sec->reloc_count == 0)
+ continue;
+
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ /* Load the relocs. */
+
+ irel = (_bfd_elf32_link_read_relocs (abfd, sec, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL, false));
+
+ BFD_ASSERT (irel != 0);
+
+ irelend = irel + sec->reloc_count;
+ for (; irel < irelend; irel++)
+ {
+ long r_type;
+ unsigned long r_index;
+
+ struct elf_link_hash_entry *h;
+
+ r_type = ELF32_R_TYPE (irel->r_info);
+ r_index = ELF32_R_SYM (irel->r_info);
+
+ /* These are the only relocation types we care about */
+ if ( r_type != R_ARM_PC24
+ && r_type != R_ARM_THM_PC22)
+ continue;
+
+ /* Get the section contents if we haven't done so already. */
+ if (contents == NULL)
+ {
+ /* Get cached copy if it exists. */
+ if (elf_section_data (sec)->this_hdr.contents != NULL)
+ contents = elf_section_data (sec)->this_hdr.contents;
+ else
+ {
+ /* Go get them off disk. */
+ contents = (bfd_byte *) bfd_malloc (sec->_raw_size);
+ if (contents == NULL)
+ goto error_return;
+ free_contents = contents;
+
+ if (!bfd_get_section_contents (abfd, sec, contents,
+ (file_ptr) 0, sec->_raw_size))
+ goto error_return;
+ }
+ }
+
+ /* Read this BFD's symbols if we haven't done so already. */
+ if (extsyms == NULL)
+ {
+ /* Get cached copy if it exists. */
+ if (symtab_hdr->contents != NULL)
+ extsyms = (Elf32_External_Sym *) symtab_hdr->contents;
+ else
+ {
+ /* Go get them off disk. */
+ extsyms = ((Elf32_External_Sym *)
+ bfd_malloc (symtab_hdr->sh_size));
+ if (extsyms == NULL)
+ goto error_return;
+ free_extsyms = extsyms;
+ if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0
+ || (bfd_read (extsyms, 1, symtab_hdr->sh_size, abfd)
+ != symtab_hdr->sh_size))
+ goto error_return;
+ }
+ }
+
+ /* If the relocation is not against a symbol it cannot concern us. */
+
+ h = NULL;
+
+ /* We don't care about local symbols */
+ if (r_index < symtab_hdr->sh_info)
+ continue;
+
+ /* This is an external symbol */
+ r_index -= symtab_hdr->sh_info;
+ h = (struct elf_link_hash_entry *)
+ elf_sym_hashes (abfd)[r_index];
+
+ /* If the relocation is against a static symbol it must be within
+ the current section and so cannot be a cross ARM/Thumb relocation. */
+ if (h == NULL)
+ continue;
+
+ switch (r_type)
+ {
+ case R_ARM_PC24:
+ /* This one is a call from arm code. We need to look up
+ the target of the call. If it is a thumb target, we
+ insert glue. */
+
+ if (ELF_ST_TYPE(h->type) == STT_ARM_TFUNC)
+ record_arm_to_thumb_glue (link_info, h);
+ break;
+
+ case R_ARM_THM_PC22:
+ /* This one is a call from thumb code. We look
+ up the target of the call. If it is not a thumb
+ target, we insert glue. */
+
+ if (ELF_ST_TYPE (h->type) != STT_ARM_TFUNC)
+ record_thumb_to_arm_glue (link_info, h);
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+
+ return true;
+
+error_return:
+ if (free_relocs != NULL)
+ free (free_relocs);
+ if (free_contents != NULL)
+ free (free_contents);
+ if (free_extsyms != NULL)
+ free (free_extsyms);
+
+ return false;
+}
+
+/* The thumb form of a long branch is a bit finicky, because the offset
+ encoding is split over two fields, each in it's own instruction. They
+ can occur in any order. So given a thumb form of long branch, and an
+ offset, insert the offset into the thumb branch and return finished
+ instruction.
+
+ It takes two thumb instructions to encode the target address. Each has
+ 11 bits to invest. The upper 11 bits are stored in one (identifed by
+ H-0.. see below), the lower 11 bits are stored in the other (identified
+ by H-1).
+
+ Combine together and shifted left by 1 (it's a half word address) and
+ there you have it.
+
+ Op: 1111 = F,
+ H-0, upper address-0 = 000
+ Op: 1111 = F,
+ H-1, lower address-0 = 800
+
+ They can be ordered either way, but the arm tools I've seen always put
+ the lower one first. It probably doesn't matter. krk@cygnus.com
+
+ XXX: Actually the order does matter. The second instruction (H-1)
+ moves the computed address into the PC, so it must be the second one
+ in the sequence. The problem, however is that whilst little endian code
+ stores the instructions in HI then LOW order, big endian code does the
+ reverse. nickc@cygnus.com */
+
+#define LOW_HI_ORDER 0xF800F000
+#define HI_LOW_ORDER 0xF000F800
+
+static insn32
+insert_thumb_branch (br_insn, rel_off)
+ insn32 br_insn;
+ int rel_off;
+{
+ unsigned int low_bits;
+ unsigned int high_bits;
+
+
+ BFD_ASSERT ((rel_off & 1) != 1);
+
+ rel_off >>= 1; /* half word aligned address */
+ low_bits = rel_off & 0x000007FF; /* the bottom 11 bits */
+ high_bits = (rel_off >> 11) & 0x000007FF; /* the top 11 bits */
+
+ if ((br_insn & LOW_HI_ORDER) == LOW_HI_ORDER)
+ br_insn = LOW_HI_ORDER | (low_bits << 16) | high_bits;
+ else if ((br_insn & HI_LOW_ORDER) == HI_LOW_ORDER)
+ br_insn = HI_LOW_ORDER | (high_bits << 16) | low_bits;
+ else
+ abort (); /* error - not a valid branch instruction form */
+
+ /* FIXME: abort is probably not the right call. krk@cygnus.com */
+
+ return br_insn;
+}
+
+/* Thumb code calling an ARM function */
+static int
+elf32_thumb_to_arm_stub (info, name, input_bfd, output_bfd, input_section,
+ hit_data, sym_sec, offset, addend, val)
+ struct bfd_link_info * info;
+ const char * name;
+ bfd * input_bfd;
+ bfd * output_bfd;
+ asection * input_section;
+ bfd_byte * hit_data;
+ asection * sym_sec;
+ bfd_vma offset;
+ bfd_signed_vma addend;
+ bfd_vma val;
+{
+ asection * s = 0;
+ long int my_offset;
+ unsigned long int tmp;
+ long int ret_offset;
+ struct elf_link_hash_entry * myh;
+ struct elf32_arm_link_hash_table * globals;
+
+ myh = find_thumb_glue (info, name, input_bfd);
+ if (myh == NULL)
+ return false;
+
+ globals = elf32_arm_hash_table (info);
+
+ BFD_ASSERT (globals != NULL);
+ BFD_ASSERT (globals->bfd_of_glue_owner != NULL);
+
+ my_offset = myh->root.u.def.value;
+
+ s = bfd_get_section_by_name (globals->bfd_of_glue_owner,
+ THUMB2ARM_GLUE_SECTION_NAME);
+
+ BFD_ASSERT (s != NULL);
+ BFD_ASSERT (s->contents != NULL);
+ BFD_ASSERT (s->output_section != NULL);
+
+ if ((my_offset & 0x01) == 0x01)
+ {
+ if (sym_sec != NULL
+ && sym_sec->owner != NULL
+ && !INTERWORK_FLAG (sym_sec->owner))
+ {
+ _bfd_error_handler
+ (_ ("%s(%s): warning: interworking not enabled."),
+ bfd_get_filename (sym_sec->owner), name);
+ _bfd_error_handler
+ (_ (" first occurrence: %s: thumb call to arm"),
+ bfd_get_filename (input_bfd));
+
+ return false;
+ }
+
+ --my_offset;
+ myh->root.u.def.value = my_offset;
+
+ bfd_put_16 (output_bfd, t2a1_bx_pc_insn,
+ s->contents + my_offset);
+
+ bfd_put_16 (output_bfd, t2a2_noop_insn,
+ s->contents + my_offset + 2);
+
+ ret_offset =
+ ((bfd_signed_vma) val) /* Address of destination of the stub */
+ - ((bfd_signed_vma)
+ (s->output_offset /* Offset from the start of the current section to the start of the stubs. */
+ + my_offset /* Offset of the start of this stub from the start of the stubs. */
+ + s->output_section->vma) /* Address of the start of the current section. */
+ + 4 /* The branch instruction is 4 bytes into the stub. */
+ + 8); /* ARM branches work from the pc of the instruction + 8. */
+
+ bfd_put_32 (output_bfd,
+ t2a3_b_insn | ((ret_offset >> 2) & 0x00FFFFFF),
+ s->contents + my_offset + 4);
+ }
+
+ BFD_ASSERT (my_offset <= globals->thumb_glue_size);
+
+ /* Now go back and fix up the original BL insn to point
+ to here. */
+ ret_offset =
+ s->output_offset
+ + my_offset
+ - (input_section->output_offset
+ + offset + addend)
+ - 8;
+
+ tmp = bfd_get_32 (input_bfd, hit_data
+ - input_section->vma);
+
+ bfd_put_32 (output_bfd,
+ insert_thumb_branch (tmp, ret_offset),
+ hit_data - input_section->vma);
+
+ return true;
+}
+
+/* Arm code calling a Thumb function */
+static int
+elf32_arm_to_thumb_stub (info, name, input_bfd, output_bfd, input_section,
+ hit_data, sym_sec, offset, addend, val)
+ struct bfd_link_info * info;
+ const char * name;
+ bfd * input_bfd;
+ bfd * output_bfd;
+ asection * input_section;
+ bfd_byte * hit_data;
+ asection * sym_sec;
+ bfd_vma offset;
+ bfd_signed_vma addend;
+ bfd_vma val;
+{
+ unsigned long int tmp;
+ long int my_offset;
+ asection * s;
+ long int ret_offset;
+ struct elf_link_hash_entry * myh;
+ struct elf32_arm_link_hash_table * globals;
+
+ myh = find_arm_glue (info, name, input_bfd);
+ if (myh == NULL)
+ return false;
+
+ globals = elf32_arm_hash_table (info);
+
+ BFD_ASSERT (globals != NULL);
+ BFD_ASSERT (globals->bfd_of_glue_owner != NULL);
+
+ my_offset = myh->root.u.def.value;
+ s = bfd_get_section_by_name (globals->bfd_of_glue_owner,
+ ARM2THUMB_GLUE_SECTION_NAME);
+ BFD_ASSERT (s != NULL);
+ BFD_ASSERT (s->contents != NULL);
+ BFD_ASSERT (s->output_section != NULL);
+
+ if ((my_offset & 0x01) == 0x01)
+ {
+ if (sym_sec != NULL
+ && sym_sec->owner != NULL
+ && !INTERWORK_FLAG (sym_sec->owner))
+ {
+ _bfd_error_handler
+ (_ ("%s(%s): warning: interworking not enabled."),
+ bfd_get_filename (sym_sec->owner), name);
+ _bfd_error_handler
+ (_ (" first occurrence: %s: arm call to thumb"),
+ bfd_get_filename (input_bfd));
+ }
+ --my_offset;
+ myh->root.u.def.value = my_offset;
+
+ bfd_put_32 (output_bfd, a2t1_ldr_insn,
+ s->contents + my_offset);
+
+ bfd_put_32 (output_bfd, a2t2_bx_r12_insn,
+ s->contents + my_offset + 4);
+
+ /* It's a thumb address. Add the low order bit. */
+ bfd_put_32 (output_bfd, val | a2t3_func_addr_insn,
+ s->contents + my_offset + 8);
+ }
+
+ BFD_ASSERT (my_offset <= globals->arm_glue_size);
+
+ tmp = bfd_get_32 (input_bfd, hit_data);
+ tmp = tmp & 0xFF000000;
+
+ /* Somehow these are both 4 too far, so subtract 8. */
+ ret_offset = s->output_offset
+ + my_offset
+ + s->output_section->vma
+ - (input_section->output_offset
+ + input_section->output_section->vma
+ + offset + addend)
+ - 8;
+
+ tmp = tmp | ((ret_offset >> 2) & 0x00FFFFFF);
+
+ bfd_put_32 (output_bfd, tmp, hit_data
+ - input_section->vma);
+
+ return true;
+}
+
+/* Perform a relocation as part of a final link. */
+static bfd_reloc_status_type
+elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
+ input_section, contents, rel, value,
+ info, sym_sec, sym_name, sym_flags, h)
+ reloc_howto_type * howto;
+ bfd * input_bfd;
+ bfd * output_bfd;
+ asection * input_section;
+ bfd_byte * contents;
+ Elf_Internal_Rela * rel;
+ bfd_vma value;
+ struct bfd_link_info * info;
+ asection * sym_sec;
+ const char * sym_name;
+ unsigned char sym_flags;
+ struct elf_link_hash_entry * h;
+{
+ unsigned long r_type = howto->type;
+ unsigned long r_symndx;
+ bfd_byte * hit_data = contents + rel->r_offset;
+ bfd * dynobj = NULL;
+ Elf_Internal_Shdr * symtab_hdr;
+ struct elf_link_hash_entry ** sym_hashes;
+ bfd_vma * local_got_offsets;
+ asection * sgot = NULL;
+ asection * splt = NULL;
+ asection * sreloc = NULL;
+ bfd_vma addend;
+ bfd_signed_vma signed_addend;
+ struct elf32_arm_link_hash_table * globals;
+
+ globals = elf32_arm_hash_table (info);
+
+ dynobj = elf_hash_table (info)->dynobj;
+ if (dynobj)
+ {
+ sgot = bfd_get_section_by_name (dynobj, ".got");
+ splt = bfd_get_section_by_name (dynobj, ".plt");
+ }
+ symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (input_bfd);
+ local_got_offsets = elf_local_got_offsets (input_bfd);
+ r_symndx = ELF32_R_SYM (rel->r_info);
+
+#ifdef USE_REL
+ addend = bfd_get_32 (input_bfd, hit_data) & howto->src_mask;
+
+ if (addend & ((howto->src_mask + 1) >> 1))
+ {
+ signed_addend = -1;
+ signed_addend &= ~ howto->src_mask;
+ signed_addend |= addend;
+ }
+ else
+ signed_addend = addend;
+#else
+ addend = signed_addend = rel->r_addend;
+#endif
+
+ switch (r_type)
+ {
+ case R_ARM_NONE:
+ return bfd_reloc_ok;
+
+ case R_ARM_PC24:
+ case R_ARM_ABS32:
+ case R_ARM_REL32:
+ /* When generating a shared object, these relocations are copied
+ into the output file to be resolved at run time. */
+
+ if (info->shared
+ && (r_type != R_ARM_PC24
+ || (h != NULL
+ && h->dynindx != -1
+ && (! info->symbolic
+ || (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_REGULAR) == 0))))
+ {
+ Elf_Internal_Rel outrel;
+ boolean skip, relocate;
+
+ if (sreloc == NULL)
+ {
+ const char * name;
+
+ name = (bfd_elf_string_from_elf_section
+ (input_bfd,
+ elf_elfheader (input_bfd)->e_shstrndx,
+ elf_section_data (input_section)->rel_hdr.sh_name));
+ if (name == NULL)
+ return bfd_reloc_notsupported;
+
+ BFD_ASSERT (strncmp (name, ".rel", 4) == 0
+ && strcmp (bfd_get_section_name (input_bfd,
+ input_section),
+ name + 4) == 0);
+
+ sreloc = bfd_get_section_by_name (dynobj, name);
+ BFD_ASSERT (sreloc != NULL);
+ }
+
+ skip = false;
+
+ if (elf_section_data (input_section)->stab_info == NULL)
+ outrel.r_offset = rel->r_offset;
+ else
+ {
+ bfd_vma off;
+
+ off = (_bfd_stab_section_offset
+ (output_bfd, &elf_hash_table (info)->stab_info,
+ input_section,
+ & elf_section_data (input_section)->stab_info,
+ rel->r_offset));
+ if (off == (bfd_vma) -1)
+ skip = true;
+ outrel.r_offset = off;
+ }
+
+ outrel.r_offset += (input_section->output_section->vma
+ + input_section->output_offset);
+
+ if (skip)
+ {
+ memset (&outrel, 0, sizeof outrel);
+ relocate = false;
+ }
+ else if (r_type == R_ARM_PC24)
+ {
+ BFD_ASSERT (h != NULL && h->dynindx != -1);
+ if ((input_section->flags & SEC_ALLOC) != 0)
+ relocate = false;
+ else
+ relocate = true;
+ outrel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_PC24);
+ }
+ else
+ {
+ if (h == NULL
+ || ((info->symbolic || h->dynindx == -1)
+ && (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_REGULAR) != 0))
+ {
+ relocate = true;
+ outrel.r_info = ELF32_R_INFO (0, R_ARM_RELATIVE);
+ }
+ else
+ {
+ BFD_ASSERT (h->dynindx != -1);
+ if ((input_section->flags & SEC_ALLOC) != 0)
+ relocate = false;
+ else
+ relocate = true;
+ outrel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_ABS32);
+ }
+ }
+
+ bfd_elf32_swap_reloc_out (output_bfd, &outrel,
+ (((Elf32_External_Rel *)
+ sreloc->contents)
+ + sreloc->reloc_count));
+ ++sreloc->reloc_count;
+
+ /* If this reloc is against an external symbol, we do not want to
+ fiddle with the addend. Otherwise, we need to include the symbol
+ value so that it becomes an addend for the dynamic reloc. */
+ if (! relocate)
+ return bfd_reloc_ok;
+
+
+ return _bfd_final_link_relocate (howto, input_bfd, input_section,
+ contents, rel->r_offset, value,
+ (bfd_vma) 0);
+ }
+ else switch (r_type)
+ {
+ case R_ARM_PC24:
+ /* Arm B/BL instruction */
+
+ /* Check for arm calling thumb function. */
+ if (sym_flags == STT_ARM_TFUNC)
+ {
+ elf32_arm_to_thumb_stub (info, sym_name, input_bfd, output_bfd,
+ input_section, hit_data, sym_sec, rel->r_offset,
+ signed_addend, value);
+ return bfd_reloc_ok;
+ }
+
+ if ( strcmp (bfd_get_target (input_bfd), "elf32-littlearm-oabi") == 0
+ || strcmp (bfd_get_target (input_bfd), "elf32-bigarm-oabi") == 0)
+ {
+ /* The old way of doing things. Trearing the addend as a
+ byte sized field and adding in the pipeline offset. */
+
+ value -= (input_section->output_section->vma
+ + input_section->output_offset);
+ value -= rel->r_offset;
+ value += addend;
+
+ if (! globals->no_pipeline_knowledge)
+ value -= 8;
+ }
+ else
+ {
+ /* The ARM ELF ABI says that this reloc is computed as: S - P + A
+ where:
+ S is the address of the symbol in the relocation.
+ P is address of the instruction being relocated.
+ A is the addend (extracted from the instruction) in bytes.
+
+ S is held in 'value'.
+ P is the base address of the section containing the instruction
+ plus the offset of the reloc into that section, ie:
+ (input_section->output_section->vma +
+ input_section->output_offset +
+ rel->r_offset).
+ A is the addend, converted into bytes, ie:
+ (signed_addend * 4)
+
+ Note: None of these operations have knowledge of the pipeline
+ size of the processor, thus it is up to the assembler to encode
+ this information into the addend. */
+
+ value -= (input_section->output_section->vma
+ + input_section->output_offset);
+ value -= rel->r_offset;
+ value += (signed_addend << howto->size);
+
+ /* Previous versions of this code also used to add in the pipeline
+ offset here. This is wrong because the linker is not supposed
+ to know about such things, and one day it might change. In order
+ to support old binaries that need the old behaviour however, so
+ we attempt to detect which ABI was used to create the reloc. */
+ if (! globals->no_pipeline_knowledge)
+ {
+ Elf_Internal_Ehdr * i_ehdrp; /* Elf file header, internal form */
+
+ i_ehdrp = elf_elfheader (input_bfd);
+
+ if (i_ehdrp->e_ident[EI_OSABI] == 0)
+ value -= 8;
+ }
+ }
+
+ /* It is not an error for an undefined weak reference to be
+ out of range. Any program that branches to such a symbol
+ is going to crash anyway, so there is no point worrying
+ about getting the destination exactly right. */
+ if (! h || h->root.type != bfd_link_hash_undefweak)
+ {
+ /* Perform a signed range check. */
+ signed_addend = value;
+ signed_addend >>= howto->rightshift;
+ if (signed_addend > ((bfd_signed_vma)(howto->dst_mask >> 1))
+ || signed_addend < - ((bfd_signed_vma) ((howto->dst_mask + 1) >> 1)))
+ return bfd_reloc_overflow;
+ }
+
+ value = (signed_addend & howto->dst_mask)
+ | (bfd_get_32 (input_bfd, hit_data) & (~ howto->dst_mask));
+ break;
+
+ case R_ARM_ABS32:
+ value += addend;
+ if (sym_flags == STT_ARM_TFUNC)
+ value |= 1;
+ break;
+
+ case R_ARM_REL32:
+ value -= (input_section->output_section->vma
+ + input_section->output_offset);
+ value += addend;
+ break;
+ }
+
+ bfd_put_32 (input_bfd, value, hit_data);
+ return bfd_reloc_ok;
+
+ case R_ARM_ABS8:
+ value += addend;
+ if ((long) value > 0x7f || (long) value < -0x80)
+ return bfd_reloc_overflow;
+
+ bfd_put_8 (input_bfd, value, hit_data);
+ return bfd_reloc_ok;
+
+ case R_ARM_ABS16:
+ value += addend;
+
+ if ((long) value > 0x7fff || (long) value < -0x8000)
+ return bfd_reloc_overflow;
+
+ bfd_put_16 (input_bfd, value, hit_data);
+ return bfd_reloc_ok;
+
+ case R_ARM_ABS12:
+ /* Support ldr and str instruction for the arm */
+ /* Also thumb b (unconditional branch). ??? Really? */
+ value += addend;
+
+ if ((long) value > 0x7ff || (long) value < -0x800)
+ return bfd_reloc_overflow;
+
+ value |= (bfd_get_32 (input_bfd, hit_data) & 0xfffff000);
+ bfd_put_32 (input_bfd, value, hit_data);
+ return bfd_reloc_ok;
+
+ case R_ARM_THM_ABS5:
+ /* Support ldr and str instructions for the thumb. */
+#ifdef USE_REL
+ /* Need to refetch addend. */
+ addend = bfd_get_16 (input_bfd, hit_data) & howto->src_mask;
+ /* ??? Need to determine shift amount from operand size. */
+ addend >>= howto->rightshift;
+#endif
+ value += addend;
+
+ /* ??? Isn't value unsigned? */
+ if ((long) value > 0x1f || (long) value < -0x10)
+ return bfd_reloc_overflow;
+
+ /* ??? Value needs to be properly shifted into place first. */
+ value |= bfd_get_16 (input_bfd, hit_data) & 0xf83f;
+ bfd_put_16 (input_bfd, value, hit_data);
+ return bfd_reloc_ok;
+
+ case R_ARM_THM_PC22:
+ /* Thumb BL (branch long instruction). */
+ {
+ bfd_vma relocation;
+ boolean overflow = false;
+ bfd_vma upper_insn = bfd_get_16 (input_bfd, hit_data);
+ bfd_vma lower_insn = bfd_get_16 (input_bfd, hit_data + 2);
+ bfd_signed_vma reloc_signed_max = (1 << (howto->bitsize - 1)) - 1;
+ bfd_signed_vma reloc_signed_min = ~ reloc_signed_max;
+ bfd_vma check;
+ bfd_signed_vma signed_check;
+
+#ifdef USE_REL
+ /* Need to refetch the addend and squish the two 11 bit pieces
+ together. */
+ {
+ bfd_vma upper = upper_insn & 0x7ff;
+ bfd_vma lower = lower_insn & 0x7ff;
+ upper = (upper ^ 0x400) - 0x400; /* sign extend */
+ addend = (upper << 12) | (lower << 1);
+ signed_addend = addend;
+ }
+#endif
+
+ /* If it is not a call to thumb, assume call to arm.
+ If it is a call relative to a section name, then it is not a
+ function call at all, but rather a long jump. */
+ if (sym_flags != STT_ARM_TFUNC && sym_flags != STT_SECTION)
+ {
+ if (elf32_thumb_to_arm_stub
+ (info, sym_name, input_bfd, output_bfd, input_section,
+ hit_data, sym_sec, rel->r_offset, signed_addend, value))
+ return bfd_reloc_ok;
+ else
+ return bfd_reloc_dangerous;
+ }
+
+ relocation = value + signed_addend;
+
+ relocation -= (input_section->output_section->vma
+ + input_section->output_offset
+ + rel->r_offset);
+
+ if (! globals->no_pipeline_knowledge)
+ {
+ Elf_Internal_Ehdr * i_ehdrp; /* Elf file header, internal form */
+
+ i_ehdrp = elf_elfheader (input_bfd);
+
+ /* Previous versions of this code also used to add in the pipline
+ offset here. This is wrong because the linker is not supposed
+ to know about such things, and one day it might change. In order
+ to support old binaries that need the old behaviour however, so
+ we attempt to detect which ABI was used to create the reloc. */
+ if ( strcmp (bfd_get_target (input_bfd), "elf32-littlearm-oabi") == 0
+ || strcmp (bfd_get_target (input_bfd), "elf32-bigarm-oabi") == 0
+ || i_ehdrp->e_ident[EI_OSABI] == 0)
+ relocation += 4;
+ }
+
+ check = relocation >> howto->rightshift;
+
+ /* If this is a signed value, the rightshift just dropped
+ leading 1 bits (assuming twos complement). */
+ if ((bfd_signed_vma) relocation >= 0)
+ signed_check = check;
+ else
+ signed_check = check | ~((bfd_vma) -1 >> howto->rightshift);
+
+ /* Assumes two's complement. */
+ if (signed_check > reloc_signed_max || signed_check < reloc_signed_min)
+ overflow = true;
+
+ /* Put RELOCATION back into the insn. */
+ upper_insn = (upper_insn & ~(bfd_vma) 0x7ff) | ((relocation >> 12) & 0x7ff);
+ lower_insn = (lower_insn & ~(bfd_vma) 0x7ff) | ((relocation >> 1) & 0x7ff);
+
+ /* Put the relocated value back in the object file: */
+ bfd_put_16 (input_bfd, upper_insn, hit_data);
+ bfd_put_16 (input_bfd, lower_insn, hit_data + 2);
+
+ return (overflow ? bfd_reloc_overflow : bfd_reloc_ok);
+ }
+ break;
+
+ case R_ARM_GNU_VTINHERIT:
+ case R_ARM_GNU_VTENTRY:
+ return bfd_reloc_ok;
+
+ case R_ARM_COPY:
+ return bfd_reloc_notsupported;
+
+ case R_ARM_GLOB_DAT:
+ return bfd_reloc_notsupported;
+
+ case R_ARM_JUMP_SLOT:
+ return bfd_reloc_notsupported;
+
+ case R_ARM_RELATIVE:
+ return bfd_reloc_notsupported;
+
+ case R_ARM_GOTOFF:
+ /* Relocation is relative to the start of the
+ global offset table. */
+
+ BFD_ASSERT (sgot != NULL);
+ if (sgot == NULL)
+ return bfd_reloc_notsupported;
+
+ /* Note that sgot->output_offset is not involved in this
+ calculation. We always want the start of .got. If we
+ define _GLOBAL_OFFSET_TABLE in a different way, as is
+ permitted by the ABI, we might have to change this
+ calculation. */
+
+ value -= sgot->output_section->vma;
+ return _bfd_final_link_relocate (howto, input_bfd, input_section,
+ contents, rel->r_offset, value,
+ (bfd_vma) 0);
+
+ case R_ARM_GOTPC:
+ /* Use global offset table as symbol value. */
+
+ BFD_ASSERT (sgot != NULL);
+
+ if (sgot == NULL)
+ return bfd_reloc_notsupported;
+
+ value = sgot->output_section->vma;
+ return _bfd_final_link_relocate (howto, input_bfd, input_section,
+ contents, rel->r_offset, value,
+ (bfd_vma) 0);
+
+ case R_ARM_GOT32:
+ /* Relocation is to the entry for this symbol in the
+ global offset table. */
+ if (sgot == NULL)
+ return bfd_reloc_notsupported;
+
+ if (h != NULL)
+ {
+ bfd_vma off;
+
+ off = h->got.offset;
+ BFD_ASSERT (off != (bfd_vma) -1);
+
+ if (!elf_hash_table (info)->dynamic_sections_created ||
+ (info->shared && (info->symbolic || h->dynindx == -1)
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+ {
+ /* This is actually a static link, or it is a -Bsymbolic link
+ and the symbol is defined locally. We must initialize this
+ entry in the global offset table. Since the offset must
+ always be a multiple of 4, we use the least significant bit
+ to record whether we have initialized it already.
+
+ When doing a dynamic link, we create a .rel.got relocation
+ entry to initialize the value. This is done in the
+ finish_dynamic_symbol routine. */
+
+ if ((off & 1) != 0)
+ off &= ~1;
+ else
+ {
+ bfd_put_32 (output_bfd, value, sgot->contents + off);
+ h->got.offset |= 1;
+ }
+ }
+
+ value = sgot->output_offset + off;
+ }
+ else
+ {
+ bfd_vma off;
+
+ BFD_ASSERT (local_got_offsets != NULL &&
+ local_got_offsets[r_symndx] != (bfd_vma) -1);
+
+ off = local_got_offsets[r_symndx];
+
+ /* The offset must always be a multiple of 4. We use the
+ least significant bit to record whether we have already
+ generated the necessary reloc. */
+ if ((off & 1) != 0)
+ off &= ~1;
+ else
+ {
+ bfd_put_32 (output_bfd, value, sgot->contents + off);
+
+ if (info->shared)
+ {
+ asection * srelgot;
+ Elf_Internal_Rel outrel;
+
+ srelgot = bfd_get_section_by_name (dynobj, ".rel.got");
+ BFD_ASSERT (srelgot != NULL);
+
+ outrel.r_offset = (sgot->output_section->vma
+ + sgot->output_offset
+ + off);
+ outrel.r_info = ELF32_R_INFO (0, R_ARM_RELATIVE);
+ bfd_elf32_swap_reloc_out (output_bfd, &outrel,
+ (((Elf32_External_Rel *)
+ srelgot->contents)
+ + srelgot->reloc_count));
+ ++srelgot->reloc_count;
+ }
+
+ local_got_offsets[r_symndx] |= 1;
+ }
+
+ value = sgot->output_offset + off;
+ }
+
+ return _bfd_final_link_relocate (howto, input_bfd, input_section,
+ contents, rel->r_offset, value,
+ (bfd_vma) 0);
+
+ case R_ARM_PLT32:
+ /* Relocation is to the entry for this symbol in the
+ procedure linkage table. */
+
+ /* Resolve a PLT32 reloc against a local symbol directly,
+ without using the procedure linkage table. */
+ if (h == NULL)
+ return _bfd_final_link_relocate (howto, input_bfd, input_section,
+ contents, rel->r_offset, value,
+ (bfd_vma) 0);
+
+ if (h->plt.offset == (bfd_vma) -1)
+ /* We didn't make a PLT entry for this symbol. This
+ happens when statically linking PIC code, or when
+ using -Bsymbolic. */
+ return _bfd_final_link_relocate (howto, input_bfd, input_section,
+ contents, rel->r_offset, value,
+ (bfd_vma) 0);
+
+ BFD_ASSERT(splt != NULL);
+ if (splt == NULL)
+ return bfd_reloc_notsupported;
+
+ value = (splt->output_section->vma
+ + splt->output_offset
+ + h->plt.offset);
+ return _bfd_final_link_relocate (howto, input_bfd, input_section,
+ contents, rel->r_offset, value,
+ (bfd_vma) 0);
+
+ case R_ARM_SBREL32:
+ return bfd_reloc_notsupported;
+
+ case R_ARM_AMP_VCALL9:
+ return bfd_reloc_notsupported;
+
+ case R_ARM_RSBREL32:
+ return bfd_reloc_notsupported;
+
+ case R_ARM_THM_RPC22:
+ return bfd_reloc_notsupported;
+
+ case R_ARM_RREL32:
+ return bfd_reloc_notsupported;
+
+ case R_ARM_RABS32:
+ return bfd_reloc_notsupported;
+
+ case R_ARM_RPC24:
+ return bfd_reloc_notsupported;
+
+ case R_ARM_RBASE:
+ return bfd_reloc_notsupported;
+
+ default:
+ return bfd_reloc_notsupported;
+ }
+}
+
+#ifdef USE_REL
+/* Add INCREMENT to the reloc (of type HOWTO) at ADDRESS. */
+static void
+arm_add_to_rel (abfd, address, howto, increment)
+ bfd * abfd;
+ bfd_byte * address;
+ reloc_howto_type * howto;
+ bfd_signed_vma increment;
+{
+ bfd_vma contents;
+ bfd_signed_vma addend;
+
+ contents = bfd_get_32 (abfd, address);
+
+ /* Get the (signed) value from the instruction. */
+ addend = contents & howto->src_mask;
+ if (addend & ((howto->src_mask + 1) >> 1))
+ {
+ bfd_signed_vma mask;
+
+ mask = -1;
+ mask &= ~ howto->src_mask;
+ addend |= mask;
+ }
+
+ /* Add in the increment, (which is a byte value). */
+ switch (howto->type)
+ {
+ case R_ARM_THM_PC22:
+ default:
+ addend += increment;
+ break;
+
+ case R_ARM_PC24:
+ addend <<= howto->size;
+ addend += increment;
+
+ /* Should we check for overflow here ? */
+
+ /* Drop any undesired bits. */
+ addend >>= howto->rightshift;
+ break;
+ }
+
+ contents = (contents & ~ howto->dst_mask) | (addend & howto->dst_mask);
+
+ bfd_put_32 (abfd, contents, address);
+}
+#endif /* USE_REL */
+
+/* Relocate an ARM ELF section. */
+static boolean
+elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
+ contents, relocs, local_syms, local_sections)
+ bfd * output_bfd;
+ struct bfd_link_info * info;
+ bfd * input_bfd;
+ asection * input_section;
+ bfd_byte * contents;
+ Elf_Internal_Rela * relocs;
+ Elf_Internal_Sym * local_syms;
+ asection ** local_sections;
+{
+ Elf_Internal_Shdr * symtab_hdr;
+ struct elf_link_hash_entry ** sym_hashes;
+ Elf_Internal_Rela * rel;
+ Elf_Internal_Rela * relend;
+ const char * name;
+
+ symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (input_bfd);
+
+ rel = relocs;
+ relend = relocs + input_section->reloc_count;
+ for (; rel < relend; rel++)
+ {
+ int r_type;
+ reloc_howto_type * howto;
+ unsigned long r_symndx;
+ Elf_Internal_Sym * sym;
+ asection * sec;
+ struct elf_link_hash_entry * h;
+ bfd_vma relocation;
+ bfd_reloc_status_type r;
+ arelent bfd_reloc;
+
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ r_type = ELF32_R_TYPE (rel->r_info);
+
+ if ( r_type == R_ARM_GNU_VTENTRY
+ || r_type == R_ARM_GNU_VTINHERIT)
+ continue;
+
+ elf32_arm_info_to_howto (input_bfd, & bfd_reloc, rel);
+ howto = bfd_reloc.howto;
+
+ if (info->relocateable)
+ {
+ /* This is a relocateable link. We don't have to change
+ anything, unless the reloc is against a section symbol,
+ in which case we have to adjust according to where the
+ section symbol winds up in the output section. */
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ sym = local_syms + r_symndx;
+ if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+ {
+ sec = local_sections[r_symndx];
+#ifdef USE_REL
+ arm_add_to_rel (input_bfd, contents + rel->r_offset,
+ howto, sec->output_offset + sym->st_value);
+#else
+ rel->r_addend += (sec->output_offset + sym->st_value)
+ >> howto->rightshift;
+#endif
+ }
+ }
+
+ continue;
+ }
+
+ /* This is a final link. */
+ h = NULL;
+ sym = NULL;
+ sec = NULL;
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+ relocation = (sec->output_section->vma
+ + sec->output_offset
+ + sym->st_value);
+ }
+ else
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ if (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ {
+ int relocation_needed = 1;
+
+ sec = h->root.u.def.section;
+
+ /* In these cases, we don't need the relocation value.
+ We check specially because in some obscure cases
+ sec->output_section will be NULL. */
+ switch (r_type)
+ {
+ case R_ARM_PC24:
+ case R_ARM_ABS32:
+ if (info->shared
+ && (
+ (!info->symbolic && h->dynindx != -1)
+ || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
+ )
+ && ((input_section->flags & SEC_ALLOC) != 0)
+ )
+ relocation_needed = 0;
+ break;
+
+ case R_ARM_GOTPC:
+ relocation_needed = 0;
+ break;
+
+ case R_ARM_GOT32:
+ if (elf_hash_table(info)->dynamic_sections_created
+ && (!info->shared
+ || (!info->symbolic && h->dynindx != -1)
+ || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
+ )
+ )
+ relocation_needed = 0;
+ break;
+
+ case R_ARM_PLT32:
+ if (h->plt.offset != (bfd_vma)-1)
+ relocation_needed = 0;
+ break;
+
+ default:
+ if (sec->output_section == NULL)
+ {
+ (*_bfd_error_handler)
+ (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
+ bfd_get_filename (input_bfd), h->root.root.string,
+ bfd_get_section_name (input_bfd, input_section));
+ relocation_needed = 0;
+ }
+ }
+
+ if (relocation_needed)
+ relocation = h->root.u.def.value
+ + sec->output_section->vma
+ + sec->output_offset;
+ else
+ relocation = 0;
+ }
+ else if (h->root.type == bfd_link_hash_undefweak)
+ relocation = 0;
+ else if (info->shared && !info->symbolic && !info->no_undefined)
+ relocation = 0;
+ else
+ {
+ if (!((*info->callbacks->undefined_symbol)
+ (info, h->root.root.string, input_bfd,
+ input_section, rel->r_offset,
+ (!info->shared || info->no_undefined))))
+ return false;
+ relocation = 0;
+ }
+ }
+
+ if (h != NULL)
+ name = h->root.root.string;
+ else
+ {
+ name = (bfd_elf_string_from_elf_section
+ (input_bfd, symtab_hdr->sh_link, sym->st_name));
+ if (name == NULL || *name == '\0')
+ name = bfd_section_name (input_bfd, sec);
+ }
+
+ r = elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
+ input_section, contents, rel,
+ relocation, info, sec, name,
+ (h ? ELF_ST_TYPE (h->type) :
+ ELF_ST_TYPE (sym->st_info)), h);
+
+ if (r != bfd_reloc_ok)
+ {
+ const char * msg = (const char *) 0;
+
+ switch (r)
+ {
+ case bfd_reloc_overflow:
+ if (!((*info->callbacks->reloc_overflow)
+ (info, name, howto->name, (bfd_vma) 0,
+ input_bfd, input_section, rel->r_offset)))
+ return false;
+ break;
+
+ case bfd_reloc_undefined:
+ if (!((*info->callbacks->undefined_symbol)
+ (info, name, input_bfd, input_section,
+ rel->r_offset, true)))
+ return false;
+ break;
+
+ case bfd_reloc_outofrange:
+ msg = _ ("internal error: out of range error");
+ goto common_error;
+
+ case bfd_reloc_notsupported:
+ msg = _ ("internal error: unsupported relocation error");
+ goto common_error;
+
+ case bfd_reloc_dangerous:
+ msg = _ ("internal error: dangerous error");
+ goto common_error;
+
+ default:
+ msg = _ ("internal error: unknown error");
+ /* fall through */
+
+ common_error:
+ if (!((*info->callbacks->warning)
+ (info, msg, name, input_bfd, input_section,
+ rel->r_offset)))
+ return false;
+ break;
+ }
+ }
+ }
+
+ return true;
+}
+
+/* Function to keep ARM specific flags in the ELF header. */
+static boolean
+elf32_arm_set_private_flags (abfd, flags)
+ bfd *abfd;
+ flagword flags;
+{
+ if (elf_flags_init (abfd)
+ && elf_elfheader (abfd)->e_flags != flags)
+ {
+ if (flags & EF_INTERWORK)
+ _bfd_error_handler (_ ("\
+Warning: Not setting interwork flag of %s since it has already been specified as non-interworking"),
+ bfd_get_filename (abfd));
+ else
+ _bfd_error_handler (_ ("\
+Warning: Clearing the interwork flag of %s due to outside request"),
+ bfd_get_filename (abfd));
+ }
+ else
+ {
+ elf_elfheader (abfd)->e_flags = flags;
+ elf_flags_init (abfd) = true;
+ }
+
+ return true;
+}
+
+/* Copy backend specific data from one object module to another */
+static boolean
+elf32_arm_copy_private_bfd_data (ibfd, obfd)
+ bfd *ibfd;
+ bfd *obfd;
+{
+ flagword in_flags;
+ flagword out_flags;
+
+ if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+ || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+ return true;
+
+ in_flags = elf_elfheader (ibfd)->e_flags;
+ out_flags = elf_elfheader (obfd)->e_flags;
+
+ if (elf_flags_init (obfd) && in_flags != out_flags)
+ {
+ /* Cannot mix PIC and non-PIC code. */
+ if ((in_flags & EF_PIC) != (out_flags & EF_PIC))
+ return false;
+
+ /* Cannot mix APCS26 and APCS32 code. */
+ if ((in_flags & EF_APCS_26) != (out_flags & EF_APCS_26))
+ return false;
+
+ /* Cannot mix float APCS and non-float APCS code. */
+ if ((in_flags & EF_APCS_FLOAT) != (out_flags & EF_APCS_FLOAT))
+ return false;
+
+ /* If the src and dest have different interworking flags
+ then turn off the interworking bit. */
+ if ((in_flags & EF_INTERWORK) != (out_flags & EF_INTERWORK))
+ {
+ if (out_flags & EF_INTERWORK)
+ _bfd_error_handler (_ ("\
+Warning: Clearing the interwork flag in %s because non-interworking code in %s has been linked with it"),
+ bfd_get_filename (obfd), bfd_get_filename (ibfd));
+
+ in_flags &= ~EF_INTERWORK;
+ }
+ }
+
+ elf_elfheader (obfd)->e_flags = in_flags;
+ elf_flags_init (obfd) = true;
+
+ return true;
+}
+
+/* Merge backend specific data from an object file to the output
+ object file when linking. */
+static boolean
+elf32_arm_merge_private_bfd_data (ibfd, obfd)
+ bfd *ibfd;
+ bfd *obfd;
+{
+ flagword out_flags;
+ flagword in_flags;
+
+ if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+ || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+ return true;
+
+ /* Check if we have the same endianess */
+ if ( ibfd->xvec->byteorder != obfd->xvec->byteorder
+ && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN
+ && ibfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
+ {
+ (*_bfd_error_handler)
+ (_("%s: compiled for a %s endian system and target is %s endian"),
+ bfd_get_filename (ibfd),
+ bfd_big_endian (ibfd) ? "big" : "little",
+ bfd_big_endian (obfd) ? "big" : "little");
+
+ bfd_set_error (bfd_error_wrong_format);
+ return false;
+ }
+
+ /* The input BFD must have had its flags initialised. */
+ /* The following seems bogus to me -- The flags are initialized in
+ the assembler but I don't think an elf_flags_init field is
+ written into the object */
+ /* BFD_ASSERT (elf_flags_init (ibfd)); */
+
+ in_flags = elf_elfheader (ibfd)->e_flags;
+ out_flags = elf_elfheader (obfd)->e_flags;
+
+ if (!elf_flags_init (obfd))
+ {
+ /* If the input is the default architecture then do not
+ bother setting the flags for the output architecture,
+ instead allow future merges to do this. If no future
+ merges ever set these flags then they will retain their
+ unitialised values, which surprise surprise, correspond
+ to the default values. */
+ if (bfd_get_arch_info (ibfd)->the_default)
+ return true;
+
+ elf_flags_init (obfd) = true;
+ elf_elfheader (obfd)->e_flags = in_flags;
+
+ if (bfd_get_arch (obfd) == bfd_get_arch (ibfd)
+ && bfd_get_arch_info (obfd)->the_default)
+ return bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), bfd_get_mach (ibfd));
+
+ return true;
+ }
+
+ /* Check flag compatibility. */
+ if (in_flags == out_flags)
+ return true;
+
+ /* Complain about various flag mismatches. */
+
+ if ((in_flags & EF_APCS_26) != (out_flags & EF_APCS_26))
+ _bfd_error_handler (_ ("\
+Error: %s compiled for APCS-%d, whereas %s is compiled for APCS-%d"),
+ bfd_get_filename (ibfd),
+ in_flags & EF_APCS_26 ? 26 : 32,
+ bfd_get_filename (obfd),
+ out_flags & EF_APCS_26 ? 26 : 32);
+
+ if ((in_flags & EF_APCS_FLOAT) != (out_flags & EF_APCS_FLOAT))
+ _bfd_error_handler (_ ("\
+Error: %s passes floats in %s registers, whereas %s passes them in %s registers"),
+ bfd_get_filename (ibfd),
+ in_flags & EF_APCS_FLOAT ? _ ("float") : _ ("integer"),
+ bfd_get_filename (obfd),
+ out_flags & EF_APCS_26 ? _ ("float") : _ ("integer"));
+
+ if ((in_flags & EF_PIC) != (out_flags & EF_PIC))
+ _bfd_error_handler (_ ("\
+Error: %s is compiled as position %s code, whereas %s is not"),
+ bfd_get_filename (ibfd),
+ in_flags & EF_PIC ? _ ("independent") : _ ("dependent"),
+ bfd_get_filename (obfd));
+
+ /* Interworking mismatch is only a warning. */
+ if ((in_flags & EF_INTERWORK) != (out_flags & EF_INTERWORK))
+ {
+ _bfd_error_handler (_ ("\
+Warning: %s %s interworking, whereas %s %s"),
+ bfd_get_filename (ibfd),
+ in_flags & EF_INTERWORK ? _ ("supports") : _ ("does not support"),
+ bfd_get_filename (obfd),
+ out_flags & EF_INTERWORK ? _ ("does not") : _ ("does"));
+ return true;
+ }
+
+ return false;
+}
+
+/* Display the flags field */
+static boolean
+elf32_arm_print_private_bfd_data (abfd, ptr)
+ bfd *abfd;
+ PTR ptr;
+{
+ FILE *file = (FILE *) ptr;
+
+ BFD_ASSERT (abfd != NULL && ptr != NULL);
+
+ /* Print normal ELF private data. */
+ _bfd_elf_print_private_bfd_data (abfd, ptr);
+
+ /* Ignore init flag - it may not be set, despite the flags field containing valid data. */
+
+ /* xgettext:c-format */
+ fprintf (file, _ ("private flags = %lx:"), elf_elfheader (abfd)->e_flags);
+
+ if (elf_elfheader (abfd)->e_flags & EF_INTERWORK)
+ fprintf (file, _ (" [interworking enabled]"));
+ else
+ fprintf (file, _ (" [interworking not enabled]"));
+
+ if (elf_elfheader (abfd)->e_flags & EF_APCS_26)
+ fprintf (file, _ (" [APCS-26]"));
+ else
+ fprintf (file, _ (" [APCS-32]"));
+
+ if (elf_elfheader (abfd)->e_flags & EF_APCS_FLOAT)
+ fprintf (file, _ (" [floats passed in float registers]"));
+ else
+ fprintf (file, _ (" [floats passed in integer registers]"));
+
+ if (elf_elfheader (abfd)->e_flags & EF_PIC)
+ fprintf (file, _ (" [position independent]"));
+ else
+ fprintf (file, _ (" [absolute position]"));
+
+ fputc ('\n', file);
+
+ return true;
+}
+
+static int
+elf32_arm_get_symbol_type (elf_sym, type)
+ Elf_Internal_Sym * elf_sym;
+ int type;
+{
+ switch (ELF_ST_TYPE (elf_sym->st_info))
+ {
+ case STT_ARM_TFUNC:
+ return ELF_ST_TYPE (elf_sym->st_info);
+ break;
+ case STT_ARM_16BIT:
+ /* If the symbol is not an object, return the STT_ARM_16BIT flag.
+ This allows us to distinguish between data used by Thumb instructions
+ and non-data (which is probably code) inside Thumb regions of an
+ executable. */
+ if (type != STT_OBJECT)
+ return ELF_ST_TYPE (elf_sym->st_info);
+ break;
+ }
+
+ return type;
+}
+
+static asection *
+elf32_arm_gc_mark_hook (abfd, info, rel, h, sym)
+ bfd *abfd;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ Elf_Internal_Rela *rel;
+ struct elf_link_hash_entry *h;
+ Elf_Internal_Sym *sym;
+{
+ if (h != NULL)
+ {
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ case R_ARM_GNU_VTINHERIT:
+ case R_ARM_GNU_VTENTRY:
+ break;
+
+ default:
+ switch (h->root.type)
+ {
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ return h->root.u.def.section;
+
+ case bfd_link_hash_common:
+ return h->root.u.c.p->section;
+
+ default:
+ break;
+ }
+ }
+ }
+ else
+ {
+ if (!(elf_bad_symtab (abfd)
+ && ELF_ST_BIND (sym->st_info) != STB_LOCAL)
+ && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE)
+ && sym->st_shndx != SHN_COMMON))
+ {
+ return bfd_section_from_elf_index (abfd, sym->st_shndx);
+ }
+ }
+ return NULL;
+}
+
+/* Update the got entry reference counts for the section being removed. */
+
+static boolean
+elf32_arm_gc_sweep_hook (abfd, info, sec, relocs)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ asection *sec ATTRIBUTE_UNUSED;
+ const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED;
+{
+ /* We don't support garbage collection of GOT and PLT relocs yet. */
+ return true;
+}
+
+/* Look through the relocs for a section during the first phase. */
+
+static boolean
+elf32_arm_check_relocs (abfd, info, sec, relocs)
+ bfd * abfd;
+ struct bfd_link_info * info;
+ asection * sec;
+ const Elf_Internal_Rela * relocs;
+{
+ Elf_Internal_Shdr * symtab_hdr;
+ struct elf_link_hash_entry ** sym_hashes;
+ struct elf_link_hash_entry ** sym_hashes_end;
+ const Elf_Internal_Rela * rel;
+ const Elf_Internal_Rela * rel_end;
+ bfd * dynobj;
+ asection * sgot, *srelgot, *sreloc;
+ bfd_vma * local_got_offsets;
+
+ if (info->relocateable)
+ return true;
+
+ sgot = srelgot = sreloc = NULL;
+
+ dynobj = elf_hash_table (info)->dynobj;
+ local_got_offsets = elf_local_got_offsets (abfd);
+
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (abfd);
+ sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof(Elf32_External_Sym);
+ if (!elf_bad_symtab (abfd))
+ sym_hashes_end -= symtab_hdr->sh_info;
+
+ rel_end = relocs + sec->reloc_count;
+ for (rel = relocs; rel < rel_end; rel++)
+ {
+ struct elf_link_hash_entry *h;
+ unsigned long r_symndx;
+
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ if (r_symndx < symtab_hdr->sh_info)
+ h = NULL;
+ else
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+
+ /* Some relocs require a global offset table. */
+ if (dynobj == NULL)
+ {
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ case R_ARM_GOT32:
+ case R_ARM_GOTOFF:
+ case R_ARM_GOTPC:
+ elf_hash_table (info)->dynobj = dynobj = abfd;
+ if (! _bfd_elf_create_got_section (dynobj, info))
+ return false;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ case R_ARM_GOT32:
+ /* This symbol requires a global offset table entry. */
+ if (sgot == NULL)
+ {
+ sgot = bfd_get_section_by_name (dynobj, ".got");
+ BFD_ASSERT (sgot != NULL);
+ }
+
+ /* Get the got relocation section if necessary. */
+ if (srelgot == NULL
+ && (h != NULL || info->shared))
+ {
+ srelgot = bfd_get_section_by_name (dynobj, ".rel.got");
+
+ /* If no got relocation section, make one and initialize. */
+ if (srelgot == NULL)
+ {
+ srelgot = bfd_make_section (dynobj, ".rel.got");
+ if (srelgot == NULL
+ || ! bfd_set_section_flags (dynobj, srelgot,
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED
+ | SEC_READONLY))
+ || ! bfd_set_section_alignment (dynobj, srelgot, 2))
+ return false;
+ }
+ }
+
+ if (h != NULL)
+ {
+ if (h->got.offset != (bfd_vma) -1)
+ /* We have already allocated space in the .got. */
+ break;
+
+ h->got.offset = sgot->_raw_size;
+
+ /* Make sure this symbol is output as a dynamic symbol. */
+ if (h->dynindx == -1)
+ if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+ return false;
+
+ srelgot->_raw_size += sizeof (Elf32_External_Rel);
+ }
+ else
+ {
+ /* This is a global offset table entry for a local
+ symbol. */
+ if (local_got_offsets == NULL)
+ {
+ size_t size;
+ register unsigned int i;
+
+ size = symtab_hdr->sh_info * sizeof (bfd_vma);
+ local_got_offsets = (bfd_vma *) bfd_alloc (abfd, size);
+ if (local_got_offsets == NULL)
+ return false;
+ elf_local_got_offsets (abfd) = local_got_offsets;
+ for (i = 0; i < symtab_hdr->sh_info; i++)
+ local_got_offsets[i] = (bfd_vma) -1;
+ }
+
+ if (local_got_offsets[r_symndx] != (bfd_vma) -1)
+ /* We have already allocated space in the .got. */
+ break;
+
+ local_got_offsets[r_symndx] = sgot->_raw_size;
+
+ if (info->shared)
+ /* If we are generating a shared object, we need to
+ output a R_ARM_RELATIVE reloc so that the dynamic
+ linker can adjust this GOT entry. */
+ srelgot->_raw_size += sizeof (Elf32_External_Rel);
+ }
+
+ sgot->_raw_size += 4;
+ break;
+
+ case R_ARM_PLT32:
+ /* This symbol requires a procedure linkage table entry. We
+ actually build the entry in adjust_dynamic_symbol,
+ because this might be a case of linking PIC code which is
+ never referenced by a dynamic object, in which case we
+ don't need to generate a procedure linkage table entry
+ after all. */
+
+ /* If this is a local symbol, we resolve it directly without
+ creating a procedure linkage table entry. */
+ if (h == NULL)
+ continue;
+
+ h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
+ break;
+
+ case R_ARM_ABS32:
+ case R_ARM_REL32:
+ case R_ARM_PC24:
+ /* If we are creating a shared library, and this is a reloc
+ against a global symbol, or a non PC relative reloc
+ against a local symbol, then we need to copy the reloc
+ into the shared library. However, if we are linking with
+ -Bsymbolic, we do not need to copy a reloc against a
+ global symbol which is defined in an object we are
+ including in the link (i.e., DEF_REGULAR is set). At
+ this point we have not seen all the input files, so it is
+ possible that DEF_REGULAR is not set now but will be set
+ later (it is never cleared). We account for that
+ possibility below by storing information in the
+ pcrel_relocs_copied field of the hash table entry. */
+ if (info->shared
+ && (ELF32_R_TYPE (rel->r_info) != R_ARM_PC24
+ || (h != NULL
+ && (! info->symbolic
+ || (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_REGULAR) == 0))))
+ {
+ /* When creating a shared object, we must copy these
+ reloc types into the output file. We create a reloc
+ section in dynobj and make room for this reloc. */
+ if (sreloc == NULL)
+ {
+ const char * name;
+
+ name = (bfd_elf_string_from_elf_section
+ (abfd,
+ elf_elfheader (abfd)->e_shstrndx,
+ elf_section_data (sec)->rel_hdr.sh_name));
+ if (name == NULL)
+ return false;
+
+ BFD_ASSERT (strncmp (name, ".rel", 4) == 0
+ && strcmp (bfd_get_section_name (abfd, sec),
+ name + 4) == 0);
+
+ sreloc = bfd_get_section_by_name (dynobj, name);
+ if (sreloc == NULL)
+ {
+ flagword flags;
+
+ sreloc = bfd_make_section (dynobj, name);
+ flags = (SEC_HAS_CONTENTS | SEC_READONLY
+ | SEC_IN_MEMORY | SEC_LINKER_CREATED);
+ if ((sec->flags & SEC_ALLOC) != 0)
+ flags |= SEC_ALLOC | SEC_LOAD;
+ if (sreloc == NULL
+ || ! bfd_set_section_flags (dynobj, sreloc, flags)
+ || ! bfd_set_section_alignment (dynobj, sreloc, 2))
+ return false;
+ }
+ }
+
+ sreloc->_raw_size += sizeof (Elf32_External_Rel);
+ /* If we are linking with -Bsymbolic, and this is a
+ global symbol, we count the number of PC relative
+ relocations we have entered for this symbol, so that
+ we can discard them again if the symbol is later
+ defined by a regular object. Note that this function
+ is only called if we are using an elf_i386 linker
+ hash table, which means that h is really a pointer to
+ an elf_i386_link_hash_entry. */
+ if (h != NULL && info->symbolic
+ && ELF32_R_TYPE (rel->r_info) == R_ARM_PC24)
+ {
+ struct elf32_arm_link_hash_entry * eh;
+ struct elf32_arm_pcrel_relocs_copied * p;
+
+ eh = (struct elf32_arm_link_hash_entry *) h;
+
+ for (p = eh->pcrel_relocs_copied; p != NULL; p = p->next)
+ if (p->section == sreloc)
+ break;
+
+ if (p == NULL)
+ {
+ p = ((struct elf32_arm_pcrel_relocs_copied *)
+ bfd_alloc (dynobj, sizeof * p));
+
+ if (p == NULL)
+ return false;
+ p->next = eh->pcrel_relocs_copied;
+ eh->pcrel_relocs_copied = p;
+ p->section = sreloc;
+ p->count = 0;
+ }
+
+ ++p->count;
+ }
+ }
+ break;
+
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_ARM_GNU_VTINHERIT:
+ if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return false;
+ break;
+
+ /* This relocation describes which C++ vtable entries are actually
+ used. Record for later use during GC. */
+ case R_ARM_GNU_VTENTRY:
+ if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_offset))
+ return false;
+ break;
+ }
+ }
+
+ return true;
+}
+
+
+/* Find the nearest line to a particular section and offset, for error
+ reporting. This code is a duplicate of the code in elf.c, except
+ that it also accepts STT_ARM_TFUNC as a symbol that names a function. */
+
+static boolean
+elf32_arm_find_nearest_line
+ (abfd, section, symbols, offset, filename_ptr, functionname_ptr, line_ptr)
+ bfd * abfd;
+ asection * section;
+ asymbol ** symbols;
+ bfd_vma offset;
+ CONST char ** filename_ptr;
+ CONST char ** functionname_ptr;
+ unsigned int * line_ptr;
+{
+ boolean found;
+ const char * filename;
+ asymbol * func;
+ bfd_vma low_func;
+ asymbol ** p;
+
+ if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
+ filename_ptr, functionname_ptr,
+ line_ptr, 0))
+ return true;
+
+ if (! _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset,
+ &found, filename_ptr,
+ functionname_ptr, line_ptr,
+ &elf_tdata (abfd)->line_info))
+ return false;
+
+ if (found)
+ return true;
+
+ if (symbols == NULL)
+ return false;
+
+ filename = NULL;
+ func = NULL;
+ low_func = 0;
+
+ for (p = symbols; *p != NULL; p++)
+ {
+ elf_symbol_type *q;
+
+ q = (elf_symbol_type *) *p;
+
+ if (bfd_get_section (&q->symbol) != section)
+ continue;
+
+ switch (ELF_ST_TYPE (q->internal_elf_sym.st_info))
+ {
+ default:
+ break;
+ case STT_FILE:
+ filename = bfd_asymbol_name (&q->symbol);
+ break;
+ case STT_NOTYPE:
+ case STT_FUNC:
+ case STT_ARM_TFUNC:
+ if (q->symbol.section == section
+ && q->symbol.value >= low_func
+ && q->symbol.value <= offset)
+ {
+ func = (asymbol *) q;
+ low_func = q->symbol.value;
+ }
+ break;
+ }
+ }
+
+ if (func == NULL)
+ return false;
+
+ *filename_ptr = filename;
+ *functionname_ptr = bfd_asymbol_name (func);
+ *line_ptr = 0;
+
+ return true;
+}
+
+/* Adjust a symbol defined by a dynamic object and referenced by a
+ regular object. The current definition is in some section of the
+ dynamic object, but we're not including those sections. We have to
+ change the definition to something the rest of the link can
+ understand. */
+
+static boolean
+elf32_arm_adjust_dynamic_symbol (info, h)
+ struct bfd_link_info * info;
+ struct elf_link_hash_entry * h;
+{
+ bfd * dynobj;
+ asection * s;
+ unsigned int power_of_two;
+
+ dynobj = elf_hash_table (info)->dynobj;
+
+ /* Make sure we know what is going on here. */
+ BFD_ASSERT (dynobj != NULL
+ && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
+ || h->weakdef != NULL
+ || ((h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ && (h->elf_link_hash_flags
+ & ELF_LINK_HASH_REF_REGULAR) != 0
+ && (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_REGULAR) == 0)));
+
+ /* If this is a function, put it in the procedure linkage table. We
+ will fill in the contents of the procedure linkage table later,
+ when we know the address of the .got section. */
+ if (h->type == STT_FUNC
+ || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
+ {
+ if (! info->shared
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0)
+ {
+ /* This case can occur if we saw a PLT32 reloc in an input
+ file, but the symbol was never referred to by a dynamic
+ object. In such a case, we don't actually need to build
+ a procedure linkage table, and we can just do a PC32
+ reloc instead. */
+ BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0);
+ return true;
+ }
+
+ /* Make sure this symbol is output as a dynamic symbol. */
+ if (h->dynindx == -1)
+ {
+ if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+ return false;
+ }
+
+ s = bfd_get_section_by_name (dynobj, ".plt");
+ BFD_ASSERT (s != NULL);
+
+ /* If this is the first .plt entry, make room for the special
+ first entry. */
+ if (s->_raw_size == 0)
+ s->_raw_size += PLT_ENTRY_SIZE;
+
+ /* If this symbol is not defined in a regular file, and we are
+ not generating a shared library, then set the symbol to this
+ location in the .plt. This is required to make function
+ pointers compare as equal between the normal executable and
+ the shared library. */
+ if (! info->shared
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ {
+ h->root.u.def.section = s;
+ h->root.u.def.value = s->_raw_size;
+ }
+
+ h->plt.offset = s->_raw_size;
+
+ /* Make room for this entry. */
+ s->_raw_size += PLT_ENTRY_SIZE;
+
+ /* We also need to make an entry in the .got.plt section, which
+ will be placed in the .got section by the linker script. */
+
+ s = bfd_get_section_by_name (dynobj, ".got.plt");
+ BFD_ASSERT (s != NULL);
+ s->_raw_size += 4;
+
+ /* We also need to make an entry in the .rel.plt section. */
+
+ s = bfd_get_section_by_name (dynobj, ".rel.plt");
+ BFD_ASSERT (s != NULL);
+ s->_raw_size += sizeof (Elf32_External_Rel);
+
+ return true;
+ }
+
+ /* If this is a weak symbol, and there is a real definition, the
+ processor independent code will have arranged for us to see the
+ real definition first, and we can just use the same value. */
+ if (h->weakdef != NULL)
+ {
+ BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+ || h->weakdef->root.type == bfd_link_hash_defweak);
+ h->root.u.def.section = h->weakdef->root.u.def.section;
+ h->root.u.def.value = h->weakdef->root.u.def.value;
+ return true;
+ }
+
+ /* This is a reference to a symbol defined by a dynamic object which
+ is not a function. */
+
+ /* If we are creating a shared library, we must presume that the
+ only references to the symbol are via the global offset table.
+ For such cases we need not do anything here; the relocations will
+ be handled correctly by relocate_section. */
+ if (info->shared)
+ return true;
+
+ /* We must allocate the symbol in our .dynbss section, which will
+ become part of the .bss section of the executable. There will be
+ an entry for this symbol in the .dynsym section. The dynamic
+ object will contain position independent code, so all references
+ from the dynamic object to this symbol will go through the global
+ offset table. The dynamic linker will use the .dynsym entry to
+ determine the address it must put in the global offset table, so
+ both the dynamic object and the regular object will refer to the
+ same memory location for the variable. */
+
+ s = bfd_get_section_by_name (dynobj, ".dynbss");
+ BFD_ASSERT (s != NULL);
+
+ /* We must generate a R_ARM_COPY reloc to tell the dynamic linker to
+ copy the initial value out of the dynamic object and into the
+ runtime process image. We need to remember the offset into the
+ .rel.bss section we are going to use. */
+ if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
+ {
+ asection *srel;
+
+ srel = bfd_get_section_by_name (dynobj, ".rel.bss");
+ BFD_ASSERT (srel != NULL);
+ srel->_raw_size += sizeof (Elf32_External_Rel);
+ h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
+ }
+
+ /* We need to figure out the alignment required for this symbol. I
+ have no idea how ELF linkers handle this. */
+ power_of_two = bfd_log2 (h->size);
+ if (power_of_two > 3)
+ power_of_two = 3;
+
+ /* Apply the required alignment. */
+ s->_raw_size = BFD_ALIGN (s->_raw_size,
+ (bfd_size_type) (1 << power_of_two));
+ if (power_of_two > bfd_get_section_alignment (dynobj, s))
+ {
+ if (! bfd_set_section_alignment (dynobj, s, power_of_two))
+ return false;
+ }
+
+ /* Define the symbol as being at this point in the section. */
+ h->root.u.def.section = s;
+ h->root.u.def.value = s->_raw_size;
+
+ /* Increment the section size to make room for the symbol. */
+ s->_raw_size += h->size;
+
+ return true;
+}
+
+/* Set the sizes of the dynamic sections. */
+
+static boolean
+elf32_arm_size_dynamic_sections (output_bfd, info)
+ bfd * output_bfd;
+ struct bfd_link_info * info;
+{
+ bfd * dynobj;
+ asection * s;
+ boolean plt;
+ boolean relocs;
+ boolean reltext;
+
+ dynobj = elf_hash_table (info)->dynobj;
+ BFD_ASSERT (dynobj != NULL);
+
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ /* Set the contents of the .interp section to the interpreter. */
+ if (! info->shared)
+ {
+ s = bfd_get_section_by_name (dynobj, ".interp");
+ BFD_ASSERT (s != NULL);
+ s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+ s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
+ }
+ }
+ else
+ {
+ /* We may have created entries in the .rel.got section.
+ However, if we are not creating the dynamic sections, we will
+ not actually use these entries. Reset the size of .rel.got,
+ which will cause it to get stripped from the output file
+ below. */
+ s = bfd_get_section_by_name (dynobj, ".rel.got");
+ if (s != NULL)
+ s->_raw_size = 0;
+ }
+
+ /* If this is a -Bsymbolic shared link, then we need to discard all
+ PC relative relocs against symbols defined in a regular object.
+ We allocated space for them in the check_relocs routine, but we
+ will not fill them in in the relocate_section routine. */
+ if (info->shared && info->symbolic)
+ elf32_arm_link_hash_traverse (elf32_arm_hash_table (info),
+ elf32_arm_discard_copies,
+ (PTR) NULL);
+
+ /* The check_relocs and adjust_dynamic_symbol entry points have
+ determined the sizes of the various dynamic sections. Allocate
+ memory for them. */
+ plt = false;
+ relocs = false;
+ reltext = false;
+ for (s = dynobj->sections; s != NULL; s = s->next)
+ {
+ const char * name;
+ boolean strip;
+
+ if ((s->flags & SEC_LINKER_CREATED) == 0)
+ continue;
+
+ /* It's OK to base decisions on the section name, because none
+ of the dynobj section names depend upon the input files. */
+ name = bfd_get_section_name (dynobj, s);
+
+ strip = false;
+
+ if (strcmp (name, ".plt") == 0)
+ {
+ if (s->_raw_size == 0)
+ {
+ /* Strip this section if we don't need it; see the
+ comment below. */
+ strip = true;
+ }
+ else
+ {
+ /* Remember whether there is a PLT. */
+ plt = true;
+ }
+ }
+ else if (strncmp (name, ".rel", 4) == 0)
+ {
+ if (s->_raw_size == 0)
+ {
+ /* If we don't need this section, strip it from the
+ output file. This is mostly to handle .rel.bss and
+ .rel.plt. We must create both sections in
+ create_dynamic_sections, because they must be created
+ before the linker maps input sections to output
+ sections. The linker does that before
+ adjust_dynamic_symbol is called, and it is that
+ function which decides whether anything needs to go
+ into these sections. */
+ strip = true;
+ }
+ else
+ {
+ asection * target;
+
+ /* Remember whether there are any reloc sections other
+ than .rel.plt. */
+ if (strcmp (name, ".rel.plt") != 0)
+ {
+ const char *outname;
+
+ relocs = true;
+
+ /* If this relocation section applies to a read only
+ section, then we probably need a DT_TEXTREL
+ entry. The entries in the .rel.plt section
+ really apply to the .got section, which we
+ created ourselves and so know is not readonly. */
+ outname = bfd_get_section_name (output_bfd,
+ s->output_section);
+ target = bfd_get_section_by_name (output_bfd, outname + 4);
+
+ if (target != NULL
+ && (target->flags & SEC_READONLY) != 0
+ && (target->flags & SEC_ALLOC) != 0)
+ reltext = true;
+ }
+
+ /* We use the reloc_count field as a counter if we need
+ to copy relocs into the output file. */
+ s->reloc_count = 0;
+ }
+ }
+ else if (strncmp (name, ".got", 4) != 0)
+ {
+ /* It's not one of our sections, so don't allocate space. */
+ continue;
+ }
+
+ if (strip)
+ {
+ asection ** spp;
+
+ for (spp = &s->output_section->owner->sections;
+ *spp != s->output_section;
+ spp = &(*spp)->next)
+ ;
+ *spp = s->output_section->next;
+ --s->output_section->owner->section_count;
+
+ continue;
+ }
+
+ /* Allocate memory for the section contents. */
+ s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
+ if (s->contents == NULL && s->_raw_size != 0)
+ return false;
+ }
+
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ /* Add some entries to the .dynamic section. We fill in the
+ values later, in elf32_arm_finish_dynamic_sections, but we
+ must add the entries now so that we get the correct size for
+ the .dynamic section. The DT_DEBUG entry is filled in by the
+ dynamic linker and used by the debugger. */
+ if (! info->shared)
+ {
+ if (! bfd_elf32_add_dynamic_entry (info, DT_DEBUG, 0))
+ return false;
+ }
+
+ if (plt)
+ {
+ if (! bfd_elf32_add_dynamic_entry (info, DT_PLTGOT, 0)
+ || ! bfd_elf32_add_dynamic_entry (info, DT_PLTRELSZ, 0)
+ || ! bfd_elf32_add_dynamic_entry (info, DT_PLTREL, DT_REL)
+ || ! bfd_elf32_add_dynamic_entry (info, DT_JMPREL, 0))
+ return false;
+ }
+
+ if (relocs)
+ {
+ if (! bfd_elf32_add_dynamic_entry (info, DT_REL, 0)
+ || ! bfd_elf32_add_dynamic_entry (info, DT_RELSZ, 0)
+ || ! bfd_elf32_add_dynamic_entry (info, DT_RELENT,
+ sizeof (Elf32_External_Rel)))
+ return false;
+ }
+
+ if (reltext)
+ {
+ if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0))
+ return false;
+ }
+ }
+
+ return true;
+}
+
+/* This function is called via elf32_arm_link_hash_traverse if we are
+ creating a shared object with -Bsymbolic. It discards the space
+ allocated to copy PC relative relocs against symbols which are
+ defined in regular objects. We allocated space for them in the
+ check_relocs routine, but we won't fill them in in the
+ relocate_section routine. */
+
+static boolean
+elf32_arm_discard_copies (h, ignore)
+ struct elf32_arm_link_hash_entry * h;
+ PTR ignore ATTRIBUTE_UNUSED;
+{
+ struct elf32_arm_pcrel_relocs_copied * s;
+
+ /* We only discard relocs for symbols defined in a regular object. */
+ if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ return true;
+
+ for (s = h->pcrel_relocs_copied; s != NULL; s = s->next)
+ s->section->_raw_size -= s->count * sizeof (Elf32_External_Rel);
+
+ return true;
+}
+
+/* Finish up dynamic symbol handling. We set the contents of various
+ dynamic sections here. */
+
+static boolean
+elf32_arm_finish_dynamic_symbol (output_bfd, info, h, sym)
+ bfd * output_bfd;
+ struct bfd_link_info * info;
+ struct elf_link_hash_entry * h;
+ Elf_Internal_Sym * sym;
+{
+ bfd * dynobj;
+
+ dynobj = elf_hash_table (info)->dynobj;
+
+ if (h->plt.offset != (bfd_vma) -1)
+ {
+ asection * splt;
+ asection * sgot;
+ asection * srel;
+ bfd_vma plt_index;
+ bfd_vma got_offset;
+ Elf_Internal_Rel rel;
+
+ /* This symbol has an entry in the procedure linkage table. Set
+ it up. */
+
+ BFD_ASSERT (h->dynindx != -1);
+
+ splt = bfd_get_section_by_name (dynobj, ".plt");
+ sgot = bfd_get_section_by_name (dynobj, ".got.plt");
+ srel = bfd_get_section_by_name (dynobj, ".rel.plt");
+ BFD_ASSERT (splt != NULL && sgot != NULL && srel != NULL);
+
+ /* Get the index in the procedure linkage table which
+ corresponds to this symbol. This is the index of this symbol
+ in all the symbols for which we are making plt entries. The
+ first entry in the procedure linkage table is reserved. */
+ plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
+
+ /* Get the offset into the .got table of the entry that
+ corresponds to this function. Each .got entry is 4 bytes.
+ The first three are reserved. */
+ got_offset = (plt_index + 3) * 4;
+
+ /* Fill in the entry in the procedure linkage table. */
+ memcpy (splt->contents + h->plt.offset,
+ elf32_arm_plt_entry,
+ PLT_ENTRY_SIZE);
+ bfd_put_32 (output_bfd,
+ (sgot->output_section->vma
+ + sgot->output_offset
+ + got_offset
+ - splt->output_section->vma
+ - splt->output_offset
+ - h->plt.offset - 12),
+ splt->contents + h->plt.offset + 12);
+
+ /* Fill in the entry in the global offset table. */
+ bfd_put_32 (output_bfd,
+ (splt->output_section->vma
+ + splt->output_offset),
+ sgot->contents + got_offset);
+
+ /* Fill in the entry in the .rel.plt section. */
+ rel.r_offset = (sgot->output_section->vma
+ + sgot->output_offset
+ + got_offset);
+ rel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_JUMP_SLOT);
+ bfd_elf32_swap_reloc_out (output_bfd, &rel,
+ ((Elf32_External_Rel *) srel->contents
+ + plt_index));
+
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ {
+ /* Mark the symbol as undefined, rather than as defined in
+ the .plt section. Leave the value alone. */
+ sym->st_shndx = SHN_UNDEF;
+ }
+ }
+
+ if (h->got.offset != (bfd_vma) -1)
+ {
+ asection * sgot;
+ asection * srel;
+ Elf_Internal_Rel rel;
+
+ /* This symbol has an entry in the global offset table. Set it
+ up. */
+
+ sgot = bfd_get_section_by_name (dynobj, ".got");
+ srel = bfd_get_section_by_name (dynobj, ".rel.got");
+ BFD_ASSERT (sgot != NULL && srel != NULL);
+
+ rel.r_offset = (sgot->output_section->vma
+ + sgot->output_offset
+ + (h->got.offset &~ 1));
+
+ /* If this is a -Bsymbolic link, and the symbol is defined
+ locally, we just want to emit a RELATIVE reloc. The entry in
+ the global offset table will already have been initialized in
+ the relocate_section function. */
+ if (info->shared
+ && (info->symbolic || h->dynindx == -1)
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
+ rel.r_info = ELF32_R_INFO (0, R_ARM_RELATIVE);
+ else
+ {
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset);
+ rel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_GLOB_DAT);
+ }
+
+ bfd_elf32_swap_reloc_out (output_bfd, &rel,
+ ((Elf32_External_Rel *) srel->contents
+ + srel->reloc_count));
+ ++srel->reloc_count;
+ }
+
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
+ {
+ asection * s;
+ Elf_Internal_Rel rel;
+
+ /* This symbol needs a copy reloc. Set it up. */
+
+ BFD_ASSERT (h->dynindx != -1
+ && (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak));
+
+ s = bfd_get_section_by_name (h->root.u.def.section->owner,
+ ".rel.bss");
+ BFD_ASSERT (s != NULL);
+
+ rel.r_offset = (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+ rel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_COPY);
+ bfd_elf32_swap_reloc_out (output_bfd, &rel,
+ ((Elf32_External_Rel *) s->contents
+ + s->reloc_count));
+ ++s->reloc_count;
+ }
+
+ /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */
+ if (strcmp (h->root.root.string, "_DYNAMIC") == 0
+ || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+ sym->st_shndx = SHN_ABS;
+
+ return true;
+}
+
+/* Finish up the dynamic sections. */
+
+static boolean
+elf32_arm_finish_dynamic_sections (output_bfd, info)
+ bfd * output_bfd;
+ struct bfd_link_info * info;
+{
+ bfd * dynobj;
+ asection * sgot;
+ asection * sdyn;
+
+ dynobj = elf_hash_table (info)->dynobj;
+
+ sgot = bfd_get_section_by_name (dynobj, ".got.plt");
+ BFD_ASSERT (sgot != NULL);
+ sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
+
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ asection *splt;
+ Elf32_External_Dyn *dyncon, *dynconend;
+
+ splt = bfd_get_section_by_name (dynobj, ".plt");
+ BFD_ASSERT (splt != NULL && sdyn != NULL);
+
+ dyncon = (Elf32_External_Dyn *) sdyn->contents;
+ dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+ for (; dyncon < dynconend; dyncon++)
+ {
+ Elf_Internal_Dyn dyn;
+ const char * name;
+ asection * s;
+
+ bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
+
+ switch (dyn.d_tag)
+ {
+ default:
+ break;
+
+ case DT_PLTGOT:
+ name = ".got";
+ goto get_vma;
+ case DT_JMPREL:
+ name = ".rel.plt";
+ get_vma:
+ s = bfd_get_section_by_name (output_bfd, name);
+ BFD_ASSERT (s != NULL);
+ dyn.d_un.d_ptr = s->vma;
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ break;
+
+ case DT_PLTRELSZ:
+ s = bfd_get_section_by_name (output_bfd, ".rel.plt");
+ BFD_ASSERT (s != NULL);
+ if (s->_cooked_size != 0)
+ dyn.d_un.d_val = s->_cooked_size;
+ else
+ dyn.d_un.d_val = s->_raw_size;
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ break;
+
+ case DT_RELSZ:
+ /* My reading of the SVR4 ABI indicates that the
+ procedure linkage table relocs (DT_JMPREL) should be
+ included in the overall relocs (DT_REL). This is
+ what Solaris does. However, UnixWare can not handle
+ that case. Therefore, we override the DT_RELSZ entry
+ here to make it not include the JMPREL relocs. Since
+ the linker script arranges for .rel.plt to follow all
+ other relocation sections, we don't have to worry
+ about changing the DT_REL entry. */
+ s = bfd_get_section_by_name (output_bfd, ".rel.plt");
+ if (s != NULL)
+ {
+ if (s->_cooked_size != 0)
+ dyn.d_un.d_val -= s->_cooked_size;
+ else
+ dyn.d_un.d_val -= s->_raw_size;
+ }
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ break;
+ }
+ }
+
+ /* Fill in the first entry in the procedure linkage table. */
+ if (splt->_raw_size > 0)
+ memcpy (splt->contents, elf32_arm_plt0_entry, PLT_ENTRY_SIZE);
+
+ /* UnixWare sets the entsize of .plt to 4, although that doesn't
+ really seem like the right value. */
+ elf_section_data (splt->output_section)->this_hdr.sh_entsize = 4;
+ }
+
+ /* Fill in the first three entries in the global offset table. */
+ if (sgot->_raw_size > 0)
+ {
+ if (sdyn == NULL)
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
+ else
+ bfd_put_32 (output_bfd,
+ sdyn->output_section->vma + sdyn->output_offset,
+ sgot->contents);
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + 4);
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + 8);
+ }
+
+ elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4;
+
+ return true;
+}
+
+static void
+elf32_arm_post_process_headers (abfd, link_info)
+ bfd * abfd;
+ struct bfd_link_info * link_info ATTRIBUTE_UNUSED;
+{
+ Elf_Internal_Ehdr * i_ehdrp; /* Elf file header, internal form */
+
+ i_ehdrp = elf_elfheader (abfd);
+
+ i_ehdrp->e_ident[EI_OSABI] = ARM_ELF_OS_ABI_VERSION;
+ i_ehdrp->e_ident[EI_ABIVERSION] = ARM_ELF_ABI_VERSION;
+}
+
+
+#define ELF_ARCH bfd_arch_arm
+#define ELF_MACHINE_CODE EM_ARM
+#define ELF_MAXPAGESIZE 0x8000
+
+
+#define bfd_elf32_bfd_copy_private_bfd_data elf32_arm_copy_private_bfd_data
+#define bfd_elf32_bfd_merge_private_bfd_data elf32_arm_merge_private_bfd_data
+#define bfd_elf32_bfd_set_private_flags elf32_arm_set_private_flags
+#define bfd_elf32_bfd_print_private_bfd_data elf32_arm_print_private_bfd_data
+#define bfd_elf32_bfd_link_hash_table_create elf32_arm_link_hash_table_create
+#define bfd_elf32_bfd_reloc_type_lookup elf32_arm_reloc_type_lookup
+#define bfd_elf32_find_nearest_line elf32_arm_find_nearest_line
+
+#define elf_backend_get_symbol_type elf32_arm_get_symbol_type
+#define elf_backend_gc_mark_hook elf32_arm_gc_mark_hook
+#define elf_backend_gc_sweep_hook elf32_arm_gc_sweep_hook
+#define elf_backend_check_relocs elf32_arm_check_relocs
+#define elf_backend_relocate_section elf32_arm_relocate_section
+#define elf_backend_adjust_dynamic_symbol elf32_arm_adjust_dynamic_symbol
+#define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections
+#define elf_backend_finish_dynamic_symbol elf32_arm_finish_dynamic_symbol
+#define elf_backend_finish_dynamic_sections elf32_arm_finish_dynamic_sections
+#define elf_backend_size_dynamic_sections elf32_arm_size_dynamic_sections
+#define elf_backend_post_process_headers elf32_arm_post_process_headers
+
+#define elf_backend_can_gc_sections 1
+#define elf_backend_plt_readonly 1
+#define elf_backend_want_got_plt 1
+#define elf_backend_want_plt_sym 0
+
+#define elf_backend_got_header_size 12
+#define elf_backend_plt_header_size PLT_ENTRY_SIZE
+
+#include "elf32-target.h"
diff --git a/contrib/binutils/bfd/elf32-gen.c b/contrib/binutils/bfd/elf32-gen.c
index 385fda208602..47da53b1bc68 100644
--- a/contrib/binutils/bfd/elf32-gen.c
+++ b/contrib/binutils/bfd/elf32-gen.c
@@ -1,5 +1,5 @@
/* Generic support for 32-bit ELF
- Copyright 1993 Free Software Foundation, Inc.
+ Copyright 1993, 1995, 1998, 1999 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -22,8 +22,41 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "libbfd.h"
#include "elf-bfd.h"
-/* This does not include any relocations, but should be good enough
- for GDB to read the file. */
+/* This does not include any relocation information, but should be
+ good enough for GDB or objdump to read the file. */
+
+static reloc_howto_type dummy =
+ HOWTO (0, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "UNKNOWN", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false); /* pcrel_offset */
+
+static void
+elf_generic_info_to_howto (abfd, bfd_reloc, elf_reloc)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *bfd_reloc;
+ Elf32_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED;
+{
+ bfd_reloc->howto = &dummy;
+}
+
+static void
+elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *bfd_reloc;
+ Elf32_Internal_Rel *elf_reloc ATTRIBUTE_UNUSED;
+{
+ bfd_reloc->howto = &dummy;
+}
#define TARGET_LITTLE_SYM bfd_elf32_little_generic_vec
#define TARGET_LITTLE_NAME "elf32-little"
@@ -31,7 +64,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define TARGET_BIG_NAME "elf32-big"
#define ELF_ARCH bfd_arch_unknown
#define ELF_MACHINE_CODE EM_NONE
+#define ELF_MAXPAGESIZE 0x1
#define bfd_elf32_bfd_reloc_type_lookup bfd_default_reloc_type_lookup
-#define elf_info_to_howto _bfd_elf_no_info_to_howto
+#define elf_info_to_howto elf_generic_info_to_howto
+#define elf_info_to_howto_rel elf_generic_info_to_howto_rel
#include "elf32-target.h"
diff --git a/contrib/binutils/bfd/elf32-i386.c b/contrib/binutils/bfd/elf32-i386.c
index a2d53eade577..90efba8dc9bc 100644
--- a/contrib/binutils/bfd/elf32-i386.c
+++ b/contrib/binutils/bfd/elf32-i386.c
@@ -1,5 +1,5 @@
/* Intel 80386/80486-specific support for 32-bit ELF
- Copyright 1993-1997, 1998 Free Software Foundation, Inc.
+ Copyright 1993, 94-98, 1999 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -52,45 +52,7 @@ static boolean elf_i386_finish_dynamic_sections
#define USE_REL 1 /* 386 uses REL relocations instead of RELA */
-enum reloc_type
- {
- R_386_NONE = 0,
- R_386_32,
- R_386_PC32,
- R_386_GOT32,
- R_386_PLT32,
- R_386_COPY,
- R_386_GLOB_DAT,
- R_386_JUMP_SLOT,
- R_386_RELATIVE,
- R_386_GOTOFF,
- R_386_GOTPC,
- FIRST_INVALID_RELOC,
- LAST_INVALID_RELOC = 19,
- /* The remaining relocs are a GNU extension. */
- R_386_16 = 20,
- R_386_PC16,
- R_386_8,
- R_386_PC8,
- R_386_max
- };
-
-#if 0
-static CONST char *CONST reloc_type_names[] =
-{
- "R_386_NONE",
- "R_386_32",
- "R_386_PC32",
- "R_386_GOT32",
- "R_386_PLT32",
- "R_386_COPY",
- "R_386_GLOB_DAT",
- "R_386_JUMP_SLOT",
- "R_386_RELATIVE",
- "R_386_GOTOFF",
- "R_386_GOTPC",
-};
-#endif
+#include "elf/i386.h"
static reloc_howto_type elf_howto_table[]=
{
@@ -105,22 +67,54 @@ static reloc_howto_type elf_howto_table[]=
HOWTO(R_386_RELATIVE, 0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_RELATIVE", true,0xffffffff,0xffffffff,false),
HOWTO(R_386_GOTOFF, 0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_GOTOFF", true,0xffffffff,0xffffffff,false),
HOWTO(R_386_GOTPC, 0,2,32,true,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_GOTPC", true,0xffffffff,0xffffffff,true),
- { 11 },
- { 12 },
- { 13 },
- { 14 },
- { 15 },
- { 16 },
- { 17 },
- { 18 },
- { 19 },
+ EMPTY_HOWTO (11),
+ EMPTY_HOWTO (12),
+ EMPTY_HOWTO (13),
+ EMPTY_HOWTO (14),
+ EMPTY_HOWTO (15),
+ EMPTY_HOWTO (16),
+ EMPTY_HOWTO (17),
+ EMPTY_HOWTO (18),
+ EMPTY_HOWTO (19),
/* The remaining relocs are a GNU extension. */
HOWTO(R_386_16, 0,1,16,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_16", true,0xffff,0xffff,false),
HOWTO(R_386_PC16, 0,1,16,true, 0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_PC16", true,0xffff,0xffff,true),
HOWTO(R_386_8, 0,0,8,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_8", true,0xff,0xff,false),
- HOWTO(R_386_PC8, 0,0,8,true, 0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_PC8", true,0xff,0xff,true),
+ HOWTO(R_386_PC8, 0,0,8,true, 0,complain_overflow_signed, bfd_elf_generic_reloc,"R_386_PC8", true,0xff,0xff,true),
};
+/* GNU extension to record C++ vtable hierarchy. */
+static reloc_howto_type elf32_i386_vtinherit_howto =
+ HOWTO (R_386_GNU_VTINHERIT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_386_GNU_VTINHERIT", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false);
+
+/* GNU extension to record C++ vtable member usage. */
+static reloc_howto_type elf32_i386_vtentry_howto =
+ HOWTO (R_386_GNU_VTENTRY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_386_GNU_VTENTRY", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false);
+
#ifdef DEBUG_GEN_RELOC
#define TRACE(str) fprintf (stderr, "i386 bfd reloc lookup %d (%s)\n", code, str)
#else
@@ -129,7 +123,7 @@ static reloc_howto_type elf_howto_table[]=
static reloc_howto_type *
elf_i386_reloc_type_lookup (abfd, code)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
bfd_reloc_code_real_type code;
{
switch (code)
@@ -142,6 +136,10 @@ elf_i386_reloc_type_lookup (abfd, code)
TRACE ("BFD_RELOC_32");
return &elf_howto_table[ (int)R_386_32 ];
+ case BFD_RELOC_CTOR:
+ TRACE ("BFD_RELOC_CTOR");
+ return &elf_howto_table[ (int)R_386_32 ];
+
case BFD_RELOC_32_PCREL:
TRACE ("BFD_RELOC_PC32");
return &elf_howto_table[ (int)R_386_PC32 ];
@@ -195,6 +193,14 @@ elf_i386_reloc_type_lookup (abfd, code)
TRACE ("BFD_RELOC_8_PCREL");
return &elf_howto_table[(int) R_386_PC8];
+ case BFD_RELOC_VTABLE_INHERIT:
+ TRACE ("BFD_RELOC_VTABLE_INHERIT");
+ return &elf32_i386_vtinherit_howto;
+
+ case BFD_RELOC_VTABLE_ENTRY:
+ TRACE ("BFD_RELOC_VTABLE_ENTRY");
+ return &elf32_i386_vtentry_howto;
+
default:
break;
}
@@ -205,26 +211,35 @@ elf_i386_reloc_type_lookup (abfd, code)
static void
elf_i386_info_to_howto (abfd, cache_ptr, dst)
- bfd *abfd;
- arelent *cache_ptr;
- Elf32_Internal_Rela *dst;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *cache_ptr ATTRIBUTE_UNUSED;
+ Elf32_Internal_Rela *dst ATTRIBUTE_UNUSED;
{
abort ();
}
static void
elf_i386_info_to_howto_rel (abfd, cache_ptr, dst)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr;
Elf32_Internal_Rel *dst;
{
- enum reloc_type type;
-
- type = (enum reloc_type) ELF32_R_TYPE (dst->r_info);
- BFD_ASSERT (type < R_386_max);
- BFD_ASSERT (type < FIRST_INVALID_RELOC || type > LAST_INVALID_RELOC);
-
- cache_ptr->howto = &elf_howto_table[(int) type];
+ enum elf_i386_reloc_type type;
+
+ type = (enum elf_i386_reloc_type) ELF32_R_TYPE (dst->r_info);
+ if (type == R_386_GNU_VTINHERIT)
+ cache_ptr->howto = &elf32_i386_vtinherit_howto;
+ else if (type == R_386_GNU_VTENTRY)
+ cache_ptr->howto = &elf32_i386_vtentry_howto;
+ else if (type < R_386_max
+ && (type < FIRST_INVALID_RELOC || type > LAST_INVALID_RELOC))
+ cache_ptr->howto = &elf_howto_table[(int) type];
+ else
+ {
+ (*_bfd_error_handler) (_("%s: invalid relocation type %d"),
+ bfd_get_filename (abfd), (int) type);
+ cache_ptr->howto = &elf_howto_table[(int) R_386_NONE];
+ }
}
/* Return whether a symbol name implies a local label. The UnixWare
@@ -507,12 +522,12 @@ elf_i386_check_relocs (abfd, info, sec, relocs)
if (h != NULL)
{
- if (h->got_offset != (bfd_vma) -1)
+ if (h->got.offset != (bfd_vma) -1)
{
/* We have already allocated space in the .got. */
break;
}
- h->got_offset = sgot->_raw_size;
+ h->got.offset = sgot->_raw_size;
/* Make sure this symbol is output as a dynamic symbol. */
if (h->dynindx == -1)
@@ -579,6 +594,9 @@ elf_i386_check_relocs (abfd, info, sec, relocs)
case R_386_32:
case R_386_PC32:
+ if (h != NULL)
+ h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
+
/* If we are creating a shared library, and this is a reloc
against a global symbol, or a non PC relative reloc
against a local symbol, then we need to copy the reloc
@@ -592,6 +610,7 @@ elf_i386_check_relocs (abfd, info, sec, relocs)
possibility below by storing information in the
pcrel_relocs_copied field of the hash table entry. */
if (info->shared
+ && (sec->flags & SEC_ALLOC) != 0
&& (ELF32_R_TYPE (rel->r_info) != R_386_PC32
|| (h != NULL
&& (! info->symbolic
@@ -673,6 +692,20 @@ elf_i386_check_relocs (abfd, info, sec, relocs)
break;
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_386_GNU_VTINHERIT:
+ if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return false;
+ break;
+
+ /* This relocation describes which C++ vtable entries are actually
+ used. Record for later use during GC. */
+ case R_386_GNU_VTENTRY:
+ if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_offset))
+ return false;
+ break;
+
default:
break;
}
@@ -681,6 +714,70 @@ elf_i386_check_relocs (abfd, info, sec, relocs)
return true;
}
+/* Return the section that should be marked against GC for a given
+ relocation. */
+
+static asection *
+elf_i386_gc_mark_hook (abfd, info, rel, h, sym)
+ bfd *abfd;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ Elf_Internal_Rela *rel;
+ struct elf_link_hash_entry *h;
+ Elf_Internal_Sym *sym;
+{
+ if (h != NULL)
+ {
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ case R_386_GNU_VTINHERIT:
+ case R_386_GNU_VTENTRY:
+ break;
+
+ default:
+ switch (h->root.type)
+ {
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ return h->root.u.def.section;
+
+ case bfd_link_hash_common:
+ return h->root.u.c.p->section;
+
+ default:
+ break;
+ }
+ }
+ }
+ else
+ {
+ if (!(elf_bad_symtab (abfd)
+ && ELF_ST_BIND (sym->st_info) != STB_LOCAL)
+ && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE)
+ && sym->st_shndx != SHN_COMMON))
+ {
+ return bfd_section_from_elf_index (abfd, sym->st_shndx);
+ }
+ }
+
+ return NULL;
+}
+
+/* Update the got entry reference counts for the section being removed. */
+
+static boolean
+elf_i386_gc_sweep_hook (abfd, info, sec, relocs)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ asection *sec ATTRIBUTE_UNUSED;
+ const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED;
+{
+ /* ??? It would seem that the existing i386 code does no sort
+ of reference counting or whatnot on its GOT and PLT entries,
+ so it is not possible to garbage collect them at this time. */
+
+ return true;
+}
+
/* Adjust a symbol defined by a dynamic object and referenced by a
regular object. The current definition is in some section of the
dynamic object, but we're not including those sections. We have to
@@ -755,7 +852,7 @@ elf_i386_adjust_dynamic_symbol (info, h)
h->root.u.def.value = s->_raw_size;
}
- h->plt_offset = s->_raw_size;
+ h->plt.offset = s->_raw_size;
/* Make room for this entry. */
s->_raw_size += PLT_ENTRY_SIZE;
@@ -798,6 +895,11 @@ elf_i386_adjust_dynamic_symbol (info, h)
if (info->shared)
return true;
+ /* If there are no references to this symbol that do not use the
+ GOT, we don't need to generate a copy reloc. */
+ if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
+ return true;
+
/* We must allocate the symbol in our .dynbss section, which will
become part of the .bss section of the executable. There will be
an entry for this symbol in the .dynsym section. The dynamic
@@ -986,15 +1088,7 @@ elf_i386_size_dynamic_sections (output_bfd, info)
if (strip)
{
- asection **spp;
-
- for (spp = &s->output_section->owner->sections;
- *spp != s->output_section;
- spp = &(*spp)->next)
- ;
- *spp = s->output_section->next;
- --s->output_section->owner->section_count;
-
+ _bfd_strip_section_from_output (info, s);
continue;
}
@@ -1056,7 +1150,7 @@ elf_i386_size_dynamic_sections (output_bfd, info)
static boolean
elf_i386_discard_copies (h, ignore)
struct elf_i386_link_hash_entry *h;
- PTR ignore;
+ PTR ignore ATTRIBUTE_UNUSED;
{
struct elf_i386_pcrel_relocs_copied *s;
@@ -1117,6 +1211,9 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_reloc_status_type r;
r_type = ELF32_R_TYPE (rel->r_info);
+ if (r_type == R_386_GNU_VTINHERIT
+ || r_type == R_386_GNU_VTENTRY)
+ continue;
if (r_type < 0
|| r_type >= (int) R_386_max
|| (r_type >= (int) FIRST_INVALID_RELOC
@@ -1176,7 +1273,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
sec = h->root.u.def.section;
if (r_type == R_386_GOTPC
|| (r_type == R_386_PLT32
- && h->plt_offset != (bfd_vma) -1)
+ && h->plt.offset != (bfd_vma) -1)
|| (r_type == R_386_GOT32
&& elf_hash_table (info)->dynamic_sections_created
&& (! info->shared
@@ -1189,7 +1286,12 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
& ELF_LINK_HASH_DEF_REGULAR) == 0)
&& (r_type == R_386_32
|| r_type == R_386_PC32)
- && (input_section->flags & SEC_ALLOC) != 0))
+ && ((input_section->flags & SEC_ALLOC) != 0
+ /* DWARF will emit R_386_32 relocations in its
+ sections against symbols defined externally
+ in shared libraries. We can't do anything
+ with them here. */
+ || (input_section->flags & SEC_DEBUGGING) != 0)))
{
/* In these cases, we don't need the relocation
value. We check specially because in some
@@ -1199,7 +1301,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
else if (sec->output_section == NULL)
{
(*_bfd_error_handler)
- ("%s: warning: unresolvable relocation against symbol `%s' from %s section",
+ (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
bfd_get_filename (input_bfd), h->root.root.string,
bfd_get_section_name (input_bfd, input_section));
relocation = 0;
@@ -1211,13 +1313,14 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
- else if (info->shared && !info->symbolic)
+ else if (info->shared && !info->symbolic && !info->no_undefined)
relocation = 0;
else
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset,
+ (!info->shared || info->no_undefined))))
return false;
relocation = 0;
}
@@ -1238,7 +1341,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
{
bfd_vma off;
- off = h->got_offset;
+ off = h->got.offset;
BFD_ASSERT (off != (bfd_vma) -1);
if (! elf_hash_table (info)->dynamic_sections_created
@@ -1264,7 +1367,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
{
bfd_put_32 (output_bfd, relocation,
sgot->contents + off);
- h->got_offset |= 1;
+ h->got.offset |= 1;
}
}
@@ -1356,7 +1459,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
if (h == NULL)
break;
- if (h->plt_offset == (bfd_vma) -1)
+ if (h->plt.offset == (bfd_vma) -1)
{
/* We didn't make a PLT entry for this symbol. This
happens when statically linking PIC code, or when
@@ -1372,13 +1475,14 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
relocation = (splt->output_section->vma
+ splt->output_offset
- + h->plt_offset);
+ + h->plt.offset);
break;
case R_386_32:
case R_386_PC32:
if (info->shared
+ && (input_section->flags & SEC_ALLOC) != 0
&& (r_type != R_386_PC32
|| (h != NULL
&& h->dynindx != -1
@@ -1442,10 +1546,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
else if (r_type == R_386_PC32)
{
BFD_ASSERT (h != NULL && h->dynindx != -1);
- if ((input_section->flags & SEC_ALLOC) != 0)
- relocate = false;
- else
- relocate = true;
+ relocate = false;
outrel.r_info = ELF32_R_INFO (h->dynindx, R_386_PC32);
}
else
@@ -1463,10 +1564,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
else
{
BFD_ASSERT (h->dynindx != -1);
- if ((input_section->flags & SEC_ALLOC) != 0)
- relocate = false;
- else
- relocate = true;
+ relocate = false;
outrel.r_info = ELF32_R_INFO (h->dynindx, R_386_32);
}
}
@@ -1545,7 +1643,7 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym)
dynobj = elf_hash_table (info)->dynobj;
- if (h->plt_offset != (bfd_vma) -1)
+ if (h->plt.offset != (bfd_vma) -1)
{
asection *splt;
asection *sgot;
@@ -1568,7 +1666,7 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym)
corresponds to this symbol. This is the index of this symbol
in all the symbols for which we are making plt entries. The
first entry in the procedure linkage table is reserved. */
- plt_index = h->plt_offset / PLT_ENTRY_SIZE - 1;
+ plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
/* Get the offset into the .got table of the entry that
corresponds to this function. Each .got entry is 4 bytes.
@@ -1578,32 +1676,32 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym)
/* Fill in the entry in the procedure linkage table. */
if (! info->shared)
{
- memcpy (splt->contents + h->plt_offset, elf_i386_plt_entry,
+ memcpy (splt->contents + h->plt.offset, elf_i386_plt_entry,
PLT_ENTRY_SIZE);
bfd_put_32 (output_bfd,
(sgot->output_section->vma
+ sgot->output_offset
+ got_offset),
- splt->contents + h->plt_offset + 2);
+ splt->contents + h->plt.offset + 2);
}
else
{
- memcpy (splt->contents + h->plt_offset, elf_i386_pic_plt_entry,
+ memcpy (splt->contents + h->plt.offset, elf_i386_pic_plt_entry,
PLT_ENTRY_SIZE);
bfd_put_32 (output_bfd, got_offset,
- splt->contents + h->plt_offset + 2);
+ splt->contents + h->plt.offset + 2);
}
bfd_put_32 (output_bfd, plt_index * sizeof (Elf32_External_Rel),
- splt->contents + h->plt_offset + 7);
- bfd_put_32 (output_bfd, - (h->plt_offset + PLT_ENTRY_SIZE),
- splt->contents + h->plt_offset + 12);
+ splt->contents + h->plt.offset + 7);
+ bfd_put_32 (output_bfd, - (h->plt.offset + PLT_ENTRY_SIZE),
+ splt->contents + h->plt.offset + 12);
/* Fill in the entry in the global offset table. */
bfd_put_32 (output_bfd,
(splt->output_section->vma
+ splt->output_offset
- + h->plt_offset
+ + h->plt.offset
+ 6),
sgot->contents + got_offset);
@@ -1624,7 +1722,7 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym)
}
}
- if (h->got_offset != (bfd_vma) -1)
+ if (h->got.offset != (bfd_vma) -1)
{
asection *sgot;
asection *srel;
@@ -1639,7 +1737,7 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym)
rel.r_offset = (sgot->output_section->vma
+ sgot->output_offset
- + (h->got_offset &~ 1));
+ + (h->got.offset &~ 1));
/* If this is a -Bsymbolic link, and the symbol is defined
locally, we just want to emit a RELATIVE reloc. Likewise if
@@ -1652,7 +1750,7 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym)
rel.r_info = ELF32_R_INFO (0, R_386_RELATIVE);
else
{
- bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got_offset);
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset);
rel.r_info = ELF32_R_INFO (h->dynindx, R_386_GLOB_DAT);
}
@@ -1717,8 +1815,7 @@ elf_i386_finish_dynamic_sections (output_bfd, info)
asection *splt;
Elf32_External_Dyn *dyncon, *dynconend;
- splt = bfd_get_section_by_name (dynobj, ".plt");
- BFD_ASSERT (splt != NULL && sdyn != NULL);
+ BFD_ASSERT (sdyn != NULL);
dyncon = (Elf32_External_Dyn *) sdyn->contents;
dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
@@ -1781,7 +1878,8 @@ elf_i386_finish_dynamic_sections (output_bfd, info)
}
/* Fill in the first entry in the procedure linkage table. */
- if (splt->_raw_size > 0)
+ splt = bfd_get_section_by_name (dynobj, ".plt");
+ if (splt && splt->_raw_size > 0)
{
if (info->shared)
memcpy (splt->contents, elf_i386_pic_plt0_entry, PLT_ENTRY_SIZE);
@@ -1795,11 +1893,11 @@ elf_i386_finish_dynamic_sections (output_bfd, info)
sgot->output_section->vma + sgot->output_offset + 8,
splt->contents + 8);
}
- }
- /* UnixWare sets the entsize of .plt to 4, although that doesn't
- really seem like the right value. */
- elf_section_data (splt->output_section)->this_hdr.sh_entsize = 4;
+ /* UnixWare sets the entsize of .plt to 4, although that doesn't
+ really seem like the right value. */
+ elf_section_data (splt->output_section)->this_hdr.sh_entsize = 4;
+ }
}
/* Fill in the first three entries in the global offset table. */
@@ -1844,8 +1942,14 @@ elf_i386_finish_dynamic_sections (output_bfd, info)
elf_i386_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections \
elf_i386_finish_dynamic_sections
-#define elf_backend_want_got_plt 1
-#define elf_backend_plt_readonly 1
-#define elf_backend_want_plt_sym 0
+#define elf_backend_gc_mark_hook elf_i386_gc_mark_hook
+#define elf_backend_gc_sweep_hook elf_i386_gc_sweep_hook
+
+#define elf_backend_can_gc_sections 1
+#define elf_backend_want_got_plt 1
+#define elf_backend_plt_readonly 1
+#define elf_backend_want_plt_sym 0
+#define elf_backend_got_header_size 12
+#define elf_backend_plt_header_size PLT_ENTRY_SIZE
#include "elf32-target.h"
diff --git a/contrib/binutils/bfd/elf32-mips.c b/contrib/binutils/bfd/elf32-mips.c
index fa6ec062f1d0..d91bab972684 100644
--- a/contrib/binutils/bfd/elf32-mips.c
+++ b/contrib/binutils/bfd/elf32-mips.c
@@ -1,8 +1,10 @@
/* MIPS-specific support for 32-bit ELF
- Copyright 1993, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+ Copyright 1993, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
Most of the information added by Ian Lance Taylor, Cygnus Support,
<ian@cygnus.com>.
+ N32/64 ABI support added by Mark Mitchell, CodeSourcery, LLC.
+ <mark@codesourcery.com>
This file is part of BFD, the Binary File Descriptor library.
@@ -41,104 +43,248 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define ECOFF_32
#include "ecoffswap.h"
+/* This structure is used to hold .got information when linking. It
+ is stored in the tdata field of the bfd_elf_section_data structure. */
+
+struct mips_got_info
+{
+ /* The global symbol in the GOT with the lowest index in the dynamic
+ symbol table. */
+ struct elf_link_hash_entry *global_gotsym;
+ /* The number of global .got entries. */
+ unsigned int global_gotno;
+ /* The number of local .got entries. */
+ unsigned int local_gotno;
+ /* The number of local .got entries we have used. */
+ unsigned int assigned_gotno;
+};
+
+/* The MIPS ELF linker needs additional information for each symbol in
+ the global hash table. */
+
+struct mips_elf_link_hash_entry
+{
+ struct elf_link_hash_entry root;
+
+ /* External symbol information. */
+ EXTR esym;
+
+ /* Number of R_MIPS_32, R_MIPS_REL32, or R_MIPS_64 relocs against
+ this symbol. */
+ unsigned int possibly_dynamic_relocs;
+
+ /* The index of the first dynamic relocation (in the .rel.dyn
+ section) against this symbol. */
+ unsigned int min_dyn_reloc_index;
+
+ /* If there is a stub that 32 bit functions should use to call this
+ 16 bit function, this points to the section containing the stub. */
+ asection *fn_stub;
+
+ /* Whether we need the fn_stub; this is set if this symbol appears
+ in any relocs other than a 16 bit call. */
+ boolean need_fn_stub;
+
+ /* If there is a stub that 16 bit functions should use to call this
+ 32 bit function, this points to the section containing the stub. */
+ asection *call_stub;
+
+ /* This is like the call_stub field, but it is used if the function
+ being called returns a floating point value. */
+ asection *call_fp_stub;
+};
+
static bfd_reloc_status_type mips32_64bit_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type));
+static reloc_howto_type *mips_rtype_to_howto
+ PARAMS ((unsigned int));
static void mips_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *));
+static void mips_info_to_howto_rela
+ PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *));
static void bfd_mips_elf32_swap_gptab_in
PARAMS ((bfd *, const Elf32_External_gptab *, Elf32_gptab *));
static void bfd_mips_elf32_swap_gptab_out
PARAMS ((bfd *, const Elf32_gptab *, Elf32_External_gptab *));
+#if 0
+static void bfd_mips_elf_swap_msym_in
+ PARAMS ((bfd *, const Elf32_External_Msym *, Elf32_Internal_Msym *));
+#endif
+static void bfd_mips_elf_swap_msym_out
+ PARAMS ((bfd *, const Elf32_Internal_Msym *, Elf32_External_Msym *));
static boolean mips_elf_sym_is_global PARAMS ((bfd *, asymbol *));
-static boolean mips_elf32_object_p PARAMS ((bfd *));
static boolean mips_elf_create_procedure_table
PARAMS ((PTR, bfd *, struct bfd_link_info *, asection *,
struct ecoff_debug_info *));
-static int mips_elf_additional_program_headers PARAMS ((bfd *));
-static boolean mips_elf_modify_segment_map PARAMS ((bfd *));
static INLINE int elf_mips_isa PARAMS ((flagword));
-static boolean mips_elf32_section_from_shdr
- PARAMS ((bfd *, Elf32_Internal_Shdr *, char *));
-static boolean mips_elf32_section_processing
- PARAMS ((bfd *, Elf32_Internal_Shdr *));
+static INLINE int elf_mips_mach PARAMS ((flagword));
+static INLINE char* elf_mips_abi_name PARAMS ((bfd *));
static boolean mips_elf_is_local_label_name
PARAMS ((bfd *, const char *));
static struct bfd_hash_entry *mips_elf_link_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
-static struct bfd_link_hash_table *mips_elf_link_hash_table_create
- PARAMS ((bfd *));
static int gptab_compare PARAMS ((const void *, const void *));
-static boolean mips_elf_final_link
- PARAMS ((bfd *, struct bfd_link_info *));
-static void mips_elf_relocate_hi16
- PARAMS ((bfd *, Elf_Internal_Rela *, Elf_Internal_Rela *, bfd_byte *,
- bfd_vma));
-static boolean mips_elf_relocate_got_local
- PARAMS ((bfd *, bfd *, asection *, Elf_Internal_Rela *,
- Elf_Internal_Rela *, bfd_byte *, bfd_vma));
-static void mips_elf_relocate_global_got
- PARAMS ((bfd *, Elf_Internal_Rela *, bfd_byte *, bfd_vma));
static bfd_reloc_status_type mips16_jump_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static bfd_reloc_status_type mips16_gprel_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static boolean mips_elf_adjust_dynindx
- PARAMS ((struct elf_link_hash_entry *, PTR));
-static boolean mips_elf_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
-static boolean mips_elf_link_output_symbol_hook
- PARAMS ((bfd *, struct bfd_link_info *, const char *, Elf_Internal_Sym *,
- asection *));
-static boolean mips_elf_create_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
static boolean mips_elf_create_compact_rel_section
PARAMS ((bfd *, struct bfd_link_info *));
static boolean mips_elf_create_got_section
PARAMS ((bfd *, struct bfd_link_info *));
-static boolean mips_elf_check_relocs
- PARAMS ((bfd *, struct bfd_link_info *, asection *,
- const Elf_Internal_Rela *));
-static boolean mips_elf_adjust_dynamic_symbol
- PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
-static boolean mips_elf_always_size_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-static boolean mips_elf_size_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-static boolean mips_elf_finish_dynamic_symbol
- PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
- Elf_Internal_Sym *));
-static boolean mips_elf_finish_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-static boolean mips_elf_add_symbol_hook
- PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
- const char **, flagword *, asection **, bfd_vma *));
static bfd_reloc_status_type mips_elf_final_gp
PARAMS ((bfd *, asymbol *, boolean, char **, bfd_vma *));
static bfd_byte *elf32_mips_get_relocated_section_contents
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *,
bfd_byte *, boolean, asymbol **));
-
-/* This is true for Irix 5 executables, false for normal MIPS ELF ABI
- executables. FIXME: At the moment, we default to always generating
- Irix 5 executables. */
-
-#define SGI_COMPAT(abfd) (1)
-
-/* This structure is used to hold .got information when linking. It
- is stored in the tdata field of the bfd_elf_section_data structure. */
-
-struct mips_got_info
-{
- /* The symbol index of the first global .got symbol. */
- unsigned long global_gotsym;
- /* The number of local .got entries. */
- unsigned int local_gotno;
- /* The number of local .got entries we have used. */
- unsigned int assigned_gotno;
-};
+static asection *mips_elf_create_msym_section
+ PARAMS ((bfd *));
+static void mips_elf_irix6_finish_dynamic_symbol
+ PARAMS ((bfd *, const char *, Elf_Internal_Sym *));
+static bfd_vma mips_elf_sign_extend PARAMS ((bfd_vma, int));
+static boolean mips_elf_overflow_p PARAMS ((bfd_vma, int));
+static bfd_vma mips_elf_high PARAMS ((bfd_vma));
+static bfd_vma mips_elf_higher PARAMS ((bfd_vma));
+static bfd_vma mips_elf_highest PARAMS ((bfd_vma));
+static bfd_vma mips_elf_global_got_index
+ PARAMS ((bfd *, struct elf_link_hash_entry *));
+static bfd_vma mips_elf_local_got_index
+ PARAMS ((bfd *, struct bfd_link_info *, bfd_vma));
+static bfd_vma mips_elf_got_offset_from_index
+ PARAMS ((bfd *, bfd *, bfd_vma));
+static boolean mips_elf_record_global_got_symbol
+ PARAMS ((struct elf_link_hash_entry *, struct bfd_link_info *,
+ struct mips_got_info *));
+static bfd_vma mips_elf_got_page
+ PARAMS ((bfd *, struct bfd_link_info *, bfd_vma, bfd_vma *));
+static const Elf_Internal_Rela *mips_elf_next_relocation
+ PARAMS ((unsigned int, const Elf_Internal_Rela *,
+ const Elf_Internal_Rela *));
+static bfd_reloc_status_type mips_elf_calculate_relocation
+ PARAMS ((bfd *, bfd *, asection *, struct bfd_link_info *,
+ const Elf_Internal_Rela *, bfd_vma, reloc_howto_type *,
+ Elf_Internal_Sym *, asection **, bfd_vma *, const char **,
+ boolean *));
+static bfd_vma mips_elf_obtain_contents
+ PARAMS ((reloc_howto_type *, const Elf_Internal_Rela *, bfd *, bfd_byte *));
+static boolean mips_elf_perform_relocation
+ PARAMS ((struct bfd_link_info *, reloc_howto_type *,
+ const Elf_Internal_Rela *, bfd_vma,
+ bfd *, asection *, bfd_byte *, boolean));
+static boolean mips_elf_assign_gp PARAMS ((bfd *, bfd_vma *));
+static boolean mips_elf_sort_hash_table_f
+ PARAMS ((struct mips_elf_link_hash_entry *, PTR));
+static boolean mips_elf_sort_hash_table
+ PARAMS ((struct bfd_link_info *, unsigned long));
+static asection * mips_elf_got_section PARAMS ((bfd *));
+static struct mips_got_info *mips_elf_got_info
+ PARAMS ((bfd *, asection **));
+static boolean mips_elf_local_relocation_p
+ PARAMS ((bfd *, const Elf_Internal_Rela *, asection **));
+static bfd_vma mips_elf_create_local_got_entry
+ PARAMS ((bfd *, struct mips_got_info *, asection *, bfd_vma));
+static bfd_vma mips_elf_got16_entry
+ PARAMS ((bfd *, struct bfd_link_info *, bfd_vma));
+static boolean mips_elf_create_dynamic_relocation
+ PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Rela *,
+ struct mips_elf_link_hash_entry *, asection *,
+ bfd_vma, bfd_vma *, asection *));
+static void mips_elf_allocate_dynamic_relocations
+ PARAMS ((bfd *, unsigned int));
+static boolean mips_elf_stub_section_p
+ PARAMS ((bfd *, asection *));
+
+/* The level of IRIX compatibility we're striving for. */
+
+typedef enum {
+ ict_none,
+ ict_irix5,
+ ict_irix6
+} irix_compat_t;
+
+/* Nonzero if ABFD is using the N32 ABI. */
+
+#define ABI_N32_P(abfd) \
+ ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI2) != 0)
+
+/* Nonzero if ABFD is using the 64-bit ABI. FIXME: This is never
+ true, yet. */
+#define ABI_64_P(abfd) \
+ ((elf_elfheader (abfd)->e_ident[EI_CLASS] == ELFCLASS64) != 0)
+
+/* What version of Irix we are trying to be compatible with. FIXME:
+ At the moment, we never generate "normal" MIPS ELF ABI executables;
+ we always use some version of Irix. */
+
+#define IRIX_COMPAT(abfd) \
+ ((ABI_N32_P (abfd) || ABI_64_P (abfd)) ? ict_irix6 : ict_irix5)
+
+/* Whether we are trying to be compatible with IRIX at all. */
+
+#define SGI_COMPAT(abfd) \
+ (IRIX_COMPAT (abfd) != ict_none)
+
+/* The name of the msym section. */
+#define MIPS_ELF_MSYM_SECTION_NAME(abfd) ".msym"
+
+/* The name of the srdata section. */
+#define MIPS_ELF_SRDATA_SECTION_NAME(abfd) ".srdata"
+
+/* The name of the options section. */
+#define MIPS_ELF_OPTIONS_SECTION_NAME(abfd) \
+ (IRIX_COMPAT (abfd) == ict_irix6 ? ".MIPS.options" : ".options")
+
+/* The name of the stub section. */
+#define MIPS_ELF_STUB_SECTION_NAME(abfd) \
+ (IRIX_COMPAT (abfd) == ict_irix6 ? ".MIPS.stubs" : ".stub")
+
+/* The name of the dynamic relocation section. */
+#define MIPS_ELF_REL_DYN_SECTION_NAME(abfd) ".rel.dyn"
+
+/* The size of an external REL relocation. */
+#define MIPS_ELF_REL_SIZE(abfd) \
+ (get_elf_backend_data (abfd)->s->sizeof_rel)
+
+/* The size of an external dynamic table entry. */
+#define MIPS_ELF_DYN_SIZE(abfd) \
+ (get_elf_backend_data (abfd)->s->sizeof_dyn)
+
+/* The size of a GOT entry. */
+#define MIPS_ELF_GOT_SIZE(abfd) \
+ (get_elf_backend_data (abfd)->s->arch_size / 8)
+
+/* The size of a symbol-table entry. */
+#define MIPS_ELF_SYM_SIZE(abfd) \
+ (get_elf_backend_data (abfd)->s->sizeof_sym)
+
+/* The default alignment for sections, as a power of two. */
+#define MIPS_ELF_LOG_FILE_ALIGN(abfd) \
+ (get_elf_backend_data (abfd)->s->file_align == 8 ? 3 : 2)
+
+/* Get word-sized data. */
+#define MIPS_ELF_GET_WORD(abfd, ptr) \
+ (ABI_64_P (abfd) ? bfd_get_64 (abfd, ptr) : bfd_get_32 (abfd, ptr))
+
+/* Put out word-sized data. */
+#define MIPS_ELF_PUT_WORD(abfd, val, ptr) \
+ (ABI_64_P (abfd) \
+ ? bfd_put_64 (abfd, val, ptr) \
+ : bfd_put_32 (abfd, val, ptr))
+
+/* Add a dynamic symbol table-entry. */
+#ifdef BFD64
+#define MIPS_ELF_ADD_DYNAMIC_ENTRY(info, tag, val) \
+ (ABI_64_P (elf_hash_table (info)->dynobj) \
+ ? bfd_elf64_add_dynamic_entry (info, tag, val) \
+ : bfd_elf32_add_dynamic_entry (info, tag, val))
+#else
+#define MIPS_ELF_ADD_DYNAMIC_ENTRY(info, tag, val) \
+ (ABI_64_P (elf_hash_table (info)->dynobj) \
+ ? (abort (), false) \
+ : bfd_elf32_add_dynamic_entry (info, tag, val))
+#endif
/* The number of local .got entries we reserve. */
#define MIPS_RESERVED_GOTNO (2)
@@ -146,15 +292,22 @@ struct mips_got_info
/* Instructions which appear in a stub. For some reason the stub is
slightly different on an SGI system. */
#define ELF_MIPS_GP_OFFSET(abfd) (SGI_COMPAT (abfd) ? 0x7ff0 : 0x8000)
-#define STUB_LW(abfd) \
- (SGI_COMPAT (abfd) \
- ? 0x8f998010 /* lw t9,0x8010(gp) */ \
+#define STUB_LW(abfd) \
+ (SGI_COMPAT (abfd) \
+ ? (ABI_64_P (abfd) \
+ ? 0xdf998010 /* ld t9,0x8010(gp) */ \
+ : 0x8f998010) /* lw t9,0x8010(gp) */ \
: 0x8f998000) /* lw t9,0x8000(gp) */
#define STUB_MOVE 0x03e07825 /* move t7,ra */
#define STUB_JALR 0x0320f809 /* jal t9 */
#define STUB_LI16 0x34180000 /* ori t8,zero,0 */
#define MIPS_FUNCTION_STUB_SIZE (16)
+#if 0
+/* We no longer try to identify particular sections for the .dynsym
+ section. When we do, we wind up crashing if there are other random
+ sections with relocations. */
+
/* Names of sections which appear in the .dynsym section in an Irix 5
executable. */
@@ -179,6 +332,8 @@ static const char * const mips_elf_dynsym_sec_names[] =
#define MIPS_TEXT_DYNSYM_SECNO (3)
+#endif /* 0 */
+
/* The names of the runtime procedure table symbols used on Irix 5. */
static const char * const mips_elf_dynsym_rtproc_names[] =
@@ -288,32 +443,9 @@ static void bfd_elf32_swap_crinfo_out
#define USE_REL 1 /* MIPS uses REL relocations instead of RELA */
-enum reloc_type
-{
- R_MIPS_NONE = 0,
- R_MIPS_16, R_MIPS_32,
- R_MIPS_REL32, R_MIPS_26,
- R_MIPS_HI16, R_MIPS_LO16,
- R_MIPS_GPREL16, R_MIPS_LITERAL,
- R_MIPS_GOT16, R_MIPS_PC16,
- R_MIPS_CALL16, R_MIPS_GPREL32,
- /* The remaining relocs are defined on Irix, although they are not
- in the MIPS ELF ABI. */
- R_MIPS_UNUSED1, R_MIPS_UNUSED2,
- R_MIPS_UNUSED3,
- R_MIPS_SHIFT5, R_MIPS_SHIFT6,
- R_MIPS_64, R_MIPS_GOT_DISP,
- R_MIPS_GOT_PAGE, R_MIPS_GOT_OFST,
- R_MIPS_GOT_HI16, R_MIPS_GOT_LO16,
- R_MIPS_SUB, R_MIPS_INSERT_A,
- R_MIPS_INSERT_B, R_MIPS_DELETE,
- R_MIPS_HIGHER, R_MIPS_HIGHEST,
- R_MIPS_CALL_HI16, R_MIPS_CALL_LO16,
- R_MIPS_max,
- /* These relocs are used for the mips16. */
- R_MIPS16_26 = 100,
- R_MIPS16_GPREL = 101
-};
+/* In case we're on a 32-bit machine, construct a 64-bit "-1" value
+ from smaller values. Start with zero, widen, *then* decrement. */
+#define MINUS_ONE (((bfd_vma)0) - 1)
static reloc_howto_type elf_mips_howto_table[] =
{
@@ -466,7 +598,7 @@ static reloc_howto_type elf_mips_howto_table[] =
_bfd_mips_elf_got16_reloc, /* special_function */
"R_MIPS_GOT16", /* name */
false, /* partial_inplace */
- 0, /* src_mask */
+ 0xffff, /* src_mask */
0xffff, /* dst_mask */
false), /* pcrel_offset */
@@ -483,10 +615,9 @@ static reloc_howto_type elf_mips_howto_table[] =
true, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- false), /* pcrel_offset */
+ true), /* pcrel_offset */
/* 16 bit call through global offset table. */
- /* FIXME: This is not handled correctly. */
HOWTO (R_MIPS_CALL16, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
@@ -497,7 +628,7 @@ static reloc_howto_type elf_mips_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_MIPS_CALL16", /* name */
false, /* partial_inplace */
- 0, /* src_mask */
+ 0xffff, /* src_mask */
0xffff, /* dst_mask */
false), /* pcrel_offset */
@@ -518,9 +649,9 @@ static reloc_howto_type elf_mips_howto_table[] =
/* The remaining relocs are defined on Irix 5, although they are
not defined by the ABI. */
- { 13 },
- { 14 },
- { 15 },
+ EMPTY_HOWTO (13),
+ EMPTY_HOWTO (14),
+ EMPTY_HOWTO (15),
/* A 5 bit shift field. */
HOWTO (R_MIPS_SHIFT5, /* type */
@@ -554,26 +685,22 @@ static reloc_howto_type elf_mips_howto_table[] =
0x000007c4, /* dst_mask */
false), /* pcrel_offset */
- /* A 64 bit relocation. This is used in 32 bit ELF when addresses
- are 64 bits long; the upper 32 bits are simply a sign extension.
- The fields of the howto should be the same as for R_MIPS_32,
- other than the type, name, and special_function. */
+ /* A 64 bit relocation. */
HOWTO (R_MIPS_64, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
+ 4, /* size (0 = byte, 1 = short, 2 = long) */
+ 64, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
mips32_64bit_reloc, /* special_function */
"R_MIPS_64", /* name */
true, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
+ MINUS_ONE, /* src_mask */
+ MINUS_ONE, /* dst_mask */
false), /* pcrel_offset */
/* Displacement in the global offset table. */
- /* FIXME: Not handled correctly. */
HOWTO (R_MIPS_GOT_DISP, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
@@ -589,7 +716,6 @@ static reloc_howto_type elf_mips_howto_table[] =
false), /* pcrel_offset */
/* Displacement to page pointer in the global offset table. */
- /* FIXME: Not handled correctly. */
HOWTO (R_MIPS_GOT_PAGE, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
@@ -605,7 +731,6 @@ static reloc_howto_type elf_mips_howto_table[] =
false), /* pcrel_offset */
/* Offset from page pointer in the global offset table. */
- /* FIXME: Not handled correctly. */
HOWTO (R_MIPS_GOT_OFST, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
@@ -621,7 +746,6 @@ static reloc_howto_type elf_mips_howto_table[] =
false), /* pcrel_offset */
/* High 16 bits of displacement in global offset table. */
- /* FIXME: Not handled correctly. */
HOWTO (R_MIPS_GOT_HI16, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
@@ -637,7 +761,6 @@ static reloc_howto_type elf_mips_howto_table[] =
false), /* pcrel_offset */
/* Low 16 bits of displacement in global offset table. */
- /* FIXME: Not handled correctly. */
HOWTO (R_MIPS_GOT_LO16, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
@@ -652,21 +775,57 @@ static reloc_howto_type elf_mips_howto_table[] =
0x0000ffff, /* dst_mask */
false), /* pcrel_offset */
- /* 64 bit subtraction. Presumably not used in 32 bit ELF. */
- { R_MIPS_SUB },
+ /* 64 bit subtraction. Used in the N32 ABI. */
+ HOWTO (R_MIPS_SUB, /* type */
+ 0, /* rightshift */
+ 4, /* size (0 = byte, 1 = short, 2 = long) */
+ 64, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_MIPS_SUB", /* name */
+ true, /* partial_inplace */
+ MINUS_ONE, /* src_mask */
+ MINUS_ONE, /* dst_mask */
+ false), /* pcrel_offset */
/* Used to cause the linker to insert and delete instructions? */
- { R_MIPS_INSERT_A },
- { R_MIPS_INSERT_B },
- { R_MIPS_DELETE },
+ EMPTY_HOWTO (R_MIPS_INSERT_A),
+ EMPTY_HOWTO (R_MIPS_INSERT_B),
+ EMPTY_HOWTO (R_MIPS_DELETE),
+
+ /* Get the higher value of a 64 bit addend. */
+ HOWTO (R_MIPS_HIGHER, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_MIPS_HIGHER", /* name */
+ true, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
- /* Get the higher values of a 64 bit addend. Presumably not used in
- 32 bit ELF. */
- { R_MIPS_HIGHER },
- { R_MIPS_HIGHEST },
+ /* Get the highest value of a 64 bit addend. */
+ HOWTO (R_MIPS_HIGHEST, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_MIPS_HIGHEST", /* name */
+ true, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
/* High 16 bits of displacement in global offset table. */
- /* FIXME: Not handled correctly. */
HOWTO (R_MIPS_CALL_HI16, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
@@ -682,7 +841,6 @@ static reloc_howto_type elf_mips_howto_table[] =
false), /* pcrel_offset */
/* Low 16 bits of displacement in global offset table. */
- /* FIXME: Not handled correctly. */
HOWTO (R_MIPS_CALL_LO16, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
@@ -697,7 +855,41 @@ static reloc_howto_type elf_mips_howto_table[] =
0x0000ffff, /* dst_mask */
false), /* pcrel_offset */
+ /* Section displacement. */
+ HOWTO (R_MIPS_SCN_DISP, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_MIPS_SCN_DISP", /* name */
+ false, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+ EMPTY_HOWTO (R_MIPS_REL16),
+ EMPTY_HOWTO (R_MIPS_ADD_IMMEDIATE),
+ EMPTY_HOWTO (R_MIPS_PJUMP),
+ EMPTY_HOWTO (R_MIPS_RELGOT),
+
+ /* Protected jump conversion. This is an optimization hint. No
+ relocation is required for correctness. */
+ HOWTO (R_MIPS_JALR, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_MIPS_JALR", /* name */
+ false, /* partial_inplace */
+ 0x00000000, /* src_mask */
+ 0x00000000, /* dst_mask */
+ false), /* pcrel_offset */
};
/* The reloc used for BFD_RELOC_CTOR when doing a 64 bit link. This
@@ -736,10 +928,7 @@ static reloc_howto_type elf_mips16_jump_howto =
0x3ffffff, /* dst_mask */
false); /* pcrel_offset */
-/* The reloc used for the mips16 gprel instruction. The src_mask and
- dsk_mask for this howto do not reflect the actual instruction, in
- which the value is not contiguous; the masks are for the
- convenience of the relocate_section routine. */
+/* The reloc used for the mips16 gprel instruction. */
static reloc_howto_type elf_mips16_gprel_howto =
HOWTO (R_MIPS16_GPREL, /* type */
0, /* rightshift */
@@ -751,10 +940,123 @@ static reloc_howto_type elf_mips16_gprel_howto =
mips16_gprel_reloc, /* special_function */
"R_MIPS16_GPREL", /* name */
true, /* partial_inplace */
+ 0x07ff001f, /* src_mask */
+ 0x07ff001f, /* dst_mask */
+ false); /* pcrel_offset */
+
+
+/* GNU extensions for embedded-pic. */
+/* High 16 bits of symbol value, pc-relative. */
+static reloc_howto_type elf_mips_gnu_rel_hi16 =
+ HOWTO (R_MIPS_GNU_REL_HI16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_mips_elf_hi16_reloc, /* special_function */
+ "R_MIPS_GNU_REL_HI16", /* name */
+ true, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ true); /* pcrel_offset */
+
+/* Low 16 bits of symbol value, pc-relative. */
+static reloc_howto_type elf_mips_gnu_rel_lo16 =
+ HOWTO (R_MIPS_GNU_REL_LO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_mips_elf_lo16_reloc, /* special_function */
+ "R_MIPS_GNU_REL_LO16", /* name */
+ true, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
+ true); /* pcrel_offset */
+
+/* 16 bit offset for pc-relative branches. */
+static reloc_howto_type elf_mips_gnu_rel16_s2 =
+ HOWTO (R_MIPS_GNU_REL16_S2, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_MIPS_GNU_REL16_S2", /* name */
+ true, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ true); /* pcrel_offset */
+
+/* 64 bit pc-relative. */
+static reloc_howto_type elf_mips_gnu_pcrel64 =
+ HOWTO (R_MIPS_PC64, /* type */
+ 0, /* rightshift */
+ 4, /* size (0 = byte, 1 = short, 2 = long) */
+ 64, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC64", /* name */
+ true, /* partial_inplace */
+ MINUS_ONE, /* src_mask */
+ MINUS_ONE, /* dst_mask */
+ true); /* pcrel_offset */
+
+/* 32 bit pc-relative. */
+static reloc_howto_type elf_mips_gnu_pcrel32 =
+ HOWTO (R_MIPS_PC32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC32", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ true); /* pcrel_offset */
+
+/* GNU extension to record C++ vtable hierarchy */
+static reloc_howto_type elf_mips_gnu_vtinherit_howto =
+ HOWTO (R_MIPS_GNU_VTINHERIT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_MIPS_GNU_VTINHERIT", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
false); /* pcrel_offset */
+/* GNU extension to record C++ vtable member usage */
+static reloc_howto_type elf_mips_gnu_vtentry_howto =
+ HOWTO (R_MIPS_GNU_VTENTRY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_MIPS_GNU_VTENTRY", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false); /* pcrel_offset */
/* Do a R_MIPS_HI16 relocation. This has to be done in combination
with a R_MIPS_LO16 reloc, because there is a carry from the LO16 to
@@ -784,7 +1086,7 @@ _bfd_mips_elf_hi16_reloc (abfd,
input_section,
output_bfd,
error_message)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
arelent *reloc_entry;
asymbol *symbol;
PTR data;
@@ -1015,6 +1317,57 @@ _bfd_mips_elf_got16_reloc (abfd,
abort ();
}
+/* Set the GP value for OUTPUT_BFD. Returns false if this is a
+ dangerous relocation. */
+
+static boolean
+mips_elf_assign_gp (output_bfd, pgp)
+ bfd *output_bfd;
+ bfd_vma *pgp;
+{
+ unsigned int count;
+ asymbol **sym;
+ unsigned int i;
+
+ /* If we've already figured out what GP will be, just return it. */
+ *pgp = _bfd_get_gp_value (output_bfd);
+ if (*pgp)
+ return true;
+
+ count = bfd_get_symcount (output_bfd);
+ sym = bfd_get_outsymbols (output_bfd);
+
+ /* The linker script will have created a symbol named `_gp' with the
+ appropriate value. */
+ if (sym == (asymbol **) NULL)
+ i = count;
+ else
+ {
+ for (i = 0; i < count; i++, sym++)
+ {
+ register CONST char *name;
+
+ name = bfd_asymbol_name (*sym);
+ if (*name == '_' && strcmp (name, "_gp") == 0)
+ {
+ *pgp = bfd_asymbol_value (*sym);
+ _bfd_set_gp_value (output_bfd, *pgp);
+ break;
+ }
+ }
+ }
+
+ if (i >= count)
+ {
+ /* Only get the error once. */
+ *pgp = 4;
+ _bfd_set_gp_value (output_bfd, *pgp);
+ return false;
+ }
+
+ return true;
+}
+
/* We have to figure out the gp value, so that we can adjust the
symbol value correctly. We look up the symbol _gp in the output
BFD. If we can't find it, we're stuck. We cache it in the ELF
@@ -1047,42 +1400,11 @@ mips_elf_final_gp (output_bfd, symbol, relocateable, error_message, pgp)
*pgp = symbol->section->output_section->vma + 0x4000;
_bfd_set_gp_value (output_bfd, *pgp);
}
- else
+ else if (!mips_elf_assign_gp (output_bfd, pgp))
{
- unsigned int count;
- asymbol **sym;
- unsigned int i;
-
- count = bfd_get_symcount (output_bfd);
- sym = bfd_get_outsymbols (output_bfd);
-
- if (sym == (asymbol **) NULL)
- i = count;
- else
- {
- for (i = 0; i < count; i++, sym++)
- {
- register CONST char *name;
-
- name = bfd_asymbol_name (*sym);
- if (*name == '_' && strcmp (name, "_gp") == 0)
- {
- *pgp = bfd_asymbol_value (*sym);
- _bfd_set_gp_value (output_bfd, *pgp);
- break;
- }
- }
- }
-
- if (i >= count)
- {
- /* Only get the error once. */
- *pgp = 4;
- _bfd_set_gp_value (output_bfd, *pgp);
- *error_message =
- (char *) "GP relative relocation when _gp not defined";
- return bfd_reloc_dangerous;
- }
+ *error_message =
+ (char *) _("GP relative relocation when _gp not defined");
+ return bfd_reloc_dangerous;
}
}
@@ -1240,7 +1562,7 @@ _bfd_mips_elf_gprel32_reloc (abfd,
&& reloc_entry->addend == 0)
{
*error_message = (char *)
- "32bits gp relative relocation occurs for an external symbol";
+ _("32bits gp relative relocation occurs for an external symbol");
return bfd_reloc_outofrange;
}
@@ -1367,13 +1689,13 @@ mips32_64bit_reloc (abfd, reloc_entry, symbol, data, input_section,
static bfd_reloc_status_type
mips16_jump_reloc (abfd, reloc_entry, symbol, data, input_section,
output_bfd, error_message)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
arelent *reloc_entry;
asymbol *symbol;
- PTR data;
+ PTR data ATTRIBUTE_UNUSED;
asection *input_section;
bfd *output_bfd;
- char **error_message;
+ char **error_message ATTRIBUTE_UNUSED;
{
if (output_bfd != (bfd *) NULL
&& (symbol->flags & BSF_SECTION_SYM) == 0
@@ -1389,7 +1711,7 @@ mips16_jump_reloc (abfd, reloc_entry, symbol, data, input_section,
if (! warned)
(*_bfd_error_handler)
- ("Linking mips16 objects into %s format is not supported",
+ (_("Linking mips16 objects into %s format is not supported"),
bfd_get_target (input_section->output_section->owner));
warned = true;
}
@@ -1493,11 +1815,90 @@ elf_mips_isa (flags)
return 4;
}
+/* Return the MACH for a MIPS e_flags value. */
+
+static INLINE int
+elf_mips_mach (flags)
+ flagword flags;
+{
+ switch (flags & EF_MIPS_MACH)
+ {
+ case E_MIPS_MACH_3900:
+ return bfd_mach_mips3900;
+
+ case E_MIPS_MACH_4010:
+ return bfd_mach_mips4010;
+
+ case E_MIPS_MACH_4100:
+ return bfd_mach_mips4100;
+
+ case E_MIPS_MACH_4111:
+ return bfd_mach_mips4111;
+
+ case E_MIPS_MACH_4650:
+ return bfd_mach_mips4650;
+
+ default:
+ switch (flags & EF_MIPS_ARCH)
+ {
+ default:
+ case E_MIPS_ARCH_1:
+ return bfd_mach_mips3000;
+ break;
+
+ case E_MIPS_ARCH_2:
+ return bfd_mach_mips6000;
+ break;
+
+ case E_MIPS_ARCH_3:
+ return bfd_mach_mips4000;
+ break;
+
+ case E_MIPS_ARCH_4:
+ return bfd_mach_mips8000;
+ break;
+ }
+ }
+
+ return 0;
+}
+
+/* Return printable name for ABI. */
+
+static INLINE char*
+elf_mips_abi_name (abfd)
+ bfd *abfd;
+{
+ flagword flags;
+
+ if (ABI_N32_P (abfd))
+ return "N32";
+ else if (ABI_64_P (abfd))
+ return "64";
+
+ flags = elf_elfheader (abfd)->e_flags;
+ switch (flags & EF_MIPS_ABI)
+ {
+ case 0:
+ return "none";
+ case E_MIPS_ABI_O32:
+ return "O32";
+ case E_MIPS_ABI_O64:
+ return "O64";
+ case E_MIPS_ABI_EABI32:
+ return "EABI32";
+ case E_MIPS_ABI_EABI64:
+ return "EABI64";
+ default:
+ return "unknown abi";
+ }
+}
+
/* A mapping from BFD reloc types to MIPS ELF reloc types. */
struct elf_reloc_map {
bfd_reloc_code_real_type bfd_reloc_val;
- enum reloc_type elf_reloc_val;
+ enum elf_mips_reloc_type elf_reloc_val;
};
static CONST struct elf_reloc_map mips_reloc_map[] =
@@ -1519,6 +1920,10 @@ static CONST struct elf_reloc_map mips_reloc_map[] =
{ BFD_RELOC_MIPS_GOT_LO16, R_MIPS_GOT_LO16 },
{ BFD_RELOC_MIPS_CALL_HI16, R_MIPS_CALL_HI16 },
{ BFD_RELOC_MIPS_CALL_LO16, R_MIPS_CALL_LO16 },
+ { BFD_RELOC_MIPS_SUB, R_MIPS_SUB },
+ { BFD_RELOC_MIPS_GOT_PAGE, R_MIPS_GOT_PAGE },
+ { BFD_RELOC_MIPS_GOT_OFST, R_MIPS_GOT_OFST },
+ { BFD_RELOC_MIPS_GOT_DISP, R_MIPS_GOT_DISP }
};
/* Given a BFD reloc type, return a howto structure. */
@@ -1536,29 +1941,86 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code)
return &elf_mips_howto_table[(int) mips_reloc_map[i].elf_reloc_val];
}
- /* We need to handle BFD_RELOC_CTOR specially.
-
- Select the right relocation (R_MIPS_32 or R_MIPS_64) based on the
- size of addresses on this architecture. */
- if (code == BFD_RELOC_CTOR)
+ switch (code)
{
+ default:
+ bfd_set_error (bfd_error_bad_value);
+ return NULL;
+
+ case BFD_RELOC_CTOR:
+ /* We need to handle BFD_RELOC_CTOR specially.
+ Select the right relocation (R_MIPS_32 or R_MIPS_64) based on the
+ size of addresses on this architecture. */
if (bfd_arch_bits_per_address (abfd) == 32)
return &elf_mips_howto_table[(int) R_MIPS_32];
else
return &elf_mips_ctor64_howto;
+
+ case BFD_RELOC_MIPS16_JMP:
+ return &elf_mips16_jump_howto;
+ case BFD_RELOC_MIPS16_GPREL:
+ return &elf_mips16_gprel_howto;
+ case BFD_RELOC_VTABLE_INHERIT:
+ return &elf_mips_gnu_vtinherit_howto;
+ case BFD_RELOC_VTABLE_ENTRY:
+ return &elf_mips_gnu_vtentry_howto;
+ case BFD_RELOC_PCREL_HI16_S:
+ return &elf_mips_gnu_rel_hi16;
+ case BFD_RELOC_PCREL_LO16:
+ return &elf_mips_gnu_rel_lo16;
+ case BFD_RELOC_16_PCREL_S2:
+ return &elf_mips_gnu_rel16_s2;
+ case BFD_RELOC_64_PCREL:
+ return &elf_mips_gnu_pcrel64;
+ case BFD_RELOC_32_PCREL:
+ return &elf_mips_gnu_pcrel32;
}
+}
- /* Special handling for the MIPS16 relocs, since they are made up
- reloc types with a large value. */
- if (code == BFD_RELOC_MIPS16_JMP)
- return &elf_mips16_jump_howto;
- else if (code == BFD_RELOC_MIPS16_GPREL)
- return &elf_mips16_gprel_howto;
+/* Given a MIPS Elf32_Internal_Rel, fill in an arelent structure. */
- return NULL;
+static reloc_howto_type *
+mips_rtype_to_howto (r_type)
+ unsigned int r_type;
+{
+ switch (r_type)
+ {
+ case R_MIPS16_26:
+ return &elf_mips16_jump_howto;
+ break;
+ case R_MIPS16_GPREL:
+ return &elf_mips16_gprel_howto;
+ break;
+ case R_MIPS_GNU_VTINHERIT:
+ return &elf_mips_gnu_vtinherit_howto;
+ break;
+ case R_MIPS_GNU_VTENTRY:
+ return &elf_mips_gnu_vtentry_howto;
+ break;
+ case R_MIPS_GNU_REL_HI16:
+ return &elf_mips_gnu_rel_hi16;
+ break;
+ case R_MIPS_GNU_REL_LO16:
+ return &elf_mips_gnu_rel_lo16;
+ break;
+ case R_MIPS_GNU_REL16_S2:
+ return &elf_mips_gnu_rel16_s2;
+ break;
+ case R_MIPS_PC64:
+ return &elf_mips_gnu_pcrel64;
+ break;
+ case R_MIPS_PC32:
+ return &elf_mips_gnu_pcrel32;
+ break;
+
+ default:
+ BFD_ASSERT (r_type < (unsigned int) R_MIPS_max);
+ return &elf_mips_howto_table[r_type];
+ break;
+ }
}
-/* Given a MIPS reloc type, fill in an arelent structure. */
+/* Given a MIPS Elf32_Internal_Rel, fill in an arelent structure. */
static void
mips_info_to_howto_rel (abfd, cache_ptr, dst)
@@ -1569,15 +2031,7 @@ mips_info_to_howto_rel (abfd, cache_ptr, dst)
unsigned int r_type;
r_type = ELF32_R_TYPE (dst->r_info);
- if (r_type == R_MIPS16_26)
- cache_ptr->howto = &elf_mips16_jump_howto;
- else if (r_type == R_MIPS16_GPREL)
- cache_ptr->howto = &elf_mips16_gprel_howto;
- else
- {
- BFD_ASSERT (r_type < (unsigned int) R_MIPS_max);
- cache_ptr->howto = &elf_mips_howto_table[r_type];
- }
+ cache_ptr->howto = mips_rtype_to_howto (r_type);
/* The addend for a GPREL16 or LITERAL relocation comes from the GP
value for the object file. We get the addend now, rather than
@@ -1588,6 +2042,23 @@ mips_info_to_howto_rel (abfd, cache_ptr, dst)
|| r_type == (unsigned int) R_MIPS_LITERAL))
cache_ptr->addend = elf_gp (abfd);
}
+
+/* Given a MIPS Elf32_Internal_Rela, fill in an arelent structure. */
+
+static void
+mips_info_to_howto_rela (abfd, cache_ptr, dst)
+ bfd *abfd;
+ arelent *cache_ptr;
+ Elf32_Internal_Rela *dst;
+{
+ /* Since an Elf32_Internal_Rel is an initial prefix of an
+ Elf32_Internal_Rela, we can just use mips_info_to_howto_rel
+ above. */
+ mips_info_to_howto_rel (abfd, cache_ptr, (Elf32_Internal_Rel *) dst);
+
+ /* If we ever need to do any extra processing with dst->r_addend
+ (the field omitted in an Elf32_Internal_Rel) we can do it here. */
+}
/* A .reginfo section holds a single Elf32_RegInfo structure. These
routines swap this structure in and out. They are used outside of
@@ -1753,6 +2224,31 @@ bfd_mips_elf_swap_options_out (abfd, in, ex)
bfd_h_put_16 (abfd, in->section, ex->section);
bfd_h_put_32 (abfd, in->info, ex->info);
}
+#if 0
+/* Swap in an MSYM entry. */
+
+static void
+bfd_mips_elf_swap_msym_in (abfd, ex, in)
+ bfd *abfd;
+ const Elf32_External_Msym *ex;
+ Elf32_Internal_Msym *in;
+{
+ in->ms_hash_value = bfd_h_get_32 (abfd, ex->ms_hash_value);
+ in->ms_info = bfd_h_get_32 (abfd, ex->ms_info);
+}
+#endif
+/* Swap out an MSYM entry. */
+
+static void
+bfd_mips_elf_swap_msym_out (abfd, in, ex)
+ bfd *abfd;
+ const Elf32_Internal_Msym *in;
+ Elf32_External_Msym *ex;
+{
+ bfd_h_put_32 (abfd, in->ms_hash_value, ex->ms_hash_value);
+ bfd_h_put_32 (abfd, in->ms_info, ex->ms_info);
+}
+
/* Determine whether a symbol is global for the purposes of splitting
the symbol table into global symbols and local symbols. At least
@@ -1763,7 +2259,7 @@ bfd_mips_elf_swap_options_out (abfd, in, ex)
/*ARGSUSED*/
static boolean
mips_elf_sym_is_global (abfd, sym)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
asymbol *sym;
{
return (sym->flags & BSF_SECTION_SYM) == 0 ? true : false;
@@ -1776,41 +2272,14 @@ boolean
_bfd_mips_elf_object_p (abfd)
bfd *abfd;
{
- switch (elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH)
- {
- default:
- case E_MIPS_ARCH_1:
- (void) bfd_default_set_arch_mach (abfd, bfd_arch_mips, 3000);
- break;
-
- case E_MIPS_ARCH_2:
- (void) bfd_default_set_arch_mach (abfd, bfd_arch_mips, 6000);
- break;
-
- case E_MIPS_ARCH_3:
- (void) bfd_default_set_arch_mach (abfd, bfd_arch_mips, 4000);
- break;
-
- case E_MIPS_ARCH_4:
- (void) bfd_default_set_arch_mach (abfd, bfd_arch_mips, 8000);
- break;
- }
-
- return true;
-}
-
-/* Set the right machine number for a 32-bit MIPS ELF file. */
-
-static boolean
-mips_elf32_object_p (abfd)
- bfd *abfd;
-{
- /* Irix 5 is broken. Object file symbol tables are not always
+ /* Irix 5 and 6 is broken. Object file symbol tables are not always
sorted correctly such that local symbols precede global symbols,
and the sh_info field in the symbol table is not always right. */
elf_bad_symtab (abfd) = true;
- return _bfd_mips_elf_object_p (abfd);
+ bfd_default_set_arch_mach (abfd, bfd_arch_mips,
+ elf_mips_mach (elf_elfheader (abfd)->e_flags));
+ return true;
}
/* The final processing done just before writing out a MIPS ELF object
@@ -1821,7 +2290,7 @@ mips_elf32_object_p (abfd)
void
_bfd_mips_elf_final_write_processing (abfd, linker)
bfd *abfd;
- boolean linker;
+ boolean linker ATTRIBUTE_UNUSED;
{
unsigned long val;
unsigned int i;
@@ -1831,37 +2300,57 @@ _bfd_mips_elf_final_write_processing (abfd, linker)
switch (bfd_get_mach (abfd))
{
- case 3000:
+ default:
+ case bfd_mach_mips3000:
val = E_MIPS_ARCH_1;
break;
- case 6000:
+ case bfd_mach_mips3900:
+ val = E_MIPS_ARCH_1 | E_MIPS_MACH_3900;
+ break;
+
+ case bfd_mach_mips6000:
val = E_MIPS_ARCH_2;
break;
- case 4000:
+ case bfd_mach_mips4000:
+ case bfd_mach_mips4300:
val = E_MIPS_ARCH_3;
break;
- case 8000:
- val = E_MIPS_ARCH_4;
+ case bfd_mach_mips4010:
+ val = E_MIPS_ARCH_3 | E_MIPS_MACH_4010;
break;
- default:
- val = 0;
+ case bfd_mach_mips4100:
+ val = E_MIPS_ARCH_3 | E_MIPS_MACH_4100;
+ break;
+
+ case bfd_mach_mips4111:
+ val = E_MIPS_ARCH_3 | E_MIPS_MACH_4111;
+ break;
+
+ case bfd_mach_mips4650:
+ val = E_MIPS_ARCH_3 | E_MIPS_MACH_4650;
+ break;
+
+ case bfd_mach_mips8000:
+ val = E_MIPS_ARCH_4;
break;
}
- elf_elfheader (abfd)->e_flags &=~ EF_MIPS_ARCH;
+ elf_elfheader (abfd)->e_flags &= ~ (EF_MIPS_ARCH | EF_MIPS_MACH);
elf_elfheader (abfd)->e_flags |= val;
- /* Set the sh_info field for .gptab sections. */
+ /* Set the sh_info field for .gptab sections and other appropriate
+ info for each special section. */
for (i = 1, hdrpp = elf_elfsections (abfd) + 1;
i < elf_elfheader (abfd)->e_shnum;
i++, hdrpp++)
{
switch ((*hdrpp)->sh_type)
{
+ case SHT_MIPS_MSYM:
case SHT_MIPS_LIBLIST:
sec = bfd_get_section_by_name (abfd, ".dynstr");
if (sec != NULL)
@@ -1887,7 +2376,7 @@ _bfd_mips_elf_final_write_processing (abfd, linker)
sec = bfd_get_section_by_name (abfd,
name + sizeof ".MIPS.content" - 1);
BFD_ASSERT (sec != NULL);
- (*hdrpp)->sh_info = elf_section_data (sec)->this_idx;
+ (*hdrpp)->sh_link = elf_section_data (sec)->this_idx;
break;
case SHT_MIPS_SYMBOL_LIB:
@@ -1917,6 +2406,7 @@ _bfd_mips_elf_final_write_processing (abfd, linker)
BFD_ASSERT (sec != NULL);
(*hdrpp)->sh_link = elf_section_data (sec)->this_idx;
break;
+
}
}
}
@@ -1973,11 +2463,14 @@ _bfd_mips_elf_merge_private_bfd_data (ibfd, obfd)
if (ibfd->xvec->byteorder != obfd->xvec->byteorder
&& obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
{
- (*_bfd_error_handler)
- ("%s: compiled for a %s endian system and target is %s endian",
- bfd_get_filename (ibfd),
- bfd_big_endian (ibfd) ? "big" : "little",
- bfd_big_endian (obfd) ? "big" : "little");
+ const char *msg;
+
+ if (bfd_big_endian (ibfd))
+ msg = _("%s: compiled for a big endian system and target is little endian");
+ else
+ msg = _("%s: compiled for a little endian system and target is big endian");
+
+ (*_bfd_error_handler) (msg, bfd_get_filename (ibfd));
bfd_set_error (bfd_error_wrong_format);
return false;
@@ -1995,6 +2488,8 @@ _bfd_mips_elf_merge_private_bfd_data (ibfd, obfd)
{
elf_flags_init (obfd) = true;
elf_elfheader (obfd)->e_flags = new_flags;
+ elf_elfheader (obfd)->e_ident[EI_CLASS]
+ = elf_elfheader (ibfd)->e_ident[EI_CLASS];
if (bfd_get_arch (obfd) == bfd_get_arch (ibfd)
&& bfd_get_arch_info (obfd)->the_default)
@@ -2022,7 +2517,7 @@ _bfd_mips_elf_merge_private_bfd_data (ibfd, obfd)
new_flags &= ~EF_MIPS_PIC;
old_flags &= ~EF_MIPS_PIC;
(*_bfd_error_handler)
- ("%s: linking PIC files with non-PIC files",
+ (_("%s: linking PIC files with non-PIC files"),
bfd_get_filename (ibfd));
ok = false;
}
@@ -2032,39 +2527,83 @@ _bfd_mips_elf_merge_private_bfd_data (ibfd, obfd)
new_flags &= ~EF_MIPS_CPIC;
old_flags &= ~EF_MIPS_CPIC;
(*_bfd_error_handler)
- ("%s: linking abicalls files with non-abicalls files",
+ (_("%s: linking abicalls files with non-abicalls files"),
bfd_get_filename (ibfd));
ok = false;
}
- /* Don't warn about mixing -mips1 and -mips2 code, or mixing -mips3
- and -mips4 code. They will normally use the same data sizes and
- calling conventions. */
- if ((new_flags & EF_MIPS_ARCH) != (old_flags & EF_MIPS_ARCH))
+ /* Compare the ISA's. */
+ if ((new_flags & (EF_MIPS_ARCH | EF_MIPS_MACH))
+ != (old_flags & (EF_MIPS_ARCH | EF_MIPS_MACH)))
{
- int new_isa, old_isa;
+ int new_mach = new_flags & EF_MIPS_MACH;
+ int old_mach = old_flags & EF_MIPS_MACH;
+ int new_isa = elf_mips_isa (new_flags);
+ int old_isa = elf_mips_isa (old_flags);
+
+ /* If either has no machine specified, just compare the general isa's.
+ Some combinations of machines are ok, if the isa's match. */
+ if (! new_mach
+ || ! old_mach
+ || new_mach == old_mach
+ )
+ {
+ /* Don't warn about mixing -mips1 and -mips2 code, or mixing -mips3
+ and -mips4 code. They will normally use the same data sizes and
+ calling conventions. */
+
+ if ((new_isa == 1 || new_isa == 2)
+ ? (old_isa != 1 && old_isa != 2)
+ : (old_isa == 1 || old_isa == 2))
+ {
+ (*_bfd_error_handler)
+ (_("%s: ISA mismatch (-mips%d) with previous modules (-mips%d)"),
+ bfd_get_filename (ibfd), new_isa, old_isa);
+ ok = false;
+ }
+ }
- new_isa = elf_mips_isa (new_flags);
- old_isa = elf_mips_isa (old_flags);
- if ((new_isa == 1 || new_isa == 2)
- ? (old_isa != 1 && old_isa != 2)
- : (old_isa == 1 || old_isa == 2))
+ else
{
(*_bfd_error_handler)
- ("%s: ISA mismatch (-mips%d) with previous modules (-mips%d)",
- bfd_get_filename (ibfd), new_isa, old_isa);
+ (_("%s: ISA mismatch (%d) with previous modules (%d)"),
+ bfd_get_filename (ibfd),
+ elf_mips_mach (new_flags),
+ elf_mips_mach (old_flags));
ok = false;
}
- new_flags &= ~ EF_MIPS_ARCH;
- old_flags &= ~ EF_MIPS_ARCH;
+ new_flags &= ~ (EF_MIPS_ARCH | EF_MIPS_MACH);
+ old_flags &= ~ (EF_MIPS_ARCH | EF_MIPS_MACH);
+ }
+
+ /* Compare ABI's. The 64-bit ABI does not use EF_MIPS_ABI. But, it
+ does set EI_CLASS differently from any 32-bit ABI. */
+ if ((new_flags & EF_MIPS_ABI) != (old_flags & EF_MIPS_ABI)
+ || (elf_elfheader (ibfd)->e_ident[EI_CLASS]
+ != elf_elfheader (obfd)->e_ident[EI_CLASS]))
+ {
+ /* Only error if both are set (to different values). */
+ if (((new_flags & EF_MIPS_ABI) && (old_flags & EF_MIPS_ABI))
+ || (elf_elfheader (ibfd)->e_ident[EI_CLASS]
+ != elf_elfheader (obfd)->e_ident[EI_CLASS]))
+ {
+ (*_bfd_error_handler)
+ (_("%s: ABI mismatch: linking %s module with previous %s modules"),
+ bfd_get_filename (ibfd),
+ elf_mips_abi_name (ibfd),
+ elf_mips_abi_name (obfd));
+ ok = false;
+ }
+ new_flags &= ~EF_MIPS_ABI;
+ old_flags &= ~EF_MIPS_ABI;
}
/* Warn about any other mismatches */
if (new_flags != old_flags)
{
(*_bfd_error_handler)
- ("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)",
+ (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
bfd_get_filename (ibfd), (unsigned long) new_flags,
(unsigned long) old_flags);
ok = false;
@@ -2079,6 +2618,59 @@ _bfd_mips_elf_merge_private_bfd_data (ibfd, obfd)
return true;
}
+boolean
+_bfd_mips_elf_print_private_bfd_data (abfd, ptr)
+ bfd *abfd;
+ PTR ptr;
+{
+ FILE *file = (FILE *) ptr;
+
+ BFD_ASSERT (abfd != NULL && ptr != NULL);
+
+ /* Print normal ELF private data. */
+ _bfd_elf_print_private_bfd_data (abfd, ptr);
+
+ /* xgettext:c-format */
+ fprintf (file, _ ("private flags = %lx:"), elf_elfheader (abfd)->e_flags);
+
+ if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI) == E_MIPS_ABI_O32)
+ fprintf (file, _ (" [abi=O32]"));
+ else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI) == E_MIPS_ABI_O64)
+ fprintf (file, _ (" [abi=O64]"));
+ else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI) == E_MIPS_ABI_EABI32)
+ fprintf (file, _ (" [abi=EABI32]"));
+ else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI) == E_MIPS_ABI_EABI64)
+ fprintf (file, _ (" [abi=EABI64]"));
+ else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI))
+ fprintf (file, _ (" [abi unknown]"));
+ else if (ABI_N32_P (abfd))
+ fprintf (file, _ (" [abi=N32]"));
+ else if (ABI_64_P (abfd))
+ fprintf (file, _ (" [abi=64]"));
+ else
+ fprintf (file, _ (" [no abi set]"));
+
+ if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_1)
+ fprintf (file, _ (" [mips1]"));
+ else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_2)
+ fprintf (file, _ (" [mips2]"));
+ else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_3)
+ fprintf (file, _ (" [mips3]"));
+ else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_4)
+ fprintf (file, _ (" [mips4]"));
+ else
+ fprintf (file, _ (" [unknown ISA]"));
+
+ if (elf_elfheader (abfd)->e_flags & EF_MIPS_32BITMODE)
+ fprintf (file, _ (" [32bitmode]"));
+ else
+ fprintf (file, _ (" [not 32bitmode]"));
+
+ fputc ('\n', file);
+
+ return true;
+}
+
/* Handle a MIPS specific section when reading an object file. This
is called when elfcode.h finds a section with an unknown type.
This routine supports both the 32-bit and 64-bit ELF ABI.
@@ -2090,8 +2682,10 @@ boolean
_bfd_mips_elf_section_from_shdr (abfd, hdr, name)
bfd *abfd;
Elf_Internal_Shdr *hdr;
- const char *name;
+ char *name;
{
+ flagword flags = 0;
+
/* There ought to be a place to keep ELF backend specific flags, but
at the moment there isn't one. We just keep track of the
sections by their name, instead. Fortunately, the ABI gives
@@ -2104,7 +2698,7 @@ _bfd_mips_elf_section_from_shdr (abfd, hdr, name)
return false;
break;
case SHT_MIPS_MSYM:
- if (strcmp (name, ".msym") != 0)
+ if (strcmp (name, MIPS_ELF_MSYM_SECTION_NAME (abfd)) != 0)
return false;
break;
case SHT_MIPS_CONFLICT:
@@ -2122,11 +2716,13 @@ _bfd_mips_elf_section_from_shdr (abfd, hdr, name)
case SHT_MIPS_DEBUG:
if (strcmp (name, ".mdebug") != 0)
return false;
+ flags = SEC_DEBUGGING;
break;
case SHT_MIPS_REGINFO:
if (strcmp (name, ".reginfo") != 0
|| hdr->sh_size != sizeof (Elf32_External_RegInfo))
return false;
+ flags = (SEC_LINK_ONCE | SEC_LINK_DUPLICATES_SAME_SIZE);
break;
case SHT_MIPS_IFACE:
if (strcmp (name, ".MIPS.interfaces") != 0)
@@ -2137,8 +2733,7 @@ _bfd_mips_elf_section_from_shdr (abfd, hdr, name)
return false;
break;
case SHT_MIPS_OPTIONS:
- if (strcmp (name, ".options") != 0
- && strcmp (name, ".MIPS.options") != 0)
+ if (strcmp (name, MIPS_ELF_OPTIONS_SECTION_NAME (abfd)) != 0)
return false;
break;
case SHT_MIPS_DWARF:
@@ -2162,29 +2757,15 @@ _bfd_mips_elf_section_from_shdr (abfd, hdr, name)
if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name))
return false;
- if (hdr->sh_type == SHT_MIPS_DEBUG)
+ if (flags)
{
if (! bfd_set_section_flags (abfd, hdr->bfd_section,
(bfd_get_section_flags (abfd,
hdr->bfd_section)
- | SEC_DEBUGGING)))
+ | flags)))
return false;
}
- return true;
-}
-
-/* Handle a 32-bit MIPS ELF specific section. */
-
-static boolean
-mips_elf32_section_from_shdr (abfd, hdr, name)
- bfd *abfd;
- Elf_Internal_Shdr *hdr;
- char *name;
-{
- if (! _bfd_mips_elf_section_from_shdr (abfd, hdr, name))
- return false;
-
/* FIXME: We should record sh_info for a .gptab section. */
/* For a .reginfo section, set the gp value in the tdata information
@@ -2228,7 +2809,18 @@ mips_elf32_section_from_shdr (abfd, hdr, name)
bfd_mips_elf_swap_options_in (abfd, (Elf_External_Options *) l,
&intopt);
- if (intopt.kind == ODK_REGINFO)
+ if (ABI_64_P (abfd) && intopt.kind == ODK_REGINFO)
+ {
+ Elf64_Internal_RegInfo intreg;
+
+ bfd_mips_elf64_swap_reginfo_in
+ (abfd,
+ ((Elf64_External_RegInfo *)
+ (l + sizeof (Elf_External_Options))),
+ &intreg);
+ elf_gp (abfd) = intreg.ri_gp_value;
+ }
+ else if (intopt.kind == ODK_REGINFO)
{
Elf32_RegInfo intreg;
@@ -2267,12 +2859,6 @@ _bfd_mips_elf_fake_sections (abfd, hdr, sec)
hdr->sh_info = sec->_raw_size / sizeof (Elf32_Lib);
/* The sh_link field is set in final_write_processing. */
}
- else if (strcmp (name, ".msym") == 0)
- {
- hdr->sh_type = SHT_MIPS_MSYM;
- hdr->sh_entsize = 8;
- /* FIXME: Set the sh_info field. */
- }
else if (strcmp (name, ".conflict") == 0)
hdr->sh_type = SHT_MIPS_CONFLICT;
else if (strncmp (name, ".gptab.", sizeof ".gptab." - 1) == 0)
@@ -2302,11 +2888,6 @@ _bfd_mips_elf_fake_sections (abfd, hdr, sec)
hdr->sh_entsize = sizeof (Elf32_External_RegInfo);
else
hdr->sh_entsize = 1;
-
- /* Force the section size to the correct value, even if the
- linker thinks it is larger. The link routine below will only
- write out this much data for .reginfo. */
- hdr->sh_size = sec->_raw_size = sizeof (Elf32_External_RegInfo);
}
else if (SGI_COMPAT (abfd)
&& (strcmp (name, ".hash") == 0
@@ -2314,9 +2895,13 @@ _bfd_mips_elf_fake_sections (abfd, hdr, sec)
|| strcmp (name, ".dynstr") == 0))
{
hdr->sh_entsize = 0;
+#if 0
+ /* This isn't how the Irix 6 linker behaves. */
hdr->sh_info = SIZEOF_MIPS_DYNSYM_SECNAMES;
+#endif
}
else if (strcmp (name, ".got") == 0
+ || strcmp (name, MIPS_ELF_SRDATA_SECTION_NAME (abfd)) == 0
|| strcmp (name, ".sdata") == 0
|| strcmp (name, ".sbss") == 0
|| strcmp (name, ".lit4") == 0
@@ -2327,13 +2912,13 @@ _bfd_mips_elf_fake_sections (abfd, hdr, sec)
hdr->sh_type = SHT_MIPS_IFACE;
hdr->sh_flags |= SHF_MIPS_NOSTRIP;
}
- else if (strcmp (name, ".MIPS.content") == 0)
+ else if (strncmp (name, ".MIPS.content", strlen (".MIPS.content")) == 0)
{
hdr->sh_type = SHT_MIPS_CONTENT;
+ hdr->sh_flags |= SHF_MIPS_NOSTRIP;
/* The sh_info field is set in final_write_processing. */
}
- else if (strcmp (name, ".options") == 0
- || strcmp (name, ".MIPS.options") == 0)
+ else if (strcmp (name, MIPS_ELF_OPTIONS_SECTION_NAME (abfd)) == 0)
{
hdr->sh_type = SHT_MIPS_OPTIONS;
hdr->sh_entsize = 1;
@@ -2355,6 +2940,29 @@ _bfd_mips_elf_fake_sections (abfd, hdr, sec)
hdr->sh_flags |= SHF_MIPS_NOSTRIP;
/* The sh_link field is set in final_write_processing. */
}
+ else if (strcmp (name, MIPS_ELF_MSYM_SECTION_NAME (abfd)) == 0)
+ {
+ hdr->sh_type = SHT_MIPS_MSYM;
+ hdr->sh_flags |= SHF_ALLOC;
+ hdr->sh_entsize = 8;
+ }
+
+ /* The generic elf_fake_sections will set up REL_HDR using the
+ default kind of relocations. But, we may actually need both
+ kinds of relocations, so we set up the second header here. */
+ if ((sec->flags & SEC_RELOC) != 0)
+ {
+ struct bfd_elf_section_data *esd;
+
+ esd = elf_section_data (sec);
+ BFD_ASSERT (esd->rel_hdr2 == NULL);
+ esd->rel_hdr2
+ = (Elf_Internal_Shdr *) bfd_zalloc (abfd, sizeof (Elf_Internal_Shdr));
+ if (!esd->rel_hdr2)
+ return false;
+ _bfd_elf_init_reloc_shdr (abfd, esd->rel_hdr2, sec,
+ !elf_section_data (sec)->use_rela_p);
+ }
return true;
}
@@ -2367,8 +2975,8 @@ _bfd_mips_elf_fake_sections (abfd, hdr, sec)
boolean
_bfd_mips_elf_section_from_bfd_section (abfd, hdr, sec, retval)
- bfd *abfd;
- Elf32_Internal_Shdr *hdr;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ Elf32_Internal_Shdr *hdr ATTRIBUTE_UNUSED;
asection *sec;
int *retval;
{
@@ -2397,8 +3005,7 @@ _bfd_mips_elf_set_section_contents (abfd, section, location, offset, count)
file_ptr offset;
bfd_size_type count;
{
- if (strcmp (section->name, ".options") == 0
- || strcmp (section->name, ".MIPS.options") == 0)
+ if (strcmp (section->name, MIPS_ELF_OPTIONS_SECTION_NAME (abfd)) == 0)
{
bfd_byte *c;
@@ -2441,57 +3048,8 @@ _bfd_mips_elf_section_processing (abfd, hdr)
bfd *abfd;
Elf_Internal_Shdr *hdr;
{
- if (hdr->bfd_section != NULL)
- {
- const char *name = bfd_get_section_name (abfd, hdr->bfd_section);
-
- if (strcmp (name, ".sdata") == 0)
- {
- hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL;
- hdr->sh_type = SHT_PROGBITS;
- }
- else if (strcmp (name, ".sbss") == 0)
- {
- hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL;
- hdr->sh_type = SHT_NOBITS;
- }
- else if (strcmp (name, ".lit8") == 0
- || strcmp (name, ".lit4") == 0)
- {
- hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL;
- hdr->sh_type = SHT_PROGBITS;
- }
- else if (strcmp (name, ".compact_rel") == 0)
- {
- hdr->sh_flags = 0;
- hdr->sh_type = SHT_PROGBITS;
- }
- else if (strcmp (name, ".rtproc") == 0)
- {
- if (hdr->sh_addralign != 0 && hdr->sh_entsize == 0)
- {
- unsigned int adjust;
-
- adjust = hdr->sh_size % hdr->sh_addralign;
- if (adjust != 0)
- hdr->sh_size += hdr->sh_addralign - adjust;
- }
- }
- }
-
- return true;
-}
-
-/* Work over a section just before writing it out. We update the GP
- value in the SHT_MIPS_REGINFO and SHT_MIPS_OPTIONS sections based
- on the value we are using. */
-
-static boolean
-mips_elf32_section_processing (abfd, hdr)
- bfd *abfd;
- Elf32_Internal_Shdr *hdr;
-{
- if (hdr->sh_type == SHT_MIPS_REGINFO)
+ if (hdr->sh_type == SHT_MIPS_REGINFO
+ && hdr->sh_size > 0)
{
bfd_byte buf[4];
@@ -2530,7 +3088,22 @@ mips_elf32_section_processing (abfd, hdr)
bfd_mips_elf_swap_options_in (abfd, (Elf_External_Options *) l,
&intopt);
- if (intopt.kind == ODK_REGINFO)
+ if (ABI_64_P (abfd) && intopt.kind == ODK_REGINFO)
+ {
+ bfd_byte buf[8];
+
+ if (bfd_seek (abfd,
+ (hdr->sh_offset
+ + (l - contents)
+ + sizeof (Elf_External_Options)
+ + (sizeof (Elf64_External_RegInfo) - 8)),
+ SEEK_SET) == -1)
+ return false;
+ bfd_h_put_64 (abfd, elf_gp (abfd), buf);
+ if (bfd_write (buf, 1, 8, abfd) != 8)
+ return false;
+ }
+ else if (intopt.kind == ODK_REGINFO)
{
bfd_byte buf[4];
@@ -2549,8 +3122,48 @@ mips_elf32_section_processing (abfd, hdr)
}
}
- return _bfd_mips_elf_section_processing (abfd, hdr);
+ if (hdr->bfd_section != NULL)
+ {
+ const char *name = bfd_get_section_name (abfd, hdr->bfd_section);
+
+ if (strcmp (name, ".sdata") == 0
+ || strcmp (name, ".lit8") == 0
+ || strcmp (name, ".lit4") == 0)
+ {
+ hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL;
+ hdr->sh_type = SHT_PROGBITS;
+ }
+ else if (strcmp (name, ".sbss") == 0)
+ {
+ hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL;
+ hdr->sh_type = SHT_NOBITS;
+ }
+ else if (strcmp (name, MIPS_ELF_SRDATA_SECTION_NAME (abfd)) == 0)
+ {
+ hdr->sh_flags |= SHF_ALLOC | SHF_MIPS_GPREL;
+ hdr->sh_type = SHT_PROGBITS;
+ }
+ else if (strcmp (name, ".compact_rel") == 0)
+ {
+ hdr->sh_flags = 0;
+ hdr->sh_type = SHT_PROGBITS;
+ }
+ else if (strcmp (name, ".rtproc") == 0)
+ {
+ if (hdr->sh_addralign != 0 && hdr->sh_entsize == 0)
+ {
+ unsigned int adjust;
+
+ adjust = hdr->sh_size % hdr->sh_addralign;
+ if (adjust != 0)
+ hdr->sh_size += hdr->sh_addralign - adjust;
+ }
+ }
+ }
+
+ return true;
}
+
/* MIPS ELF uses two common sections. One is the usual one, and the
other is for small objects. All the small objects are kept
@@ -2617,8 +3230,9 @@ _bfd_mips_elf_symbol_processing (abfd, asym)
case SHN_COMMON:
/* Common symbols less than the GP size are automatically
- treated as SHN_MIPS_SCOMMON symbols. */
- if (asym->value > elf_gp_size (abfd))
+ treated as SHN_MIPS_SCOMMON symbols on IRIX5. */
+ if (asym->value > elf_gp_size (abfd)
+ || IRIX_COMPAT (abfd) == ict_irix6)
break;
/* Fall through. */
case SHN_MIPS_SCOMMON:
@@ -2658,39 +3272,40 @@ _bfd_mips_elf_symbol_processing (abfd, asym)
/* When creating an Irix 5 executable, we need REGINFO and RTPROC
segments. */
-static int
-mips_elf_additional_program_headers (abfd)
+int
+_bfd_mips_elf_additional_program_headers (abfd)
bfd *abfd;
{
asection *s;
- int ret;
-
- ret = 0;
+ int ret = 0;
- if (! SGI_COMPAT (abfd))
- return ret;
+ if (!SGI_COMPAT (abfd))
+ return 0;
+ /* See if we need a PT_MIPS_REGINFO segment. */
s = bfd_get_section_by_name (abfd, ".reginfo");
- if (s != NULL && (s->flags & SEC_LOAD) != 0)
- {
- /* We need a PT_MIPS_REGINFO segment. */
- ++ret;
- }
+ if (s && (s->flags & SEC_LOAD))
+ ++ret;
- if (bfd_get_section_by_name (abfd, ".dynamic") != NULL
- && bfd_get_section_by_name (abfd, ".mdebug") != NULL)
- {
- /* We need a PT_MIPS_RTPROC segment. */
- ++ret;
- }
+ /* See if we need a PT_MIPS_OPTIONS segment. */
+ if (IRIX_COMPAT (abfd) == ict_irix6
+ && bfd_get_section_by_name (abfd,
+ MIPS_ELF_OPTIONS_SECTION_NAME (abfd)))
+ ++ret;
+
+ /* See if we need a PT_MIPS_RTPROC segment. */
+ if (IRIX_COMPAT (abfd) == ict_irix5
+ && bfd_get_section_by_name (abfd, ".dynamic")
+ && bfd_get_section_by_name (abfd, ".mdebug"))
+ ++ret;
return ret;
}
/* Modify the segment map for an Irix 5 executable. */
-static boolean
-mips_elf_modify_segment_map (abfd)
+boolean
+_bfd_mips_elf_modify_segment_map (abfd)
bfd *abfd;
{
asection *s;
@@ -2729,114 +3344,156 @@ mips_elf_modify_segment_map (abfd)
}
}
- /* If there are .dynamic and .mdebug sections, we make a room for
- the RTPROC header. FIXME: Rewrite without section names. */
- if (bfd_get_section_by_name (abfd, ".interp") == NULL
- && bfd_get_section_by_name (abfd, ".dynamic") != NULL
- && bfd_get_section_by_name (abfd, ".mdebug") != NULL)
+ /* For IRIX 6, we don't have .mdebug sections, nor does anything but
+ .dynamic end up in PT_DYNAMIC. However, we do have to insert a
+ PT_OPTIONS segement immediately following the program header
+ table. */
+ if (IRIX_COMPAT (abfd) == ict_irix6)
{
- for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next)
- if (m->p_type == PT_MIPS_RTPROC)
+ asection *s;
+
+ for (s = abfd->sections; s; s = s->next)
+ if (elf_section_data (s)->this_hdr.sh_type == SHT_MIPS_OPTIONS)
break;
- if (m == NULL)
+
+ if (s)
{
- m = (struct elf_segment_map *) bfd_zalloc (abfd, sizeof *m);
+ struct elf_segment_map *options_segment;
+
+ /* Usually, there's a program header table. But, sometimes
+ there's not (like when running the `ld' testsuite). So,
+ if there's no program header table, we just put the
+ options segement at the end. */
+ for (pm = &elf_tdata (abfd)->segment_map;
+ *pm != NULL;
+ pm = &(*pm)->next)
+ if ((*pm)->p_type == PT_PHDR)
+ break;
+
+ options_segment = bfd_zalloc (abfd,
+ sizeof (struct elf_segment_map));
+ options_segment->next = *pm;
+ options_segment->p_type = PT_MIPS_OPTIONS;
+ options_segment->p_flags = PF_R;
+ options_segment->p_flags_valid = true;
+ options_segment->count = 1;
+ options_segment->sections[0] = s;
+ *pm = options_segment;
+ }
+ }
+ else
+ {
+ /* If there are .dynamic and .mdebug sections, we make a room
+ for the RTPROC header. FIXME: Rewrite without section names. */
+ if (bfd_get_section_by_name (abfd, ".interp") == NULL
+ && bfd_get_section_by_name (abfd, ".dynamic") != NULL
+ && bfd_get_section_by_name (abfd, ".mdebug") != NULL)
+ {
+ for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next)
+ if (m->p_type == PT_MIPS_RTPROC)
+ break;
if (m == NULL)
- return false;
+ {
+ m = (struct elf_segment_map *) bfd_zalloc (abfd, sizeof *m);
+ if (m == NULL)
+ return false;
- m->p_type = PT_MIPS_RTPROC;
+ m->p_type = PT_MIPS_RTPROC;
- s = bfd_get_section_by_name (abfd, ".rtproc");
- if (s == NULL)
- {
- m->count = 0;
- m->p_flags = 0;
- m->p_flags_valid = 1;
- }
- else
- {
- m->count = 1;
- m->sections[0] = s;
- }
+ s = bfd_get_section_by_name (abfd, ".rtproc");
+ if (s == NULL)
+ {
+ m->count = 0;
+ m->p_flags = 0;
+ m->p_flags_valid = 1;
+ }
+ else
+ {
+ m->count = 1;
+ m->sections[0] = s;
+ }
- /* We want to put it after the DYNAMIC segment. */
- pm = &elf_tdata (abfd)->segment_map;
- while (*pm != NULL && (*pm)->p_type != PT_DYNAMIC)
- pm = &(*pm)->next;
- if (*pm != NULL)
- pm = &(*pm)->next;
+ /* We want to put it after the DYNAMIC segment. */
+ pm = &elf_tdata (abfd)->segment_map;
+ while (*pm != NULL && (*pm)->p_type != PT_DYNAMIC)
+ pm = &(*pm)->next;
+ if (*pm != NULL)
+ pm = &(*pm)->next;
- m->next = *pm;
- *pm = m;
+ m->next = *pm;
+ *pm = m;
+ }
}
- }
- /* On Irix 5, the PT_DYNAMIC segment includes the .dynamic, .dynstr,
- .dynsym, and .hash sections, and everything in between. */
- for (pm = &elf_tdata (abfd)->segment_map; *pm != NULL; pm = &(*pm)->next)
- if ((*pm)->p_type == PT_DYNAMIC)
- break;
- m = *pm;
- if (m != NULL
- && m->count == 1
- && strcmp (m->sections[0]->name, ".dynamic") == 0)
- {
- static const char *sec_names[] =
- { ".dynamic", ".dynstr", ".dynsym", ".hash" };
- bfd_vma low, high;
- unsigned int i, c;
- struct elf_segment_map *n;
-
- low = 0xffffffff;
- high = 0;
- for (i = 0; i < sizeof sec_names / sizeof sec_names[0]; i++)
+ /* On Irix 5, the PT_DYNAMIC segment includes the .dynamic,
+ .dynstr, .dynsym, and .hash sections, and everything in
+ between. */
+ for (pm = &elf_tdata (abfd)->segment_map; *pm != NULL; pm = &(*pm)->next)
+ if ((*pm)->p_type == PT_DYNAMIC)
+ break;
+ m = *pm;
+ if (m != NULL
+ && m->count == 1
+ && strcmp (m->sections[0]->name, ".dynamic") == 0)
{
- s = bfd_get_section_by_name (abfd, sec_names[i]);
- if (s != NULL && (s->flags & SEC_LOAD) != 0)
+ static const char *sec_names[] =
+ { ".dynamic", ".dynstr", ".dynsym", ".hash" };
+ bfd_vma low, high;
+ unsigned int i, c;
+ struct elf_segment_map *n;
+
+ low = 0xffffffff;
+ high = 0;
+ for (i = 0; i < sizeof sec_names / sizeof sec_names[0]; i++)
{
- bfd_size_type sz;
-
- if (low > s->vma)
- low = s->vma;
- sz = s->_cooked_size;
- if (sz == 0)
- sz = s->_raw_size;
- if (high < s->vma + sz)
- high = s->vma + sz;
+ s = bfd_get_section_by_name (abfd, sec_names[i]);
+ if (s != NULL && (s->flags & SEC_LOAD) != 0)
+ {
+ bfd_size_type sz;
+
+ if (low > s->vma)
+ low = s->vma;
+ sz = s->_cooked_size;
+ if (sz == 0)
+ sz = s->_raw_size;
+ if (high < s->vma + sz)
+ high = s->vma + sz;
+ }
}
- }
- c = 0;
- for (s = abfd->sections; s != NULL; s = s->next)
- if ((s->flags & SEC_LOAD) != 0
- && s->vma >= low
- && ((s->vma
- + (s->_cooked_size != 0 ? s->_cooked_size : s->_raw_size))
- <= high))
- ++c;
-
- n = ((struct elf_segment_map *)
- bfd_zalloc (abfd, sizeof *n + (c - 1) * sizeof (asection *)));
- if (n == NULL)
- return false;
- *n = *m;
- n->count = c;
+ c = 0;
+ for (s = abfd->sections; s != NULL; s = s->next)
+ if ((s->flags & SEC_LOAD) != 0
+ && s->vma >= low
+ && ((s->vma
+ + (s->_cooked_size != 0 ? s->_cooked_size : s->_raw_size))
+ <= high))
+ ++c;
+
+ n = ((struct elf_segment_map *)
+ bfd_zalloc (abfd, sizeof *n + (c - 1) * sizeof (asection *)));
+ if (n == NULL)
+ return false;
+ *n = *m;
+ n->count = c;
- i = 0;
- for (s = abfd->sections; s != NULL; s = s->next)
- {
- if ((s->flags & SEC_LOAD) != 0
- && s->vma >= low
- && ((s->vma
- + (s->_cooked_size != 0 ? s->_cooked_size : s->_raw_size))
- <= high))
+ i = 0;
+ for (s = abfd->sections; s != NULL; s = s->next)
{
- n->sections[i] = s;
- ++i;
+ if ((s->flags & SEC_LOAD) != 0
+ && s->vma >= low
+ && ((s->vma
+ + (s->_cooked_size != 0 ?
+ s->_cooked_size : s->_raw_size))
+ <= high))
+ {
+ n->sections[i] = s;
+ ++i;
+ }
}
- }
- *pm = n;
+ *pm = n;
+ }
}
return true;
@@ -2903,6 +3560,7 @@ _bfd_mips_elf_read_ecoff_info (abfd, section, debug)
char *ext_hdr = NULL;
swap = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap;
+ memset (debug, 0, sizeof(*debug));
ext_hdr = (char *) bfd_malloc ((size_t) swap->external_hdr_size);
if (ext_hdr == NULL && swap->external_hdr_size != 0)
@@ -3017,11 +3675,17 @@ _bfd_mips_elf_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
{
asection *msec;
- if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
- filename_ptr, functionname_ptr,
+ if (_bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset,
+ filename_ptr, functionname_ptr,
line_ptr))
return true;
+ if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
+ filename_ptr, functionname_ptr,
+ line_ptr,
+ ABI_64_P (abfd) ? 8 : 0))
+ return true;
+
msec = bfd_get_section_by_name (abfd, ".mdebug");
if (msec != NULL)
{
@@ -3143,43 +3807,16 @@ _bfd_mips_elf_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
#define CALL_STUB ".mips16.call."
#define CALL_FP_STUB ".mips16.call.fp."
-/* The MIPS ELF linker needs additional information for each symbol in
- the global hash table. */
-
-struct mips_elf_link_hash_entry
-{
- struct elf_link_hash_entry root;
-
- /* External symbol information. */
- EXTR esym;
-
- /* Number of MIPS_32 or MIPS_REL32 relocs against this symbol. */
- unsigned int mips_32_relocs;
-
- /* If there is a stub that 32 bit functions should use to call this
- 16 bit function, this points to the section containing the stub. */
- asection *fn_stub;
-
- /* Whether we need the fn_stub; this is set if this symbol appears
- in any relocs other than a 16 bit call. */
- boolean need_fn_stub;
-
- /* If there is a stub that 16 bit functions should use to call this
- 32 bit function, this points to the section containing the stub. */
- asection *call_stub;
-
- /* This is like the call_stub field, but it is used if the function
- being called returns a floating point value. */
- asection *call_fp_stub;
-};
-
/* MIPS ELF linker hash table. */
struct mips_elf_link_hash_table
{
struct elf_link_hash_table root;
+#if 0
+ /* We no longer use this. */
/* String section indices for the dynamic section symbols. */
bfd_size_type dynsym_sec_strindex[SIZEOF_MIPS_DYNSYM_SECNAMES];
+#endif
/* The number of .rtproc entries. */
bfd_size_type procedure_count;
/* The size of the .compact_rel section (if SGI_COMPAT). */
@@ -3247,7 +3884,8 @@ mips_elf_link_hash_newfunc (entry, table, string)
/* We use -2 as a marker to indicate that the information has
not been set. -1 means there is no associated ifd. */
ret->esym.ifd = -2;
- ret->mips_32_relocs = 0;
+ ret->possibly_dynamic_relocs = 0;
+ ret->min_dyn_reloc_index = 0;
ret->fn_stub = NULL;
ret->need_fn_stub = false;
ret->call_stub = NULL;
@@ -3259,12 +3897,11 @@ mips_elf_link_hash_newfunc (entry, table, string)
/* Create a MIPS ELF linker hash table. */
-static struct bfd_link_hash_table *
-mips_elf_link_hash_table_create (abfd)
+struct bfd_link_hash_table *
+_bfd_mips_elf_link_hash_table_create (abfd)
bfd *abfd;
{
struct mips_elf_link_hash_table *ret;
- unsigned int i;
ret = ((struct mips_elf_link_hash_table *)
bfd_alloc (abfd, sizeof (struct mips_elf_link_hash_table)));
@@ -3278,8 +3915,11 @@ mips_elf_link_hash_table_create (abfd)
return NULL;
}
+#if 0
+ /* We no longer use this. */
for (i = 0; i < SIZEOF_MIPS_DYNSYM_SECNAMES; i++)
ret->dynsym_sec_strindex[i] = (bfd_size_type) -1;
+#endif
ret->procedure_count = 0;
ret->compact_rel_size = 0;
ret->use_rld_obj_head = false;
@@ -3293,13 +3933,13 @@ mips_elf_link_hash_table_create (abfd)
file. We must handle the special MIPS section numbers here. */
/*ARGSUSED*/
-static boolean
-mips_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
+boolean
+_bfd_mips_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
bfd *abfd;
struct bfd_link_info *info;
const Elf_Internal_Sym *sym;
const char **namep;
- flagword *flagsp;
+ flagword *flagsp ATTRIBUTE_UNUSED;
asection **secp;
bfd_vma *valp;
{
@@ -3317,7 +3957,8 @@ mips_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
case SHN_COMMON:
/* Common symbols less than the GP size are automatically
treated as SHN_MIPS_SCOMMON symbols. */
- if (sym->st_size > elf_gp_size (abfd))
+ if (sym->st_size > elf_gp_size (abfd)
+ || IRIX_COMPAT (abfd) == ict_irix6)
break;
/* Fall through. */
case SHN_MIPS_SCOMMON:
@@ -3337,7 +3978,7 @@ mips_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
mips_elf_text_section.symbol = &mips_elf_text_symbol;
mips_elf_text_section.symbol_ptr_ptr = &mips_elf_text_symbol_ptr;
mips_elf_text_symbol.name = ".text";
- mips_elf_text_symbol.flags = BSF_SECTION_SYM;
+ mips_elf_text_symbol.flags = BSF_SECTION_SYM | BSF_DYNAMIC;
mips_elf_text_symbol.section = &mips_elf_text_section;
mips_elf_text_symbol_ptr = &mips_elf_text_symbol;
mips_elf_text_section_ptr = &mips_elf_text_section;
@@ -3361,7 +4002,7 @@ mips_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
mips_elf_data_section.symbol = &mips_elf_data_symbol;
mips_elf_data_section.symbol_ptr_ptr = &mips_elf_data_symbol_ptr;
mips_elf_data_symbol.name = ".data";
- mips_elf_data_symbol.flags = BSF_SECTION_SYM;
+ mips_elf_data_symbol.flags = BSF_SECTION_SYM | BSF_DYNAMIC;
mips_elf_data_symbol.section = &mips_elf_data_section;
mips_elf_data_symbol_ptr = &mips_elf_data_symbol;
mips_elf_data_section_ptr = &mips_elf_data_section;
@@ -3580,7 +4221,7 @@ mips_elf_output_extsym (h, data)
{
output_section = sec->output_section;
if (output_section != NULL)
- h->esym.asym.value = (h->root.plt_offset
+ h->esym.asym.value = (h->root.plt.offset
+ sec->output_offset
+ output_section->vma);
else
@@ -3626,7 +4267,7 @@ mips_elf_create_procedure_table (handle, abfd, info, s, debug)
unsigned long i;
PDR pdr;
SYMR sym;
- const char *no_name_func = "static procedure (no name)";
+ const char *no_name_func = _("static procedure (no name)");
epdr = NULL;
rpdr = NULL;
@@ -3770,8 +4411,8 @@ gptab_compare (p1, p2)
the .mdebug sections. We need to merge all instances of these
sections together, not write them all out sequentially. */
-static boolean
-mips_elf_final_link (abfd, info)
+boolean
+_bfd_mips_elf_final_link (abfd, info)
bfd *abfd;
struct bfd_link_info *info;
{
@@ -3787,22 +4428,69 @@ mips_elf_final_link (abfd, info)
HDRR *symhdr = &debug.symbolic_header;
PTR mdebug_handle = NULL;
- /* Drop the .options section, since it has special semantics which I
- haven't bothered to figure out. */
- for (secpp = &abfd->sections; *secpp != NULL; secpp = &(*secpp)->next)
+ /* If all the things we linked together were PIC, but we're
+ producing an executable (rather than a shared object), then the
+ resulting file is CPIC (i.e., it calls PIC code.) */
+ if (!info->shared
+ && !info->relocateable
+ && elf_elfheader (abfd)->e_flags & EF_MIPS_PIC)
{
- if (strcmp ((*secpp)->name, ".options") == 0)
- {
- for (p = (*secpp)->link_order_head; p != NULL; p = p->next)
- if (p->type == bfd_indirect_link_order)
- p->u.indirect.section->flags &=~ SEC_HAS_CONTENTS;
- (*secpp)->link_order_head = NULL;
- *secpp = (*secpp)->next;
- --abfd->section_count;
- break;
- }
+ elf_elfheader (abfd)->e_flags &= ~EF_MIPS_PIC;
+ elf_elfheader (abfd)->e_flags |= EF_MIPS_CPIC;
}
+ /* We'd carefully arranged the dynamic symbol indices, and then the
+ generic size_dynamic_sections renumbered them out from under us.
+ Rather than trying somehow to prevent the renumbering, just do
+ the sort again. */
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ bfd *dynobj;
+ asection *got;
+ struct mips_got_info *g;
+
+ /* When we resort, we must tell mips_elf_sort_hash_table what
+ the lowest index it may use is. That's the number of section
+ symbols we're going to add. The generic ELF linker only
+ adds these symbols when building a shared object. Note that
+ we count the sections after (possibly) removing the .options
+ section above. */
+ if (!mips_elf_sort_hash_table (info, (info->shared
+ ? bfd_count_sections (abfd) + 1
+ : 1)))
+ return false;
+
+ /* Make sure we didn't grow the global .got region. */
+ dynobj = elf_hash_table (info)->dynobj;
+ got = bfd_get_section_by_name (dynobj, ".got");
+ g = (struct mips_got_info *) elf_section_data (got)->tdata;
+
+ if (g->global_gotsym != NULL)
+ BFD_ASSERT ((elf_hash_table (info)->dynsymcount
+ - g->global_gotsym->dynindx)
+ <= g->global_gotno);
+ }
+
+ /* On IRIX5, we omit the .options section. On IRIX6, however, we
+ include it, even though we don't process it quite right. (Some
+ entries are supposed to be merged.) Empirically, we seem to be
+ better off including it then not. */
+ if (IRIX_COMPAT (abfd) == ict_irix5)
+ for (secpp = &abfd->sections; *secpp != NULL; secpp = &(*secpp)->next)
+ {
+ if (strcmp ((*secpp)->name, MIPS_ELF_OPTIONS_SECTION_NAME (abfd)) == 0)
+ {
+ for (p = (*secpp)->link_order_head; p != NULL; p = p->next)
+ if (p->type == bfd_indirect_link_order)
+ p->u.indirect.section->flags &=~ SEC_HAS_CONTENTS;
+ (*secpp)->link_order_head = NULL;
+ *secpp = (*secpp)->next;
+ --abfd->section_count;
+
+ break;
+ }
+ }
+
/* Get a value for the GP register. */
if (elf_gp (abfd) == 0)
{
@@ -3818,17 +4506,14 @@ mips_elf_final_link (abfd, info)
{
bfd_vma lo;
- /* Make up a value. */
+ /* Find the GP-relative section with the lowest offset. */
lo = (bfd_vma) -1;
for (o = abfd->sections; o != (asection *) NULL; o = o->next)
- {
- if (o->vma < lo
- && (strcmp (o->name, ".sbss") == 0
- || strcmp (o->name, ".sdata") == 0
- || strcmp (o->name, ".lit4") == 0
- || strcmp (o->name, ".lit8") == 0))
- lo = o->vma;
- }
+ if (o->vma < lo
+ && (elf_section_data (o)->this_hdr.sh_flags & SHF_MIPS_GPREL))
+ lo = o->vma;
+
+ /* And calculate GP relative to that. */
elf_gp (abfd) = lo + ELF_MIPS_GP_OFFSET (abfd);
}
else
@@ -3901,8 +4586,8 @@ mips_elf_final_link (abfd, info)
input_section->flags &=~ SEC_HAS_CONTENTS;
}
- /* Force the section size to the value we want. */
- o->_raw_size = sizeof (Elf32_External_RegInfo);
+ /* Size has been set in mips_elf_always_size_sections */
+ BFD_ASSERT(o->_raw_size == sizeof (Elf32_External_RegInfo));
/* Skip this section later on (I don't think this currently
matters, but someday it might). */
@@ -4199,7 +4884,7 @@ mips_elf_final_link (abfd, info)
else
{
(*_bfd_error_handler)
- ("%s: illegal section name `%s'",
+ (_("%s: illegal section name `%s'"),
bfd_get_filename (abfd), o->name);
bfd_set_error (bfd_error_nonrepresentable_section);
return false;
@@ -4361,7 +5046,17 @@ mips_elf_final_link (abfd, info)
}
/* Invoke the regular ELF backend linker to do all the work. */
- if (! bfd_elf32_bfd_final_link (abfd, info))
+ if (ABI_64_P (abfd))
+ {
+#ifdef BFD64
+ if (!bfd_elf64_bfd_final_link (abfd, info))
+ return false;
+#else
+ abort ();
+ return false;
+#endif /* BFD64 */
+ }
+ else if (!bfd_elf32_bfd_final_link (abfd, info))
return false;
/* Now write out the computed sections. */
@@ -4421,1001 +5116,1782 @@ mips_elf_final_link (abfd, info)
return true;
}
-/* Handle a MIPS ELF HI16 reloc. */
+/* Returns the GOT section for ABFD. */
-static void
-mips_elf_relocate_hi16 (input_bfd, relhi, rello, contents, addend)
- bfd *input_bfd;
- Elf_Internal_Rela *relhi;
- Elf_Internal_Rela *rello;
- bfd_byte *contents;
- bfd_vma addend;
+static asection *
+mips_elf_got_section (abfd)
+ bfd *abfd;
{
- bfd_vma insn;
- bfd_vma addlo;
+ return bfd_get_section_by_name (abfd, ".got");
+}
- insn = bfd_get_32 (input_bfd, contents + relhi->r_offset);
+/* Returns the GOT information associated with the link indicated by
+ INFO. If SGOTP is non-NULL, it is filled in with the GOT
+ section. */
+
+static struct mips_got_info *
+mips_elf_got_info (abfd, sgotp)
+ bfd *abfd;
+ asection **sgotp;
+{
+ asection *sgot;
+ struct mips_got_info *g;
- addlo = bfd_get_32 (input_bfd, contents + rello->r_offset);
- addlo &= 0xffff;
+ sgot = mips_elf_got_section (abfd);
+ BFD_ASSERT (sgot != NULL);
+ BFD_ASSERT (elf_section_data (sgot) != NULL);
+ g = (struct mips_got_info *) elf_section_data (sgot)->tdata;
+ BFD_ASSERT (g != NULL);
- addend += ((insn & 0xffff) << 16) + addlo;
+ if (sgotp)
+ *sgotp = sgot;
+ return g;
+}
- if ((addlo & 0x8000) != 0)
- addend -= 0x10000;
- if ((addend & 0x8000) != 0)
- addend += 0x10000;
+/* Return whether a relocation is against a local symbol. */
- bfd_put_32 (input_bfd,
- (insn & 0xffff0000) | ((addend >> 16) & 0xffff),
- contents + relhi->r_offset);
+static boolean
+mips_elf_local_relocation_p (input_bfd, relocation, local_sections)
+ bfd *input_bfd;
+ const Elf_Internal_Rela *relocation;
+ asection **local_sections;
+{
+ unsigned long r_symndx;
+ Elf_Internal_Shdr *symtab_hdr;
+
+ r_symndx = ELF32_R_SYM (relocation->r_info);
+ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+ if (! elf_bad_symtab (input_bfd))
+ return r_symndx < symtab_hdr->sh_info;
+ else
+ {
+ /* The symbol table does not follow the rule that local symbols
+ must come before globals. */
+ return local_sections[r_symndx] != NULL;
+ }
}
-/* Handle a MIPS ELF local GOT16 reloc. */
+/* Sign-extend VALUE, which has the indicated number of BITS. */
+
+static bfd_vma
+mips_elf_sign_extend (value, bits)
+ bfd_vma value;
+ int bits;
+{
+ if (value & ((bfd_vma)1 << (bits - 1)))
+ /* VALUE is negative. */
+ value |= ((bfd_vma) - 1) << bits;
+
+ return value;
+}
+
+/* Return non-zero if the indicated VALUE has overflowed the maximum
+ range expressable by a signed number with the indicated number of
+ BITS. */
static boolean
-mips_elf_relocate_got_local (output_bfd, input_bfd, sgot, relhi, rello,
- contents, addend)
+mips_elf_overflow_p (value, bits)
+ bfd_vma value;
+ int bits;
+{
+ bfd_signed_vma svalue = (bfd_signed_vma) value;
+
+ if (svalue > (1 << (bits - 1)) - 1)
+ /* The value is too big. */
+ return true;
+ else if (svalue < -(1 << (bits - 1)))
+ /* The value is too small. */
+ return true;
+
+ /* All is well. */
+ return false;
+}
+
+/* Calculate the %high function. */
+
+static bfd_vma
+mips_elf_high (value)
+ bfd_vma value;
+{
+ return ((value + (bfd_vma) 0x8000) >> 16) & 0xffff;
+}
+
+/* Calculate the %higher function. */
+
+static bfd_vma
+mips_elf_higher (value)
+ bfd_vma value ATTRIBUTE_UNUSED;
+{
+#ifdef BFD64
+ return ((value + (bfd_vma) 0x80008000) >> 32) & 0xffff;
+#else
+ abort ();
+ return (bfd_vma) -1;
+#endif
+}
+
+/* Calculate the %highest function. */
+
+static bfd_vma
+mips_elf_highest (value)
+ bfd_vma value ATTRIBUTE_UNUSED;
+{
+#ifdef BFD64
+ return ((value + (bfd_vma) 0x800080008000) >> 48) & 0xffff;
+#else
+ abort ();
+ return (bfd_vma) -1;
+#endif
+}
+
+/* Returns the GOT index for the global symbol indicated by H. */
+
+static bfd_vma
+mips_elf_global_got_index (abfd, h)
+ bfd *abfd;
+ struct elf_link_hash_entry *h;
+{
+ bfd_vma index;
+ asection *sgot;
+ struct mips_got_info *g;
+
+ g = mips_elf_got_info (abfd, &sgot);
+
+ /* Once we determine the global GOT entry with the lowest dynamic
+ symbol table index, we must put all dynamic symbols with greater
+ indices into the GOT. That makes it easy to calculate the GOT
+ offset. */
+ BFD_ASSERT (h->dynindx >= g->global_gotsym->dynindx);
+ index = ((h->dynindx - g->global_gotsym->dynindx + g->local_gotno)
+ * MIPS_ELF_GOT_SIZE (abfd));
+ BFD_ASSERT (index < sgot->_raw_size);
+
+ return index;
+}
+
+/* Returns the offset for the entry at the INDEXth position
+ in the GOT. */
+
+static bfd_vma
+mips_elf_got_offset_from_index (dynobj, output_bfd, index)
+ bfd *dynobj;
bfd *output_bfd;
- bfd *input_bfd;
- asection *sgot;
- Elf_Internal_Rela *relhi;
- Elf_Internal_Rela *rello;
- bfd_byte *contents;
- bfd_vma addend;
+ bfd_vma index;
{
- unsigned int assigned_gotno;
- unsigned int i;
- bfd_vma insn;
- bfd_vma addlo;
- bfd_vma address;
- bfd_vma hipage;
- bfd_byte *got_contents;
+ asection *sgot;
+ bfd_vma gp;
+
+ sgot = mips_elf_got_section (dynobj);
+ gp = _bfd_get_gp_value (output_bfd);
+ return (sgot->output_section->vma + sgot->output_offset + index -
+ gp);
+}
+
+/* If H is a symbol that needs a global GOT entry, but has a dynamic
+ symbol table index lower than any we've seen to date, record it for
+ posterity. */
+
+static boolean
+mips_elf_record_global_got_symbol (h, info, g)
+ struct elf_link_hash_entry *h;
+ struct bfd_link_info *info;
+ struct mips_got_info *g ATTRIBUTE_UNUSED;
+{
+ /* A global symbol in the GOT must also be in the dynamic symbol
+ table. */
+ if (h->dynindx == -1
+ && !bfd_elf32_link_record_dynamic_symbol (info, h))
+ return false;
+
+ /* If we've already marked this entry as need GOT space, we don't
+ need to do it again. */
+ if (h->got.offset != (bfd_vma) - 1)
+ return true;
+
+ /* By setting this to a value other than -1, we are indicating that
+ there needs to be a GOT entry for H. */
+ h->got.offset = 0;
+
+ return true;
+}
+
+/* This structure is passed to mips_elf_sort_hash_table_f when sorting
+ the dynamic symbols. */
+
+struct mips_elf_hash_sort_data
+{
+ /* The symbol in the global GOT with the lowest dynamic symbol table
+ index. */
+ struct elf_link_hash_entry *low;
+ /* The least dynamic symbol table index corresponding to a symbol
+ with a GOT entry. */
+ long min_got_dynindx;
+ /* The greatest dynamic symbol table index not corresponding to a
+ symbol without a GOT entry. */
+ long max_non_got_dynindx;
+};
+
+/* If H needs a GOT entry, assign it the highest available dynamic
+ index. Otherwise, assign it the lowest available dynamic
+ index. */
+
+static boolean
+mips_elf_sort_hash_table_f (h, data)
+ struct mips_elf_link_hash_entry *h;
+ PTR data;
+{
+ struct mips_elf_hash_sort_data *hsd
+ = (struct mips_elf_hash_sort_data *) data;
+
+ /* Symbols without dynamic symbol table entries aren't interesting
+ at all. */
+ if (h->root.dynindx == -1)
+ return true;
+
+ if (h->root.got.offset != 0)
+ h->root.dynindx = hsd->max_non_got_dynindx++;
+ else
+ {
+ h->root.dynindx = --hsd->min_got_dynindx;
+ hsd->low = (struct elf_link_hash_entry *) h;
+ }
+
+ return true;
+}
+
+/* Sort the dynamic symbol table so that symbols that need GOT entries
+ appear towards the end. This reduces the amount of GOT space
+ required. MAX_LOCAL is used to set the number of local symbols
+ known to be in the dynamic symbol table. During
+ mips_elf_size_dynamic_sections, this value is 1. Afterward, the
+ section symbols are added and the count is higher. */
+
+static boolean
+mips_elf_sort_hash_table (info, max_local)
+ struct bfd_link_info *info;
+ unsigned long max_local;
+{
+ struct mips_elf_hash_sort_data hsd;
struct mips_got_info *g;
+ bfd *dynobj;
- insn = bfd_get_32 (input_bfd, contents + relhi->r_offset);
+ dynobj = elf_hash_table (info)->dynobj;
- addlo = bfd_get_32 (input_bfd, contents + rello->r_offset);
- addlo &= 0xffff;
+ hsd.low = NULL;
+ hsd.min_got_dynindx = elf_hash_table (info)->dynsymcount;
+ hsd.max_non_got_dynindx = max_local;
+ mips_elf_link_hash_traverse (((struct mips_elf_link_hash_table *)
+ elf_hash_table (info)),
+ mips_elf_sort_hash_table_f,
+ &hsd);
- addend += ((insn & 0xffff) << 16) + addlo;
+ /* There shoud have been enough room in the symbol table to
+ accomodate both the GOT and non-GOT symbols. */
+ BFD_ASSERT (hsd.min_got_dynindx == hsd.max_non_got_dynindx);
- if ((addlo & 0x8000) != 0)
- addend -= 0x10000;
- if ((addend & 0x8000) != 0)
- addend += 0x10000;
+ /* Now we know which dynamic symbol has the lowest dynamic symbol
+ table index in the GOT. */
+ g = mips_elf_got_info (dynobj, NULL);
+ g->global_gotsym = hsd.low;
- /* Get a got entry representing requested hipage. */
- BFD_ASSERT (elf_section_data (sgot) != NULL);
- g = (struct mips_got_info *) elf_section_data (sgot)->tdata;
- BFD_ASSERT (g != NULL);
+ return true;
+}
- assigned_gotno = g->assigned_gotno;
- got_contents = sgot->contents;
- hipage = addend & 0xffff0000;
+/* Create a local GOT entry for VALUE. Return the index of the entry,
+ or -1 if it could not be created. */
- for (i = MIPS_RESERVED_GOTNO; i < assigned_gotno; i++)
+static bfd_vma
+mips_elf_create_local_got_entry (abfd, g, sgot, value)
+ bfd *abfd;
+ struct mips_got_info *g;
+ asection *sgot;
+ bfd_vma value;
+{
+ if (g->assigned_gotno >= g->local_gotno)
{
- address = bfd_get_32 (input_bfd, got_contents + i * 4);
- if (hipage == (address & 0xffff0000))
- break;
+ /* We didn't allocate enough space in the GOT. */
+ (*_bfd_error_handler)
+ (_("not enough GOT space for local GOT entries"));
+ bfd_set_error (bfd_error_bad_value);
+ return (bfd_vma) -1;
}
- if (i == assigned_gotno)
+ MIPS_ELF_PUT_WORD (abfd, value,
+ (sgot->contents
+ + MIPS_ELF_GOT_SIZE (abfd) * g->assigned_gotno));
+ return MIPS_ELF_GOT_SIZE (abfd) * g->assigned_gotno++;
+}
+
+/* Returns the GOT offset at which the indicated address can be found.
+ If there is not yet a GOT entry for this value, create one. Returns
+ -1 if no satisfactory GOT offset can be found. */
+
+static bfd_vma
+mips_elf_local_got_index (abfd, info, value)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ bfd_vma value;
+{
+ asection *sgot;
+ struct mips_got_info *g;
+ bfd_byte *entry;
+
+ g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot);
+
+ /* Look to see if we already have an appropriate entry. */
+ for (entry = (sgot->contents
+ + MIPS_ELF_GOT_SIZE (abfd) * MIPS_RESERVED_GOTNO);
+ entry != sgot->contents + MIPS_ELF_GOT_SIZE (abfd) * g->assigned_gotno;
+ entry += MIPS_ELF_GOT_SIZE (abfd))
{
- if (assigned_gotno >= g->local_gotno)
+ bfd_vma address = MIPS_ELF_GET_WORD (abfd, entry);
+ if (address == value)
+ return entry - sgot->contents;
+ }
+
+ return mips_elf_create_local_got_entry (abfd, g, sgot, value);
+}
+
+/* Find a GOT entry that is within 32KB of the VALUE. These entries
+ are supposed to be placed at small offsets in the GOT, i.e.,
+ within 32KB of GP. Return the index into the GOT for this page,
+ and store the offset from this entry to the desired address in
+ OFFSETP, if it is non-NULL. */
+
+static bfd_vma
+mips_elf_got_page (abfd, info, value, offsetp)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ bfd_vma value;
+ bfd_vma *offsetp;
+{
+ asection *sgot;
+ struct mips_got_info *g;
+ bfd_byte *entry;
+ bfd_byte *last_entry;
+ bfd_vma index = 0;
+ bfd_vma address;
+
+ g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot);
+
+ /* Look to see if we aleady have an appropriate entry. */
+ last_entry = sgot->contents + MIPS_ELF_GOT_SIZE (abfd) * g->assigned_gotno;
+ for (entry = (sgot->contents
+ + MIPS_ELF_GOT_SIZE (abfd) * MIPS_RESERVED_GOTNO);
+ entry != last_entry;
+ entry += MIPS_ELF_GOT_SIZE (abfd))
+ {
+ address = MIPS_ELF_GET_WORD (abfd, entry);
+
+ if (!mips_elf_overflow_p (value - address, 16))
{
- (*_bfd_error_handler)
- ("more got entries are needed for hipage relocations");
- bfd_set_error (bfd_error_bad_value);
- return false;
+ /* This entry will serve as the page pointer. We can add a
+ 16-bit number to it to get the actual address. */
+ index = entry - sgot->contents;
+ break;
}
+ }
+
+ /* If we didn't have an appropriate entry, we create one now. */
+ if (entry == last_entry)
+ index = mips_elf_create_local_got_entry (abfd, g, sgot, value);
- bfd_put_32 (input_bfd, hipage, got_contents + assigned_gotno * 4);
- ++g->assigned_gotno;
+ if (offsetp)
+ {
+ address = MIPS_ELF_GET_WORD (abfd, entry);
+ *offsetp = value - address;
}
- i = - ELF_MIPS_GP_OFFSET (output_bfd) + i * 4;
- bfd_put_32 (input_bfd, (insn & 0xffff0000) | (i & 0xffff),
- contents + relhi->r_offset);
+ return index;
+}
- return true;
+/* Find a GOT entry whose higher-order 16 bits are the same as those
+ for value. Return the index into the GOT for this entry. */
+
+static bfd_vma
+mips_elf_got16_entry (abfd, info, value)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ bfd_vma value;
+{
+ asection *sgot;
+ struct mips_got_info *g;
+ bfd_byte *entry;
+ bfd_byte *last_entry;
+ bfd_vma index = 0;
+ bfd_vma address;
+
+ /* Although the ABI says that it is "the high-order 16 bits" that we
+ want, it is really the %high value. The complete value is
+ calculated with a `addiu' of a LO16 relocation, just as with a
+ HI16/LO16 pair. */
+ value = mips_elf_high (value) << 16;
+ g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot);
+
+ /* Look to see if we already have an appropriate entry. */
+ last_entry = sgot->contents + MIPS_ELF_GOT_SIZE (abfd) * g->assigned_gotno;
+ for (entry = (sgot->contents
+ + MIPS_ELF_GOT_SIZE (abfd) * MIPS_RESERVED_GOTNO);
+ entry != last_entry;
+ entry += MIPS_ELF_GOT_SIZE (abfd))
+ {
+ address = MIPS_ELF_GET_WORD (abfd, entry);
+ if ((address & 0xffff0000) == value)
+ {
+ /* This entry has the right high-order 16 bits. */
+ index = entry - sgot->contents;
+ break;
+ }
+ }
+
+ /* If we didn't have an appropriate entry, we create one now. */
+ if (entry == last_entry)
+ index = mips_elf_create_local_got_entry (abfd, g, sgot, value);
+
+ return index;
}
-/* Handle MIPS ELF CALL16 reloc and global GOT16 reloc. */
+/* Returns the first relocation of type r_type found, beginning with
+ RELOCATION. RELEND is one-past-the-end of the relocation table. */
-static void
-mips_elf_relocate_global_got (input_bfd, rel, contents, offset)
- bfd *input_bfd;
- Elf_Internal_Rela *rel;
- bfd_byte *contents;
- bfd_vma offset;
+static const Elf_Internal_Rela *
+mips_elf_next_relocation (r_type, relocation, relend)
+ unsigned int r_type;
+ const Elf_Internal_Rela *relocation;
+ const Elf_Internal_Rela *relend;
{
- bfd_vma insn;
+ /* According to the MIPS ELF ABI, the R_MIPS_LO16 relocation must be
+ immediately following. However, for the IRIX6 ABI, the next
+ relocation may be a composed relocation consisting of several
+ relocations for the same address. In that case, the R_MIPS_LO16
+ relocation may occur as one of these. We permit a similar
+ extension in general, as that is useful for GCC. */
+ while (relocation < relend)
+ {
+ if (ELF32_R_TYPE (relocation->r_info) == r_type)
+ return relocation;
+
+ ++relocation;
+ }
- insn = bfd_get_32 (input_bfd, contents + rel->r_offset);
- bfd_put_32 (input_bfd,
- (insn & 0xffff0000) | (offset & 0xffff),
- contents + rel->r_offset);
+ /* We didn't find it. */
+ bfd_set_error (bfd_error_bad_value);
+ return NULL;
}
-/* Relocate a MIPS ELF section. */
+/* Create a rel.dyn relocation for the dynamic linker to resolve. REL
+ is the original relocation, which is now being transformed into a
+ dyanmic relocation. The ADDENDP is adjusted if necessary; the
+ caller should store the result in place of the original addend. */
static boolean
-mips_elf_relocate_section (output_bfd, info, input_bfd, input_section,
- contents, relocs, local_syms, local_sections)
+mips_elf_create_dynamic_relocation (output_bfd, info, rel, h, sec,
+ symbol, addendp, input_section)
bfd *output_bfd;
struct bfd_link_info *info;
- bfd *input_bfd;
+ const Elf_Internal_Rela *rel;
+ struct mips_elf_link_hash_entry *h;
+ asection *sec;
+ bfd_vma symbol;
+ bfd_vma *addendp;
asection *input_section;
- bfd_byte *contents;
- Elf_Internal_Rela *relocs;
- Elf_Internal_Sym *local_syms;
- asection **local_sections;
{
- Elf_Internal_Shdr *symtab_hdr;
- size_t locsymcount;
- size_t extsymoff;
- asection *sgot, *sreloc, *scpt;
+ Elf_Internal_Rel outrel;
+ boolean skip;
+ asection *sreloc;
bfd *dynobj;
- bfd_vma gp;
- Elf_Internal_Rela *rel;
- Elf_Internal_Rela *relend;
- struct mips_got_info *g;
+ int r_type;
+ r_type = ELF32_R_TYPE (rel->r_info);
dynobj = elf_hash_table (info)->dynobj;
- symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+ sreloc
+ = bfd_get_section_by_name (dynobj,
+ MIPS_ELF_REL_DYN_SECTION_NAME (output_bfd));
+ BFD_ASSERT (sreloc != NULL);
+
+ skip = false;
+
+ /* We begin by assuming that the offset for the dynamic relocation
+ is the same as for the original relocation. We'll adjust this
+ later to reflect the correct output offsets. */
+ if (elf_section_data (input_section)->stab_info == NULL)
+ outrel.r_offset = rel->r_offset;
+ else
+ {
+ /* Except that in a stab section things are more complex.
+ Because we compress stab information, the offset given in the
+ relocation may not be the one we want; we must let the stabs
+ machinery tell us the offset. */
+ outrel.r_offset
+ = (_bfd_stab_section_offset
+ (output_bfd, &elf_hash_table (info)->stab_info,
+ input_section,
+ &elf_section_data (input_section)->stab_info,
+ rel->r_offset));
+ /* If we didn't need the relocation at all, this value will be
+ -1. */
+ if (outrel.r_offset == (bfd_vma) -1)
+ skip = true;
+ }
- sgot = NULL;
- sreloc = NULL;
- if (dynobj == NULL || ! SGI_COMPAT (output_bfd))
- scpt = NULL;
+ /* If we've decided to skip this relocation, just output an emtpy
+ record. Note that R_MIPS_NONE == 0, so that this call to memset
+ is a way of setting R_TYPE to R_MIPS_NONE. */
+ if (skip)
+ memset (&outrel, 0, sizeof (outrel));
else
- scpt = bfd_get_section_by_name (dynobj, ".compact_rel");
- g = NULL;
+ {
+ long indx;
+ bfd_vma section_offset;
+
+ /* We must now calculate the dynamic symbol table index to use
+ in the relocation. */
+ if (h != NULL
+ && (! info->symbolic || (h->root.elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_REGULAR) == 0))
+ {
+ indx = h->root.dynindx;
+ BFD_ASSERT (indx != -1);
+ }
+ else
+ {
+ if (sec != NULL && bfd_is_abs_section (sec))
+ indx = 0;
+ else if (sec == NULL || sec->owner == NULL)
+ {
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ }
+ else
+ {
+ indx = elf_section_data (sec->output_section)->dynindx;
+ if (indx == 0)
+ abort ();
+ }
- if (elf_bad_symtab (input_bfd))
+ /* Figure out how far the target of the relocation is from
+ the beginning of its section. */
+ section_offset = symbol - sec->output_section->vma;
+ /* The relocation we're building is section-relative.
+ Therefore, the original addend must be adjusted by the
+ section offset. */
+ *addendp += symbol - sec->output_section->vma;
+ /* Now, the relocation is just against the section. */
+ symbol = sec->output_section->vma;
+ }
+
+ /* If the relocation was previously an absolute relocation, we
+ must adjust it by the value we give it in the dynamic symbol
+ table. */
+ if (r_type != R_MIPS_REL32)
+ *addendp += symbol;
+
+ /* The relocation is always an REL32 relocation because we don't
+ know where the shared library will wind up at load-time. */
+ outrel.r_info = ELF32_R_INFO (indx, R_MIPS_REL32);
+
+ /* Adjust the output offset of the relocation to reference the
+ correct location in the output file. */
+ outrel.r_offset += (input_section->output_section->vma
+ + input_section->output_offset);
+ }
+
+ /* Put the relocation back out. We have to use the special
+ relocation outputter in the 64-bit case since the 64-bit
+ relocation format is non-standard. */
+ if (ABI_64_P (output_bfd))
{
- locsymcount = symtab_hdr->sh_size / sizeof (Elf32_External_Sym);
- extsymoff = 0;
+ (*get_elf_backend_data (output_bfd)->s->swap_reloc_out)
+ (output_bfd, &outrel,
+ (sreloc->contents
+ + sreloc->reloc_count * sizeof (Elf64_Mips_External_Rel)));
}
else
+ bfd_elf32_swap_reloc_out (output_bfd, &outrel,
+ (((Elf32_External_Rel *)
+ sreloc->contents)
+ + sreloc->reloc_count));
+
+ /* Record the index of the first relocation referencing H. This
+ information is later emitted in the .msym section. */
+ if (h != NULL
+ && (h->min_dyn_reloc_index == 0
+ || sreloc->reloc_count < h->min_dyn_reloc_index))
+ h->min_dyn_reloc_index = sreloc->reloc_count;
+
+ /* We've now added another relocation. */
+ ++sreloc->reloc_count;
+
+ /* Make sure the output section is writable. The dynamic linker
+ will be writing to it. */
+ elf_section_data (input_section->output_section)->this_hdr.sh_flags
+ |= SHF_WRITE;
+
+ /* On IRIX5, make an entry of compact relocation info. */
+ if (! skip && IRIX_COMPAT (output_bfd) == ict_irix5)
{
- locsymcount = symtab_hdr->sh_info;
- extsymoff = symtab_hdr->sh_info;
+ asection* scpt = bfd_get_section_by_name (dynobj, ".compact_rel");
+ bfd_byte *cr;
+
+ if (scpt)
+ {
+ Elf32_crinfo cptrel;
+
+ mips_elf_set_cr_format (cptrel, CRF_MIPS_LONG);
+ cptrel.vaddr = (rel->r_offset
+ + input_section->output_section->vma
+ + input_section->output_offset);
+ if (r_type == R_MIPS_REL32)
+ mips_elf_set_cr_type (cptrel, CRT_MIPS_REL32);
+ else
+ mips_elf_set_cr_type (cptrel, CRT_MIPS_WORD);
+ mips_elf_set_cr_dist2to (cptrel, 0);
+ cptrel.konst = *addendp;
+
+ cr = (scpt->contents
+ + sizeof (Elf32_External_compact_rel));
+ bfd_elf32_swap_crinfo_out (output_bfd, &cptrel,
+ ((Elf32_External_crinfo *) cr
+ + scpt->reloc_count));
+ ++scpt->reloc_count;
+ }
}
- gp = _bfd_get_gp_value (output_bfd);
+ return true;
+}
+
+/* Calculate the value produced by the RELOCATION (which comes from
+ the INPUT_BFD). The ADDEND is the addend to use for this
+ RELOCATION; RELOCATION->R_ADDEND is ignored.
+
+ The result of the relocation calculation is stored in VALUEP.
+ REQUIRE_JALXP indicates whether or not the opcode used with this
+ relocation must be JALX.
- rel = relocs;
- relend = relocs + input_section->reloc_count;
- for (; rel < relend; rel++)
+ This function returns bfd_reloc_continue if the caller need take no
+ further action regarding this relocation, bfd_reloc_notsupported if
+ something goes dramatically wrong, bfd_reloc_overflow if an
+ overflow occurs, and bfd_reloc_ok to indicate success. */
+
+static bfd_reloc_status_type
+mips_elf_calculate_relocation (abfd,
+ input_bfd,
+ input_section,
+ info,
+ relocation,
+ addend,
+ howto,
+ local_syms,
+ local_sections,
+ valuep,
+ namep,
+ require_jalxp)
+ bfd *abfd;
+ bfd *input_bfd;
+ asection *input_section;
+ struct bfd_link_info *info;
+ const Elf_Internal_Rela *relocation;
+ bfd_vma addend;
+ reloc_howto_type *howto;
+ Elf_Internal_Sym *local_syms;
+ asection **local_sections;
+ bfd_vma *valuep;
+ const char **namep;
+ boolean *require_jalxp;
+{
+ /* The eventual value we will return. */
+ bfd_vma value;
+ /* The address of the symbol against which the relocation is
+ occurring. */
+ bfd_vma symbol = 0;
+ /* The final GP value to be used for the relocatable, executable, or
+ shared object file being produced. */
+ bfd_vma gp = (bfd_vma) - 1;
+ /* The place (section offset or address) of the storage unit being
+ relocated. */
+ bfd_vma p;
+ /* The value of GP used to create the relocatable object. */
+ bfd_vma gp0 = (bfd_vma) - 1;
+ /* The offset into the global offset table at which the address of
+ the relocation entry symbol, adjusted by the addend, resides
+ during execution. */
+ bfd_vma g = (bfd_vma) - 1;
+ /* The section in which the symbol referenced by the relocation is
+ located. */
+ asection *sec = NULL;
+ struct mips_elf_link_hash_entry* h = NULL;
+ /* True if the symbol referred to by this relocation is a local
+ symbol. */
+ boolean local_p;
+ /* True if the symbol referred to by this relocation is "_gp_disp". */
+ boolean gp_disp_p = false;
+ Elf_Internal_Shdr *symtab_hdr;
+ size_t extsymoff;
+ unsigned long r_symndx;
+ int r_type;
+ /* True if overflow occurred during the calculation of the
+ relocation value. */
+ boolean overflowed_p;
+ /* True if this relocation refers to a MIPS16 function. */
+ boolean target_is_16_bit_code_p = false;
+
+ /* Parse the relocation. */
+ r_symndx = ELF32_R_SYM (relocation->r_info);
+ r_type = ELF32_R_TYPE (relocation->r_info);
+ p = (input_section->output_section->vma
+ + input_section->output_offset
+ + relocation->r_offset);
+
+ /* Assume that there will be no overflow. */
+ overflowed_p = false;
+
+ /* Figure out whether or not the symbol is local, and get the offset
+ used in the array of hash table entries. */
+ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+ local_p = mips_elf_local_relocation_p (input_bfd, relocation,
+ local_sections);
+ if (! elf_bad_symtab (input_bfd))
+ extsymoff = symtab_hdr->sh_info;
+ else
+ {
+ /* The symbol table does not follow the rule that local symbols
+ must come before globals. */
+ extsymoff = 0;
+ }
+
+ /* Figure out the value of the symbol. */
+ if (local_p)
{
- int r_type;
- reloc_howto_type *howto;
- unsigned long r_symndx;
- bfd_vma addend;
- struct elf_link_hash_entry *h;
- asection *sec;
Elf_Internal_Sym *sym;
- struct mips_elf_link_hash_entry *mh;
- int other;
- bfd_reloc_status_type r;
- r_type = ELF32_R_TYPE (rel->r_info);
- if ((r_type < 0 || r_type >= (int) R_MIPS_max)
- && r_type != R_MIPS16_26
- && r_type != R_MIPS16_GPREL)
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+
+ symbol = sec->output_section->vma + sec->output_offset;
+ if (ELF_ST_TYPE (sym->st_info) != STT_SECTION)
+ symbol += sym->st_value;
+
+ /* MIPS16 text labels should be treated as odd. */
+ if (sym->st_other == STO_MIPS16)
+ ++symbol;
+
+ /* Record the name of this symbol, for our caller. */
+ *namep = bfd_elf_string_from_elf_section (input_bfd,
+ symtab_hdr->sh_link,
+ sym->st_name);
+ if (*namep == '\0')
+ *namep = bfd_section_name (input_bfd, sec);
+
+ target_is_16_bit_code_p = (sym->st_other == STO_MIPS16);
+ }
+ else
+ {
+ /* For global symbols we look up the symbol in the hash-table. */
+ h = ((struct mips_elf_link_hash_entry *)
+ elf_sym_hashes (input_bfd) [r_symndx - extsymoff]);
+ /* Find the real hash-table entry for this symbol. */
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct mips_elf_link_hash_entry *) h->root.root.u.i.link;
+
+ /* Record the name of this symbol, for our caller. */
+ *namep = h->root.root.root.string;
+
+ /* See if this is the special _gp_disp symbol. Note that such a
+ symbol must always be a global symbol. */
+ if (strcmp (h->root.root.root.string, "_gp_disp") == 0)
{
- bfd_set_error (bfd_error_bad_value);
- return false;
+ /* Relocations against _gp_disp are permitted only with
+ R_MIPS_HI16 and R_MIPS_LO16 relocations. */
+ if (r_type != R_MIPS_HI16 && r_type != R_MIPS_LO16)
+ return bfd_reloc_notsupported;
+
+ gp_disp_p = true;
+ }
+ /* If this symbol is defined, calculate its address. Note that
+ _gp_disp is a magic symbol, always implicitly defined by the
+ linker, so it's inappropriate to check to see whether or not
+ its defined. */
+ else if ((h->root.root.type == bfd_link_hash_defined
+ || h->root.root.type == bfd_link_hash_defweak)
+ && h->root.root.u.def.section)
+ {
+ sec = h->root.root.u.def.section;
+ if (sec->output_section)
+ symbol = (h->root.root.u.def.value
+ + sec->output_section->vma
+ + sec->output_offset);
+ else
+ symbol = h->root.root.u.def.value;
+ }
+ else if (h->root.root.type == bfd_link_hash_undefweak)
+ /* We allow relocations against undefined weak symbols, giving
+ it the value zero, so that you can undefined weak functions
+ and check to see if they exist by looking at their
+ addresses. */
+ symbol = 0;
+ else if (info->shared && !info->symbolic && !info->no_undefined)
+ symbol = 0;
+ else if (strcmp (h->root.root.root.string, "_DYNAMIC_LINK") == 0)
+ {
+ /* If this is a dynamic link, we should have created a
+ _DYNAMIC_LINK symbol in mips_elf_create_dynamic_sections.
+ Otherwise, we should define the symbol with a value of 0.
+ FIXME: It should probably get into the symbol table
+ somehow as well. */
+ BFD_ASSERT (! info->shared);
+ BFD_ASSERT (bfd_get_section_by_name (abfd, ".dynamic") == NULL);
+ symbol = 0;
}
- if (r_type == R_MIPS16_26)
- howto = &elf_mips16_jump_howto;
- else if (r_type == R_MIPS16_GPREL)
- howto = &elf_mips16_gprel_howto;
else
- howto = elf_mips_howto_table + r_type;
-
- if (dynobj != NULL
- && (r_type == R_MIPS_CALL16
- || r_type == R_MIPS_GOT16
- || r_type == R_MIPS_CALL_HI16
- || r_type == R_MIPS_CALL_LO16
- || r_type == R_MIPS_GOT_HI16
- || r_type == R_MIPS_GOT_LO16))
{
- /* We need the .got section. */
- if (sgot == NULL)
- {
- sgot = bfd_get_section_by_name (dynobj, ".got");
- BFD_ASSERT (sgot != NULL);
- BFD_ASSERT (elf_section_data (sgot) != NULL);
- g = (struct mips_got_info *) elf_section_data (sgot)->tdata;
- BFD_ASSERT (g != NULL);
- }
+ if (! ((*info->callbacks->undefined_symbol)
+ (info, h->root.root.root.string, input_bfd,
+ input_section, relocation->r_offset,
+ (!info->shared || info->no_undefined))))
+ return bfd_reloc_undefined;
+ symbol = 0;
}
- r_symndx = ELF32_R_SYM (rel->r_info);
-
- /* Mix in the change in GP address for a GP relative reloc. */
- if (r_type != R_MIPS_GPREL16
- && r_type != R_MIPS_LITERAL
- && r_type != R_MIPS_GPREL32
- && r_type != R_MIPS16_GPREL)
- addend = 0;
+ target_is_16_bit_code_p = (h->root.other == STO_MIPS16);
+ }
+
+ /* If this is a 32-bit call to a 16-bit function with a stub, we
+ need to redirect the call to the stub, unless we're already *in*
+ a stub. */
+ if (r_type != R_MIPS16_26 && !info->relocateable
+ && ((h != NULL && h->fn_stub != NULL)
+ || (local_p && elf_tdata (input_bfd)->local_stubs != NULL
+ && elf_tdata (input_bfd)->local_stubs[r_symndx] != NULL))
+ && !mips_elf_stub_section_p (input_bfd, input_section))
+ {
+ /* This is a 32-bit call to a 16-bit function. We should
+ have already noticed that we were going to need the
+ stub. */
+ if (local_p)
+ sec = elf_tdata (input_bfd)->local_stubs[r_symndx];
else
{
- if (gp == 0)
- {
- if (! ((*info->callbacks->reloc_dangerous)
- (info,
- "GP relative relocation when GP not defined",
- input_bfd, input_section,
- rel->r_offset)))
- return false;
- /* Only give the error once per link. */
- gp = 4;
- _bfd_set_gp_value (output_bfd, gp);
- }
-
- if (r_symndx < extsymoff
- || (elf_bad_symtab (input_bfd)
- && local_sections[r_symndx] != NULL))
- {
- /* This is a relocation against a section. The current
- addend in the instruction is the difference between
- INPUT_SECTION->vma and the GP value of INPUT_BFD. We
- must change this to be the difference between the
- final definition (which will end up in RELOCATION)
- and the GP value of OUTPUT_BFD (which is in GP). */
- addend = elf_gp (input_bfd) - gp;
- }
- else if (! info->relocateable)
- {
- /* We are doing a final link. The current addend in the
- instruction is simply the desired offset into the
- symbol (normally zero). We want the instruction to
- hold the difference between the final definition of
- the symbol (which will end up in RELOCATION) and the
- GP value of OUTPUT_BFD (which is in GP). */
- addend = - gp;
- }
- else
- {
- /* We are generating relocateable output, and we aren't
- going to define this symbol, so we just leave the
- instruction alone. */
- addend = 0;
- }
+ BFD_ASSERT (h->need_fn_stub);
+ sec = h->fn_stub;
}
- h = NULL;
- sym = NULL;
- sec = NULL;
- if (info->relocateable)
+ symbol = sec->output_section->vma + sec->output_offset;
+ }
+ /* If this is a 16-bit call to a 32-bit function with a stub, we
+ need to redirect the call to the stub. */
+ else if (r_type == R_MIPS16_26 && !info->relocateable
+ && h != NULL
+ && (h->call_stub != NULL || h->call_fp_stub != NULL)
+ && !target_is_16_bit_code_p)
+ {
+ /* If both call_stub and call_fp_stub are defined, we can figure
+ out which one to use by seeing which one appears in the input
+ file. */
+ if (h->call_stub != NULL && h->call_fp_stub != NULL)
{
- /* This is a relocateable link. We don't have to change
- anything, unless the reloc is against a section symbol,
- in which case we have to adjust according to where the
- section symbol winds up in the output section. */
- if (r_symndx >= locsymcount
- || (elf_bad_symtab (input_bfd)
- && local_sections[r_symndx] == NULL))
- r = bfd_reloc_ok;
- else
+ asection *o;
+
+ sec = NULL;
+ for (o = input_bfd->sections; o != NULL; o = o->next)
{
- sym = local_syms + r_symndx;
- if (ELF_ST_TYPE (sym->st_info) != STT_SECTION)
- r = bfd_reloc_ok;
- else
+ if (strncmp (bfd_get_section_name (input_bfd, o),
+ CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0)
{
- sec = local_sections[r_symndx];
-
- /* It would be logical to add sym->st_value here,
- but Irix 5 sometimes generates a garbage symbol
- value. */
- addend += sec->output_offset;
-
- /* If this is HI16 or GOT16 with an associated LO16,
- adjust the addend accordingly. Otherwise, just
- relocate. */
- if (r_type == R_MIPS_64 && bfd_big_endian (input_bfd))
- r = _bfd_relocate_contents (howto, input_bfd,
- addend,
- contents + rel->r_offset + 4);
- else if (r_type != R_MIPS_HI16 && r_type != R_MIPS_GOT16)
- r = _bfd_relocate_contents (howto, input_bfd,
- addend,
- contents + rel->r_offset);
- else
- {
- Elf_Internal_Rela *lorel;
-
- /* As a GNU extension, permit an arbitrary
- number of R_MIPS_HI16 relocs before the
- R_MIPS_LO16 reloc. This permits gcc to emit
- the HI and LO relocs itself. */
- if (r_type == R_MIPS_GOT16)
- lorel = rel + 1;
- else
- {
- for (lorel = rel + 1;
- (lorel < relend
- && (ELF32_R_TYPE (lorel->r_info)
- == R_MIPS_HI16));
- lorel++)
- ;
- }
- if (lorel < relend
- && ELF32_R_TYPE (lorel->r_info) == R_MIPS_LO16)
- {
- mips_elf_relocate_hi16 (input_bfd, rel, lorel,
- contents, addend);
- r = bfd_reloc_ok;
- }
- else
- r = _bfd_relocate_contents (howto, input_bfd,
- addend,
- contents + rel->r_offset);
- }
+ sec = h->call_fp_stub;
+ break;
}
}
+ if (sec == NULL)
+ sec = h->call_stub;
}
+ else if (h->call_stub != NULL)
+ sec = h->call_stub;
else
+ sec = h->call_fp_stub;
+
+ BFD_ASSERT (sec->_raw_size > 0);
+ symbol = sec->output_section->vma + sec->output_offset;
+ }
+
+ /* Calls from 16-bit code to 32-bit code and vice versa require the
+ special jalx instruction. */
+ *require_jalxp = (!info->relocateable
+ && ((r_type == R_MIPS16_26) != target_is_16_bit_code_p));
+
+ /* If we haven't already determined the GOT offset, or the GP value,
+ and we're going to need it, get it now. */
+ switch (r_type)
+ {
+ case R_MIPS_CALL16:
+ case R_MIPS_GOT16:
+ case R_MIPS_GOT_DISP:
+ case R_MIPS_GOT_HI16:
+ case R_MIPS_CALL_HI16:
+ case R_MIPS_GOT_LO16:
+ case R_MIPS_CALL_LO16:
+ /* Find the index into the GOT where this value is located. */
+ if (!local_p)
{
- bfd_vma relocation;
- boolean local;
-
- /* This is a final link. */
- sym = NULL;
- if (r_symndx < extsymoff
- || (elf_bad_symtab (input_bfd)
- && local_sections[r_symndx] != NULL))
- {
- local = true;
- sym = local_syms + r_symndx;
- sec = local_sections[r_symndx];
- relocation = (sec->output_section->vma
- + sec->output_offset);
-
- /* It would be logical to always add sym->st_value here,
- but Irix 5 sometimes generates a garbage symbol
- value. */
- if (ELF_ST_TYPE (sym->st_info) != STT_SECTION)
- relocation += sym->st_value;
-
- /* mips16 text labels should be treated as odd. */
- if (sym->st_other == STO_MIPS16)
- ++relocation;
- }
- else
- {
- long indx;
+ BFD_ASSERT (addend == 0);
+ g = mips_elf_global_got_index
+ (elf_hash_table (info)->dynobj,
+ (struct elf_link_hash_entry*) h);
+ }
+ else if (r_type == R_MIPS_GOT16)
+ /* There's no need to create a local GOT entry here; the
+ calculation for a local GOT16 entry does not involve G. */
+ break;
+ else
+ {
+ g = mips_elf_local_got_index (abfd, info, symbol + addend);
+ if (g == (bfd_vma) -1)
+ return false;
+ }
- local = false;
- indx = r_symndx - extsymoff;
- h = elf_sym_hashes (input_bfd)[indx];
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
- if (strcmp (h->root.root.string, "_gp_disp") == 0)
- {
- if (gp == 0)
- {
- if (! ((*info->callbacks->reloc_dangerous)
- (info,
- "_gp_disp used when GP not defined",
- input_bfd, input_section,
- rel->r_offset)))
- return false;
- /* Only give the error once per link. */
- gp = 4;
- _bfd_set_gp_value (output_bfd, gp);
- relocation = 0;
- }
- else
- {
- sec = input_section;
- if (sec->output_section != NULL)
- relocation = (gp
- - (rel->r_offset
- + sec->output_section->vma
- + sec->output_offset));
- else
- relocation = gp - rel->r_offset;
- if (r_type == R_MIPS_LO16)
- relocation += 4;
- }
- }
- else if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- {
- sec = h->root.u.def.section;
- if (sec->output_section == NULL)
- relocation = 0;
- else
- relocation = (h->root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
- }
- else if (h->root.type == bfd_link_hash_undefweak)
- relocation = 0;
- else if (info->shared && ! info->symbolic)
- relocation = 0;
- else if (strcmp (h->root.root.string, "_DYNAMIC_LINK") == 0)
- {
- /* If this is a dynamic link, we should have created
- a _DYNAMIC_LINK symbol in
- mips_elf_create_dynamic_sections. Otherwise, we
- should define the symbol with a value of 0.
- FIXME: It should probably get into the symbol
- table somehow as well. */
- BFD_ASSERT (! info->shared);
- BFD_ASSERT (bfd_get_section_by_name (output_bfd,
- ".dynamic") == NULL);
- relocation = 0;
- }
- else
- {
- if (! ((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
- return false;
- relocation = 0;
- }
- }
+ /* Convert GOT indices to actual offsets. */
+ g = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj,
+ abfd, g);
+ break;
+
+ case R_MIPS_HI16:
+ case R_MIPS_LO16:
+ case R_MIPS_GPREL16:
+ case R_MIPS_GPREL32:
+ case R_MIPS_LITERAL:
+ gp0 = _bfd_get_gp_value (input_bfd);
+ gp = _bfd_get_gp_value (abfd);
+ break;
- mh = (struct mips_elf_link_hash_entry *) h;
- if (h != NULL)
- other = h->other;
- else if (sym != NULL)
- other = sym->st_other;
+ default:
+ break;
+ }
+
+ /* Figure out what kind of relocation is being performed. */
+ switch (r_type)
+ {
+ case R_MIPS_NONE:
+ return bfd_reloc_continue;
+
+ case R_MIPS_16:
+ value = symbol + mips_elf_sign_extend (addend, 16);
+ overflowed_p = mips_elf_overflow_p (value, 16);
+ break;
+
+ case R_MIPS_32:
+ case R_MIPS_REL32:
+ case R_MIPS_64:
+ if ((info->shared
+ || (elf_hash_table (info)->dynamic_sections_created
+ && h != NULL
+ && ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
+ == 0)))
+ && (input_section->flags & SEC_ALLOC) != 0)
+ {
+ /* If we're creating a shared library, or this relocation is
+ against a symbol in a shared library, then we can't know
+ where the symbol will end up. So, we create a relocation
+ record in the output, and leave the job up to the dynamic
+ linker. */
+ value = addend;
+ if (!mips_elf_create_dynamic_relocation (abfd,
+ info,
+ relocation,
+ h,
+ sec,
+ symbol,
+ &value,
+ input_section))
+ return false;
+ }
+ else
+ {
+ if (r_type != R_MIPS_REL32)
+ value = symbol + addend;
else
- other = 0;
-
- /* If this function has an fn_stub, then it is a mips16
- function which needs a stub if it is called by a 32 bit
- function. If this reloc is anything other than a 16 bit
- call, redirect the reloc to the stub. We don't redirect
- relocs from other stub functions. */
- if (r_type != R_MIPS16_26
- && ((mh != NULL
- && mh->fn_stub != NULL)
- || (mh == NULL
- && elf_tdata (input_bfd)->local_stubs != NULL
- && elf_tdata (input_bfd)->local_stubs[r_symndx] != NULL))
- && strncmp (bfd_get_section_name (input_bfd, input_section),
- FN_STUB, sizeof FN_STUB - 1) != 0
- && strncmp (bfd_get_section_name (input_bfd, input_section),
- CALL_STUB, sizeof CALL_STUB - 1) != 0
- && strncmp (bfd_get_section_name (input_bfd, input_section),
- CALL_FP_STUB, sizeof CALL_FP_STUB - 1) != 0)
- {
- if (mh != NULL)
- {
- BFD_ASSERT (mh->need_fn_stub);
- relocation = (mh->fn_stub->output_section->vma
- + mh->fn_stub->output_offset);
- }
- else
- {
- asection *fn_stub;
+ value = addend;
+ }
+ value &= howto->dst_mask;
+ break;
- fn_stub = elf_tdata (input_bfd)->local_stubs[r_symndx];
- relocation = (fn_stub->output_section->vma
- + fn_stub->output_offset);
- }
+ case R_MIPS_PC32:
+ case R_MIPS_PC64:
+ case R_MIPS_GNU_REL_LO16:
+ value = symbol + addend - p;
+ value &= howto->dst_mask;
+ break;
- /* RELOCATION now points to 32 bit code. */
- other = 0;
- }
+ case R_MIPS_GNU_REL16_S2:
+ value = symbol + mips_elf_sign_extend (addend << 2, 18) - p;
+ overflowed_p = mips_elf_overflow_p (value, 18);
+ value = (value >> 2) & howto->dst_mask;
+ break;
- /* If this function has a call_stub, then it is called by a
- mips16 function; the call needs to go through a stub if
- this function is a 32 bit function. If this reloc is a
- 16 bit call, and the symbol is not a 16 bit function,
- then redirect the reloc to the stub. Note that we don't
- need to worry about calling the function through a
- function pointer; such calls are handled by routing
- through a special mips16 routine. We don't have to check
- whether this call is from a stub; it can't be, because a
- stub contains 32 bit code, and hence can not have a 16
- bit reloc. */
- if (r_type == R_MIPS16_26
- && mh != NULL
- && (mh->call_stub != NULL || mh->call_fp_stub != NULL)
- && other != STO_MIPS16)
- {
- asection *stub;
+ case R_MIPS_GNU_REL_HI16:
+ value = mips_elf_high (addend + symbol - p);
+ value &= howto->dst_mask;
+ break;
- /* If both call_stub and call_fp_stub are defined, we
- can figure out which one to use by seeing which one
- appears in the input file. */
- if (mh->call_stub != NULL && mh->call_fp_stub != NULL)
- {
- asection *o;
+ case R_MIPS16_26:
+ /* The calculation for R_MIPS_26 is just the same as for an
+ R_MIPS_26. It's only the storage of the relocated field into
+ the output file that's different. That's handled in
+ mips_elf_perform_relocation. So, we just fall through to the
+ R_MIPS_26 case here. */
+ case R_MIPS_26:
+ if (local_p)
+ value = (((addend << 2) | (p & 0xf0000000)) + symbol) >> 2;
+ else
+ value = (mips_elf_sign_extend (addend << 2, 28) + symbol) >> 2;
+ value &= howto->dst_mask;
+ break;
- stub = NULL;
- for (o = input_bfd->sections; o != NULL; o = o->next)
- {
- if (strncmp (bfd_get_section_name (input_bfd, o),
- CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0)
- {
- stub = mh->call_fp_stub;
- break;
- }
- }
- if (stub == NULL)
- stub = mh->call_stub;
- }
- else if (mh->call_stub != NULL)
- stub = mh->call_stub;
- else
- stub = mh->call_fp_stub;
+ case R_MIPS_HI16:
+ if (!gp_disp_p)
+ {
+ value = mips_elf_high (addend + symbol);
+ value &= howto->dst_mask;
+ }
+ else
+ {
+ value = mips_elf_high (addend + gp - p);
+ overflowed_p = mips_elf_overflow_p (value, 16);
+ }
+ break;
- BFD_ASSERT (stub->_raw_size > 0);
- relocation = stub->output_section->vma + stub->output_offset;
- }
+ case R_MIPS_LO16:
+ if (!gp_disp_p)
+ value = (symbol + addend) & howto->dst_mask;
+ else
+ {
+ value = addend + gp - p + 4;
+ /* The MIPS ABI requires checking the R_MIPS_LO16 relocation
+ for overflow. But, on, say, Irix 5, relocations against
+ _gp_disp are normally generated from the .cpload
+ pseudo-op. It generates code that normally looks like
+ this:
+
+ lui $gp,%hi(_gp_disp)
+ addiu $gp,$gp,%lo(_gp_disp)
+ addu $gp,$gp,$t9
+
+ Here $t9 holds the address of the function being called,
+ as required by the MIPS ELF ABI. The R_MIPS_LO16
+ relocation can easily overflow in this situation, but the
+ R_MIPS_HI16 relocation will handle the overflow.
+ Therefore, we consider this a bug in the MIPS ABI, and do
+ not check for overflow here. */
+ }
+ break;
- if (r_type == R_MIPS_HI16)
- {
- Elf_Internal_Rela *lorel;
-
- /* As a GNU extension, permit an arbitrary number of
- R_MIPS_HI16 relocs before the R_MIPS_LO16 reloc.
- This permits gcc to emit the HI and LO relocs itself. */
- for (lorel = rel + 1;
- (lorel < relend
- && ELF32_R_TYPE (lorel->r_info) == R_MIPS_HI16);
- lorel++)
- ;
- if (lorel < relend
- && ELF32_R_TYPE (lorel->r_info) == R_MIPS_LO16)
- {
- mips_elf_relocate_hi16 (input_bfd, rel, lorel,
- contents, relocation + addend);
- r = bfd_reloc_ok;
- }
- else
- r = _bfd_final_link_relocate (howto, input_bfd, input_section,
- contents, rel->r_offset,
- relocation, addend);
- }
- else if (r_type == R_MIPS_GOT16 && local)
- {
- /* GOT16 must also have an associated LO16 in the local
- case. In this case, the addend is extracted and the
- section in which the referenced object is determined.
- Then the final address of the object is computed and
- the GOT entry for the hipage (an aligned 64kb chunk)
- is added to .got section if needed. The offset field
- of the GOT16-relocated instruction is replaced by the
- index of this GOT entry for the hipage. */
- if ((rel + 1) < relend
- && ELF32_R_TYPE ((rel + 1)->r_info) == R_MIPS_LO16)
- {
- if (! mips_elf_relocate_got_local (output_bfd, input_bfd,
- sgot, rel, rel + 1,
- contents,
- relocation + addend))
- return false;
- r = bfd_reloc_ok;
- }
- else
- r = bfd_reloc_outofrange;
- }
- else if (r_type == R_MIPS_CALL16
- || r_type == R_MIPS_GOT16
- || r_type == R_MIPS_CALL_LO16
- || r_type == R_MIPS_GOT_LO16)
- {
- bfd_vma offset;
-
- /* This symbol must be registered as a global symbol
- having the corresponding got entry. */
- BFD_ASSERT (h->got_offset != (bfd_vma) -1);
-
- offset = (h->dynindx - g->global_gotsym + g->local_gotno) * 4;
- BFD_ASSERT (g->local_gotno <= offset
- && offset < sgot->_raw_size);
- bfd_put_32 (output_bfd, relocation + addend,
- sgot->contents + offset);
- offset = (sgot->output_section->vma + sgot->output_offset
- + offset - gp);
- mips_elf_relocate_global_got (input_bfd, rel, contents,
- offset);
- r = bfd_reloc_ok;
- }
- else if (r_type == R_MIPS_CALL_HI16
- || r_type == R_MIPS_GOT_HI16)
- {
- bfd_vma offset;
-
- /* This must be a global symbol with a got entry. The
- next reloc must be the corresponding LO16 reloc. */
- BFD_ASSERT (h != NULL && h->got_offset != (bfd_vma) -1);
- BFD_ASSERT ((rel + 1) < relend);
- BFD_ASSERT ((int) ELF32_R_TYPE ((rel + 1)->r_info)
- == (r_type == R_MIPS_CALL_HI16
- ? (int) R_MIPS_CALL_LO16
- : (int) R_MIPS_GOT_LO16));
-
- offset = (h->dynindx - g->global_gotsym + g->local_gotno) * 4;
- BFD_ASSERT (g->local_gotno <= offset
- && offset < sgot->_raw_size);
- bfd_put_32 (output_bfd, relocation + addend,
- sgot->contents + offset);
- offset = (sgot->output_section->vma + sgot->output_offset
- + offset - gp);
- mips_elf_relocate_hi16 (input_bfd, rel, rel + 1, contents,
- offset);
- r = bfd_reloc_ok;
- }
- else if (r_type == R_MIPS_REL32
- || r_type == R_MIPS_32)
- {
- Elf_Internal_Rel outrel;
- Elf32_crinfo cptrel;
- bfd_byte *cr;
-
- if ((info->shared
- || (elf_hash_table (info)->dynamic_sections_created
- && h != NULL
- && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
- == 0)))
- && (input_section->flags & SEC_ALLOC) != 0)
- {
- boolean skip;
+ case R_MIPS_LITERAL:
+ /* Because we don't merge literal sections, we can handle this
+ just like R_MIPS_GPREL16. In the long run, we should merge
+ shared literals, and then we will need to additional work
+ here. */
- /* When generating a shared object, these
- relocations are copied into the output file to be
- resolved at run time. */
- if (sreloc == NULL)
- {
- sreloc = bfd_get_section_by_name (dynobj, ".rel.dyn");
- BFD_ASSERT (sreloc != NULL);
- }
+ /* Fall through. */
- skip = false;
+ case R_MIPS16_GPREL:
+ /* The R_MIPS16_GPREL performs the same calculation as
+ R_MIPS_GPREL16, but stores the relocated bits in a different
+ order. We don't need to do anything special here; the
+ differences are handled in mips_elf_perform_relocation. */
+ case R_MIPS_GPREL16:
+ if (local_p)
+ value = mips_elf_sign_extend (addend, 16) + symbol + gp0 - gp;
+ else
+ value = mips_elf_sign_extend (addend, 16) + symbol - gp;
+ overflowed_p = mips_elf_overflow_p (value, 16);
+ break;
+
+ case R_MIPS_GOT16:
+ if (local_p)
+ {
+ value = mips_elf_got16_entry (abfd, info, symbol + addend);
+ if (value == (bfd_vma) -1)
+ return false;
+ value
+ = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj,
+ abfd,
+ value);
+ overflowed_p = mips_elf_overflow_p (value, 16);
+ break;
+ }
- if (elf_section_data (input_section)->stab_info == NULL)
- outrel.r_offset = rel->r_offset;
- else
- {
- bfd_vma off;
-
- off = (_bfd_stab_section_offset
- (output_bfd, &elf_hash_table (info)->stab_info,
- input_section,
- &elf_section_data (input_section)->stab_info,
- rel->r_offset));
- if (off == (bfd_vma) -1)
- skip = true;
- outrel.r_offset = off;
- }
+ /* Fall through. */
- outrel.r_offset += (input_section->output_section->vma
- + input_section->output_offset);
+ case R_MIPS_CALL16:
+ case R_MIPS_GOT_DISP:
+ value = g;
+ overflowed_p = mips_elf_overflow_p (value, 16);
+ break;
- addend = bfd_get_32 (input_bfd, contents + rel->r_offset);
+ case R_MIPS_GPREL32:
+ value = (addend + symbol + gp0 - gp) & howto->dst_mask;
+ break;
- if (skip)
- memset (&outrel, 0, sizeof outrel);
- else if (h != NULL
- && (! info->symbolic
- || (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_REGULAR) == 0))
- {
- BFD_ASSERT (h->dynindx != -1);
- outrel.r_info = ELF32_R_INFO (h->dynindx, R_MIPS_REL32);
- sec = input_section;
- }
- else
- {
- long indx;
+ case R_MIPS_PC16:
+ value = mips_elf_sign_extend (addend, 16) + symbol - p;
+ value = (bfd_vma) ((bfd_signed_vma) value / 4);
+ overflowed_p = mips_elf_overflow_p (value, 16);
+ break;
- if (h == NULL)
- sec = local_sections[r_symndx];
- else
- {
- BFD_ASSERT (h->root.type == bfd_link_hash_defined
- || (h->root.type
- == bfd_link_hash_defweak));
- sec = h->root.u.def.section;
- }
- if (sec != NULL && bfd_is_abs_section (sec))
- indx = 0;
- else if (sec == NULL || sec->owner == NULL)
- {
- bfd_set_error (bfd_error_bad_value);
- return false;
- }
- else
- {
- asection *osec;
+ case R_MIPS_GOT_HI16:
+ case R_MIPS_CALL_HI16:
+ /* We're allowed to handle these two relocations identically.
+ The dynamic linker is allowed to handle the CALL relocations
+ differently by creating a lazy evaluation stub. */
+ value = g;
+ value = mips_elf_high (value);
+ value &= howto->dst_mask;
+ break;
- osec = sec->output_section;
- indx = elf_section_data (osec)->dynindx;
- if (indx == 0)
- abort ();
- }
+ case R_MIPS_GOT_LO16:
+ case R_MIPS_CALL_LO16:
+ value = g & howto->dst_mask;
+ break;
- outrel.r_info = ELF32_R_INFO (indx, R_MIPS_REL32);
- addend += relocation;
- }
+ case R_MIPS_GOT_PAGE:
+ value = mips_elf_got_page (abfd, info, symbol + addend, NULL);
+ if (value == (bfd_vma) -1)
+ return false;
+ value = mips_elf_got_offset_from_index (elf_hash_table (info)->dynobj,
+ abfd,
+ value);
+ overflowed_p = mips_elf_overflow_p (value, 16);
+ break;
+
+ case R_MIPS_GOT_OFST:
+ mips_elf_got_page (abfd, info, symbol + addend, &value);
+ overflowed_p = mips_elf_overflow_p (value, 16);
+ break;
- if (! skip)
- bfd_put_32 (output_bfd, addend, contents + rel->r_offset);
+ case R_MIPS_SUB:
+ value = symbol - addend;
+ value &= howto->dst_mask;
+ break;
- bfd_elf32_swap_reloc_out (output_bfd, &outrel,
- (((Elf32_External_Rel *)
- sreloc->contents)
- + sreloc->reloc_count));
- ++sreloc->reloc_count;
+ case R_MIPS_HIGHER:
+ value = mips_elf_higher (addend + symbol);
+ value &= howto->dst_mask;
+ break;
- if (! skip && SGI_COMPAT (output_bfd))
- {
- if (scpt == NULL)
- continue;
+ case R_MIPS_HIGHEST:
+ value = mips_elf_highest (addend + symbol);
+ value &= howto->dst_mask;
+ break;
+
+ case R_MIPS_SCN_DISP:
+ value = symbol + addend - sec->output_offset;
+ value &= howto->dst_mask;
+ break;
- /* Make an entry of compact relocation info. */
- mips_elf_set_cr_format (cptrel, CRF_MIPS_LONG);
- cptrel.vaddr = (rel->r_offset
- + input_section->output_section->vma
- + input_section->output_offset);
- if (r_type == R_MIPS_REL32)
- mips_elf_set_cr_type (cptrel, CRT_MIPS_REL32);
- else
- mips_elf_set_cr_type (cptrel, CRT_MIPS_WORD);
- mips_elf_set_cr_dist2to (cptrel, 0);
- cptrel.konst = addend;
-
- cr = (scpt->contents
- + sizeof (Elf32_External_compact_rel));
- bfd_elf32_swap_crinfo_out (output_bfd, &cptrel,
- ((Elf32_External_crinfo *) cr
- + scpt->reloc_count));
- ++scpt->reloc_count;
- }
+ case R_MIPS_PJUMP:
+ case R_MIPS_JALR:
+ /* Both of these may be ignored. R_MIPS_JALR is an optimization
+ hint; we could improve performance by honoring that hint. */
+ return bfd_reloc_continue;
- /* This reloc will be computed at runtime, so
- there's no need to do anything now. */
- continue;
- }
- else
- r = _bfd_final_link_relocate (howto, input_bfd, input_section,
- contents, rel->r_offset,
- relocation, addend);
- }
- else if (r_type == R_MIPS_64)
- {
- bfd_size_type addr;
- unsigned long val;
-
- /* Do a 32 bit relocation, and sign extend to 64 bits. */
- addr = rel->r_offset;
- if (bfd_big_endian (input_bfd))
- addr += 4;
- r = _bfd_final_link_relocate (howto, input_bfd, input_section,
- contents, addr, relocation,
- addend);
- val = bfd_get_32 (input_bfd, contents + addr);
- if ((val & 0x80000000) != 0)
- val = 0xffffffff;
- else
- val = 0;
- addr = rel->r_offset;
- if (bfd_little_endian (input_bfd))
- addr += 4;
- bfd_put_32 (input_bfd, val, contents + addr);
- }
- else if (r_type == R_MIPS_26 && other == STO_MIPS16)
- {
- unsigned long insn;
+ case R_MIPS_GNU_VTINHERIT:
+ case R_MIPS_GNU_VTENTRY:
+ /* We don't do anything with these at present. */
+ return bfd_reloc_continue;
- /* This is a jump to a mips16 routine from a mips32
- routine. We need to change jal into jalx. */
- insn = bfd_get_32 (input_bfd, contents + rel->r_offset);
- if (((insn >> 26) & 0x3f) != 0x3
- && ((insn >> 26) & 0x3f) != 0x1d)
- {
- (*_bfd_error_handler)
- ("%s: %s+0x%lx: jump to mips16 routine which is not jal",
- bfd_get_filename (input_bfd),
- input_section->name,
- (unsigned long) rel->r_offset);
- bfd_set_error (bfd_error_bad_value);
- return false;
- }
- insn = (insn & 0x3ffffff) | (0x1d << 26);
- bfd_put_32 (input_bfd, insn, contents + rel->r_offset);
- r = _bfd_final_link_relocate (howto, input_bfd, input_section,
- contents, rel->r_offset,
- relocation, addend);
- }
- else if (r_type == R_MIPS16_26)
- {
- /* It's easiest to do the normal relocation, and then
- dig out the instruction and swap the first word the
- way the mips16 expects it. If this is little endian,
- though, we need to swap the two words first, and then
- swap them back again later, so that the address looks
- right. */
-
- if (bfd_little_endian (input_bfd))
- {
- unsigned long insn;
+ default:
+ /* An unrecognized relocation type. */
+ return bfd_reloc_notsupported;
+ }
- insn = bfd_get_32 (input_bfd, contents + rel->r_offset);
- insn = ((insn >> 16) & 0xffff) | ((insn & 0xffff) << 16);
- bfd_put_32 (input_bfd, insn, contents + rel->r_offset);
- }
+ /* Store the VALUE for our caller. */
+ *valuep = value;
+ return overflowed_p ? bfd_reloc_overflow : bfd_reloc_ok;
+}
- r = _bfd_final_link_relocate (howto, input_bfd, input_section,
- contents, rel->r_offset,
- relocation, addend);
- if (r == bfd_reloc_ok)
- {
- unsigned long insn;
+/* Obtain the field relocated by RELOCATION. */
- if (bfd_little_endian (input_bfd))
- {
- insn = bfd_get_32 (input_bfd, contents + rel->r_offset);
- insn = ((insn >> 16) & 0xffff) | ((insn & 0xffff) << 16);
- bfd_put_32 (input_bfd, insn, contents + rel->r_offset);
- }
+static bfd_vma
+mips_elf_obtain_contents (howto, relocation, input_bfd, contents)
+ reloc_howto_type *howto;
+ const Elf_Internal_Rela *relocation;
+ bfd *input_bfd;
+ bfd_byte *contents;
+{
+ bfd_vma x;
+ bfd_byte *location = contents + relocation->r_offset;
- insn = bfd_get_16 (input_bfd, contents + rel->r_offset);
- insn = ((insn & 0xfc00)
- | ((insn & 0x1f) << 5)
- | ((insn & 0x3e0) >> 5));
- /* If this is a jump to a 32 bit routine, then make
- it jalx. */
- if (other != STO_MIPS16)
- insn |= 0x400;
- bfd_put_16 (input_bfd, insn, contents + rel->r_offset);
- }
- }
- else if (r_type == R_MIPS16_GPREL)
+ /* Obtain the bytes. */
+ x = bfd_get (8 * bfd_get_reloc_size (howto), input_bfd, location);
+
+ if ((ELF32_R_TYPE (relocation->r_info) == R_MIPS16_26
+ || ELF32_R_TYPE (relocation->r_info) == R_MIPS16_GPREL)
+ && bfd_little_endian (input_bfd))
+ /* The two 16-bit words will be reversed on a little-endian
+ system. See mips_elf_perform_relocation for more details. */
+ x = (((x & 0xffff) << 16) | ((x & 0xffff0000) >> 16));
+
+ return x;
+}
+
+/* It has been determined that the result of the RELOCATION is the
+ VALUE. Use HOWTO to place VALUE into the output file at the
+ appropriate position. The SECTION is the section to which the
+ relocation applies. If REQUIRE_JALX is true, then the opcode used
+ for the relocation must be either JAL or JALX, and it is
+ unconditionally converted to JALX.
+
+ Returns false if anything goes wrong. */
+
+static boolean
+mips_elf_perform_relocation (info, howto, relocation, value,
+ input_bfd, input_section,
+ contents, require_jalx)
+ struct bfd_link_info *info;
+ reloc_howto_type *howto;
+ const Elf_Internal_Rela *relocation;
+ bfd_vma value;
+ bfd *input_bfd;
+ asection *input_section;
+ bfd_byte *contents;
+ boolean require_jalx;
+{
+ bfd_vma x;
+ bfd_byte *location;
+ int r_type = ELF32_R_TYPE (relocation->r_info);
+
+ /* Figure out where the relocation is occurring. */
+ location = contents + relocation->r_offset;
+
+ /* Obtain the current value. */
+ x = mips_elf_obtain_contents (howto, relocation, input_bfd, contents);
+
+ /* Clear the field we are setting. */
+ x &= ~howto->dst_mask;
+
+ /* If this is the R_MIPS16_26 relocation, we must store the
+ value in a funny way. */
+ if (r_type == R_MIPS16_26)
+ {
+ /* R_MIPS16_26 is used for the mips16 jal and jalx instructions.
+ Most mips16 instructions are 16 bits, but these instructions
+ are 32 bits.
+
+ The format of these instructions is:
+
+ +--------------+--------------------------------+
+ ! JALX ! X! Imm 20:16 ! Imm 25:21 !
+ +--------------+--------------------------------+
+ ! Immediate 15:0 !
+ +-----------------------------------------------+
+
+ JALX is the 5-bit value 00011. X is 0 for jal, 1 for jalx.
+ Note that the immediate value in the first word is swapped.
+
+ When producing a relocateable object file, R_MIPS16_26 is
+ handled mostly like R_MIPS_26. In particular, the addend is
+ stored as a straight 26-bit value in a 32-bit instruction.
+ (gas makes life simpler for itself by never adjusting a
+ R_MIPS16_26 reloc to be against a section, so the addend is
+ always zero). However, the 32 bit instruction is stored as 2
+ 16-bit values, rather than a single 32-bit value. In a
+ big-endian file, the result is the same; in a little-endian
+ file, the two 16-bit halves of the 32 bit value are swapped.
+ This is so that a disassembler can recognize the jal
+ instruction.
+
+ When doing a final link, R_MIPS16_26 is treated as a 32 bit
+ instruction stored as two 16-bit values. The addend A is the
+ contents of the targ26 field. The calculation is the same as
+ R_MIPS_26. When storing the calculated value, reorder the
+ immediate value as shown above, and don't forget to store the
+ value as two 16-bit values.
+
+ To put it in MIPS ABI terms, the relocation field is T-targ26-16,
+ defined as
+
+ big-endian:
+ +--------+----------------------+
+ | | |
+ | | targ26-16 |
+ |31 26|25 0|
+ +--------+----------------------+
+
+ little-endian:
+ +----------+------+-------------+
+ | | | |
+ | sub1 | | sub2 |
+ |0 9|10 15|16 31|
+ +----------+--------------------+
+ where targ26-16 is sub1 followed by sub2 (i.e., the addend field A is
+ ((sub1 << 16) | sub2)).
+
+ When producing a relocateable object file, the calculation is
+ (((A < 2) | (P & 0xf0000000) + S) >> 2)
+ When producing a fully linked file, the calculation is
+ let R = (((A < 2) | (P & 0xf0000000) + S) >> 2)
+ ((R & 0x1f0000) << 5) | ((R & 0x3e00000) >> 5) | (R & 0xffff) */
+
+ if (!info->relocateable)
+ /* Shuffle the bits according to the formula above. */
+ value = (((value & 0x1f0000) << 5)
+ | ((value & 0x3e00000) >> 5)
+ | (value & 0xffff));
+
+ }
+ else if (r_type == R_MIPS16_GPREL)
+ {
+ /* R_MIPS16_GPREL is used for GP-relative addressing in mips16
+ mode. A typical instruction will have a format like this:
+
+ +--------------+--------------------------------+
+ ! EXTEND ! Imm 10:5 ! Imm 15:11 !
+ +--------------+--------------------------------+
+ ! Major ! rx ! ry ! Imm 4:0 !
+ +--------------+--------------------------------+
+
+ EXTEND is the five bit value 11110. Major is the instruction
+ opcode.
+
+ This is handled exactly like R_MIPS_GPREL16, except that the
+ addend is retrieved and stored as shown in this diagram; that
+ is, the Imm fields above replace the V-rel16 field.
+
+ All we need to do here is shuffle the bits appropriately. As
+ above, the two 16-bit halves must be swapped on a
+ little-endian system. */
+ value = (((value & 0x7e0) << 16)
+ | ((value & 0xf800) << 5)
+ | (value & 0x1f));
+ }
+
+ /* Set the field. */
+ x |= (value & howto->dst_mask);
+
+ /* If required, turn JAL into JALX. */
+ if (require_jalx)
+ {
+ boolean ok;
+ bfd_vma opcode = x >> 26;
+ bfd_vma jalx_opcode;
+
+ /* Check to see if the opcode is already JAL or JALX. */
+ if (r_type == R_MIPS16_26)
+ {
+ ok = ((opcode == 0x6) || (opcode == 0x7));
+ jalx_opcode = 0x7;
+ }
+ else
+ {
+ ok = ((opcode == 0x3) || (opcode == 0x1d));
+ jalx_opcode = 0x1d;
+ }
+
+ /* If the opcode is not JAL or JALX, there's a problem. */
+ if (!ok)
+ {
+ (*_bfd_error_handler)
+ (_("%s: %s+0x%lx: jump to stub routine which is not jal"),
+ bfd_get_filename (input_bfd),
+ input_section->name,
+ (unsigned long) relocation->r_offset);
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ }
+
+ /* Make this the JALX opcode. */
+ x = (x & ~(0x3f << 26)) | (jalx_opcode << 26);
+ }
+
+ /* Swap the high- and low-order 16 bits on little-endian systems
+ when doing a MIPS16 relocation. */
+ if ((r_type == R_MIPS16_GPREL || r_type == R_MIPS16_26)
+ && bfd_little_endian (input_bfd))
+ x = (((x & 0xffff) << 16) | ((x & 0xffff0000) >> 16));
+
+ /* Put the value into the output. */
+ bfd_put (8 * bfd_get_reloc_size (howto), input_bfd, x, location);
+ return true;
+}
+
+/* Returns true if SECTION is a MIPS16 stub section. */
+
+static boolean
+mips_elf_stub_section_p (abfd, section)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asection *section;
+{
+ const char *name = bfd_get_section_name (abfd, section);
+
+ return (strncmp (name, FN_STUB, sizeof FN_STUB - 1) == 0
+ || strncmp (name, CALL_STUB, sizeof CALL_STUB - 1) == 0
+ || strncmp (name, CALL_FP_STUB, sizeof CALL_FP_STUB - 1) == 0);
+}
+
+/* Relocate a MIPS ELF section. */
+
+boolean
+_bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section,
+ contents, relocs, local_syms, local_sections)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+ bfd *input_bfd;
+ asection *input_section;
+ bfd_byte *contents;
+ Elf_Internal_Rela *relocs;
+ Elf_Internal_Sym *local_syms;
+ asection **local_sections;
+{
+ Elf_Internal_Rela *rel;
+ const Elf_Internal_Rela *relend;
+ bfd_vma addend = 0;
+ boolean use_saved_addend_p = false;
+ struct elf_backend_data *bed;
+
+ bed = get_elf_backend_data (output_bfd);
+ relend = relocs + input_section->reloc_count * bed->s->int_rels_per_ext_rel;
+ for (rel = relocs; rel < relend; ++rel)
+ {
+ const char *name;
+ bfd_vma value;
+ reloc_howto_type *howto;
+ boolean require_jalx;
+ /* True if the relocation is a RELA relocation, rather than a
+ REL relocation. */
+ boolean rela_relocation_p = true;
+ int r_type = ELF32_R_TYPE (rel->r_info);
+
+ /* Find the relocation howto for this relocation. */
+ if (r_type == R_MIPS_64 && !ABI_64_P (output_bfd))
+ {
+ /* Some 32-bit code uses R_MIPS_64. In particular, people use
+ 64-bit code, but make sure all their addresses are in the
+ lowermost or uppermost 32-bit section of the 64-bit address
+ space. Thus, when they use an R_MIPS_64 they mean what is
+ usually meant by R_MIPS_32, with the exception that the
+ stored value is sign-extended to 64 bits. */
+ howto = elf_mips_howto_table + R_MIPS_32;
+
+ /* On big-endian systems, we need to lie about the position
+ of the reloc. */
+ if (bfd_big_endian (input_bfd))
+ rel->r_offset += 4;
+ }
+ else
+ howto = mips_rtype_to_howto (r_type);
+
+ if (!use_saved_addend_p)
+ {
+ Elf_Internal_Shdr *rel_hdr;
+
+ /* If these relocations were originally of the REL variety,
+ we must pull the addend out of the field that will be
+ relocated. Otherwise, we simply use the contents of the
+ RELA relocation. To determine which flavor or relocation
+ this is, we depend on the fact that the INPUT_SECTION's
+ REL_HDR is read before its REL_HDR2. */
+ rel_hdr = &elf_section_data (input_section)->rel_hdr;
+ if ((size_t) (rel - relocs)
+ >= (rel_hdr->sh_size / rel_hdr->sh_entsize
+ * bed->s->int_rels_per_ext_rel))
+ rel_hdr = elf_section_data (input_section)->rel_hdr2;
+ if (rel_hdr->sh_entsize == MIPS_ELF_REL_SIZE (input_bfd))
{
- unsigned short extend, insn;
- bfd_byte buf[4];
- unsigned long final;
+ /* Note that this is a REL relocation. */
+ rela_relocation_p = false;
+
+ /* Get the addend, which is stored in the input file. */
+ addend = mips_elf_obtain_contents (howto,
+ rel,
+ input_bfd,
+ contents);
+ addend &= howto->src_mask;
+
+ /* For some kinds of relocations, the ADDEND is a
+ combination of the addend stored in two different
+ relocations. */
+ if (r_type == R_MIPS_HI16
+ || r_type == R_MIPS_GNU_REL_HI16
+ || (r_type == R_MIPS_GOT16
+ && mips_elf_local_relocation_p (input_bfd, rel,
+ local_sections)))
+ {
+ bfd_vma l;
+ const Elf_Internal_Rela *lo16_relocation;
+ reloc_howto_type *lo16_howto;
+ int lo;
+
+ /* The combined value is the sum of the HI16 addend,
+ left-shifted by sixteen bits, and the LO16
+ addend, sign extended. (Usually, the code does
+ a `lui' of the HI16 value, and then an `addiu' of
+ the LO16 value.)
+
+ Scan ahead to find a matching LO16 relocation. */
+ if (r_type == R_MIPS_GNU_REL_HI16)
+ lo = R_MIPS_GNU_REL_LO16;
+ else
+ lo = R_MIPS_LO16;
+ lo16_relocation
+ = mips_elf_next_relocation (lo, rel, relend);
+ if (lo16_relocation == NULL)
+ return false;
- /* Extract the addend into buf, run the regular reloc,
- and stuff the resulting value back into the
- instructions. */
- if (rel->r_offset > input_section->_raw_size)
- r = bfd_reloc_outofrange;
- else
+ /* Obtain the addend kept there. */
+ lo16_howto = mips_rtype_to_howto (lo);
+ l = mips_elf_obtain_contents (lo16_howto,
+ lo16_relocation,
+ input_bfd, contents);
+ l &= lo16_howto->src_mask;
+ l = mips_elf_sign_extend (l, 16);
+
+ addend <<= 16;
+
+ /* Compute the combined addend. */
+ addend += l;
+ }
+ else if (r_type == R_MIPS16_GPREL)
{
- extend = bfd_get_16 (input_bfd, contents + rel->r_offset);
- insn = bfd_get_16 (input_bfd, contents + rel->r_offset + 2);
- bfd_put_32 (input_bfd,
- (((extend & 0x1f) << 11)
- | (extend & 0x7e0)
- | (insn & 0x1f)),
- buf);
- r = _bfd_final_link_relocate (howto, input_bfd,
- input_section, buf,
- (bfd_vma) 0, relocation,
- addend);
- final = bfd_get_32 (input_bfd, buf);
- bfd_put_16 (input_bfd,
- ((extend & 0xf800)
- | ((final >> 11) & 0x1f)
- | (final & 0x7e0)),
- contents + rel->r_offset);
- bfd_put_16 (input_bfd,
- ((insn & 0xffe0)
- | (final & 0x1f)),
- contents + rel->r_offset + 2);
+ /* The addend is scrambled in the object file. See
+ mips_elf_perform_relocation for details on the
+ format. */
+ addend = (((addend & 0x1f0000) >> 5)
+ | ((addend & 0x7e00000) >> 16)
+ | (addend & 0x1f));
}
}
else
- r = _bfd_final_link_relocate (howto, input_bfd, input_section,
- contents, rel->r_offset,
- relocation, addend);
-
- /* The jal instruction can only jump to an address which is
- divisible by 4, and it can only jump to an address with
- the same upper 4 bits as the PC. */
- if (r == bfd_reloc_ok
- && (r_type == R_MIPS16_26 || r_type == R_MIPS_26))
+ addend = rel->r_addend;
+ }
+
+ if (info->relocateable)
+ {
+ Elf_Internal_Sym *sym;
+ unsigned long r_symndx;
+
+ if (r_type == R_MIPS_64 && !ABI_64_P (output_bfd)
+ && bfd_big_endian (input_bfd))
+ rel->r_offset -= 4;
+
+ /* Since we're just relocating, all we need to do is copy
+ the relocations back out to the object file, unless
+ they're against a section symbol, in which case we need
+ to adjust by the section offset, or unless they're GP
+ relative in which case we need to adjust by the amount
+ that we're adjusting GP in this relocateable object. */
+
+ if (!mips_elf_local_relocation_p (input_bfd, rel, local_sections))
+ /* There's nothing to do for non-local relocations. */
+ continue;
+
+ if (r_type == R_MIPS16_GPREL
+ || r_type == R_MIPS_GPREL16
+ || r_type == R_MIPS_GPREL32
+ || r_type == R_MIPS_LITERAL)
+ addend -= (_bfd_get_gp_value (output_bfd)
+ - _bfd_get_gp_value (input_bfd));
+ else if (r_type == R_MIPS_26 || r_type == R_MIPS16_26
+ || r_type == R_MIPS_GNU_REL16_S2)
+ /* The addend is stored without its two least
+ significant bits (which are always zero.) In a
+ non-relocateable link, calculate_relocation will do
+ this shift; here, we must do it ourselves. */
+ addend <<= 2;
+
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ sym = local_syms + r_symndx;
+ if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+ /* Adjust the addend appropriately. */
+ addend += local_sections[r_symndx]->output_offset;
+
+ /* If the relocation is for a R_MIPS_HI16 or R_MIPS_GOT16,
+ then we only want to write out the high-order 16 bits.
+ The subsequent R_MIPS_LO16 will handle the low-order bits. */
+ if (r_type == R_MIPS_HI16 || r_type == R_MIPS_GOT16
+ || r_type == R_MIPS_GNU_REL_HI16)
+ addend = mips_elf_high (addend);
+ /* If the relocation is for an R_MIPS_26 relocation, then
+ the two low-order bits are not stored in the object file;
+ they are implicitly zero. */
+ else if (r_type == R_MIPS_26 || r_type == R_MIPS16_26
+ || r_type == R_MIPS_GNU_REL16_S2)
+ addend >>= 2;
+
+ if (rela_relocation_p)
+ /* If this is a RELA relocation, just update the addend.
+ We have to cast away constness for REL. */
+ rel->r_addend = addend;
+ else
{
- bfd_vma addr;
-
- addr = relocation;
- if (other == STO_MIPS16)
- addr &= ~ (bfd_vma) 1;
- addr += addend;
- if ((addr & 3) != 0
- || ((addr & 0xf0000000)
- != ((input_section->output_section->vma
- + input_section->output_offset
- + rel->r_offset)
- & 0xf0000000)))
- r = bfd_reloc_overflow;
+ /* Otherwise, we have to write the value back out. Note
+ that we use the source mask, rather than the
+ destination mask because the place to which we are
+ writing will be source of the addend in the final
+ link. */
+ addend &= howto->src_mask;
+
+ if (r_type == R_MIPS_64 && !ABI_64_P (output_bfd))
+ /* See the comment above about using R_MIPS_64 in the 32-bit
+ ABI. Here, we need to update the addend. It would be
+ possible to get away with just using the R_MIPS_32 reloc
+ but for endianness. */
+ {
+ bfd_vma sign_bits;
+ bfd_vma low_bits;
+ bfd_vma high_bits;
+
+ if (addend & 0x80000000u)
+ sign_bits = 0xffffffffu;
+ else
+ sign_bits = 0;
+
+ /* If we don't know that we have a 64-bit type,
+ do two separate stores. */
+ if (bfd_big_endian (input_bfd))
+ {
+ /* Store the sign-bits (which are most significant)
+ first. */
+ low_bits = sign_bits;
+ high_bits = addend;
+ }
+ else
+ {
+ low_bits = addend;
+ high_bits = sign_bits;
+ }
+ bfd_put_32 (input_bfd, low_bits,
+ contents + rel->r_offset);
+ bfd_put_32 (input_bfd, high_bits,
+ contents + rel->r_offset + 4);
+ continue;
+ }
+
+ if (!mips_elf_perform_relocation (info, howto, rel, addend,
+ input_bfd, input_section,
+ contents, false))
+ return false;
}
- if (SGI_COMPAT (abfd)
- && scpt != NULL
- && (input_section->flags & SEC_ALLOC) != 0)
- {
- Elf32_crinfo cptrel;
- bfd_byte *cr;
+ /* Go on to the next relocation. */
+ continue;
+ }
- /* Make an entry of compact relocation info. */
- mips_elf_set_cr_format (cptrel, CRF_MIPS_LONG);
- cptrel.vaddr = (rel->r_offset
- + input_section->output_section->vma
- + input_section->output_offset);
+ /* In the N32 and 64-bit ABIs there may be multiple consecutive
+ relocations for the same offset. In that case we are
+ supposed to treat the output of each relocation as the addend
+ for the next. */
+ if (rel + 1 < relend
+ && rel->r_offset == rel[1].r_offset
+ && ELF32_R_TYPE (rel[1].r_info) != R_MIPS_NONE)
+ use_saved_addend_p = true;
+ else
+ use_saved_addend_p = false;
+
+ /* Figure out what value we are supposed to relocate. */
+ switch (mips_elf_calculate_relocation (output_bfd,
+ input_bfd,
+ input_section,
+ info,
+ rel,
+ addend,
+ howto,
+ local_syms,
+ local_sections,
+ &value,
+ &name,
+ &require_jalx))
+ {
+ case bfd_reloc_continue:
+ /* There's nothing to do. */
+ continue;
- switch (r_type)
- {
- case R_MIPS_26:
- mips_elf_set_cr_type (cptrel, CRT_MIPS_JMPAD);
- /* XXX How should we set dist2to in this case. */
- mips_elf_set_cr_dist2to (cptrel, 8);
- cptrel.konst = addend + relocation;
- cr = scpt->contents + sizeof (Elf32_External_compact_rel);
- bfd_elf32_swap_crinfo_out (output_bfd, &cptrel,
- ((Elf32_External_crinfo *) cr
- + scpt->reloc_count));
- ++scpt->reloc_count;
- break;
+ case bfd_reloc_undefined:
+ /* mips_elf_calculate_relocation already called the
+ undefined_symbol callback. There's no real point in
+ trying to perform the relocation at this point, so we
+ just skip ahead to the next relocation. */
+ continue;
- case R_MIPS_GPREL16:
- case R_MIPS_LITERAL:
- case R_MIPS_GPREL32:
- mips_elf_set_cr_type (cptrel, CRT_MIPS_GPHI_LO);
- cptrel.konst = gp - cptrel.vaddr;
- mips_elf_set_cr_dist2to (cptrel, 4);
- cr = scpt->contents + sizeof (Elf32_External_compact_rel);
- bfd_elf32_swap_crinfo_out (output_bfd, &cptrel,
- ((Elf32_External_crinfo *) cr
- + scpt->reloc_count));
- ++scpt->reloc_count;
- break;
+ case bfd_reloc_notsupported:
+ abort ();
+ break;
- default:
- break;
- }
+ case bfd_reloc_overflow:
+ if (use_saved_addend_p)
+ /* Ignore overflow until we reach the last relocation for
+ a given location. */
+ ;
+ else
+ {
+ BFD_ASSERT (name != NULL);
+ if (! ((*info->callbacks->reloc_overflow)
+ (info, name, howto->name, (bfd_vma) 0,
+ input_bfd, input_section, rel->r_offset)))
+ return false;
}
+ break;
+
+ case bfd_reloc_ok:
+ break;
+
+ default:
+ abort ();
+ break;
+ }
+
+ /* If we've got another relocation for the address, keep going
+ until we reach the last one. */
+ if (use_saved_addend_p)
+ {
+ addend = value;
+ continue;
}
- if (r != bfd_reloc_ok)
+ if (r_type == R_MIPS_64 && !ABI_64_P (output_bfd))
+ /* See the comment above about using R_MIPS_64 in the 32-bit
+ ABI. Until now, we've been using the HOWTO for R_MIPS_32;
+ that calculated the right value. Now, however, we
+ sign-extend the 32-bit result to 64-bits, and store it as a
+ 64-bit value. We are especially generous here in that we
+ go to extreme lengths to support this usage on systems with
+ only a 32-bit VMA. */
{
- switch (r)
+ bfd_vma sign_bits;
+ bfd_vma low_bits;
+ bfd_vma high_bits;
+
+ if (value & 0x80000000u)
+ sign_bits = 0xffffffffu;
+ else
+ sign_bits = 0;
+
+ /* If we don't know that we have a 64-bit type,
+ do two separate stores. */
+ if (bfd_big_endian (input_bfd))
{
- default:
- case bfd_reloc_outofrange:
- abort ();
- case bfd_reloc_overflow:
- {
- const char *name;
-
- if (h != NULL)
- name = h->root.root.string;
- else
- {
- name = bfd_elf_string_from_elf_section (input_bfd,
- symtab_hdr->sh_link,
- sym->st_name);
- if (name == NULL)
- return false;
- if (*name == '\0')
- name = bfd_section_name (input_bfd, sec);
- }
- if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset)))
- return false;
- }
- break;
+ /* Undo what we did above. */
+ rel->r_offset -= 4;
+ /* Store the sign-bits (which are most significant)
+ first. */
+ low_bits = sign_bits;
+ high_bits = value;
}
+ else
+ {
+ low_bits = value;
+ high_bits = sign_bits;
+ }
+ bfd_put_32 (input_bfd, low_bits,
+ contents + rel->r_offset);
+ bfd_put_32 (input_bfd, high_bits,
+ contents + rel->r_offset + 4);
+ continue;
}
+
+ /* Actually perform the relocation. */
+ if (!mips_elf_perform_relocation (info, howto, rel, value, input_bfd,
+ input_section, contents,
+ require_jalx))
+ return false;
}
return true;
@@ -5426,11 +6902,11 @@ mips_elf_relocate_section (output_bfd, info, input_bfd, input_section,
also where we undo the increment of the value for a mips16 symbol. */
/*ARGSIGNORED*/
-static boolean
-mips_elf_link_output_symbol_hook (abfd, info, name, sym, input_sec)
- bfd *abfd;
- struct bfd_link_info *info;
- const char *name;
+boolean
+_bfd_mips_elf_link_output_symbol_hook (abfd, info, name, sym, input_sec)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ const char *name ATTRIBUTE_UNUSED;
Elf_Internal_Sym *sym;
asection *input_sec;
{
@@ -5453,12 +6929,15 @@ mips_elf_link_output_symbol_hook (abfd, info, name, sym, input_sec)
/* The name of the dynamic interpreter. This is put in the .interp
section. */
-#define ELF_DYNAMIC_INTERPRETER "/usr/lib/libc.so.1"
+#define ELF_DYNAMIC_INTERPRETER(abfd) \
+ (ABI_N32_P (abfd) ? "/usr/lib32/libc.so.1" \
+ : ABI_64_P (abfd) ? "/usr/lib64/libc.so.1" \
+ : "/usr/lib/libc.so.1")
/* Create dynamic sections when linking against a dynamic object. */
-static boolean
-mips_elf_create_dynamic_sections (abfd, info)
+boolean
+_bfd_mips_elf_create_dynamic_sections (abfd, info)
bfd *abfd;
struct bfd_link_info *info;
{
@@ -5482,28 +6961,42 @@ mips_elf_create_dynamic_sections (abfd, info)
if (! mips_elf_create_got_section (abfd, info))
return false;
+ /* Create the .msym section on IRIX6. It is used by the dynamic
+ linker to speed up dynamic relocations, and to avoid computing
+ the ELF hash for symbols. */
+ if (IRIX_COMPAT (abfd) == ict_irix6
+ && !mips_elf_create_msym_section (abfd))
+ return false;
+
/* Create .stub section. */
- if (bfd_get_section_by_name (abfd, ".stub") == NULL)
+ if (bfd_get_section_by_name (abfd,
+ MIPS_ELF_STUB_SECTION_NAME (abfd)) == NULL)
{
- s = bfd_make_section (abfd, ".stub");
+ s = bfd_make_section (abfd, MIPS_ELF_STUB_SECTION_NAME (abfd));
if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags)
- || ! bfd_set_section_alignment (abfd, s, 2))
+ || ! bfd_set_section_flags (abfd, s, flags | SEC_CODE)
+ || ! bfd_set_section_alignment (abfd, s,
+ MIPS_ELF_LOG_FILE_ALIGN (abfd)))
return false;
}
- if (SGI_COMPAT (abfd)
+ if (IRIX_COMPAT (abfd) == ict_irix5
&& !info->shared
&& bfd_get_section_by_name (abfd, ".rld_map") == NULL)
{
s = bfd_make_section (abfd, ".rld_map");
if (s == NULL
|| ! bfd_set_section_flags (abfd, s, flags & ~SEC_READONLY)
- || ! bfd_set_section_alignment (abfd, s, 2))
+ || ! bfd_set_section_alignment (abfd, s,
+ MIPS_ELF_LOG_FILE_ALIGN (abfd)))
return false;
}
- if (SGI_COMPAT (abfd))
+ /* On IRIX5, we adjust add some additional symbols and change the
+ alignments of several sections. There is no ABI documentation
+ indicating that this is necessary on IRIX6, nor any evidence that
+ the linker takes such action. */
+ if (IRIX_COMPAT (abfd) == ict_irix5)
{
for (namep = mips_elf_dynsym_rtproc_names; *namep != NULL; namep++)
{
@@ -5593,7 +7086,7 @@ mips_elf_create_dynamic_sections (abfd, info)
static boolean
mips_elf_create_compact_rel_section (abfd, info)
bfd *abfd;
- struct bfd_link_info *info;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
{
flagword flags;
register asection *s;
@@ -5606,7 +7099,8 @@ mips_elf_create_compact_rel_section (abfd, info)
s = bfd_make_section (abfd, ".compact_rel");
if (s == NULL
|| ! bfd_set_section_flags (abfd, s, flags)
- || ! bfd_set_section_alignment (abfd, s, 2))
+ || ! bfd_set_section_alignment (abfd, s,
+ MIPS_ELF_LOG_FILE_ALIGN (abfd)))
return false;
s->_raw_size = sizeof (Elf32_External_compact_rel);
@@ -5628,7 +7122,7 @@ mips_elf_create_got_section (abfd, info)
struct mips_got_info *g;
/* This function may be called more than once. */
- if (bfd_get_section_by_name (abfd, ".got") != NULL)
+ if (mips_elf_got_section (abfd))
return true;
flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
@@ -5659,13 +7153,13 @@ mips_elf_create_got_section (abfd, info)
return false;
/* The first several global offset table entries are reserved. */
- s->_raw_size = MIPS_RESERVED_GOTNO * 4;
+ s->_raw_size = MIPS_RESERVED_GOTNO * MIPS_ELF_GOT_SIZE (abfd);
g = (struct mips_got_info *) bfd_alloc (abfd,
sizeof (struct mips_got_info));
if (g == NULL)
return false;
- g->global_gotsym = 0;
+ g->global_gotsym = NULL;
g->local_gotno = MIPS_RESERVED_GOTNO;
g->assigned_gotno = MIPS_RESERVED_GOTNO;
if (elf_section_data (s) == NULL)
@@ -5676,15 +7170,66 @@ mips_elf_create_got_section (abfd, info)
return false;
}
elf_section_data (s)->tdata = (PTR) g;
+ elf_section_data (s)->this_hdr.sh_flags
+ |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL;
return true;
}
+/* Returns the .msym section for ABFD, creating it if it does not
+ already exist. Returns NULL to indicate error. */
+
+static asection *
+mips_elf_create_msym_section (abfd)
+ bfd *abfd;
+{
+ asection *s;
+
+ s = bfd_get_section_by_name (abfd, MIPS_ELF_MSYM_SECTION_NAME (abfd));
+ if (!s)
+ {
+ s = bfd_make_section (abfd, MIPS_ELF_MSYM_SECTION_NAME (abfd));
+ if (!s
+ || !bfd_set_section_flags (abfd, s,
+ SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_LINKER_CREATED
+ | SEC_READONLY)
+ || !bfd_set_section_alignment (abfd, s,
+ MIPS_ELF_LOG_FILE_ALIGN (abfd)))
+ return NULL;
+ }
+
+ return s;
+}
+
+/* Add room for N relocations to the .rel.dyn section in ABFD. */
+
+static void
+mips_elf_allocate_dynamic_relocations (abfd, n)
+ bfd *abfd;
+ unsigned int n;
+{
+ asection *s;
+
+ s = bfd_get_section_by_name (abfd, MIPS_ELF_REL_DYN_SECTION_NAME (abfd));
+ BFD_ASSERT (s != NULL);
+
+ if (s->_raw_size == 0)
+ {
+ /* Make room for a null element. */
+ s->_raw_size += MIPS_ELF_REL_SIZE (abfd);
+ ++s->reloc_count;
+ }
+ s->_raw_size += n * MIPS_ELF_REL_SIZE (abfd);
+}
+
/* Look through the relocs for a section during the first phase, and
allocate space in the global offset table. */
-static boolean
-mips_elf_check_relocs (abfd, info, sec, relocs)
+boolean
+_bfd_mips_elf_check_relocs (abfd, info, sec, relocs)
bfd *abfd;
struct bfd_link_info *info;
asection *sec;
@@ -5700,6 +7245,7 @@ mips_elf_check_relocs (abfd, info, sec, relocs)
const Elf_Internal_Rela *rel_end;
asection *sgot;
asection *sreloc;
+ struct elf_backend_data *bed;
if (info->relocateable)
return true;
@@ -5784,7 +7330,7 @@ mips_elf_check_relocs (abfd, info, sec, relocs)
asection **n;
if (elf_bad_symtab (abfd))
- symcount = symtab_hdr->sh_size / sizeof (Elf32_External_Sym);
+ symcount = symtab_hdr->sh_size / symtab_hdr->sh_entsize;
else
symcount = symtab_hdr->sh_info;
n = (asection **) bfd_zalloc (abfd,
@@ -5874,7 +7420,7 @@ mips_elf_check_relocs (abfd, info, sec, relocs)
}
else
{
- sgot = bfd_get_section_by_name (dynobj, ".got");
+ sgot = mips_elf_got_section (dynobj);
if (sgot == NULL)
g = NULL;
else
@@ -5886,14 +7432,16 @@ mips_elf_check_relocs (abfd, info, sec, relocs)
}
sreloc = NULL;
-
- rel_end = relocs + sec->reloc_count;
- for (rel = relocs; rel < rel_end; rel++)
+ bed = get_elf_backend_data (abfd);
+ rel_end = relocs + sec->reloc_count * bed->s->int_rels_per_ext_rel;
+ for (rel = relocs; rel < rel_end; ++rel)
{
unsigned long r_symndx;
+ int r_type;
struct elf_link_hash_entry *h;
r_symndx = ELF32_R_SYM (rel->r_info);
+ r_type = ELF32_R_TYPE (rel->r_info);
if (r_symndx < extsymoff)
h = NULL;
@@ -5912,7 +7460,7 @@ mips_elf_check_relocs (abfd, info, sec, relocs)
/* Some relocs require a global offset table. */
if (dynobj == NULL || sgot == NULL)
{
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (r_type)
{
case R_MIPS_GOT16:
case R_MIPS_CALL16:
@@ -5920,19 +7468,19 @@ mips_elf_check_relocs (abfd, info, sec, relocs)
case R_MIPS_CALL_LO16:
case R_MIPS_GOT_HI16:
case R_MIPS_GOT_LO16:
+ case R_MIPS_GOT_PAGE:
+ case R_MIPS_GOT_OFST:
+ case R_MIPS_GOT_DISP:
if (dynobj == NULL)
elf_hash_table (info)->dynobj = dynobj = abfd;
if (! mips_elf_create_got_section (dynobj, info))
return false;
- sgot = bfd_get_section_by_name (dynobj, ".got");
- BFD_ASSERT (sgot != NULL);
- BFD_ASSERT (elf_section_data (sgot) != NULL);
- g = (struct mips_got_info *) elf_section_data (sgot)->tdata;
- BFD_ASSERT (g != NULL);
+ g = mips_elf_got_info (dynobj, &sgot);
break;
case R_MIPS_32:
case R_MIPS_REL32:
+ case R_MIPS_64:
if (dynobj == NULL
&& (info->shared || h != NULL)
&& (sec->flags & SEC_ALLOC) != 0)
@@ -5944,90 +7492,73 @@ mips_elf_check_relocs (abfd, info, sec, relocs)
}
}
- switch (ELF32_R_TYPE (rel->r_info))
+ if (!h && (r_type == R_MIPS_CALL_LO16
+ || r_type == R_MIPS_GOT_LO16
+ || r_type == R_MIPS_GOT_DISP))
{
- case R_MIPS_CALL16:
- case R_MIPS_CALL_HI16:
- case R_MIPS_CALL_LO16:
- /* This symbol requires a global offset table entry. */
+ /* We may need a local GOT entry for this relocation. We
+ don't count R_MIPS_GOT_PAGE because we can estimate the
+ maximum number of pages needed by looking at the size of
+ the segment. Similar comments apply to R_MIPS_GOT16. We
+ don't count R_MIPS_GOT_HI16, or R_MIPS_CALL_HI16 because
+ these are always followed by an R_MIPS_GOT_LO16 or
+ R_MIPS_CALL_LO16.
+
+ This estimation is very conservative since we can merge
+ duplicate entries in the GOT. In order to be less
+ conservative, we could actually build the GOT here,
+ rather than in relocate_section. */
+ g->local_gotno++;
+ sgot->_raw_size += MIPS_ELF_GOT_SIZE (dynobj);
+ }
+ switch (r_type)
+ {
+ case R_MIPS_CALL16:
if (h == NULL)
{
(*_bfd_error_handler)
- ("%s: CALL16 reloc at 0x%lx not against global symbol",
+ (_("%s: CALL16 reloc at 0x%lx not against global symbol"),
bfd_get_filename (abfd), (unsigned long) rel->r_offset);
bfd_set_error (bfd_error_bad_value);
return false;
}
+ /* Fall through. */
- /* Make sure this symbol is output as a dynamic symbol. */
- if (h->dynindx == -1)
+ case R_MIPS_CALL_HI16:
+ case R_MIPS_CALL_LO16:
+ if (h != NULL)
{
- if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+ /* This symbol requires a global offset table entry. */
+ if (!mips_elf_record_global_got_symbol (h, info, g))
return false;
- }
- if (h->got_offset != (bfd_vma) -1)
- {
- /* We have already allocated space in the .got. */
- break;
+ /* We need a stub, not a plt entry for the undefined
+ function. But we record it as if it needs plt. See
+ elf_adjust_dynamic_symbol in elflink.h. */
+ h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
+ h->type = STT_FUNC;
}
-
- /* Note the index of the first global got symbol in .dynsym. */
- if (g->global_gotsym == 0
- || g->global_gotsym > (unsigned long) h->dynindx)
- g->global_gotsym = h->dynindx;
-
- /* Make this symbol to have the corresponding got entry. */
- h->got_offset = 0;
-
- /* We need a stub, not a plt entry for the undefined
- function. But we record it as if it needs plt. See
- elf_adjust_dynamic_symbol in elflink.h. */
- h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
- h->type = STT_FUNC;
-
break;
case R_MIPS_GOT16:
case R_MIPS_GOT_HI16:
case R_MIPS_GOT_LO16:
+ case R_MIPS_GOT_DISP:
/* This symbol requires a global offset table entry. */
-
- if (h != NULL)
- {
- /* Make sure this symbol is output as a dynamic symbol. */
- if (h->dynindx == -1)
- {
- if (! bfd_elf32_link_record_dynamic_symbol (info, h))
- return false;
- }
-
- if (h->got_offset != (bfd_vma) -1)
- {
- /* We have already allocated space in the .got. */
- break;
- }
- /* Note the index of the first global got symbol in
- .dynsym. */
- if (g->global_gotsym == 0
- || g->global_gotsym > (unsigned long) h->dynindx)
- g->global_gotsym = h->dynindx;
-
- /* Make this symbol to be the global got symbol. */
- h->got_offset = 0;
- }
-
+ if (h && !mips_elf_record_global_got_symbol (h, info, g))
+ return false;
break;
case R_MIPS_32:
case R_MIPS_REL32:
+ case R_MIPS_64:
if ((info->shared || h != NULL)
&& (sec->flags & SEC_ALLOC) != 0)
{
if (sreloc == NULL)
{
- const char *name = ".rel.dyn";
+ const char *name = MIPS_ELF_REL_DYN_SECTION_NAME (dynobj);
sreloc = bfd_get_section_by_name (dynobj, name);
if (sreloc == NULL)
@@ -6047,19 +7578,11 @@ mips_elf_check_relocs (abfd, info, sec, relocs)
}
}
if (info->shared)
- {
- /* When creating a shared object, we must copy these
- reloc types into the output file as R_MIPS_REL32
- relocs. We make room for this reloc in the
- .rel.dyn reloc section */
- if (sreloc->_raw_size == 0)
- {
- /* Add a null element. */
- sreloc->_raw_size += sizeof (Elf32_External_Rel);
- ++sreloc->reloc_count;
- }
- sreloc->_raw_size += sizeof (Elf32_External_Rel);
- }
+ /* When creating a shared object, we must copy these
+ reloc types into the output file as R_MIPS_REL32
+ relocs. We make room for this reloc in the
+ .rel.dyn reloc section. */
+ mips_elf_allocate_dynamic_relocations (dynobj, 1);
else
{
struct mips_elf_link_hash_entry *hmips;
@@ -6067,25 +7590,46 @@ mips_elf_check_relocs (abfd, info, sec, relocs)
/* We only need to copy this reloc if the symbol is
defined in a dynamic object. */
hmips = (struct mips_elf_link_hash_entry *) h;
- ++hmips->mips_32_relocs;
+ ++hmips->possibly_dynamic_relocs;
}
+
+ /* Even though we don't directly need a GOT entry for
+ this symbol, a symbol must have a dynamic symbol
+ table index greater that DT_MIPS_GOTSYM if there are
+ dynamic relocations against it. */
+ if (h != NULL
+ && !mips_elf_record_global_got_symbol (h, info, g))
+ return false;
}
- if (SGI_COMPAT (abfd))
+ if (SGI_COMPAT (dynobj))
mips_elf_hash_table (info)->compact_rel_size +=
sizeof (Elf32_External_crinfo);
-
break;
case R_MIPS_26:
case R_MIPS_GPREL16:
case R_MIPS_LITERAL:
case R_MIPS_GPREL32:
- if (SGI_COMPAT (abfd))
+ if (SGI_COMPAT (dynobj))
mips_elf_hash_table (info)->compact_rel_size +=
sizeof (Elf32_External_crinfo);
break;
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_MIPS_GNU_VTINHERIT:
+ if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return false;
+ break;
+
+ /* This relocation describes which C++ vtable entries are actually
+ used. Record for later use during GC. */
+ case R_MIPS_GNU_VTENTRY:
+ if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_offset))
+ return false;
+ break;
+
default:
break;
}
@@ -6094,7 +7638,7 @@ mips_elf_check_relocs (abfd, info, sec, relocs)
symbol, then we will need the fn_stub if there is one.
References from a stub section do not count. */
if (h != NULL
- && ELF32_R_TYPE (rel->r_info) != R_MIPS16_26
+ && r_type != R_MIPS16_26
&& strncmp (bfd_get_section_name (abfd, sec), FN_STUB,
sizeof FN_STUB - 1) != 0
&& strncmp (bfd_get_section_name (abfd, sec), CALL_STUB,
@@ -6112,14 +7656,109 @@ mips_elf_check_relocs (abfd, info, sec, relocs)
return true;
}
+/* Return the section that should be marked against GC for a given
+ relocation. */
+
+asection *
+_bfd_mips_elf_gc_mark_hook (abfd, info, rel, h, sym)
+ bfd *abfd;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ Elf_Internal_Rela *rel;
+ struct elf_link_hash_entry *h;
+ Elf_Internal_Sym *sym;
+{
+ /* ??? Do mips16 stub sections need to be handled special? */
+
+ if (h != NULL)
+ {
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ case R_MIPS_GNU_VTINHERIT:
+ case R_MIPS_GNU_VTENTRY:
+ break;
+
+ default:
+ switch (h->root.type)
+ {
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ return h->root.u.def.section;
+
+ case bfd_link_hash_common:
+ return h->root.u.c.p->section;
+
+ default:
+ break;
+ }
+ }
+ }
+ else
+ {
+ if (!(elf_bad_symtab (abfd)
+ && ELF_ST_BIND (sym->st_info) != STB_LOCAL)
+ && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE)
+ && sym->st_shndx != SHN_COMMON))
+ {
+ return bfd_section_from_elf_index (abfd, sym->st_shndx);
+ }
+ }
+
+ return NULL;
+}
+
+/* Update the got entry reference counts for the section being removed. */
+
+boolean
+_bfd_mips_elf_gc_sweep_hook (abfd, info, sec, relocs)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ asection *sec ATTRIBUTE_UNUSED;
+ const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED;
+{
+#if 0
+ Elf_Internal_Shdr *symtab_hdr;
+ struct elf_link_hash_entry **sym_hashes;
+ bfd_signed_vma *local_got_refcounts;
+ const Elf_Internal_Rela *rel, *relend;
+ unsigned long r_symndx;
+ struct elf_link_hash_entry *h;
+
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (abfd);
+ local_got_refcounts = elf_local_got_refcounts (abfd);
+
+ relend = relocs + sec->reloc_count;
+ for (rel = relocs; rel < relend; rel++)
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ case R_MIPS_GOT16:
+ case R_MIPS_CALL16:
+ case R_MIPS_CALL_HI16:
+ case R_MIPS_CALL_LO16:
+ case R_MIPS_GOT_HI16:
+ case R_MIPS_GOT_LO16:
+ /* ??? It would seem that the existing MIPS code does no sort
+ of reference counting or whatnot on its GOT and PLT entries,
+ so it is not possible to garbage collect them at this time. */
+ break;
+
+ default:
+ break;
+ }
+#endif
+
+ return true;
+}
+
+
/* Adjust a symbol defined by a dynamic object and referenced by a
regular object. The current definition is in some section of the
dynamic object, but we're not including those sections. We have to
change the definition to something the rest of the link can
understand. */
-static boolean
-mips_elf_adjust_dynamic_symbol (info, h)
+boolean
+_bfd_mips_elf_adjust_dynamic_symbol (info, h)
struct bfd_link_info *info;
struct elf_link_hash_entry *h;
{
@@ -6145,20 +7784,10 @@ mips_elf_adjust_dynamic_symbol (info, h)
file. */
hmips = (struct mips_elf_link_hash_entry *) h;
if (! info->relocateable
- && hmips->mips_32_relocs != 0
+ && hmips->possibly_dynamic_relocs != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
- {
- s = bfd_get_section_by_name (dynobj, ".rel.dyn");
- BFD_ASSERT (s != NULL);
-
- if (s->_raw_size == 0)
- {
- /* Make room for a null element. */
- s->_raw_size += sizeof (Elf32_External_Rel);
- ++s->reloc_count;
- }
- s->_raw_size += hmips->mips_32_relocs * sizeof (Elf32_External_Rel);
- }
+ mips_elf_allocate_dynamic_relocations (dynobj,
+ hmips->possibly_dynamic_relocs);
/* For a function, create a stub, if needed. */
if (h->type == STT_FUNC
@@ -6174,14 +7803,15 @@ mips_elf_adjust_dynamic_symbol (info, h)
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
{
/* We need .stub section. */
- s = bfd_get_section_by_name (dynobj, ".stub");
+ s = bfd_get_section_by_name (dynobj,
+ MIPS_ELF_STUB_SECTION_NAME (dynobj));
BFD_ASSERT (s != NULL);
h->root.u.def.section = s;
h->root.u.def.value = s->_raw_size;
/* XXX Write this stub address somewhere. */
- h->plt_offset = s->_raw_size;
+ h->plt.offset = s->_raw_size;
/* Make room for this stub code. */
s->_raw_size += MIPS_FUNCTION_STUB_SIZE;
@@ -6217,11 +7847,18 @@ mips_elf_adjust_dynamic_symbol (info, h)
static boolean mips_elf_check_mips16_stubs
PARAMS ((struct mips_elf_link_hash_entry *, PTR));
-static boolean
-mips_elf_always_size_sections (output_bfd, info)
+boolean
+_bfd_mips_elf_always_size_sections (output_bfd, info)
bfd *output_bfd;
struct bfd_link_info *info;
{
+ asection *ri;
+
+ /* The .reginfo section has a fixed size. */
+ ri = bfd_get_section_by_name (output_bfd, ".reginfo");
+ if (ri != NULL)
+ bfd_set_section_size (output_bfd, ri, sizeof (Elf32_External_RegInfo));
+
if (info->relocateable
|| ! mips_elf_hash_table (info)->mips16_stubs_seen)
return true;
@@ -6240,7 +7877,7 @@ mips_elf_always_size_sections (output_bfd, info)
static boolean
mips_elf_check_mips16_stubs (h, data)
struct mips_elf_link_hash_entry *h;
- PTR data;
+ PTR data ATTRIBUTE_UNUSED;
{
if (h->fn_stub != NULL
&& ! h->need_fn_stub)
@@ -6286,16 +7923,15 @@ mips_elf_check_mips16_stubs (h, data)
/* Set the sizes of the dynamic sections. */
-static boolean
-mips_elf_size_dynamic_sections (output_bfd, info)
+boolean
+_bfd_mips_elf_size_dynamic_sections (output_bfd, info)
bfd *output_bfd;
struct bfd_link_info *info;
{
bfd *dynobj;
asection *s;
boolean reltext;
- asection *sgot;
- struct mips_got_info *g;
+ struct mips_got_info *g = NULL;
dynobj = elf_hash_table (info)->dynobj;
BFD_ASSERT (dynobj != NULL);
@@ -6307,43 +7943,13 @@ mips_elf_size_dynamic_sections (output_bfd, info)
{
s = bfd_get_section_by_name (dynobj, ".interp");
BFD_ASSERT (s != NULL);
- s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
- s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
+ s->_raw_size
+ = strlen (ELF_DYNAMIC_INTERPRETER (output_bfd)) + 1;
+ s->contents
+ = (bfd_byte *) ELF_DYNAMIC_INTERPRETER (output_bfd);
}
}
- /* Recompute the size of .got for local entires (reserved and
- hipages) if needed. To estimate it, get the upper bound of total
- size of loadable sections. */
- sgot = bfd_get_section_by_name (dynobj, ".got");
-
- if (sgot != NULL)
- {
- bfd_size_type loadable_size = 0;
- bfd_size_type local_gotno;
- struct _bfd *sub;
-
- BFD_ASSERT (elf_section_data (sgot) != NULL);
- g = (struct mips_got_info *) elf_section_data (sgot)->tdata;
- BFD_ASSERT (g != NULL);
-
- for (sub = info->input_bfds; sub; sub = sub->link_next)
- for (s = sub->sections; s != NULL; s = s->next)
- {
- if ((s->flags & SEC_ALLOC) == 0)
- continue;
- loadable_size += (s->_raw_size + 0xf) & ~0xf;
- }
-
- loadable_size += MIPS_FUNCTION_STUB_SIZE;
-
- /* Assume there are two loadable segments consisting of
- contiguous sections. Is 5 enough? */
- local_gotno = (loadable_size >> 16) + 5 + MIPS_RESERVED_GOTNO;
- g->local_gotno = local_gotno;
- sgot->_raw_size += local_gotno * 4;
- }
-
/* The check_relocs and adjust_dynamic_symbol entry points have
determined the sizes of the various dynamic sections. Allocate
memory for them. */
@@ -6365,7 +7971,18 @@ mips_elf_size_dynamic_sections (output_bfd, info)
if (strncmp (name, ".rel", 4) == 0)
{
if (s->_raw_size == 0)
- strip = true;
+ {
+ /* We only strip the section if the output section name
+ has the same name. Otherwise, there might be several
+ input sections for this output section. FIXME: This
+ code is probably not needed these days anyhow, since
+ the linker now does not create empty output sections. */
+ if (s->output_section != NULL
+ && strcmp (name,
+ bfd_get_section_name (s->output_section->owner,
+ s->output_section)) == 0)
+ strip = true;
+ }
else
{
const char *outname;
@@ -6383,30 +8000,76 @@ mips_elf_size_dynamic_sections (output_bfd, info)
if ((target != NULL
&& (target->flags & SEC_READONLY) != 0
&& (target->flags & SEC_ALLOC) != 0)
- || strcmp (outname, ".rel.dyn") == 0)
+ || strcmp (outname,
+ MIPS_ELF_REL_DYN_SECTION_NAME (output_bfd)) == 0)
reltext = true;
/* We use the reloc_count field as a counter if we need
to copy relocs into the output file. */
- if (strcmp (name, ".rel.dyn") != 0)
+ if (strcmp (name,
+ MIPS_ELF_REL_DYN_SECTION_NAME (output_bfd)) != 0)
s->reloc_count = 0;
}
}
else if (strncmp (name, ".got", 4) == 0)
{
int i;
+ bfd_size_type loadable_size = 0;
+ bfd_size_type local_gotno;
+ struct _bfd *sub;
- BFD_ASSERT (elf_section_data (s) != NULL);
+ BFD_ASSERT (elf_section_data (s) != NULL);
g = (struct mips_got_info *) elf_section_data (s)->tdata;
- BFD_ASSERT (g != NULL);
-
- /* Fix the size of .got section for the correspondence of
- global symbols and got entries. This adds some useless
- got entries. Is this required by ABI really? */
- i = elf_hash_table (info)->dynsymcount - g->global_gotsym;
- s->_raw_size += i * 4;
+ BFD_ASSERT (g != NULL);
+
+ /* Calculate the total loadable size of the output. That
+ will give us the maximum number of GOT_PAGE entries
+ required. */
+ for (sub = info->input_bfds; sub; sub = sub->link_next)
+ {
+ asection *subsection;
+
+ for (subsection = sub->sections;
+ subsection;
+ subsection = subsection->next)
+ {
+ if ((subsection->flags & SEC_ALLOC) == 0)
+ continue;
+ loadable_size += (subsection->_raw_size + 0xf) & ~0xf;
+ }
+ }
+ loadable_size += MIPS_FUNCTION_STUB_SIZE;
+
+ /* Assume there are two loadable segments consisting of
+ contiguous sections. Is 5 enough? */
+ local_gotno = (loadable_size >> 16) + 5;
+ if (IRIX_COMPAT (output_bfd) == ict_irix6)
+ /* It's possible we will need GOT_PAGE entries as well as
+ GOT16 entries. Often, these will be able to share GOT
+ entries, but not always. */
+ local_gotno *= 2;
+
+ g->local_gotno += local_gotno;
+ s->_raw_size += local_gotno * MIPS_ELF_GOT_SIZE (dynobj);
+
+ /* There has to be a global GOT entry for every symbol with
+ a dynamic symbol table index of DT_MIPS_GOTSYM or
+ higher. Therefore, it make sense to put those symbols
+ that need GOT entries at the end of the symbol table. We
+ do that here. */
+ if (!mips_elf_sort_hash_table (info, 1))
+ return false;
+
+ if (g->global_gotsym != NULL)
+ i = elf_hash_table (info)->dynsymcount - g->global_gotsym->dynindx;
+ else
+ /* If there are no global symbols, or none requiring
+ relocations, then GLOBAL_GOTSYM will be NULL. */
+ i = 0;
+ g->global_gotno = i;
+ s->_raw_size += i * MIPS_ELF_GOT_SIZE (dynobj);
}
- else if (strncmp (name, ".stub", 5) == 0)
+ else if (strcmp (name, MIPS_ELF_STUB_SECTION_NAME (output_bfd)) == 0)
{
/* Irix rld assumes that the function stub isn't at the end
of .text section. So put a dummy. XXX */
@@ -6423,6 +8086,11 @@ mips_elf_size_dynamic_sections (output_bfd, info)
else if (SGI_COMPAT (output_bfd)
&& strncmp (name, ".compact_rel", 12) == 0)
s->_raw_size += mips_elf_hash_table (info)->compact_rel_size;
+ else if (strcmp (name, MIPS_ELF_MSYM_SECTION_NAME (output_bfd))
+ == 0)
+ s->_raw_size = (sizeof (Elf32_External_Msym)
+ * (elf_hash_table (info)->dynsymcount
+ + bfd_count_sections (output_bfd)));
else if (strncmp (name, ".init", 5) != 0)
{
/* It's not one of our sections, so don't allocate space. */
@@ -6431,26 +8099,17 @@ mips_elf_size_dynamic_sections (output_bfd, info)
if (strip)
{
- asection **spp;
-
- for (spp = &s->output_section->owner->sections;
- *spp != s->output_section;
- spp = &(*spp)->next)
- ;
- *spp = s->output_section->next;
- --s->output_section->owner->section_count;
-
+ _bfd_strip_section_from_output (info, s);
continue;
}
/* Allocate memory for the section contents. */
- s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size);
+ s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
if (s->contents == NULL && s->_raw_size != 0)
{
bfd_set_error (bfd_error_no_memory);
return false;
}
- memset (s->contents, 0, s->_raw_size);
}
if (elf_hash_table (info)->dynamic_sections_created)
@@ -6466,200 +8125,166 @@ mips_elf_size_dynamic_sections (output_bfd, info)
{
/* SGI object has the equivalence of DT_DEBUG in the
DT_MIPS_RLD_MAP entry. */
- if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_RLD_MAP, 0))
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_RLD_MAP, 0))
return false;
}
else
- if (! bfd_elf32_add_dynamic_entry (info, DT_DEBUG, 0))
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_DEBUG, 0))
return false;
}
if (reltext)
{
- if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0))
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_TEXTREL, 0))
return false;
}
- if (! bfd_elf32_add_dynamic_entry (info, DT_PLTGOT, 0))
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_PLTGOT, 0))
return false;
- if (bfd_get_section_by_name (dynobj, ".rel.dyn"))
+ if (bfd_get_section_by_name (dynobj,
+ MIPS_ELF_REL_DYN_SECTION_NAME (dynobj)))
{
- if (! bfd_elf32_add_dynamic_entry (info, DT_REL, 0))
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_REL, 0))
return false;
- if (! bfd_elf32_add_dynamic_entry (info, DT_RELSZ, 0))
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELSZ, 0))
return false;
- if (! bfd_elf32_add_dynamic_entry (info, DT_RELENT, 0))
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELENT, 0))
return false;
}
- if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_CONFLICTNO, 0))
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_CONFLICTNO, 0))
return false;
- if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_LIBLISTNO, 0))
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_LIBLISTNO, 0))
return false;
if (bfd_get_section_by_name (dynobj, ".conflict") != NULL)
{
- if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_CONFLICT, 0))
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_CONFLICT, 0))
return false;
s = bfd_get_section_by_name (dynobj, ".liblist");
BFD_ASSERT (s != NULL);
- if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_LIBLIST, 0))
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_LIBLIST, 0))
return false;
}
- if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_RLD_VERSION, 0))
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_RLD_VERSION, 0))
return false;
- if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_FLAGS, 0))
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_FLAGS, 0))
return false;
#if 0
/* Time stamps in executable files are a bad idea. */
- if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_TIME_STAMP, 0))
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_TIME_STAMP, 0))
return false;
#endif
#if 0 /* FIXME */
- if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_ICHECKSUM, 0))
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_ICHECKSUM, 0))
return false;
#endif
#if 0 /* FIXME */
- if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_IVERSION, 0))
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_IVERSION, 0))
return false;
#endif
- if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_BASE_ADDRESS, 0))
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_BASE_ADDRESS, 0))
return false;
- if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_LOCAL_GOTNO, 0))
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_LOCAL_GOTNO, 0))
return false;
- if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_SYMTABNO, 0))
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_SYMTABNO, 0))
return false;
- if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_UNREFEXTNO, 0))
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_UNREFEXTNO, 0))
return false;
- if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_GOTSYM, 0))
+ if (! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_GOTSYM, 0))
return false;
- if (! bfd_elf32_add_dynamic_entry (info, DT_MIPS_HIPAGENO, 0))
+ if (IRIX_COMPAT (dynobj) == ict_irix5
+ && ! MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_HIPAGENO, 0))
return false;
-#if 0 /* (SGI_COMPAT) */
- if (! bfd_get_section_by_name (dynobj, ".init"))
- if (! bfd_elf32_add_dynamic_entry (info, DT_INIT, 0))
- return false;
+ if (IRIX_COMPAT (dynobj) == ict_irix6
+ && (bfd_get_section_by_name
+ (dynobj, MIPS_ELF_OPTIONS_SECTION_NAME (dynobj)))
+ && !MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_OPTIONS, 0))
+ return false;
- if (! bfd_get_section_by_name (dynobj, ".fini"))
- if (! bfd_elf32_add_dynamic_entry (info, DT_FINI, 0))
- return false;
-#endif
+ if (bfd_get_section_by_name (dynobj,
+ MIPS_ELF_MSYM_SECTION_NAME (dynobj))
+ && !MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_MSYM, 0))
+ return false;
}
- /* If we use dynamic linking, we generate a section symbol for each
- output section. These are local symbols, which means that they
- must come first in the dynamic symbol table.
- That means we must increment the dynamic symbol index of every
- other dynamic symbol. */
- {
- const char * const *namep;
- unsigned int c, i;
- bfd_size_type strindex;
- struct bfd_strtab_hash *dynstr;
- struct mips_got_info *g;
-
- c = 0;
- if (elf_hash_table (info)->dynamic_sections_created)
- {
- if (SGI_COMPAT (output_bfd))
- {
- c = SIZEOF_MIPS_DYNSYM_SECNAMES - 1;
- elf_link_hash_traverse (elf_hash_table (info),
- mips_elf_adjust_dynindx,
- (PTR) &c);
- elf_hash_table (info)->dynsymcount += c;
-
- dynstr = elf_hash_table (info)->dynstr;
- BFD_ASSERT (dynstr != NULL);
-
- for (i = 1, namep = mips_elf_dynsym_sec_names;
- *namep != NULL;
- i++, namep++)
- {
- s = bfd_get_section_by_name (output_bfd, *namep);
- if (s != NULL)
- elf_section_data (s)->dynindx = i;
-
- strindex = _bfd_stringtab_add (dynstr, *namep, true, false);
- if (strindex == (bfd_size_type) -1)
- return false;
-
- mips_elf_hash_table (info)->dynsym_sec_strindex[i] = strindex;
- }
- }
- else
- {
- c = bfd_count_sections (output_bfd);
- elf_link_hash_traverse (elf_hash_table (info),
- mips_elf_adjust_dynindx,
- (PTR) &c);
- elf_hash_table (info)->dynsymcount += c;
-
- for (i = 1, s = output_bfd->sections; s != NULL; s = s->next, i++)
- {
- elf_section_data (s)->dynindx = i;
- /* These symbols will have no names, so we don't need to
- fiddle with dynstr_index. */
- }
- }
- }
-
- if (sgot != NULL)
- {
- BFD_ASSERT (elf_section_data (sgot) != NULL);
- g = (struct mips_got_info *) elf_section_data (sgot)->tdata;
- BFD_ASSERT (g != NULL);
-
- /* If there are no global got symbols, fake the last symbol so
- for safety. */
- if (g->global_gotsym)
- g->global_gotsym += c;
- else
- g->global_gotsym = elf_hash_table (info)->dynsymcount - 1;
- }
- }
-
return true;
}
-/* Increment the index of a dynamic symbol by a given amount. Called
- via elf_link_hash_traverse. */
+/* If NAME is one of the special IRIX6 symbols defined by the linker,
+ adjust it appropriately now. */
-static boolean
-mips_elf_adjust_dynindx (h, cparg)
- struct elf_link_hash_entry *h;
- PTR cparg;
+static void
+mips_elf_irix6_finish_dynamic_symbol (abfd, name, sym)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ const char *name;
+ Elf_Internal_Sym *sym;
{
- unsigned int *cp = (unsigned int *) cparg;
-
- if (h->dynindx != -1)
- h->dynindx += *cp;
- return true;
+ /* The linker script takes care of providing names and values for
+ these, but we must place them into the right sections. */
+ static const char* const text_section_symbols[] = {
+ "_ftext",
+ "_etext",
+ "__dso_displacement",
+ "__elf_header",
+ "__program_header_table",
+ NULL
+ };
+
+ static const char* const data_section_symbols[] = {
+ "_fdata",
+ "_edata",
+ "_end",
+ "_fbss",
+ NULL
+ };
+
+ const char* const *p;
+ int i;
+
+ for (i = 0; i < 2; ++i)
+ for (p = (i == 0) ? text_section_symbols : data_section_symbols;
+ *p;
+ ++p)
+ if (strcmp (*p, name) == 0)
+ {
+ /* All of these symbols are given type STT_SECTION by the
+ IRIX6 linker. */
+ sym->st_info = ELF_ST_INFO (STB_GLOBAL, STT_SECTION);
+
+ /* The IRIX linker puts these symbols in special sections. */
+ if (i == 0)
+ sym->st_shndx = SHN_MIPS_TEXT;
+ else
+ sym->st_shndx = SHN_MIPS_DATA;
+
+ break;
+ }
}
/* Finish up dynamic symbol handling. We set the contents of various
dynamic sections here. */
-static boolean
-mips_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
+boolean
+_bfd_mips_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
bfd *output_bfd;
struct bfd_link_info *info;
struct elf_link_hash_entry *h;
@@ -6668,13 +8293,16 @@ mips_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
bfd *dynobj;
bfd_vma gval;
asection *sgot;
+ asection *smsym;
struct mips_got_info *g;
const char *name;
+ struct mips_elf_link_hash_entry *mh;
dynobj = elf_hash_table (info)->dynobj;
gval = sym->st_value;
+ mh = (struct mips_elf_link_hash_entry *) h;
- if (h->plt_offset != (bfd_vma) -1)
+ if (h->plt.offset != (bfd_vma) -1)
{
asection *s;
bfd_byte *p;
@@ -6684,7 +8312,8 @@ mips_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
BFD_ASSERT (h->dynindx != -1);
- s = bfd_get_section_by_name (dynobj, ".stub");
+ s = bfd_get_section_by_name (dynobj,
+ MIPS_ELF_STUB_SECTION_NAME (dynobj));
BFD_ASSERT (s != NULL);
/* Fill the stub. */
@@ -6702,41 +8331,64 @@ mips_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
p += 4;
bfd_put_32 (output_bfd, STUB_LI16 + h->dynindx, p);
- BFD_ASSERT (h->plt_offset <= s->_raw_size);
- memcpy (s->contents + h->plt_offset, stub, MIPS_FUNCTION_STUB_SIZE);
+ BFD_ASSERT (h->plt.offset <= s->_raw_size);
+ memcpy (s->contents + h->plt.offset, stub, MIPS_FUNCTION_STUB_SIZE);
- /* Mark the symbol as undefined. plt_offset != -1 occurs
+ /* Mark the symbol as undefined. plt.offset != -1 occurs
only for the referenced symbol. */
sym->st_shndx = SHN_UNDEF;
/* The run-time linker uses the st_value field of the symbol
to reset the global offset table entry for this external
to its stub address when unlinking a shared object. */
- gval = s->output_section->vma + s->output_offset + h->plt_offset;
+ gval = s->output_section->vma + s->output_offset + h->plt.offset;
sym->st_value = gval;
}
BFD_ASSERT (h->dynindx != -1);
- sgot = bfd_get_section_by_name (dynobj, ".got");
+ sgot = mips_elf_got_section (dynobj);
BFD_ASSERT (sgot != NULL);
BFD_ASSERT (elf_section_data (sgot) != NULL);
g = (struct mips_got_info *) elf_section_data (sgot)->tdata;
BFD_ASSERT (g != NULL);
- if ((unsigned long) h->dynindx >= g->global_gotsym)
+ /* Run through the global symbol table, creating GOT entries for all
+ the symbols that need them. */
+ if (g->global_gotsym != NULL
+ && h->dynindx >= g->global_gotsym->dynindx)
{
- bfd_size_type offset;
+ bfd_vma offset;
+ bfd_vma value;
- /* This symbol has an entry in the global offset table. Set its
- value to the corresponding got entry, if needed. */
- if (h->got_offset == (bfd_vma) -1)
- {
- offset = (h->dynindx - g->global_gotsym + g->local_gotno) * 4;
- BFD_ASSERT (g->local_gotno * 4 <= offset
- && offset < sgot->_raw_size);
- bfd_put_32 (output_bfd, gval, sgot->contents + offset);
- }
+ if (sym->st_value)
+ value = sym->st_value;
+ else
+ /* For an entity defined in a shared object, this will be
+ NULL. (For functions in shared objects for
+ which we have created stubs, ST_VALUE will be non-NULL.
+ That's because such the functions are now no longer defined
+ in a shared object.) */
+ value = h->root.u.def.value;
+
+ offset = mips_elf_global_got_index (dynobj, h);
+ MIPS_ELF_PUT_WORD (output_bfd, value, sgot->contents + offset);
+ }
+
+ /* Create a .msym entry, if appropriate. */
+ smsym = bfd_get_section_by_name (dynobj,
+ MIPS_ELF_MSYM_SECTION_NAME (dynobj));
+ if (smsym)
+ {
+ Elf32_Internal_Msym msym;
+
+ msym.ms_hash_value = bfd_elf_hash (h->root.root.string);
+ /* It is undocumented what the `1' indicates, but IRIX6 uses
+ this value. */
+ msym.ms_info = ELF32_MS_INFO (mh->min_dyn_reloc_index, 1);
+ bfd_mips_elf_swap_msym_out
+ (dynobj, &msym,
+ ((Elf32_External_Msym *) smsym->contents) + h->dynindx);
}
/* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */
@@ -6782,6 +8434,10 @@ mips_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
}
}
+ /* Handle the IRIX6-specific symbols. */
+ if (IRIX_COMPAT (output_bfd) == ict_irix6)
+ mips_elf_irix6_finish_dynamic_symbol (output_bfd, name, sym);
+
if (SGI_COMPAT (output_bfd)
&& ! info->shared)
{
@@ -6798,8 +8454,10 @@ mips_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
else if (mips_elf_hash_table (info)->use_rld_obj_head
&& strcmp (name, "__rld_obj_head") == 0)
{
- asection *s = bfd_get_section_by_name (dynobj, ".rld_map");
- BFD_ASSERT (s != NULL);
+ /* IRIX6 does not use a .rld_map section. */
+ if (IRIX_COMPAT (output_bfd) == ict_irix5)
+ BFD_ASSERT (bfd_get_section_by_name (dynobj, ".rld_map")
+ != NULL);
mips_elf_hash_table (info)->rld_value = sym->st_value;
}
}
@@ -6814,8 +8472,8 @@ mips_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
/* Finish up the dynamic sections. */
-static boolean
-mips_elf_finish_dynamic_sections (output_bfd, info)
+boolean
+_bfd_mips_elf_finish_dynamic_sections (output_bfd, info)
bfd *output_bfd;
struct bfd_link_info *info;
{
@@ -6828,7 +8486,7 @@ mips_elf_finish_dynamic_sections (output_bfd, info)
sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
- sgot = bfd_get_section_by_name (dynobj, ".got");
+ sgot = mips_elf_got_section (dynobj);
if (sgot == NULL)
g = NULL;
else
@@ -6840,39 +8498,41 @@ mips_elf_finish_dynamic_sections (output_bfd, info)
if (elf_hash_table (info)->dynamic_sections_created)
{
- Elf32_External_Dyn *dyncon, *dynconend;
+ bfd_byte *b;
BFD_ASSERT (sdyn != NULL);
BFD_ASSERT (g != NULL);
- dyncon = (Elf32_External_Dyn *) sdyn->contents;
- dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
- for (; dyncon < dynconend; dyncon++)
+ for (b = sdyn->contents;
+ b < sdyn->contents + sdyn->_raw_size;
+ b += MIPS_ELF_DYN_SIZE (dynobj))
{
Elf_Internal_Dyn dyn;
const char *name;
size_t elemsize;
asection *s;
+ boolean swap_out_p;
- bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
+ /* Read in the current dynamic entry. */
+ (*get_elf_backend_data (dynobj)->s->swap_dyn_in) (dynobj, b, &dyn);
+
+ /* Assume that we're going to modify it and write it out. */
+ swap_out_p = true;
switch (dyn.d_tag)
{
- default:
- break;
-
case DT_RELENT:
- s = bfd_get_section_by_name (dynobj, ".rel.dyn");
+ s = (bfd_get_section_by_name
+ (dynobj,
+ MIPS_ELF_REL_DYN_SECTION_NAME (dynobj)));
BFD_ASSERT (s != NULL);
- dyn.d_un.d_val = sizeof (Elf32_External_Rel);
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ dyn.d_un.d_val = MIPS_ELF_REL_SIZE (dynobj);
break;
case DT_STRSZ:
/* Rewrite DT_STRSZ. */
dyn.d_un.d_val =
_bfd_stringtab_size (elf_hash_table (info)->dynstr);
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
case DT_PLTGOT:
@@ -6887,17 +8547,14 @@ mips_elf_finish_dynamic_sections (output_bfd, info)
s = bfd_get_section_by_name (output_bfd, name);
BFD_ASSERT (s != NULL);
dyn.d_un.d_ptr = s->vma;
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
case DT_MIPS_RLD_VERSION:
dyn.d_un.d_val = 1; /* XXX */
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
case DT_MIPS_FLAGS:
dyn.d_un.d_val = RHF_NOTPOT; /* XXX */
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
case DT_MIPS_CONFLICTNO:
@@ -6919,38 +8576,52 @@ mips_elf_finish_dynamic_sections (output_bfd, info)
}
else
dyn.d_un.d_val = 0;
-
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
case DT_MIPS_TIME_STAMP:
time ((time_t *) &dyn.d_un.d_val);
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
case DT_MIPS_ICHECKSUM:
/* XXX FIXME: */
+ swap_out_p = false;
break;
case DT_MIPS_IVERSION:
/* XXX FIXME: */
+ swap_out_p = false;
break;
case DT_MIPS_BASE_ADDRESS:
s = output_bfd->sections;
BFD_ASSERT (s != NULL);
dyn.d_un.d_ptr = s->vma & ~(0xffff);
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
case DT_MIPS_LOCAL_GOTNO:
dyn.d_un.d_val = g->local_gotno;
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
+ case DT_MIPS_UNREFEXTNO:
+ /* The index into the dynamic symbol table which is the
+ entry of the first external symbol that is not
+ referenced within the same object. */
+ dyn.d_un.d_val = bfd_count_sections (output_bfd) + 1;
+ break;
+
+ case DT_MIPS_GOTSYM:
+ if (g->global_gotsym)
+ {
+ dyn.d_un.d_val = g->global_gotsym->dynindx;
+ break;
+ }
+ /* In case if we don't have global got symbols we default
+ to setting DT_MIPS_GOTSYM to the same value as
+ DT_MIPS_SYMTABNO, so we just fall through. */
+
case DT_MIPS_SYMTABNO:
name = ".dynsym";
- elemsize = sizeof (Elf32_External_Sym);
+ elemsize = MIPS_ELF_SYM_SIZE (output_bfd);
s = bfd_get_section_by_name (output_bfd, name);
BFD_ASSERT (s != NULL);
@@ -6958,31 +8629,36 @@ mips_elf_finish_dynamic_sections (output_bfd, info)
dyn.d_un.d_val = s->_cooked_size / elemsize;
else
dyn.d_un.d_val = s->_raw_size / elemsize;
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
- break;
-
- case DT_MIPS_UNREFEXTNO:
- /* XXX FIXME: */
- dyn.d_un.d_val = SIZEOF_MIPS_DYNSYM_SECNAMES;
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
- break;
-
- case DT_MIPS_GOTSYM:
- dyn.d_un.d_val = g->global_gotsym;
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
case DT_MIPS_HIPAGENO:
dyn.d_un.d_val = g->local_gotno - MIPS_RESERVED_GOTNO;
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
case DT_MIPS_RLD_MAP:
dyn.d_un.d_ptr = mips_elf_hash_table (info)->rld_value;
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
+ case DT_MIPS_OPTIONS:
+ s = (bfd_get_section_by_name
+ (output_bfd, MIPS_ELF_OPTIONS_SECTION_NAME (output_bfd)));
+ dyn.d_un.d_ptr = s->vma;
+ break;
+
+ case DT_MIPS_MSYM:
+ s = (bfd_get_section_by_name
+ (output_bfd, MIPS_ELF_MSYM_SECTION_NAME (output_bfd)));
+ dyn.d_un.d_ptr = s->vma;
+ break;
+
+ default:
+ swap_out_p = false;
+ break;
}
+
+ if (swap_out_p)
+ (*get_elf_backend_data (dynobj)->s->swap_dyn_out)
+ (dynobj, &dyn, b);
}
}
@@ -6991,100 +8667,41 @@ mips_elf_finish_dynamic_sections (output_bfd, info)
This isn't the case of Irix rld. */
if (sgot != NULL && sgot->_raw_size > 0)
{
- bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
- bfd_put_32 (output_bfd, (bfd_vma) 0x80000000, sgot->contents + 4);
+ MIPS_ELF_PUT_WORD (output_bfd, (bfd_vma) 0, sgot->contents);
+ MIPS_ELF_PUT_WORD (output_bfd, (bfd_vma) 0x80000000,
+ sgot->contents + MIPS_ELF_GOT_SIZE (output_bfd));
}
if (sgot != NULL)
- elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4;
+ elf_section_data (sgot->output_section)->this_hdr.sh_entsize
+ = MIPS_ELF_GOT_SIZE (output_bfd);
{
- asection *sdynsym;
+ asection *smsym;
asection *s;
- unsigned int i;
- bfd_vma last;
- Elf_Internal_Sym sym;
- long dindx;
- const char *name;
- const char * const * namep = mips_elf_dynsym_sec_names;
Elf32_compact_rel cpt;
- /* Set up the section symbols for the output sections. SGI sets
- the STT_NOTYPE attribute for these symbols. Should we do so? */
+ /* ??? The section symbols for the output sections were set up in
+ _bfd_elf_final_link. SGI sets the STT_NOTYPE attribute for these
+ symbols. Should we do so? */
- sdynsym = bfd_get_section_by_name (dynobj, ".dynsym");
- if (sdynsym != NULL)
+ smsym = bfd_get_section_by_name (dynobj,
+ MIPS_ELF_MSYM_SECTION_NAME (dynobj));
+ if (smsym != NULL)
{
- if (SGI_COMPAT (output_bfd))
- {
- sym.st_size = 0;
- sym.st_name = 0;
- sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_NOTYPE);
- sym.st_other = 0;
+ Elf32_Internal_Msym msym;
- i = 0;
- last = 0;
- dindx = 0;
- while ((name = *namep++) != NULL)
- {
- s = bfd_get_section_by_name (output_bfd, name);
- if (s != NULL)
- {
- sym.st_value = s->vma;
- dindx = elf_section_data (s)->dynindx;
- last = s->vma + s->_raw_size;
- }
- else
- {
- sym.st_value = last;
- dindx++;
- }
-
- sym.st_shndx = (i < MIPS_TEXT_DYNSYM_SECNO
- ? SHN_MIPS_TEXT
- : SHN_MIPS_DATA);
- ++i;
- sym.st_name =
- mips_elf_hash_table (info)->dynsym_sec_strindex[dindx];
-
- bfd_elf32_swap_symbol_out (output_bfd, &sym,
- (((Elf32_External_Sym *)
- sdynsym->contents)
- + dindx));
- }
+ msym.ms_hash_value = 0;
+ msym.ms_info = ELF32_MS_INFO (0, 1);
- /* Set the sh_info field of the output .dynsym section to
- the index of the first global symbol. */
- elf_section_data (sdynsym->output_section)->this_hdr.sh_info =
- SIZEOF_MIPS_DYNSYM_SECNAMES;
- }
- else
+ for (s = output_bfd->sections; s != NULL; s = s->next)
{
- sym.st_size = 0;
- sym.st_name = 0;
- sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
- sym.st_other = 0;
-
- for (s = output_bfd->sections; s != NULL; s = s->next)
- {
- int indx;
-
- sym.st_value = s->vma;
-
- indx = elf_section_data (s)->this_idx;
- BFD_ASSERT (indx > 0);
- sym.st_shndx = indx;
-
- bfd_elf32_swap_symbol_out (output_bfd, &sym,
- (((Elf32_External_Sym *)
- sdynsym->contents)
- + elf_section_data (s)->dynindx));
- }
+ long dynindx = elf_section_data (s)->dynindx;
- /* Set the sh_info field of the output .dynsym section to
- the index of the first global symbol. */
- elf_section_data (sdynsym->output_section)->this_hdr.sh_info =
- bfd_count_sections (output_bfd) + 1;
+ bfd_mips_elf_swap_msym_out
+ (output_bfd, &msym,
+ (((Elf32_External_Msym *) smsym->contents)
+ + dynindx));
}
}
@@ -7106,7 +8723,8 @@ mips_elf_finish_dynamic_sections (output_bfd, info)
s->contents));
/* Clean up a dummy stub function entry in .text. */
- s = bfd_get_section_by_name (dynobj, ".stub");
+ s = bfd_get_section_by_name (dynobj,
+ MIPS_ELF_STUB_SECTION_NAME (dynobj));
if (s != NULL)
{
file_ptr dummy_offset;
@@ -7120,9 +8738,10 @@ mips_elf_finish_dynamic_sections (output_bfd, info)
}
/* Clean up a first relocation in .rel.dyn. */
- s = bfd_get_section_by_name (dynobj, ".rel.dyn");
+ s = bfd_get_section_by_name (dynobj,
+ MIPS_ELF_REL_DYN_SECTION_NAME (dynobj));
if (s != NULL && s->_raw_size > 0)
- memset (s->contents, 0, sizeof (Elf32_External_Rel));
+ memset (s->contents, 0, MIPS_ELF_REL_SIZE (dynobj));
}
return true;
@@ -7275,7 +8894,8 @@ elf32_mips_get_relocated_section_contents (abfd, link_info, link_order, data,
case bfd_reloc_undefined:
if (!((*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
- input_bfd, input_section, (*parent)->address)))
+ input_bfd, input_section, (*parent)->address,
+ true)))
goto error_return;
break;
case bfd_reloc_dangerous:
@@ -7369,51 +8989,59 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap =
#define elf_backend_collect true
#define elf_backend_type_change_ok true
-#define elf_info_to_howto 0
+#define elf_backend_can_gc_sections true
+#define elf_backend_sign_extend_vma true
+#define elf_info_to_howto mips_info_to_howto_rela
#define elf_info_to_howto_rel mips_info_to_howto_rel
#define elf_backend_sym_is_global mips_elf_sym_is_global
-#define elf_backend_object_p mips_elf32_object_p
-#define elf_backend_section_from_shdr mips_elf32_section_from_shdr
+#define elf_backend_object_p _bfd_mips_elf_object_p
+#define elf_backend_section_from_shdr _bfd_mips_elf_section_from_shdr
#define elf_backend_fake_sections _bfd_mips_elf_fake_sections
#define elf_backend_section_from_bfd_section \
_bfd_mips_elf_section_from_bfd_section
-#define elf_backend_section_processing mips_elf32_section_processing
+#define elf_backend_section_processing _bfd_mips_elf_section_processing
#define elf_backend_symbol_processing _bfd_mips_elf_symbol_processing
#define elf_backend_additional_program_headers \
- mips_elf_additional_program_headers
-#define elf_backend_modify_segment_map mips_elf_modify_segment_map
+ _bfd_mips_elf_additional_program_headers
+#define elf_backend_modify_segment_map _bfd_mips_elf_modify_segment_map
#define elf_backend_final_write_processing \
_bfd_mips_elf_final_write_processing
#define elf_backend_ecoff_debug_swap &mips_elf32_ecoff_debug_swap
+#define elf_backend_add_symbol_hook _bfd_mips_elf_add_symbol_hook
+#define elf_backend_create_dynamic_sections \
+ _bfd_mips_elf_create_dynamic_sections
+#define elf_backend_check_relocs _bfd_mips_elf_check_relocs
+#define elf_backend_adjust_dynamic_symbol \
+ _bfd_mips_elf_adjust_dynamic_symbol
+#define elf_backend_always_size_sections \
+ _bfd_mips_elf_always_size_sections
+#define elf_backend_size_dynamic_sections \
+ _bfd_mips_elf_size_dynamic_sections
+#define elf_backend_relocate_section _bfd_mips_elf_relocate_section
+#define elf_backend_link_output_symbol_hook \
+ _bfd_mips_elf_link_output_symbol_hook
+#define elf_backend_finish_dynamic_symbol \
+ _bfd_mips_elf_finish_dynamic_symbol
+#define elf_backend_finish_dynamic_sections \
+ _bfd_mips_elf_finish_dynamic_sections
+#define elf_backend_gc_mark_hook _bfd_mips_elf_gc_mark_hook
+#define elf_backend_gc_sweep_hook _bfd_mips_elf_gc_sweep_hook
+
+#define elf_backend_got_header_size (4*MIPS_RESERVED_GOTNO)
+#define elf_backend_plt_header_size 0
#define bfd_elf32_bfd_is_local_label_name \
mips_elf_is_local_label_name
#define bfd_elf32_find_nearest_line _bfd_mips_elf_find_nearest_line
#define bfd_elf32_set_section_contents _bfd_mips_elf_set_section_contents
#define bfd_elf32_bfd_link_hash_table_create \
- mips_elf_link_hash_table_create
-#define bfd_elf32_bfd_final_link mips_elf_final_link
+ _bfd_mips_elf_link_hash_table_create
+#define bfd_elf32_bfd_final_link _bfd_mips_elf_final_link
#define bfd_elf32_bfd_copy_private_bfd_data \
_bfd_mips_elf_copy_private_bfd_data
#define bfd_elf32_bfd_merge_private_bfd_data \
_bfd_mips_elf_merge_private_bfd_data
#define bfd_elf32_bfd_set_private_flags _bfd_mips_elf_set_private_flags
-#define elf_backend_add_symbol_hook mips_elf_add_symbol_hook
-#define elf_backend_create_dynamic_sections \
- mips_elf_create_dynamic_sections
-#define elf_backend_check_relocs mips_elf_check_relocs
-#define elf_backend_adjust_dynamic_symbol \
- mips_elf_adjust_dynamic_symbol
-#define elf_backend_always_size_sections \
- mips_elf_always_size_sections
-#define elf_backend_size_dynamic_sections \
- mips_elf_size_dynamic_sections
-#define elf_backend_relocate_section mips_elf_relocate_section
-#define elf_backend_link_output_symbol_hook \
- mips_elf_link_output_symbol_hook
-#define elf_backend_finish_dynamic_symbol \
- mips_elf_finish_dynamic_symbol
-#define elf_backend_finish_dynamic_sections \
- mips_elf_finish_dynamic_sections
-
+#define bfd_elf32_bfd_print_private_bfd_data \
+ _bfd_mips_elf_print_private_bfd_data
#include "elf32-target.h"
diff --git a/contrib/binutils/bfd/elf32-ppc.c b/contrib/binutils/bfd/elf32-ppc.c
new file mode 100644
index 000000000000..242cfb730ab5
--- /dev/null
+++ b/contrib/binutils/bfd/elf32-ppc.c
@@ -0,0 +1,3761 @@
+/* PowerPC-specific support for 32-bit ELF
+ Copyright 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
+ Written by Ian Lance Taylor, Cygnus Support.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* This file is based on a preliminary PowerPC ELF ABI. The
+ information may not match the final PowerPC ELF ABI. It includes
+ suggestions from the in-progress Embedded PowerPC ABI, and that
+ information may also not match. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "bfdlink.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+#include "elf/ppc.h"
+
+#define USE_RELA /* we want RELA relocations, not REL */
+
+
+static reloc_howto_type *ppc_elf_reloc_type_lookup
+ PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
+static void ppc_elf_info_to_howto
+ PARAMS ((bfd *abfd, arelent *cache_ptr, Elf32_Internal_Rela *dst));
+static void ppc_elf_howto_init PARAMS ((void));
+static bfd_reloc_status_type ppc_elf_addr16_ha_reloc
+ PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+static boolean ppc_elf_set_private_flags PARAMS ((bfd *, flagword));
+static boolean ppc_elf_copy_private_bfd_data PARAMS ((bfd *, bfd *));
+static boolean ppc_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *));
+
+static int ppc_elf_additional_program_headers PARAMS ((bfd *));
+static boolean ppc_elf_modify_segment_map PARAMS ((bfd *));
+
+static boolean ppc_elf_create_dynamic_sections
+ PARAMS ((bfd *, struct bfd_link_info *));
+
+static boolean ppc_elf_section_from_shdr PARAMS ((bfd *,
+ Elf32_Internal_Shdr *,
+ char *));
+static boolean ppc_elf_fake_sections
+ PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *));
+
+static elf_linker_section_t *ppc_elf_create_linker_section
+ PARAMS ((bfd *abfd,
+ struct bfd_link_info *info,
+ enum elf_linker_section_enum));
+
+static boolean ppc_elf_check_relocs PARAMS ((bfd *,
+ struct bfd_link_info *,
+ asection *,
+ const Elf_Internal_Rela *));
+
+static asection * ppc_elf_gc_mark_hook PARAMS ((bfd *abfd,
+ struct bfd_link_info *info,
+ Elf_Internal_Rela *rel,
+ struct elf_link_hash_entry *h,
+ Elf_Internal_Sym *sym));
+
+static boolean ppc_elf_gc_sweep_hook PARAMS ((bfd *abfd,
+ struct bfd_link_info *info,
+ asection *sec,
+ const Elf_Internal_Rela *relocs));
+
+static boolean ppc_elf_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *,
+ struct elf_link_hash_entry *));
+
+static boolean ppc_elf_size_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *));
+
+static boolean ppc_elf_relocate_section PARAMS ((bfd *,
+ struct bfd_link_info *info,
+ bfd *,
+ asection *,
+ bfd_byte *,
+ Elf_Internal_Rela *relocs,
+ Elf_Internal_Sym *local_syms,
+ asection **));
+
+static boolean ppc_elf_add_symbol_hook PARAMS ((bfd *,
+ struct bfd_link_info *,
+ const Elf_Internal_Sym *,
+ const char **,
+ flagword *,
+ asection **,
+ bfd_vma *));
+
+static boolean ppc_elf_finish_dynamic_symbol PARAMS ((bfd *,
+ struct bfd_link_info *,
+ struct elf_link_hash_entry *,
+ Elf_Internal_Sym *));
+
+static boolean ppc_elf_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *));
+
+#define BRANCH_PREDICT_BIT 0x200000 /* branch prediction bit for branch taken relocs */
+#define RA_REGISTER_MASK 0x001f0000 /* mask to set RA in memory instructions */
+#define RA_REGISTER_SHIFT 16 /* value to shift register by to insert RA */
+
+/* The name of the dynamic interpreter. This is put in the .interp
+ section. */
+
+#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
+
+/* The size in bytes of an entry in the procedure linkage table. */
+#define PLT_ENTRY_SIZE 12
+/* The initial size of the plt reserved for the dynamic linker. */
+#define PLT_INITIAL_ENTRY_SIZE 72
+/* The size of the gap between entries in the PLT. */
+#define PLT_SLOT_SIZE 8
+/* The number of single-slot PLT entries (the rest use two slots). */
+#define PLT_NUM_SINGLE_ENTRIES 8192
+
+
+static reloc_howto_type *ppc_elf_howto_table[ (int)R_PPC_max ];
+
+static reloc_howto_type ppc_elf_howto_raw[] =
+{
+ /* This reloc does nothing. */
+ HOWTO (R_PPC_NONE, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_NONE", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A standard 32 bit relocation. */
+ HOWTO (R_PPC_ADDR32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_ADDR32", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* An absolute 26 bit branch; the lower two bits must be zero.
+ FIXME: we don't check that, we just clear them. */
+ HOWTO (R_PPC_ADDR24, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_ADDR24", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0x3fffffc, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A standard 16 bit relocation. */
+ HOWTO (R_PPC_ADDR16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_ADDR16", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 16 bit relocation without overflow. */
+ HOWTO (R_PPC_ADDR16_LO, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_ADDR16_LO", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* The high order 16 bits of an address. */
+ HOWTO (R_PPC_ADDR16_HI, /* type */
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_ADDR16_HI", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* The high order 16 bits of an address, plus 1 if the contents of
+ the low 16 bits, treated as a signed number, is negative. */
+ HOWTO (R_PPC_ADDR16_HA, /* type */
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_addr16_ha_reloc, /* special_function */
+ "R_PPC_ADDR16_HA", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* An absolute 16 bit branch; the lower two bits must be zero.
+ FIXME: we don't check that, we just clear them. */
+ HOWTO (R_PPC_ADDR14, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_ADDR14", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xfffc, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* An absolute 16 bit branch, for which bit 10 should be set to
+ indicate that the branch is expected to be taken. The lower two
+ bits must be zero. */
+ HOWTO (R_PPC_ADDR14_BRTAKEN, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_ADDR14_BRTAKEN",/* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xfffc, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* An absolute 16 bit branch, for which bit 10 should be set to
+ indicate that the branch is not expected to be taken. The lower
+ two bits must be zero. */
+ HOWTO (R_PPC_ADDR14_BRNTAKEN, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_ADDR14_BRNTAKEN",/* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xfffc, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A relative 26 bit branch; the lower two bits must be zero. */
+ HOWTO (R_PPC_REL24, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_REL24", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0x3fffffc, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* A relative 16 bit branch; the lower two bits must be zero. */
+ HOWTO (R_PPC_REL14, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_REL14", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xfffc, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* A relative 16 bit branch. Bit 10 should be set to indicate that
+ the branch is expected to be taken. The lower two bits must be
+ zero. */
+ HOWTO (R_PPC_REL14_BRTAKEN, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_REL14_BRTAKEN", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xfffc, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* A relative 16 bit branch. Bit 10 should be set to indicate that
+ the branch is not expected to be taken. The lower two bits must
+ be zero. */
+ HOWTO (R_PPC_REL14_BRNTAKEN, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_REL14_BRNTAKEN",/* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xfffc, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* Like R_PPC_ADDR16, but referring to the GOT table entry for the
+ symbol. */
+ HOWTO (R_PPC_GOT16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_GOT16", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* Like R_PPC_ADDR16_LO, but referring to the GOT table entry for
+ the symbol. */
+ HOWTO (R_PPC_GOT16_LO, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_GOT16_LO", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* Like R_PPC_ADDR16_HI, but referring to the GOT table entry for
+ the symbol. */
+ HOWTO (R_PPC_GOT16_HI, /* type */
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_GOT16_HI", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* Like R_PPC_ADDR16_HA, but referring to the GOT table entry for
+ the symbol. */
+ HOWTO (R_PPC_GOT16_HA, /* type */
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ ppc_elf_addr16_ha_reloc, /* special_function */
+ "R_PPC_GOT16_HA", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* Like R_PPC_REL24, but referring to the procedure linkage table
+ entry for the symbol. */
+ HOWTO (R_PPC_PLTREL24, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_PLTREL24", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0x3fffffc, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* This is used only by the dynamic linker. The symbol should exist
+ both in the object being run and in some shared library. The
+ dynamic linker copies the data addressed by the symbol from the
+ shared library into the object, because the object being
+ run has to have the data at some particular address. */
+ HOWTO (R_PPC_COPY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_COPY", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* Like R_PPC_ADDR32, but used when setting global offset table
+ entries. */
+ HOWTO (R_PPC_GLOB_DAT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_GLOB_DAT", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* Marks a procedure linkage table entry for a symbol. */
+ HOWTO (R_PPC_JMP_SLOT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_JMP_SLOT", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* Used only by the dynamic linker. When the object is run, this
+ longword is set to the load address of the object, plus the
+ addend. */
+ HOWTO (R_PPC_RELATIVE, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_RELATIVE", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* Like R_PPC_REL24, but uses the value of the symbol within the
+ object rather than the final value. Normally used for
+ _GLOBAL_OFFSET_TABLE_. */
+ HOWTO (R_PPC_LOCAL24PC, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_LOCAL24PC", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0x3fffffc, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* Like R_PPC_ADDR32, but may be unaligned. */
+ HOWTO (R_PPC_UADDR32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_UADDR32", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* Like R_PPC_ADDR16, but may be unaligned. */
+ HOWTO (R_PPC_UADDR16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_UADDR16", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 32-bit PC relative */
+ HOWTO (R_PPC_REL32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_REL32", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* 32-bit relocation to the symbol's procedure linkage table.
+ FIXME: not supported. */
+ HOWTO (R_PPC_PLT32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_PLT32", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 32-bit PC relative relocation to the symbol's procedure linkage table.
+ FIXME: not supported. */
+ HOWTO (R_PPC_PLTREL32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_PLTREL32", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* Like R_PPC_ADDR16_LO, but referring to the PLT table entry for
+ the symbol. */
+ HOWTO (R_PPC_PLT16_LO, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_PLT16_LO", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* Like R_PPC_ADDR16_HI, but referring to the PLT table entry for
+ the symbol. */
+ HOWTO (R_PPC_PLT16_HI, /* type */
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_PLT16_HI", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* Like R_PPC_ADDR16_HA, but referring to the PLT table entry for
+ the symbol. */
+ HOWTO (R_PPC_PLT16_HA, /* type */
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ ppc_elf_addr16_ha_reloc, /* special_function */
+ "R_PPC_PLT16_HA", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A sign-extended 16 bit value relative to _SDA_BASE_, for use with
+ small data items. */
+ HOWTO (R_PPC_SDAREL16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_SDAREL16", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 32-bit section relative relocation. */
+ HOWTO (R_PPC_SECTOFF, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_SECTOFF", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* 16-bit lower half section relative relocation. */
+ HOWTO (R_PPC_SECTOFF_LO, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_SECTOFF_LO", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 16-bit upper half section relative relocation. */
+ HOWTO (R_PPC_SECTOFF_HI, /* type */
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_SECTOFF_HI", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 16-bit upper half adjusted section relative relocation. */
+ HOWTO (R_PPC_SECTOFF_HA, /* type */
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ ppc_elf_addr16_ha_reloc, /* special_function */
+ "R_PPC_SECTOFF_HA", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* The remaining relocs are from the Embedded ELF ABI, and are not
+ in the SVR4 ELF ABI. */
+
+ /* 32 bit value resulting from the addend minus the symbol */
+ HOWTO (R_PPC_EMB_NADDR32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_EMB_NADDR32", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 16 bit value resulting from the addend minus the symbol */
+ HOWTO (R_PPC_EMB_NADDR16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_EMB_NADDR16", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 16 bit value resulting from the addend minus the symbol */
+ HOWTO (R_PPC_EMB_NADDR16_LO, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_EMB_ADDR16_LO", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* The high order 16 bits of the addend minus the symbol */
+ HOWTO (R_PPC_EMB_NADDR16_HI, /* type */
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_EMB_NADDR16_HI", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* The high order 16 bits of the result of the addend minus the address,
+ plus 1 if the contents of the low 16 bits, treated as a signed number,
+ is negative. */
+ HOWTO (R_PPC_EMB_NADDR16_HA, /* type */
+ 16, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ ppc_elf_addr16_ha_reloc, /* special_function */
+ "R_PPC_EMB_NADDR16_HA", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 16 bit value resulting from allocating a 4 byte word to hold an
+ address in the .sdata section, and returning the offset from
+ _SDA_BASE_ for that relocation */
+ HOWTO (R_PPC_EMB_SDAI16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_EMB_SDAI16", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 16 bit value resulting from allocating a 4 byte word to hold an
+ address in the .sdata2 section, and returning the offset from
+ _SDA2_BASE_ for that relocation */
+ HOWTO (R_PPC_EMB_SDA2I16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_EMB_SDA2I16", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A sign-extended 16 bit value relative to _SDA2_BASE_, for use with
+ small data items. */
+ HOWTO (R_PPC_EMB_SDA2REL, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_EMB_SDA2REL", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* Relocate against either _SDA_BASE_ or _SDA2_BASE_, filling in the 16 bit
+ signed offset from the appropriate base, and filling in the register
+ field with the appropriate register (0, 2, or 13). */
+ HOWTO (R_PPC_EMB_SDA21, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_EMB_SDA21", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* Relocation not handled: R_PPC_EMB_MRKREF */
+ /* Relocation not handled: R_PPC_EMB_RELSEC16 */
+ /* Relocation not handled: R_PPC_EMB_RELST_LO */
+ /* Relocation not handled: R_PPC_EMB_RELST_HI */
+ /* Relocation not handled: R_PPC_EMB_RELST_HA */
+ /* Relocation not handled: R_PPC_EMB_BIT_FLD */
+
+ /* PC relative relocation against either _SDA_BASE_ or _SDA2_BASE_, filling
+ in the 16 bit signed offset from the appropriate base, and filling in the
+ register field with the appropriate register (0, 2, or 13). */
+ HOWTO (R_PPC_EMB_RELSDA, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_EMB_RELSDA", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* GNU extension to record C++ vtable hierarchy */
+ HOWTO (R_PPC_GNU_VTINHERIT, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_PPC_GNU_VTINHERIT", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* GNU extension to record C++ vtable member usage */
+ HOWTO (R_PPC_GNU_VTENTRY, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_PPC_GNU_VTENTRY", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* Phony reloc to handle AIX style TOC entries */
+ HOWTO (R_PPC_TOC16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_PPC_TOC16", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+};
+
+
+/* Initialize the ppc_elf_howto_table, so that linear accesses can be done. */
+
+static void
+ppc_elf_howto_init ()
+{
+ unsigned int i, type;
+
+ for (i = 0; i < sizeof (ppc_elf_howto_raw) / sizeof (ppc_elf_howto_raw[0]); i++)
+ {
+ type = ppc_elf_howto_raw[i].type;
+ BFD_ASSERT (type < sizeof(ppc_elf_howto_table) / sizeof(ppc_elf_howto_table[0]));
+ ppc_elf_howto_table[type] = &ppc_elf_howto_raw[i];
+ }
+}
+
+
+/* This function handles relaxing for the PPC with option --mpc860c0[=<n>].
+
+ The MPC860, revision C0 or earlier contains a bug in the die.
+ If all of the following conditions are true, the next instruction
+ to be executed *may* be treated as a no-op.
+ 1/ A forward branch is executed.
+ 2/ The branch is predicted as not taken.
+ 3/ The branch is taken.
+ 4/ The branch is located in the last 5 words of a page.
+ (The EOP limit is 5 by default but may be specified as any value from 1-10.)
+
+ Our software solution is to detect these problematic branches in a
+ linker pass and modify them as follows:
+ 1/ Unconditional branches - Since these are always predicted taken,
+ there is no problem and no action is required.
+ 2/ Conditional backward branches - No problem, no action required.
+ 3/ Conditional forward branches - Ensure that the "inverse prediction
+ bit" is set (ensure it is predicted taken).
+ 4/ Conditional register branches - Ensure that the "y bit" is set
+ (ensure it is predicted taken).
+*/
+
+/* Sort sections by address. */
+
+static int
+ppc_elf_sort_rela (arg1, arg2)
+ const void *arg1;
+ const void *arg2;
+{
+ const Elf_Internal_Rela **rela1 = (const Elf_Internal_Rela**) arg1;
+ const Elf_Internal_Rela **rela2 = (const Elf_Internal_Rela**) arg2;
+
+ /* Sort by offset. */
+ return ((*rela1)->r_offset - (*rela2)->r_offset);
+}
+
+static boolean
+ppc_elf_relax_section (abfd, isec, link_info, again)
+ bfd *abfd;
+ asection *isec;
+ struct bfd_link_info *link_info;
+ boolean *again;
+{
+#define PAGESIZE 0x1000
+
+ bfd_byte *contents = NULL;
+ bfd_byte *free_contents = NULL;
+ Elf_Internal_Rela *internal_relocs = NULL;
+ Elf_Internal_Rela *free_relocs = NULL;
+ Elf_Internal_Rela **rela_comb = NULL;
+ int comb_curr, comb_count;
+
+ /* We never have to do this more than once per input section. */
+ *again = false;
+
+ /* If needed, initialize this section's cooked size. */
+ if (isec->_cooked_size == 0)
+ isec->_cooked_size = isec->_raw_size;
+
+ /* We're only interested in text sections which overlap the
+ troublesome area at the end of a page. */
+ if (link_info->mpc860c0 && (isec->flags & SEC_CODE) && isec->_cooked_size)
+ {
+ bfd_vma dot, end_page, end_section;
+ boolean section_modified;
+
+ /* Get the section contents. */
+ /* Get cached copy if it exists. */
+ if (elf_section_data (isec)->this_hdr.contents != NULL)
+ contents = elf_section_data (isec)->this_hdr.contents;
+ else
+ {
+ /* Go get them off disk. */
+ contents = (bfd_byte *) bfd_malloc (isec->_raw_size);
+ if (contents == NULL)
+ goto error_return;
+ free_contents = contents;
+
+ if (! bfd_get_section_contents (abfd, isec, contents,
+ (file_ptr) 0, isec->_raw_size))
+ goto error_return;
+ }
+
+ comb_curr = 0;
+ comb_count = 0;
+ if (isec->reloc_count)
+ {
+ unsigned n;
+
+ /* Get a copy of the native relocations. */
+ internal_relocs = _bfd_elf32_link_read_relocs (
+ abfd, isec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
+ link_info->keep_memory);
+ if (internal_relocs == NULL)
+ goto error_return;
+ if (! link_info->keep_memory)
+ free_relocs = internal_relocs;
+
+ /* Setup a faster access method for the reloc info we need. */
+ rela_comb = (Elf_Internal_Rela**)
+ bfd_malloc (isec->reloc_count*sizeof(Elf_Internal_Rela*));
+ if (rela_comb == NULL)
+ goto error_return;
+ for (n=0; n<isec->reloc_count; ++n)
+ {
+ long r_type;
+
+ r_type = ELF32_R_TYPE (internal_relocs[n].r_info);
+ if (r_type < 0 || r_type >= (int)R_PPC_max)
+ goto error_return;
+
+ /* Prologue constants are sometimes present in the ".text"
+ sections and they can be identified by their associated relocation.
+ We don't want to process those words and some others which
+ can also be identified by their relocations. However, not all
+ conditional branches will have a relocation so we will
+ only ignore words that 1) have a reloc, and 2) the reloc
+ is not applicable to a conditional branch.
+ The array rela_comb is built here for use in the EOP scan loop. */
+ switch (r_type)
+ {
+ case R_PPC_ADDR14_BRNTAKEN: /* absolute, predicted not taken */
+ case R_PPC_REL14: /* relative cond. br. */
+ case R_PPC_REL14_BRNTAKEN: /* rel. cond. br., predicted not taken */
+ /* We should check the instruction. */
+ break;
+ default:
+ /* The word is not a conditional branch - ignore it. */
+ rela_comb[comb_count++] = &internal_relocs[n];
+ break;
+ }
+ }
+ if (comb_count > 1)
+ qsort (rela_comb, (size_t) comb_count, sizeof (int), ppc_elf_sort_rela);
+ }
+
+ /* Enumerate each EOP region that overlaps this section. */
+ end_section = isec->vma + isec->_cooked_size;
+ dot = end_page = (isec->vma | (PAGESIZE - 1)) + 1;
+ dot -= link_info->mpc860c0;
+ section_modified = false;
+ if (dot < isec->vma) /* Increment the start position if this section */
+ dot = isec->vma; /* begins in the middle of its first EOP region. */
+ for (;
+ dot < end_section;
+ dot += PAGESIZE, end_page += PAGESIZE)
+ {
+
+ /* Check each word in this EOP region. */
+ for (; dot < end_page; dot += 4)
+ {
+ bfd_vma isec_offset;
+ unsigned long insn;
+ boolean skip, modified;
+
+ /* Don't process this word if there is a relocation for it and
+ the relocation indicates the word is not a conditional branch. */
+ skip = false;
+ isec_offset = dot - isec->vma;
+ for (; comb_curr<comb_count; ++comb_curr)
+ {
+ bfd_vma r_offset;
+
+ r_offset = rela_comb[comb_curr]->r_offset;
+ if (r_offset >= isec_offset)
+ {
+ if (r_offset == isec_offset) skip = true;
+ break;
+ }
+ }
+ if (skip) continue;
+
+ /* Check the current word for a problematic conditional branch. */
+#define BO0(insn) ((insn) & 0x02000000)
+#define BO2(insn) ((insn) & 0x00800000)
+#define BO4(insn) ((insn) & 0x00200000)
+ insn = (unsigned long) bfd_get_32 (abfd, contents + isec_offset);
+ modified = false;
+ if ((insn & 0xFc000000) == 0x40000000)
+ {
+ /* Instruction is BCx */
+ if ((!BO0(insn) || !BO2(insn)) && !BO4(insn))
+ {
+ bfd_vma target;
+ /* This branch is predicted as "normal".
+ If this is a forward branch, it is problematic. */
+
+ target = insn & 0x0000Fffc; /*extract*/
+ target = (target ^ 0x8000) - 0x8000; /*sign extend*/
+ if ((insn & 0x00000002) == 0)
+ target += dot; /*convert to abs*/
+ if (target > dot)
+ {
+ insn |= 0x00200000; /* set the prediction bit */
+ modified = true;
+ }
+ }
+ }
+ else if ((insn & 0xFc00Fffe) == 0x4c000420)
+ {
+ /* Instruction is BCCTRx */
+ if ((!BO0(insn) || !BO2(insn)) && !BO4(insn))
+ {
+ /* This branch is predicted as not-taken.
+ If this is a forward branch, it is problematic.
+ Since we can't tell statically if it will branch forward,
+ always set the prediction bit. */
+ insn |= 0x00200000; /* set the prediction bit */
+ modified = true;
+ }
+ }
+ else if ((insn & 0xFc00Fffe) == 0x4c000020)
+ {
+ /* Instruction is BCLRx */
+ if ((!BO0(insn) || !BO2(insn)) && !BO4(insn))
+ {
+ /* This branch is predicted as not-taken.
+ If this is a forward branch, it is problematic.
+ Since we can't tell statically if it will branch forward,
+ always set the prediction bit. */
+ insn |= 0x00200000; /* set the prediction bit */
+ modified = true;
+ }
+ }
+#undef BO0
+#undef BO2
+#undef BO4
+ if (modified)
+ {
+ bfd_put_32 (abfd, insn, contents + isec_offset);
+ section_modified = true;
+ }
+ }
+ }
+ if (section_modified)
+ {
+ elf_section_data (isec)->this_hdr.contents = contents;
+ free_contents = NULL;
+ }
+ }
+
+ if (rela_comb != NULL)
+ {
+ free (rela_comb);
+ rela_comb = NULL;
+ }
+
+ if (free_relocs != NULL)
+ {
+ free (free_relocs);
+ free_relocs = NULL;
+ }
+
+ if (free_contents != NULL)
+ {
+ if (! link_info->keep_memory)
+ free (free_contents);
+ else
+ {
+ /* Cache the section contents for elf_link_input_bfd. */
+ elf_section_data (isec)->this_hdr.contents = contents;
+ }
+ free_contents = NULL;
+ }
+
+ return true;
+
+error_return:
+ if (rela_comb != NULL)
+ free (rela_comb);
+ if (free_relocs != NULL)
+ free (free_relocs);
+ if (free_contents != NULL)
+ free (free_contents);
+ return false;
+}
+
+
+static reloc_howto_type *
+ppc_elf_reloc_type_lookup (abfd, code)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ bfd_reloc_code_real_type code;
+{
+ enum elf_ppc_reloc_type ppc_reloc = R_PPC_NONE;
+
+ if (!ppc_elf_howto_table[R_PPC_ADDR32])
+ /* Initialize howto table if needed */
+ ppc_elf_howto_init ();
+
+ switch ((int)code)
+ {
+ default:
+ return (reloc_howto_type *)NULL;
+
+ case BFD_RELOC_NONE: ppc_reloc = R_PPC_NONE; break;
+ case BFD_RELOC_32: ppc_reloc = R_PPC_ADDR32; break;
+ case BFD_RELOC_PPC_BA26: ppc_reloc = R_PPC_ADDR24; break;
+ case BFD_RELOC_16: ppc_reloc = R_PPC_ADDR16; break;
+ case BFD_RELOC_LO16: ppc_reloc = R_PPC_ADDR16_LO; break;
+ case BFD_RELOC_HI16: ppc_reloc = R_PPC_ADDR16_HI; break;
+ case BFD_RELOC_HI16_S: ppc_reloc = R_PPC_ADDR16_HA; break;
+ case BFD_RELOC_PPC_BA16: ppc_reloc = R_PPC_ADDR14; break;
+ case BFD_RELOC_PPC_BA16_BRTAKEN: ppc_reloc = R_PPC_ADDR14_BRTAKEN; break;
+ case BFD_RELOC_PPC_BA16_BRNTAKEN: ppc_reloc = R_PPC_ADDR14_BRNTAKEN; break;
+ case BFD_RELOC_PPC_B26: ppc_reloc = R_PPC_REL24; break;
+ case BFD_RELOC_PPC_B16: ppc_reloc = R_PPC_REL14; break;
+ case BFD_RELOC_PPC_B16_BRTAKEN: ppc_reloc = R_PPC_REL14_BRTAKEN; break;
+ case BFD_RELOC_PPC_B16_BRNTAKEN: ppc_reloc = R_PPC_REL14_BRNTAKEN; break;
+ case BFD_RELOC_16_GOTOFF: ppc_reloc = R_PPC_GOT16; break;
+ case BFD_RELOC_LO16_GOTOFF: ppc_reloc = R_PPC_GOT16_LO; break;
+ case BFD_RELOC_HI16_GOTOFF: ppc_reloc = R_PPC_GOT16_HI; break;
+ case BFD_RELOC_HI16_S_GOTOFF: ppc_reloc = R_PPC_GOT16_HA; break;
+ case BFD_RELOC_24_PLT_PCREL: ppc_reloc = R_PPC_PLTREL24; break;
+ case BFD_RELOC_PPC_COPY: ppc_reloc = R_PPC_COPY; break;
+ case BFD_RELOC_PPC_GLOB_DAT: ppc_reloc = R_PPC_GLOB_DAT; break;
+ case BFD_RELOC_PPC_LOCAL24PC: ppc_reloc = R_PPC_LOCAL24PC; break;
+ case BFD_RELOC_32_PCREL: ppc_reloc = R_PPC_REL32; break;
+ case BFD_RELOC_32_PLTOFF: ppc_reloc = R_PPC_PLT32; break;
+ case BFD_RELOC_32_PLT_PCREL: ppc_reloc = R_PPC_PLTREL32; break;
+ case BFD_RELOC_LO16_PLTOFF: ppc_reloc = R_PPC_PLT16_LO; break;
+ case BFD_RELOC_HI16_PLTOFF: ppc_reloc = R_PPC_PLT16_HI; break;
+ case BFD_RELOC_HI16_S_PLTOFF: ppc_reloc = R_PPC_PLT16_HA; break;
+ case BFD_RELOC_GPREL16: ppc_reloc = R_PPC_SDAREL16; break;
+ case BFD_RELOC_32_BASEREL: ppc_reloc = R_PPC_SECTOFF; break;
+ case BFD_RELOC_LO16_BASEREL: ppc_reloc = R_PPC_SECTOFF_LO; break;
+ case BFD_RELOC_HI16_BASEREL: ppc_reloc = R_PPC_SECTOFF_HI; break;
+ case BFD_RELOC_HI16_S_BASEREL: ppc_reloc = R_PPC_SECTOFF_HA; break;
+ case BFD_RELOC_CTOR: ppc_reloc = R_PPC_ADDR32; break;
+ case BFD_RELOC_PPC_TOC16: ppc_reloc = R_PPC_TOC16; break;
+ case BFD_RELOC_PPC_EMB_NADDR32: ppc_reloc = R_PPC_EMB_NADDR32; break;
+ case BFD_RELOC_PPC_EMB_NADDR16: ppc_reloc = R_PPC_EMB_NADDR16; break;
+ case BFD_RELOC_PPC_EMB_NADDR16_LO: ppc_reloc = R_PPC_EMB_NADDR16_LO; break;
+ case BFD_RELOC_PPC_EMB_NADDR16_HI: ppc_reloc = R_PPC_EMB_NADDR16_HI; break;
+ case BFD_RELOC_PPC_EMB_NADDR16_HA: ppc_reloc = R_PPC_EMB_NADDR16_HA; break;
+ case BFD_RELOC_PPC_EMB_SDAI16: ppc_reloc = R_PPC_EMB_SDAI16; break;
+ case BFD_RELOC_PPC_EMB_SDA2I16: ppc_reloc = R_PPC_EMB_SDA2I16; break;
+ case BFD_RELOC_PPC_EMB_SDA2REL: ppc_reloc = R_PPC_EMB_SDA2REL; break;
+ case BFD_RELOC_PPC_EMB_SDA21: ppc_reloc = R_PPC_EMB_SDA21; break;
+ case BFD_RELOC_PPC_EMB_MRKREF: ppc_reloc = R_PPC_EMB_MRKREF; break;
+ case BFD_RELOC_PPC_EMB_RELSEC16: ppc_reloc = R_PPC_EMB_RELSEC16; break;
+ case BFD_RELOC_PPC_EMB_RELST_LO: ppc_reloc = R_PPC_EMB_RELST_LO; break;
+ case BFD_RELOC_PPC_EMB_RELST_HI: ppc_reloc = R_PPC_EMB_RELST_HI; break;
+ case BFD_RELOC_PPC_EMB_RELST_HA: ppc_reloc = R_PPC_EMB_RELST_HA; break;
+ case BFD_RELOC_PPC_EMB_BIT_FLD: ppc_reloc = R_PPC_EMB_BIT_FLD; break;
+ case BFD_RELOC_PPC_EMB_RELSDA: ppc_reloc = R_PPC_EMB_RELSDA; break;
+ case BFD_RELOC_VTABLE_INHERIT: ppc_reloc = R_PPC_GNU_VTINHERIT; break;
+ case BFD_RELOC_VTABLE_ENTRY: ppc_reloc = R_PPC_GNU_VTENTRY; break;
+ }
+
+ return ppc_elf_howto_table[ (int)ppc_reloc ];
+};
+
+/* Set the howto pointer for a PowerPC ELF reloc. */
+
+static void
+ppc_elf_info_to_howto (abfd, cache_ptr, dst)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *cache_ptr;
+ Elf32_Internal_Rela *dst;
+{
+ if (!ppc_elf_howto_table[ R_PPC_ADDR32 ]) /* Initialize howto table if needed */
+ ppc_elf_howto_init ();
+
+ BFD_ASSERT (ELF32_R_TYPE (dst->r_info) < (unsigned int) R_PPC_max);
+ cache_ptr->howto = ppc_elf_howto_table[ELF32_R_TYPE (dst->r_info)];
+}
+
+/* Handle the R_PPC_ADDR16_HA reloc. */
+
+static bfd_reloc_status_type
+ppc_elf_addr16_ha_reloc (abfd, reloc_entry, symbol, data, input_section,
+ output_bfd, error_message)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *reloc_entry;
+ asymbol *symbol;
+ PTR data ATTRIBUTE_UNUSED;
+ asection *input_section;
+ bfd *output_bfd;
+ char **error_message ATTRIBUTE_UNUSED;
+{
+ bfd_vma relocation;
+
+ if (output_bfd != NULL)
+ {
+ reloc_entry->address += input_section->output_offset;
+ return bfd_reloc_ok;
+ }
+
+ if (reloc_entry->address > input_section->_cooked_size)
+ return bfd_reloc_outofrange;
+
+ if (bfd_is_com_section (symbol->section))
+ relocation = 0;
+ else
+ relocation = symbol->value;
+
+ relocation += symbol->section->output_section->vma;
+ relocation += symbol->section->output_offset;
+ relocation += reloc_entry->addend;
+
+ reloc_entry->addend += (relocation & 0x8000) << 1;
+
+ return bfd_reloc_continue;
+}
+
+/* Function to set whether a module needs the -mrelocatable bit set. */
+
+static boolean
+ppc_elf_set_private_flags (abfd, flags)
+ bfd *abfd;
+ flagword flags;
+{
+ BFD_ASSERT (!elf_flags_init (abfd)
+ || elf_elfheader (abfd)->e_flags == flags);
+
+ elf_elfheader (abfd)->e_flags = flags;
+ elf_flags_init (abfd) = true;
+ return true;
+}
+
+/* Copy backend specific data from one object module to another */
+static boolean
+ppc_elf_copy_private_bfd_data (ibfd, obfd)
+ bfd *ibfd;
+ bfd *obfd;
+{
+ if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+ || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+ return true;
+
+ BFD_ASSERT (!elf_flags_init (obfd)
+ || elf_elfheader (obfd)->e_flags == elf_elfheader (ibfd)->e_flags);
+
+ elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
+ elf_flags_init (obfd) = true;
+ return true;
+}
+
+/* Merge backend specific data from an object file to the output
+ object file when linking */
+static boolean
+ppc_elf_merge_private_bfd_data (ibfd, obfd)
+ bfd *ibfd;
+ bfd *obfd;
+{
+ flagword old_flags;
+ flagword new_flags;
+ boolean error;
+
+ /* Check if we have the same endianess */
+ if (ibfd->xvec->byteorder != obfd->xvec->byteorder
+ && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
+ {
+ const char *msg;
+
+ if (bfd_big_endian (ibfd))
+ msg = _("%s: compiled for a big endian system and target is little endian");
+ else
+ msg = _("%s: compiled for a little endian system and target is big endian");
+
+ (*_bfd_error_handler) (msg, bfd_get_filename (ibfd));
+
+ bfd_set_error (bfd_error_wrong_format);
+ return false;
+ }
+
+ if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+ || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+ return true;
+
+ new_flags = elf_elfheader (ibfd)->e_flags;
+ old_flags = elf_elfheader (obfd)->e_flags;
+ if (!elf_flags_init (obfd)) /* First call, no flags set */
+ {
+ elf_flags_init (obfd) = true;
+ elf_elfheader (obfd)->e_flags = new_flags;
+ }
+
+ else if (new_flags == old_flags) /* Compatible flags are ok */
+ ;
+
+ else /* Incompatible flags */
+ {
+ /* Warn about -mrelocatable mismatch. Allow -mrelocatable-lib to be linked
+ with either. */
+ error = false;
+ if ((new_flags & EF_PPC_RELOCATABLE) != 0
+ && (old_flags & (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB)) == 0)
+ {
+ error = true;
+ (*_bfd_error_handler)
+ (_("%s: compiled with -mrelocatable and linked with modules compiled normally"),
+ bfd_get_filename (ibfd));
+ }
+ else if ((new_flags & (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB)) == 0
+ && (old_flags & EF_PPC_RELOCATABLE) != 0)
+ {
+ error = true;
+ (*_bfd_error_handler)
+ (_("%s: compiled normally and linked with modules compiled with -mrelocatable"),
+ bfd_get_filename (ibfd));
+ }
+
+ /* The output is -mrelocatable-lib iff both the input files are. */
+ if (! (new_flags & EF_PPC_RELOCATABLE_LIB))
+ elf_elfheader (obfd)->e_flags &= ~EF_PPC_RELOCATABLE_LIB;
+
+ /* The output is -mrelocatable iff it can't be -mrelocatable-lib,
+ but each input file is either -mrelocatable or -mrelocatable-lib. */
+ if (! (elf_elfheader (obfd)->e_flags & EF_PPC_RELOCATABLE_LIB)
+ && (new_flags & (EF_PPC_RELOCATABLE_LIB | EF_PPC_RELOCATABLE))
+ && (old_flags & (EF_PPC_RELOCATABLE_LIB | EF_PPC_RELOCATABLE)))
+ elf_elfheader (obfd)->e_flags |= EF_PPC_RELOCATABLE;
+
+ /* Do not warn about eabi vs. V.4 mismatch, just or in the bit if any module uses it */
+ elf_elfheader (obfd)->e_flags |= (new_flags & EF_PPC_EMB);
+
+ new_flags &= ~ (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB);
+ old_flags &= ~ (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB);
+
+ /* Warn about any other mismatches */
+ if (new_flags != old_flags)
+ {
+ error = true;
+ (*_bfd_error_handler)
+ (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
+ bfd_get_filename (ibfd), (long)new_flags, (long)old_flags);
+ }
+
+ if (error)
+ {
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ }
+ }
+
+ return true;
+}
+
+
+/* Handle a PowerPC specific section when reading an object file. This
+ is called when elfcode.h finds a section with an unknown type. */
+
+static boolean
+ppc_elf_section_from_shdr (abfd, hdr, name)
+ bfd *abfd;
+ Elf32_Internal_Shdr *hdr;
+ char *name;
+{
+ asection *newsect;
+ flagword flags;
+
+ if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name))
+ return false;
+
+ newsect = hdr->bfd_section;
+ flags = bfd_get_section_flags (abfd, newsect);
+ if (hdr->sh_flags & SHF_EXCLUDE)
+ flags |= SEC_EXCLUDE;
+
+ if (hdr->sh_type == SHT_ORDERED)
+ flags |= SEC_SORT_ENTRIES;
+
+ bfd_set_section_flags (abfd, newsect, flags);
+ return true;
+}
+
+
+/* Set up any other section flags and such that may be necessary. */
+
+static boolean
+ppc_elf_fake_sections (abfd, shdr, asect)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ Elf32_Internal_Shdr *shdr;
+ asection *asect;
+{
+ if ((asect->flags & SEC_EXCLUDE) != 0)
+ shdr->sh_flags |= SHF_EXCLUDE;
+
+ if ((asect->flags & SEC_SORT_ENTRIES) != 0)
+ shdr->sh_type = SHT_ORDERED;
+
+ return true;
+}
+
+
+/* Create a special linker section */
+static elf_linker_section_t *
+ppc_elf_create_linker_section (abfd, info, which)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ enum elf_linker_section_enum which;
+{
+ bfd *dynobj = elf_hash_table (info)->dynobj;
+ elf_linker_section_t *lsect;
+
+ /* Record the first bfd section that needs the special section */
+ if (!dynobj)
+ dynobj = elf_hash_table (info)->dynobj = abfd;
+
+ /* If this is the first time, create the section */
+ lsect = elf_linker_section (dynobj, which);
+ if (!lsect)
+ {
+ elf_linker_section_t defaults;
+ static elf_linker_section_t zero_section;
+
+ defaults = zero_section;
+ defaults.which = which;
+ defaults.hole_written_p = false;
+ defaults.alignment = 2;
+
+ /* Both of these sections are (technically) created by the user
+ putting data in them, so they shouldn't be marked
+ SEC_LINKER_CREATED.
+
+ The linker creates them so it has somewhere to attach their
+ respective symbols. In fact, if they were empty it would
+ be OK to leave the symbol set to 0 (or any random number), because
+ the appropriate register should never be used. */
+ defaults.flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY);
+
+ switch (which)
+ {
+ default:
+ (*_bfd_error_handler) (_("%s: Unknown special linker type %d"),
+ bfd_get_filename (abfd),
+ (int)which);
+
+ bfd_set_error (bfd_error_bad_value);
+ return (elf_linker_section_t *)0;
+
+ case LINKER_SECTION_SDATA: /* .sdata/.sbss section */
+ defaults.name = ".sdata";
+ defaults.rel_name = ".rela.sdata";
+ defaults.bss_name = ".sbss";
+ defaults.sym_name = "_SDA_BASE_";
+ defaults.sym_offset = 32768;
+ break;
+
+ case LINKER_SECTION_SDATA2: /* .sdata2/.sbss2 section */
+ defaults.name = ".sdata2";
+ defaults.rel_name = ".rela.sdata2";
+ defaults.bss_name = ".sbss2";
+ defaults.sym_name = "_SDA2_BASE_";
+ defaults.sym_offset = 32768;
+ defaults.flags |= SEC_READONLY;
+ break;
+ }
+
+ lsect = _bfd_elf_create_linker_section (abfd, info, which, &defaults);
+ }
+
+ return lsect;
+}
+
+
+/* If we have a non-zero sized .sbss2 or .PPC.EMB.sbss0 sections, we need to bump up
+ the number of section headers. */
+
+static int
+ppc_elf_additional_program_headers (abfd)
+ bfd *abfd;
+{
+ asection *s;
+ int ret;
+
+ ret = 0;
+
+ s = bfd_get_section_by_name (abfd, ".interp");
+ if (s != NULL)
+ ++ret;
+
+ s = bfd_get_section_by_name (abfd, ".sbss2");
+ if (s != NULL && (s->flags & SEC_LOAD) != 0 && s->_raw_size > 0)
+ ++ret;
+
+ s = bfd_get_section_by_name (abfd, ".PPC.EMB.sbss0");
+ if (s != NULL && (s->flags & SEC_LOAD) != 0 && s->_raw_size > 0)
+ ++ret;
+
+ return ret;
+}
+
+/* Modify the segment map if needed */
+
+static boolean
+ppc_elf_modify_segment_map (abfd)
+ bfd *abfd ATTRIBUTE_UNUSED;
+{
+ return true;
+}
+
+/* We have to create .dynsbss and .rela.sbss here so that they get mapped
+ to output sections (just like _bfd_elf_create_dynamic_sections has
+ to create .dynbss and .rela.bss). */
+
+static boolean
+ppc_elf_create_dynamic_sections (abfd, info)
+ bfd *abfd;
+ struct bfd_link_info *info;
+{
+ register asection *s;
+ flagword flags;
+
+ if (!_bfd_elf_create_dynamic_sections(abfd, info))
+ return false;
+
+ flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED);
+
+ s = bfd_make_section (abfd, ".dynsbss");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, SEC_ALLOC))
+ return false;
+
+ if (! info->shared)
+ {
+ s = bfd_make_section (abfd, ".rela.sbss");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+ || ! bfd_set_section_alignment (abfd, s, 2))
+ return false;
+ }
+ return true;
+}
+
+/* Adjust a symbol defined by a dynamic object and referenced by a
+ regular object. The current definition is in some section of the
+ dynamic object, but we're not including those sections. We have to
+ change the definition to something the rest of the link can
+ understand. */
+
+static boolean
+ppc_elf_adjust_dynamic_symbol (info, h)
+ struct bfd_link_info *info;
+ struct elf_link_hash_entry *h;
+{
+ bfd *dynobj = elf_hash_table (info)->dynobj;
+ asection *s;
+ unsigned int power_of_two;
+ bfd_vma plt_offset;
+
+#ifdef DEBUG
+ fprintf (stderr, "ppc_elf_adjust_dynamic_symbol called for %s\n", h->root.root.string);
+#endif
+
+ /* Make sure we know what is going on here. */
+ BFD_ASSERT (dynobj != NULL
+ && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
+ || h->weakdef != NULL
+ || ((h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ && (h->elf_link_hash_flags
+ & ELF_LINK_HASH_REF_REGULAR) != 0
+ && (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_REGULAR) == 0)));
+
+
+ /* If this is a function, put it in the procedure linkage table. We
+ will fill in the contents of the procedure linkage table later,
+ when we know the address of the .got section. */
+ if (h->type == STT_FUNC
+ || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
+ {
+ if (! elf_hash_table (info)->dynamic_sections_created
+ || ((!info->shared || info->symbolic || h->dynindx == -1)
+ && (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_REGULAR) != 0)
+ || (info->shared && h->plt.refcount <= 0))
+ {
+ /* A PLT entry is not required/allowed when:
+
+ 1. We are not using ld.so; because then the PLT entry
+ can't be set up, so we can't use one.
+
+ 2. We know for certain that a symbol is defined in
+ this object, because this object is the application,
+ is linked with -Bsymbolic, or because the symbol is local.
+
+ 3. GC has rendered the entry unused.
+ Note, however, that in an executable all references to the
+ symbol go to the PLT, so we can't turn it off in that case.
+ ??? The correct thing to do here is to reference count
+ all uses of the symbol, not just those to the GOT or PLT. */
+ h->plt.offset = (bfd_vma) -1;
+ h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
+ return true;
+ }
+
+ /* Make sure this symbol is output as a dynamic symbol. */
+ if (h->dynindx == -1)
+ {
+ if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+ return false;
+ }
+ BFD_ASSERT (h->dynindx != -1);
+
+ s = bfd_get_section_by_name (dynobj, ".plt");
+ BFD_ASSERT (s != NULL);
+
+ /* If this is the first .plt entry, make room for the special
+ first entry. */
+ if (s->_raw_size == 0)
+ s->_raw_size += PLT_INITIAL_ENTRY_SIZE;
+
+ /* The PowerPC PLT is actually composed of two parts, the first part
+ is 2 words (for a load and a jump), and then there is a remaining
+ word available at the end. */
+ plt_offset = (PLT_INITIAL_ENTRY_SIZE
+ + (PLT_SLOT_SIZE
+ * ((s->_raw_size - PLT_INITIAL_ENTRY_SIZE)
+ / PLT_ENTRY_SIZE)));
+
+ /* If this symbol is not defined in a regular file, and we are
+ not generating a shared library, then set the symbol to this
+ location in the .plt. This is required to make function
+ pointers compare as equal between the normal executable and
+ the shared library. */
+ if (! info->shared
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ {
+ h->root.u.def.section = s;
+ h->root.u.def.value = plt_offset;
+ }
+
+ h->plt.offset = plt_offset;
+
+ /* Make room for this entry. After the 8192nd entry, room
+ for two entries is allocated. */
+ if ((s->_raw_size - PLT_INITIAL_ENTRY_SIZE) / PLT_ENTRY_SIZE
+ >= PLT_NUM_SINGLE_ENTRIES)
+ s->_raw_size += 2 * PLT_ENTRY_SIZE;
+ else
+ s->_raw_size += PLT_ENTRY_SIZE;
+
+ /* We also need to make an entry in the .rela.plt section. */
+ s = bfd_get_section_by_name (dynobj, ".rela.plt");
+ BFD_ASSERT (s != NULL);
+ s->_raw_size += sizeof (Elf32_External_Rela);
+
+ return true;
+ }
+
+ /* If this is a weak symbol, and there is a real definition, the
+ processor independent code will have arranged for us to see the
+ real definition first, and we can just use the same value. */
+ if (h->weakdef != NULL)
+ {
+ BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+ || h->weakdef->root.type == bfd_link_hash_defweak);
+ h->root.u.def.section = h->weakdef->root.u.def.section;
+ h->root.u.def.value = h->weakdef->root.u.def.value;
+ return true;
+ }
+
+ /* This is a reference to a symbol defined by a dynamic object which
+ is not a function. */
+
+ /* If we are creating a shared library, we must presume that the
+ only references to the symbol are via the global offset table.
+ For such cases we need not do anything here; the relocations will
+ be handled correctly by relocate_section. */
+ if (info->shared)
+ return true;
+
+ /* We must allocate the symbol in our .dynbss section, which will
+ become part of the .bss section of the executable. There will be
+ an entry for this symbol in the .dynsym section. The dynamic
+ object will contain position independent code, so all references
+ from the dynamic object to this symbol will go through the global
+ offset table. The dynamic linker will use the .dynsym entry to
+ determine the address it must put in the global offset table, so
+ both the dynamic object and the regular object will refer to the
+ same memory location for the variable.
+
+ Of course, if the symbol is sufficiently small, we must instead
+ allocate it in .sbss. FIXME: It would be better to do this if and
+ only if there were actually SDAREL relocs for that symbol. */
+
+ if (h->size <= elf_gp_size (dynobj))
+ s = bfd_get_section_by_name (dynobj, ".dynsbss");
+ else
+ s = bfd_get_section_by_name (dynobj, ".dynbss");
+ BFD_ASSERT (s != NULL);
+
+ /* We must generate a R_PPC_COPY reloc to tell the dynamic linker to
+ copy the initial value out of the dynamic object and into the
+ runtime process image. We need to remember the offset into the
+ .rela.bss section we are going to use. */
+ if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
+ {
+ asection *srel;
+
+ if (h->size <= elf_gp_size (dynobj))
+ srel = bfd_get_section_by_name (dynobj, ".rela.sbss");
+ else
+ srel = bfd_get_section_by_name (dynobj, ".rela.bss");
+ BFD_ASSERT (srel != NULL);
+ srel->_raw_size += sizeof (Elf32_External_Rela);
+ h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
+ }
+
+ /* We need to figure out the alignment required for this symbol. I
+ have no idea how ELF linkers handle this. */
+ power_of_two = bfd_log2 (h->size);
+ if (power_of_two > 4)
+ power_of_two = 4;
+
+ /* Apply the required alignment. */
+ s->_raw_size = BFD_ALIGN (s->_raw_size,
+ (bfd_size_type) (1 << power_of_two));
+ if (power_of_two > bfd_get_section_alignment (dynobj, s))
+ {
+ if (! bfd_set_section_alignment (dynobj, s, power_of_two))
+ return false;
+ }
+
+ /* Define the symbol as being at this point in the section. */
+ h->root.u.def.section = s;
+ h->root.u.def.value = s->_raw_size;
+
+ /* Increment the section size to make room for the symbol. */
+ s->_raw_size += h->size;
+
+ return true;
+}
+
+
+/* Set the sizes of the dynamic sections. */
+
+static boolean
+ppc_elf_size_dynamic_sections (output_bfd, info)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+{
+ bfd *dynobj;
+ asection *s;
+ boolean plt;
+ boolean relocs;
+ boolean reltext;
+
+#ifdef DEBUG
+ fprintf (stderr, "ppc_elf_size_dynamic_sections called\n");
+#endif
+
+ dynobj = elf_hash_table (info)->dynobj;
+ BFD_ASSERT (dynobj != NULL);
+
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ /* Set the contents of the .interp section to the interpreter. */
+ if (! info->shared)
+ {
+ s = bfd_get_section_by_name (dynobj, ".interp");
+ BFD_ASSERT (s != NULL);
+ s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+ s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
+ }
+ }
+ else
+ {
+ /* We may have created entries in the .rela.got, .rela.sdata, and
+ .rela.sdata2 sections. However, if we are not creating the
+ dynamic sections, we will not actually use these entries. Reset
+ the size of .rela.got, et al, which will cause it to get
+ stripped from the output file below. */
+ static char *rela_sections[] = { ".rela.got", ".rela.sdata",
+ ".rela.sdata2", ".rela.sbss",
+ (char *)0 };
+ char **p;
+
+ for (p = rela_sections; *p != (char *)0; p++)
+ {
+ s = bfd_get_section_by_name (dynobj, *p);
+ if (s != NULL)
+ s->_raw_size = 0;
+ }
+ }
+
+ /* The check_relocs and adjust_dynamic_symbol entry points have
+ determined the sizes of the various dynamic sections. Allocate
+ memory for them. */
+ plt = false;
+ relocs = false;
+ reltext = false;
+ for (s = dynobj->sections; s != NULL; s = s->next)
+ {
+ const char *name;
+ boolean strip;
+
+ if ((s->flags & SEC_LINKER_CREATED) == 0)
+ continue;
+
+ /* It's OK to base decisions on the section name, because none
+ of the dynobj section names depend upon the input files. */
+ name = bfd_get_section_name (dynobj, s);
+
+ strip = false;
+
+ if (strcmp (name, ".plt") == 0)
+ {
+ if (s->_raw_size == 0)
+ {
+ /* Strip this section if we don't need it; see the
+ comment below. */
+ strip = true;
+ }
+ else
+ {
+ /* Remember whether there is a PLT. */
+ plt = true;
+ }
+ }
+ else if (strncmp (name, ".rela", 5) == 0)
+ {
+ if (s->_raw_size == 0)
+ {
+ /* If we don't need this section, strip it from the
+ output file. This is mostly to handle .rela.bss and
+ .rela.plt. We must create both sections in
+ create_dynamic_sections, because they must be created
+ before the linker maps input sections to output
+ sections. The linker does that before
+ adjust_dynamic_symbol is called, and it is that
+ function which decides whether anything needs to go
+ into these sections. */
+ strip = true;
+ }
+ else
+ {
+ asection *target;
+ const char *outname;
+
+ /* Remember whether there are any relocation sections. */
+ relocs = true;
+
+ /* If this relocation section applies to a read only
+ section, then we probably need a DT_TEXTREL entry. */
+ outname = bfd_get_section_name (output_bfd,
+ s->output_section);
+ target = bfd_get_section_by_name (output_bfd, outname + 5);
+ if (target != NULL
+ && (target->flags & SEC_READONLY) != 0
+ && (target->flags & SEC_ALLOC) != 0)
+ reltext = true;
+
+ /* We use the reloc_count field as a counter if we need
+ to copy relocs into the output file. */
+ s->reloc_count = 0;
+ }
+ }
+ else if (strcmp (name, ".got") != 0
+ && strcmp (name, ".sdata") != 0
+ && strcmp (name, ".sdata2") != 0)
+ {
+ /* It's not one of our sections, so don't allocate space. */
+ continue;
+ }
+
+ if (strip)
+ {
+ _bfd_strip_section_from_output (info, s);
+ continue;
+ }
+
+ /* Allocate memory for the section contents. */
+ s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
+ if (s->contents == NULL && s->_raw_size != 0)
+ return false;
+ }
+
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ /* Add some entries to the .dynamic section. We fill in the
+ values later, in ppc_elf_finish_dynamic_sections, but we
+ must add the entries now so that we get the correct size for
+ the .dynamic section. The DT_DEBUG entry is filled in by the
+ dynamic linker and used by the debugger. */
+ if (! info->shared)
+ {
+ if (! bfd_elf32_add_dynamic_entry (info, DT_DEBUG, 0))
+ return false;
+ }
+
+ if (plt)
+ {
+ if (! bfd_elf32_add_dynamic_entry (info, DT_PLTGOT, 0)
+ || ! bfd_elf32_add_dynamic_entry (info, DT_PLTRELSZ, 0)
+ || ! bfd_elf32_add_dynamic_entry (info, DT_PLTREL, DT_RELA)
+ || ! bfd_elf32_add_dynamic_entry (info, DT_JMPREL, 0))
+ return false;
+ }
+
+ if (relocs)
+ {
+ if (! bfd_elf32_add_dynamic_entry (info, DT_RELA, 0)
+ || ! bfd_elf32_add_dynamic_entry (info, DT_RELASZ, 0)
+ || ! bfd_elf32_add_dynamic_entry (info, DT_RELAENT,
+ sizeof (Elf32_External_Rela)))
+ return false;
+ }
+
+ if (reltext)
+ {
+ if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0))
+ return false;
+ }
+ }
+
+ return true;
+}
+
+
+/* Look through the relocs for a section during the first phase, and
+ allocate space in the global offset table or procedure linkage
+ table. */
+
+static boolean
+ppc_elf_check_relocs (abfd, info, sec, relocs)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ asection *sec;
+ const Elf_Internal_Rela *relocs;
+{
+ bfd *dynobj;
+ Elf_Internal_Shdr *symtab_hdr;
+ struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
+ const Elf_Internal_Rela *rel;
+ const Elf_Internal_Rela *rel_end;
+ bfd_signed_vma *local_got_refcounts;
+ elf_linker_section_t *sdata;
+ elf_linker_section_t *sdata2;
+ asection *sreloc;
+ asection *sgot = NULL;
+ asection *srelgot = NULL;
+
+ if (info->relocateable)
+ return true;
+
+#ifdef DEBUG
+ fprintf (stderr, "ppc_elf_check_relocs called for section %s in %s\n",
+ bfd_get_section_name (abfd, sec),
+ bfd_get_filename (abfd));
+#endif
+
+ /* Create the linker generated sections all the time so that the
+ special symbols are created. */
+
+ if ((sdata = elf_linker_section (abfd, LINKER_SECTION_SDATA)) == NULL)
+ {
+ sdata = ppc_elf_create_linker_section (abfd, info, LINKER_SECTION_SDATA);
+ if (!sdata)
+ return false;
+ }
+
+
+ if ((sdata2 = elf_linker_section (abfd, LINKER_SECTION_SDATA2)) == NULL)
+ {
+ sdata2 = ppc_elf_create_linker_section (abfd, info, LINKER_SECTION_SDATA2);
+ if (!sdata2)
+ return false;
+ }
+
+ dynobj = elf_hash_table (info)->dynobj;
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ local_got_refcounts = elf_local_got_refcounts (abfd);
+
+ sym_hashes = elf_sym_hashes (abfd);
+ sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof(Elf32_External_Sym);
+ if (!elf_bad_symtab (abfd))
+ sym_hashes_end -= symtab_hdr->sh_info;
+
+ sreloc = NULL;
+
+ rel_end = relocs + sec->reloc_count;
+ for (rel = relocs; rel < rel_end; rel++)
+ {
+ unsigned long r_symndx;
+ struct elf_link_hash_entry *h;
+
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ if (r_symndx < symtab_hdr->sh_info)
+ h = NULL;
+ else
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+
+ /* If a relocation refers to _GLOBAL_OFFSET_TABLE_, create the .got.
+ This shows up in particular in an R_PPC_ADDR32 in the eabi
+ startup code. */
+ if (h && strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+ {
+ if (sgot == NULL)
+ {
+ if (dynobj == NULL)
+ elf_hash_table (info)->dynobj = dynobj = abfd;
+ if (! _bfd_elf_create_got_section (dynobj, info))
+ return false;
+ sgot = bfd_get_section_by_name (dynobj, ".got");
+ BFD_ASSERT (sgot != NULL);
+ }
+ }
+
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ /* GOT16 relocations */
+ case R_PPC_GOT16:
+ case R_PPC_GOT16_LO:
+ case R_PPC_GOT16_HI:
+ case R_PPC_GOT16_HA:
+ /* This symbol requires a global offset table entry. */
+
+ if (sgot == NULL)
+ {
+ if (dynobj == NULL)
+ elf_hash_table (info)->dynobj = dynobj = abfd;
+ if (! _bfd_elf_create_got_section (dynobj, info))
+ return false;
+ sgot = bfd_get_section_by_name (dynobj, ".got");
+ BFD_ASSERT (sgot != NULL);
+ }
+
+ if (srelgot == NULL
+ && (h != NULL || info->shared))
+ {
+ srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+ if (srelgot == NULL)
+ {
+ srelgot = bfd_make_section (dynobj, ".rela.got");
+ if (srelgot == NULL
+ || ! bfd_set_section_flags (dynobj, srelgot,
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED
+ | SEC_READONLY))
+ || ! bfd_set_section_alignment (dynobj, srelgot, 2))
+ return false;
+ }
+ }
+
+ if (h != NULL)
+ {
+ if (h->got.refcount == -1)
+ {
+ /* Make sure this symbol is output as a dynamic symbol. */
+ if (h->dynindx == -1)
+ if (!bfd_elf32_link_record_dynamic_symbol (info, h))
+ return false;
+
+ /* Allocate space in the .got. */
+ sgot->_raw_size += 4;
+ /* Allocate relocation space. */
+ srelgot->_raw_size += sizeof (Elf32_External_Rela);
+
+ h->got.refcount = 1;
+ }
+ else
+ h->got.refcount++;
+ }
+ else
+ {
+ /* This is a global offset table entry for a local symbol. */
+ if (local_got_refcounts == NULL)
+ {
+ size_t size;
+
+ size = symtab_hdr->sh_info * sizeof (bfd_signed_vma);
+ local_got_refcounts = (bfd_signed_vma *)
+ bfd_alloc (abfd, size);
+ if (local_got_refcounts == NULL)
+ return false;
+ elf_local_got_refcounts (abfd) = local_got_refcounts;
+ memset (local_got_refcounts, -1, size);
+ }
+ if (local_got_refcounts[r_symndx] == -1)
+ {
+ sgot->_raw_size += 4;
+
+ /* If we are generating a shared object, we need to
+ output a R_PPC_RELATIVE reloc so that the
+ dynamic linker can adjust this GOT entry. */
+ if (info->shared)
+ srelgot->_raw_size += sizeof (Elf32_External_Rela);
+
+ local_got_refcounts[r_symndx] = 1;
+ }
+ else
+ local_got_refcounts[r_symndx]++;
+ }
+ break;
+
+ /* Indirect .sdata relocation */
+ case R_PPC_EMB_SDAI16:
+ if (info->shared)
+ {
+ ((*_bfd_error_handler)
+ (_("%s: relocation %s cannot be used when making a shared object"),
+ bfd_get_filename (abfd), "R_PPC_EMB_SDAI16"));
+ return false;
+ }
+
+ if (srelgot == NULL && (h != NULL || info->shared))
+ {
+ srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+ if (srelgot == NULL)
+ {
+ srelgot = bfd_make_section (dynobj, ".rela.got");
+ if (srelgot == NULL
+ || ! bfd_set_section_flags (dynobj, srelgot,
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED
+ | SEC_READONLY))
+ || ! bfd_set_section_alignment (dynobj, srelgot, 2))
+ return false;
+ }
+ }
+
+ if (!bfd_elf32_create_pointer_linker_section (abfd, info, sdata, h, rel))
+ return false;
+
+ break;
+
+ /* Indirect .sdata2 relocation */
+ case R_PPC_EMB_SDA2I16:
+ if (info->shared)
+ {
+ ((*_bfd_error_handler)
+ (_("%s: relocation %s cannot be used when making a shared object"),
+ bfd_get_filename (abfd), "R_PPC_EMB_SDA2I16"));
+ return false;
+ }
+
+ if (srelgot == NULL && (h != NULL || info->shared))
+ {
+ srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+ if (srelgot == NULL)
+ {
+ srelgot = bfd_make_section (dynobj, ".rela.got");
+ if (srelgot == NULL
+ || ! bfd_set_section_flags (dynobj, srelgot,
+ (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED
+ | SEC_READONLY))
+ || ! bfd_set_section_alignment (dynobj, srelgot, 2))
+ return false;
+ }
+ }
+
+ if (!bfd_elf32_create_pointer_linker_section (abfd, info, sdata2, h, rel))
+ return false;
+
+ break;
+
+ case R_PPC_SDAREL16:
+ case R_PPC_EMB_SDA2REL:
+ case R_PPC_EMB_SDA21:
+ if (info->shared)
+ {
+ ((*_bfd_error_handler)
+ (_("%s: relocation %s cannot be used when making a shared object"),
+ bfd_get_filename (abfd),
+ ppc_elf_howto_table[(int)ELF32_R_TYPE (rel->r_info)]->name));
+ return false;
+ }
+ break;
+
+ case R_PPC_PLT32:
+ case R_PPC_PLTREL24:
+ case R_PPC_PLT16_LO:
+ case R_PPC_PLT16_HI:
+ case R_PPC_PLT16_HA:
+#ifdef DEBUG
+ fprintf (stderr, "Reloc requires a PLT entry\n");
+#endif
+ /* This symbol requires a procedure linkage table entry. We
+ actually build the entry in adjust_dynamic_symbol,
+ because this might be a case of linking PIC code without
+ linking in any dynamic objects, in which case we don't
+ need to generate a procedure linkage table after all. */
+
+ if (h == NULL)
+ {
+ /* It does not make sense to have a procedure linkage
+ table entry for a local symbol. */
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ }
+
+ /* Make sure this symbol is output as a dynamic symbol. */
+ if (h->dynindx == -1)
+ {
+ if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+ return false;
+ }
+ if (h->plt.refcount == -1)
+ {
+ h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
+ h->plt.refcount = 1;
+ }
+ else
+ h->plt.refcount++;
+ break;
+
+ /* The following relocations don't need to propagate the
+ relocation if linking a shared object since they are
+ section relative. */
+ case R_PPC_SECTOFF:
+ case R_PPC_SECTOFF_LO:
+ case R_PPC_SECTOFF_HI:
+ case R_PPC_SECTOFF_HA:
+ break;
+
+ /* This refers only to functions defined in the shared library */
+ case R_PPC_LOCAL24PC:
+ break;
+
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_PPC_GNU_VTINHERIT:
+ if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return false;
+ break;
+
+ /* This relocation describes which C++ vtable entries are actually
+ used. Record for later use during GC. */
+ case R_PPC_GNU_VTENTRY:
+ if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return false;
+ break;
+
+ /* When creating a shared object, we must copy these
+ relocs into the output file. We create a reloc
+ section in dynobj and make room for the reloc. */
+ case R_PPC_REL24:
+ case R_PPC_REL14:
+ case R_PPC_REL14_BRTAKEN:
+ case R_PPC_REL14_BRNTAKEN:
+ case R_PPC_REL32:
+ if (h == NULL
+ || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+ break;
+ /* fall through */
+
+ default:
+ if (info->shared)
+ {
+#ifdef DEBUG
+ fprintf (stderr, "ppc_elf_check_relocs need to create relocation for %s\n",
+ (h && h->root.root.string) ? h->root.root.string : "<unknown>");
+#endif
+ if (sreloc == NULL)
+ {
+ const char *name;
+
+ name = (bfd_elf_string_from_elf_section
+ (abfd,
+ elf_elfheader (abfd)->e_shstrndx,
+ elf_section_data (sec)->rel_hdr.sh_name));
+ if (name == NULL)
+ return false;
+
+ BFD_ASSERT (strncmp (name, ".rela", 5) == 0
+ && strcmp (bfd_get_section_name (abfd, sec),
+ name + 5) == 0);
+
+ sreloc = bfd_get_section_by_name (dynobj, name);
+ if (sreloc == NULL)
+ {
+ flagword flags;
+
+ sreloc = bfd_make_section (dynobj, name);
+ flags = (SEC_HAS_CONTENTS | SEC_READONLY
+ | SEC_IN_MEMORY | SEC_LINKER_CREATED);
+ if ((sec->flags & SEC_ALLOC) != 0)
+ flags |= SEC_ALLOC | SEC_LOAD;
+ if (sreloc == NULL
+ || ! bfd_set_section_flags (dynobj, sreloc, flags)
+ || ! bfd_set_section_alignment (dynobj, sreloc, 2))
+ return false;
+ }
+ }
+
+ sreloc->_raw_size += sizeof (Elf32_External_Rela);
+
+ /* FIXME: We should here do what the m68k and i386
+ backends do: if the reloc is pc-relative, record it
+ in case it turns out that the reloc is unnecessary
+ because the symbol is forced local by versioning or
+ we are linking with -Bdynamic. Fortunately this
+ case is not frequent. */
+ }
+
+ break;
+ }
+ }
+
+ return true;
+}
+
+/* Return the section that should be marked against GC for a given
+ relocation. */
+
+static asection *
+ppc_elf_gc_mark_hook (abfd, info, rel, h, sym)
+ bfd *abfd;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ Elf_Internal_Rela *rel;
+ struct elf_link_hash_entry *h;
+ Elf_Internal_Sym *sym;
+{
+ if (h != NULL)
+ {
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ case R_PPC_GNU_VTINHERIT:
+ case R_PPC_GNU_VTENTRY:
+ break;
+
+ default:
+ switch (h->root.type)
+ {
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ return h->root.u.def.section;
+
+ case bfd_link_hash_common:
+ return h->root.u.c.p->section;
+
+ default:
+ break;
+ }
+ }
+ }
+ else
+ {
+ if (!(elf_bad_symtab (abfd)
+ && ELF_ST_BIND (sym->st_info) != STB_LOCAL)
+ && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE)
+ && sym->st_shndx != SHN_COMMON))
+ {
+ return bfd_section_from_elf_index (abfd, sym->st_shndx);
+ }
+ }
+
+ return NULL;
+}
+
+/* Update the got entry reference counts for the section being removed. */
+
+static boolean
+ppc_elf_gc_sweep_hook (abfd, info, sec, relocs)
+ bfd *abfd;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ asection *sec;
+ const Elf_Internal_Rela *relocs;
+{
+ Elf_Internal_Shdr *symtab_hdr;
+ struct elf_link_hash_entry **sym_hashes;
+ bfd_signed_vma *local_got_refcounts;
+ const Elf_Internal_Rela *rel, *relend;
+ unsigned long r_symndx;
+ struct elf_link_hash_entry *h;
+
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (abfd);
+ local_got_refcounts = elf_local_got_refcounts (abfd);
+
+ relend = relocs + sec->reloc_count;
+ for (rel = relocs; rel < relend; rel++)
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ case R_PPC_GOT16:
+ case R_PPC_GOT16_LO:
+ case R_PPC_GOT16_HI:
+ case R_PPC_GOT16_HA:
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ if (r_symndx >= symtab_hdr->sh_info)
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ if (h->got.refcount > 0)
+ h->got.refcount--;
+ }
+ else
+ {
+ if (local_got_refcounts[r_symndx] > 0)
+ local_got_refcounts[r_symndx]--;
+ }
+ break;
+
+ case R_PPC_PLT32:
+ case R_PPC_PLTREL24:
+ case R_PPC_PLT16_LO:
+ case R_PPC_PLT16_HI:
+ case R_PPC_PLT16_HA:
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ if (r_symndx >= symtab_hdr->sh_info)
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ if (h->plt.refcount > 0)
+ h->plt.refcount--;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ return true;
+}
+
+/* Hook called by the linker routine which adds symbols from an object
+ file. We use it to put .comm items in .sbss, and not .bss. */
+
+/*ARGSUSED*/
+static boolean
+ppc_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ const Elf_Internal_Sym *sym;
+ const char **namep ATTRIBUTE_UNUSED;
+ flagword *flagsp ATTRIBUTE_UNUSED;
+ asection **secp;
+ bfd_vma *valp;
+{
+ if (sym->st_shndx == SHN_COMMON
+ && !info->relocateable
+ && sym->st_size <= (bfd_vma) bfd_get_gp_size (abfd))
+ {
+ /* Common symbols less than or equal to -G nn bytes are automatically
+ put into .sdata. */
+ elf_linker_section_t *sdata
+ = ppc_elf_create_linker_section (abfd, info, LINKER_SECTION_SDATA);
+
+ if (!sdata->bss_section)
+ {
+ /* We don't go through bfd_make_section, because we don't
+ want to attach this common section to DYNOBJ. The linker
+ will move the symbols to the appropriate output section
+ when it defines common symbols. */
+ sdata->bss_section = ((asection *)
+ bfd_zalloc (abfd, sizeof (asection)));
+ if (sdata->bss_section == NULL)
+ return false;
+ sdata->bss_section->name = sdata->bss_name;
+ sdata->bss_section->flags = SEC_IS_COMMON;
+ sdata->bss_section->output_section = sdata->bss_section;
+ sdata->bss_section->symbol =
+ (asymbol *) bfd_zalloc (abfd, sizeof (asymbol));
+ sdata->bss_section->symbol_ptr_ptr =
+ (asymbol **) bfd_zalloc (abfd, sizeof (asymbol *));
+ if (sdata->bss_section->symbol == NULL
+ || sdata->bss_section->symbol_ptr_ptr == NULL)
+ return false;
+ sdata->bss_section->symbol->name = sdata->bss_name;
+ sdata->bss_section->symbol->flags = BSF_SECTION_SYM;
+ sdata->bss_section->symbol->section = sdata->bss_section;
+ *sdata->bss_section->symbol_ptr_ptr = sdata->bss_section->symbol;
+ }
+
+ *secp = sdata->bss_section;
+ *valp = sym->st_size;
+ }
+
+ return true;
+}
+
+
+/* Finish up dynamic symbol handling. We set the contents of various
+ dynamic sections here. */
+
+static boolean
+ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+ struct elf_link_hash_entry *h;
+ Elf_Internal_Sym *sym;
+{
+ bfd *dynobj;
+
+#ifdef DEBUG
+ fprintf (stderr, "ppc_elf_finish_dynamic_symbol called for %s",
+ h->root.root.string);
+#endif
+
+ dynobj = elf_hash_table (info)->dynobj;
+ BFD_ASSERT (dynobj != NULL);
+
+ if (h->plt.offset != (bfd_vma) -1)
+ {
+ asection *splt;
+ asection *srela;
+ Elf_Internal_Rela rela;
+ bfd_vma reloc_index;
+
+#ifdef DEBUG
+ fprintf (stderr, ", plt_offset = %d", h->plt.offset);
+#endif
+
+ /* This symbol has an entry in the procedure linkage table. Set
+ it up. */
+
+ BFD_ASSERT (h->dynindx != -1);
+
+ splt = bfd_get_section_by_name (dynobj, ".plt");
+ srela = bfd_get_section_by_name (dynobj, ".rela.plt");
+ BFD_ASSERT (splt != NULL && srela != NULL);
+
+ /* We don't need to fill in the .plt. The ppc dynamic linker
+ will fill it in. */
+
+ /* Fill in the entry in the .rela.plt section. */
+ rela.r_offset = (splt->output_section->vma
+ + splt->output_offset
+ + h->plt.offset);
+ rela.r_info = ELF32_R_INFO (h->dynindx, R_PPC_JMP_SLOT);
+ rela.r_addend = 0;
+
+ reloc_index = (h->plt.offset - PLT_INITIAL_ENTRY_SIZE) / PLT_SLOT_SIZE;
+ if (reloc_index > PLT_NUM_SINGLE_ENTRIES)
+ reloc_index -= (reloc_index - PLT_NUM_SINGLE_ENTRIES) / 2;
+ bfd_elf32_swap_reloca_out (output_bfd, &rela,
+ ((Elf32_External_Rela *) srela->contents
+ + reloc_index));
+
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ {
+ /* Mark the symbol as undefined, rather than as defined in
+ the .plt section. Leave the value alone. */
+ sym->st_shndx = SHN_UNDEF;
+ }
+ }
+
+ if (h->got.offset != (bfd_vma) -1)
+ {
+ asection *sgot;
+ asection *srela;
+ Elf_Internal_Rela rela;
+
+ /* This symbol has an entry in the global offset table. Set it
+ up. */
+
+ sgot = bfd_get_section_by_name (dynobj, ".got");
+ srela = bfd_get_section_by_name (dynobj, ".rela.got");
+ BFD_ASSERT (sgot != NULL && srela != NULL);
+
+ rela.r_offset = (sgot->output_section->vma
+ + sgot->output_offset
+ + (h->got.offset &~ 1));
+
+ /* If this is a -Bsymbolic link, and the symbol is defined
+ locally, we just want to emit a RELATIVE reloc. The entry in
+ the global offset table will already have been initialized in
+ the relocate_section function. */
+ if (info->shared
+ && (info->symbolic || h->dynindx == -1)
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
+ {
+ rela.r_info = ELF32_R_INFO (0, R_PPC_RELATIVE);
+ rela.r_addend = (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+ }
+ else
+ {
+ BFD_ASSERT((h->got.offset & 1) == 0);
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset);
+ rela.r_info = ELF32_R_INFO (h->dynindx, R_PPC_GLOB_DAT);
+ rela.r_addend = 0;
+ }
+
+ bfd_elf32_swap_reloca_out (output_bfd, &rela,
+ ((Elf32_External_Rela *) srela->contents
+ + srela->reloc_count));
+ ++srela->reloc_count;
+ }
+
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
+ {
+ asection *s;
+ Elf_Internal_Rela rela;
+
+ /* This symbols needs a copy reloc. Set it up. */
+
+#ifdef DEBUG
+ fprintf (stderr, ", copy");
+#endif
+
+ BFD_ASSERT (h->dynindx != -1);
+
+ if (h->size <= elf_gp_size (dynobj))
+ s = bfd_get_section_by_name (h->root.u.def.section->owner,
+ ".rela.sbss");
+ else
+ s = bfd_get_section_by_name (h->root.u.def.section->owner,
+ ".rela.bss");
+ BFD_ASSERT (s != NULL);
+
+ rela.r_offset = (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+ rela.r_info = ELF32_R_INFO (h->dynindx, R_PPC_COPY);
+ rela.r_addend = 0;
+ bfd_elf32_swap_reloca_out (output_bfd, &rela,
+ ((Elf32_External_Rela *) s->contents
+ + s->reloc_count));
+ ++s->reloc_count;
+ }
+
+#ifdef DEBUG
+ fprintf (stderr, "\n");
+#endif
+
+ /* Mark some specially defined symbols as absolute. */
+ if (strcmp (h->root.root.string, "_DYNAMIC") == 0
+ || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0
+ || strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0)
+ sym->st_shndx = SHN_ABS;
+
+ return true;
+}
+
+
+/* Finish up the dynamic sections. */
+
+static boolean
+ppc_elf_finish_dynamic_sections (output_bfd, info)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+{
+ asection *sdyn;
+ bfd *dynobj = elf_hash_table (info)->dynobj;
+ asection *sgot = bfd_get_section_by_name (dynobj, ".got");
+
+#ifdef DEBUG
+ fprintf (stderr, "ppc_elf_finish_dynamic_sections called\n");
+#endif
+
+ sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
+
+ if (elf_hash_table (info)->dynamic_sections_created)
+ {
+ asection *splt;
+ Elf32_External_Dyn *dyncon, *dynconend;
+
+ splt = bfd_get_section_by_name (dynobj, ".plt");
+ BFD_ASSERT (splt != NULL && sdyn != NULL);
+
+ dyncon = (Elf32_External_Dyn *) sdyn->contents;
+ dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+ for (; dyncon < dynconend; dyncon++)
+ {
+ Elf_Internal_Dyn dyn;
+ const char *name;
+ boolean size;
+
+ bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
+
+ switch (dyn.d_tag)
+ {
+ case DT_PLTGOT: name = ".plt"; size = false; break;
+ case DT_PLTRELSZ: name = ".rela.plt"; size = true; break;
+ case DT_JMPREL: name = ".rela.plt"; size = false; break;
+ default: name = NULL; size = false; break;
+ }
+
+ if (name != NULL)
+ {
+ asection *s;
+
+ s = bfd_get_section_by_name (output_bfd, name);
+ if (s == NULL)
+ dyn.d_un.d_val = 0;
+ else
+ {
+ if (! size)
+ dyn.d_un.d_ptr = s->vma;
+ else
+ {
+ if (s->_cooked_size != 0)
+ dyn.d_un.d_val = s->_cooked_size;
+ else
+ dyn.d_un.d_val = s->_raw_size;
+ }
+ }
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ }
+ }
+ }
+
+ /* Add a blrl instruction at _GLOBAL_OFFSET_TABLE_-4 so that a function can
+ easily find the address of the _GLOBAL_OFFSET_TABLE_. */
+ if (sgot)
+ {
+ unsigned char *contents = sgot->contents;
+ bfd_put_32 (output_bfd, 0x4e800021 /* blrl */, contents);
+
+ if (sdyn == NULL)
+ bfd_put_32 (output_bfd, (bfd_vma) 0, contents+4);
+ else
+ bfd_put_32 (output_bfd,
+ sdyn->output_section->vma + sdyn->output_offset,
+ contents+4);
+
+ elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4;
+ }
+
+ return true;
+}
+
+
+/* The RELOCATE_SECTION function is called by the ELF backend linker
+ to handle the relocations for a section.
+
+ The relocs are always passed as Rela structures; if the section
+ actually uses Rel structures, the r_addend field will always be
+ zero.
+
+ This function is responsible for adjust the section contents as
+ necessary, and (if using Rela relocs and generating a
+ relocateable output file) adjusting the reloc addend as
+ necessary.
+
+ This function does not have to worry about setting the reloc
+ address or the reloc symbol index.
+
+ LOCAL_SYMS is a pointer to the swapped in local symbols.
+
+ LOCAL_SECTIONS is an array giving the section in the input file
+ corresponding to the st_shndx field of each local symbol.
+
+ The global hash table entry for the global symbols can be found
+ via elf_sym_hashes (input_bfd).
+
+ When generating relocateable output, this function must handle
+ STB_LOCAL/STT_SECTION symbols specially. The output symbol is
+ going to be the section symbol corresponding to the output
+ section, which means that the addend must be adjusted
+ accordingly. */
+
+static boolean
+ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
+ contents, relocs, local_syms, local_sections)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+ bfd *input_bfd;
+ asection *input_section;
+ bfd_byte *contents;
+ Elf_Internal_Rela *relocs;
+ Elf_Internal_Sym *local_syms;
+ asection **local_sections;
+{
+ Elf_Internal_Shdr *symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+ struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
+ bfd *dynobj = elf_hash_table (info)->dynobj;
+ elf_linker_section_t *sdata = (dynobj) ? elf_linker_section (dynobj, LINKER_SECTION_SDATA) : NULL;
+ elf_linker_section_t *sdata2 = (dynobj) ? elf_linker_section (dynobj, LINKER_SECTION_SDATA2) : NULL;
+ Elf_Internal_Rela *rel = relocs;
+ Elf_Internal_Rela *relend = relocs + input_section->reloc_count;
+ asection *sreloc = NULL;
+ asection *splt;
+ asection *sgot;
+ bfd_vma *local_got_offsets;
+ boolean ret = true;
+ long insn;
+
+#ifdef DEBUG
+ fprintf (stderr, "ppc_elf_relocate_section called for %s section %s, %ld relocations%s\n",
+ bfd_get_filename (input_bfd),
+ bfd_section_name(input_bfd, input_section),
+ (long)input_section->reloc_count,
+ (info->relocateable) ? " (relocatable)" : "");
+#endif
+
+ if (!ppc_elf_howto_table[ R_PPC_ADDR32 ]) /* Initialize howto table if needed */
+ ppc_elf_howto_init ();
+
+ local_got_offsets = elf_local_got_offsets (input_bfd);
+
+ splt = sgot = NULL;
+ if (dynobj != NULL)
+ {
+ splt = bfd_get_section_by_name (dynobj, ".plt");
+ sgot = bfd_get_section_by_name (dynobj, ".got");
+ }
+
+ for (; rel < relend; rel++)
+ {
+ enum elf_ppc_reloc_type r_type = (enum elf_ppc_reloc_type)ELF32_R_TYPE (rel->r_info);
+ bfd_vma offset = rel->r_offset;
+ bfd_vma addend = rel->r_addend;
+ bfd_reloc_status_type r = bfd_reloc_other;
+ Elf_Internal_Sym *sym = (Elf_Internal_Sym *)0;
+ asection *sec = (asection *)0;
+ struct elf_link_hash_entry *h = (struct elf_link_hash_entry *)0;
+ const char *sym_name = (const char *)0;
+ reloc_howto_type *howto;
+ unsigned long r_symndx;
+ bfd_vma relocation;
+
+ /* Unknown relocation handling */
+ if ((unsigned)r_type >= (unsigned)R_PPC_max || !ppc_elf_howto_table[(int)r_type])
+ {
+ (*_bfd_error_handler) (_("%s: unknown relocation type %d"),
+ bfd_get_filename (input_bfd),
+ (int)r_type);
+
+ bfd_set_error (bfd_error_bad_value);
+ ret = false;
+ continue;
+ }
+
+ howto = ppc_elf_howto_table[(int)r_type];
+ r_symndx = ELF32_R_SYM (rel->r_info);
+
+ if (info->relocateable)
+ {
+ /* This is a relocateable link. We don't have to change
+ anything, unless the reloc is against a section symbol,
+ in which case we have to adjust according to where the
+ section symbol winds up in the output section. */
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ sym = local_syms + r_symndx;
+ if ((unsigned)ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+ {
+ sec = local_sections[r_symndx];
+ addend = rel->r_addend += sec->output_offset + sym->st_value;
+ }
+ }
+
+#ifdef DEBUG
+ fprintf (stderr, "\ttype = %s (%d), symbol index = %ld, offset = %ld, addend = %ld\n",
+ howto->name,
+ (int)r_type,
+ r_symndx,
+ (long)offset,
+ (long)addend);
+#endif
+ continue;
+ }
+
+ /* This is a final link. */
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+ sym_name = "<local symbol>";
+
+ relocation = (sec->output_section->vma
+ + sec->output_offset
+ + sym->st_value);
+ }
+ else
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ sym_name = h->root.root.string;
+ if (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ {
+ sec = h->root.u.def.section;
+ if ((r_type == R_PPC_PLT32
+ && h->plt.offset != (bfd_vma) -1)
+ || (r_type == R_PPC_LOCAL24PC
+ && sec->output_section == NULL)
+ || ((r_type == R_PPC_GOT16
+ || r_type == R_PPC_GOT16_LO
+ || r_type == R_PPC_GOT16_HI
+ || r_type == R_PPC_GOT16_HA)
+ && elf_hash_table (info)->dynamic_sections_created
+ && (! info->shared
+ || (! info->symbolic && h->dynindx != -1)
+ || (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_REGULAR) == 0))
+ || (info->shared
+ && ((! info->symbolic && h->dynindx != -1)
+ || (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ && ((input_section->flags & SEC_ALLOC) != 0
+ /* Testing SEC_DEBUGGING here may be wrong.
+ It's here to avoid a crash when
+ generating a shared library with DWARF
+ debugging information. */
+ || (input_section->flags & SEC_DEBUGGING) != 0)
+ && (r_type == R_PPC_ADDR32
+ || r_type == R_PPC_ADDR24
+ || r_type == R_PPC_ADDR16
+ || r_type == R_PPC_ADDR16_LO
+ || r_type == R_PPC_ADDR16_HI
+ || r_type == R_PPC_ADDR16_HA
+ || r_type == R_PPC_ADDR14
+ || r_type == R_PPC_ADDR14_BRTAKEN
+ || r_type == R_PPC_ADDR14_BRNTAKEN
+ || r_type == R_PPC_PLTREL24
+ || r_type == R_PPC_COPY
+ || r_type == R_PPC_GLOB_DAT
+ || r_type == R_PPC_JMP_SLOT
+ || r_type == R_PPC_UADDR32
+ || r_type == R_PPC_UADDR16
+ || r_type == R_PPC_SDAREL16
+ || r_type == R_PPC_EMB_NADDR32
+ || r_type == R_PPC_EMB_NADDR16
+ || r_type == R_PPC_EMB_NADDR16_LO
+ || r_type == R_PPC_EMB_NADDR16_HI
+ || r_type == R_PPC_EMB_NADDR16_HA
+ || r_type == R_PPC_EMB_SDAI16
+ || r_type == R_PPC_EMB_SDA2I16
+ || r_type == R_PPC_EMB_SDA2REL
+ || r_type == R_PPC_EMB_SDA21
+ || r_type == R_PPC_EMB_MRKREF
+ || r_type == R_PPC_EMB_BIT_FLD
+ || r_type == R_PPC_EMB_RELSDA
+ || ((r_type == R_PPC_REL24
+ || r_type == R_PPC_REL32
+ || r_type == R_PPC_REL14
+ || r_type == R_PPC_REL14_BRTAKEN
+ || r_type == R_PPC_REL14_BRNTAKEN
+ || r_type == R_PPC_RELATIVE)
+ && strcmp (h->root.root.string,
+ "_GLOBAL_OFFSET_TABLE_") != 0))))
+ {
+ /* In these cases, we don't need the relocation
+ value. We check specially because in some
+ obscure cases sec->output_section will be NULL. */
+ relocation = 0;
+ }
+ else if (sec->output_section == NULL)
+ {
+ (*_bfd_error_handler)
+ (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
+ bfd_get_filename (input_bfd), h->root.root.string,
+ bfd_get_section_name (input_bfd, input_section));
+ relocation = 0;
+ }
+ else
+ relocation = (h->root.u.def.value
+ + sec->output_section->vma
+ + sec->output_offset);
+ }
+ else if (h->root.type == bfd_link_hash_undefweak)
+ relocation = 0;
+ else if (info->shared && !info->symbolic && !info->no_undefined)
+ relocation = 0;
+ else
+ {
+ if (! (*info->callbacks->undefined_symbol)(info,
+ h->root.root.string,
+ input_bfd,
+ input_section,
+ rel->r_offset,
+ (!info->shared
+ || info->no_undefined)))
+ return false;
+ relocation = 0;
+ }
+ }
+
+ switch ((int)r_type)
+ {
+ default:
+ (*_bfd_error_handler) (_("%s: unknown relocation type %d for symbol %s"),
+ bfd_get_filename (input_bfd),
+ (int)r_type, sym_name);
+
+ bfd_set_error (bfd_error_bad_value);
+ ret = false;
+ continue;
+
+ /* Relocations that need no special processing. */
+ case (int)R_PPC_LOCAL24PC:
+ /* It makes no sense to point a local relocation
+ at a symbol not in this object. */
+ if (h != NULL
+ && (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ && sec->output_section == NULL)
+ {
+ if (! (*info->callbacks->undefined_symbol) (info,
+ h->root.root.string,
+ input_bfd,
+ input_section,
+ rel->r_offset,
+ true))
+ return false;
+ continue;
+ }
+ break;
+
+ /* Relocations that may need to be propagated if this is a shared
+ object. */
+ case (int)R_PPC_REL24:
+ case (int)R_PPC_REL32:
+ case (int)R_PPC_REL14:
+ /* If these relocations are not to a named symbol, they can be
+ handled right here, no need to bother the dynamic linker. */
+ if (h == NULL
+ || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+ break;
+ /* fall through */
+
+ /* Relocations that always need to be propagated if this is a shared
+ object. */
+ case (int)R_PPC_NONE:
+ case (int)R_PPC_ADDR32:
+ case (int)R_PPC_ADDR24:
+ case (int)R_PPC_ADDR16:
+ case (int)R_PPC_ADDR16_LO:
+ case (int)R_PPC_ADDR16_HI:
+ case (int)R_PPC_ADDR16_HA:
+ case (int)R_PPC_ADDR14:
+ case (int)R_PPC_UADDR32:
+ case (int)R_PPC_UADDR16:
+ if (info->shared)
+ {
+ Elf_Internal_Rela outrel;
+ boolean skip;
+
+#ifdef DEBUG
+ fprintf (stderr, "ppc_elf_relocate_section need to create relocation for %s\n",
+ (h && h->root.root.string) ? h->root.root.string : "<unknown>");
+#endif
+
+ /* When generating a shared object, these relocations
+ are copied into the output file to be resolved at run
+ time. */
+
+ if (sreloc == NULL)
+ {
+ const char *name;
+
+ name = (bfd_elf_string_from_elf_section
+ (input_bfd,
+ elf_elfheader (input_bfd)->e_shstrndx,
+ elf_section_data (input_section)->rel_hdr.sh_name));
+ if (name == NULL)
+ return false;
+
+ BFD_ASSERT (strncmp (name, ".rela", 5) == 0
+ && strcmp (bfd_get_section_name (input_bfd,
+ input_section),
+ name + 5) == 0);
+
+ sreloc = bfd_get_section_by_name (dynobj, name);
+ BFD_ASSERT (sreloc != NULL);
+ }
+
+ skip = false;
+
+ if (elf_section_data (input_section)->stab_info == NULL)
+ outrel.r_offset = rel->r_offset;
+ else
+ {
+ bfd_vma off;
+
+ off = (_bfd_stab_section_offset
+ (output_bfd, &elf_hash_table (info)->stab_info,
+ input_section,
+ &elf_section_data (input_section)->stab_info,
+ rel->r_offset));
+ if (off == (bfd_vma) -1)
+ skip = true;
+ outrel.r_offset = off;
+ }
+
+ outrel.r_offset += (input_section->output_section->vma
+ + input_section->output_offset);
+
+ if (skip)
+ memset (&outrel, 0, sizeof outrel);
+ /* h->dynindx may be -1 if this symbol was marked to
+ become local. */
+ else if (h != NULL
+ && ((! info->symbolic && h->dynindx != -1)
+ || (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_REGULAR) == 0))
+ {
+ BFD_ASSERT (h->dynindx != -1);
+ outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
+ outrel.r_addend = rel->r_addend;
+ }
+ else
+ {
+ if (r_type == R_PPC_ADDR32)
+ {
+ outrel.r_info = ELF32_R_INFO (0, R_PPC_RELATIVE);
+ outrel.r_addend = relocation + rel->r_addend;
+ }
+ else
+ {
+ long indx;
+
+ if (h == NULL)
+ sec = local_sections[r_symndx];
+ else
+ {
+ BFD_ASSERT (h->root.type == bfd_link_hash_defined
+ || (h->root.type
+ == bfd_link_hash_defweak));
+ sec = h->root.u.def.section;
+ }
+ if (sec != NULL && bfd_is_abs_section (sec))
+ indx = 0;
+ else if (sec == NULL || sec->owner == NULL)
+ {
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ }
+ else
+ {
+ asection *osec;
+
+ osec = sec->output_section;
+ indx = elf_section_data (osec)->dynindx;
+ BFD_ASSERT(indx > 0);
+#ifdef DEBUG
+ if (indx <= 0)
+ {
+ printf("indx=%d section=%s flags=%08x name=%s\n",
+ indx, osec->name, osec->flags,
+ h->root.root.string);
+ }
+#endif
+ }
+
+ outrel.r_info = ELF32_R_INFO (indx, r_type);
+ outrel.r_addend = relocation + rel->r_addend;
+ }
+ }
+
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel,
+ (((Elf32_External_Rela *)
+ sreloc->contents)
+ + sreloc->reloc_count));
+ ++sreloc->reloc_count;
+
+ /* This reloc will be computed at runtime, so there's no
+ need to do anything now, unless this is a RELATIVE
+ reloc in an unallocated section. */
+ if (skip
+ || (input_section->flags & SEC_ALLOC) != 0
+ || ELF32_R_TYPE (outrel.r_info) != R_PPC_RELATIVE)
+ continue;
+ }
+
+ /* Arithmetic adjust relocations that aren't going into a
+ shared object. */
+ if (r_type == R_PPC_ADDR16_HA
+ /* It's just possible that this symbol is a weak symbol
+ that's not actually defined anywhere. In that case,
+ 'sec' would be NULL, and we should leave the symbol
+ alone (it will be set to zero elsewhere in the link). */
+ && sec != NULL)
+ {
+ addend += ((relocation + addend) & 0x8000) << 1;
+ }
+ break;
+
+ /* branch taken prediction relocations */
+ case (int)R_PPC_ADDR14_BRTAKEN:
+ case (int)R_PPC_REL14_BRTAKEN:
+ insn = bfd_get_32 (output_bfd, contents + offset);
+ if ((relocation - offset) & 0x8000)
+ insn &= ~BRANCH_PREDICT_BIT;
+ else
+ insn |= BRANCH_PREDICT_BIT;
+ bfd_put_32 (output_bfd, insn, contents + offset);
+ break;
+
+ /* branch not taken predicition relocations */
+ case (int)R_PPC_ADDR14_BRNTAKEN:
+ case (int)R_PPC_REL14_BRNTAKEN:
+ insn = bfd_get_32 (output_bfd, contents + offset);
+ if ((relocation - offset) & 0x8000)
+ insn |= BRANCH_PREDICT_BIT;
+ else
+ insn &= ~BRANCH_PREDICT_BIT;
+ bfd_put_32 (output_bfd, insn, contents + offset);
+ break;
+
+ /* GOT16 relocations */
+ case (int)R_PPC_GOT16:
+ case (int)R_PPC_GOT16_LO:
+ case (int)R_PPC_GOT16_HI:
+ case (int)R_PPC_GOT16_HA:
+ /* Relocation is to the entry for this symbol in the global
+ offset table. */
+ BFD_ASSERT (sgot != NULL);
+
+ if (h != NULL)
+ {
+ bfd_vma off;
+
+ off = h->got.offset;
+ BFD_ASSERT (off != (bfd_vma) -1);
+
+ if (! elf_hash_table (info)->dynamic_sections_created
+ || (info->shared
+ && (info->symbolic || h->dynindx == -1)
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+ {
+ /* This is actually a static link, or it is a
+ -Bsymbolic link and the symbol is defined
+ locally. We must initialize this entry in the
+ global offset table. Since the offset must
+ always be a multiple of 4, we use the least
+ significant bit to record whether we have
+ initialized it already.
+
+ When doing a dynamic link, we create a .rela.got
+ relocation entry to initialize the value. This
+ is done in the finish_dynamic_symbol routine. */
+ if ((off & 1) != 0)
+ off &= ~1;
+ else
+ {
+ bfd_put_32 (output_bfd, relocation,
+ sgot->contents + off);
+ h->got.offset |= 1;
+ }
+ }
+
+ relocation = sgot->output_offset + off - 4;
+ }
+ else
+ {
+ bfd_vma off;
+
+ BFD_ASSERT (local_got_offsets != NULL
+ && local_got_offsets[r_symndx] != (bfd_vma) -1);
+
+ off = local_got_offsets[r_symndx];
+
+ /* The offset must always be a multiple of 4. We use
+ the least significant bit to record whether we have
+ already processed this entry. */
+ if ((off & 1) != 0)
+ off &= ~1;
+ else
+ {
+ bfd_put_32 (output_bfd, relocation, sgot->contents + off);
+
+ if (info->shared)
+ {
+ asection *srelgot;
+ Elf_Internal_Rela outrel;
+
+ /* We need to generate a R_PPC_RELATIVE reloc
+ for the dynamic linker. */
+ srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+ BFD_ASSERT (srelgot != NULL);
+
+ outrel.r_offset = (sgot->output_section->vma
+ + sgot->output_offset
+ + off);
+ outrel.r_info = ELF32_R_INFO (0, R_PPC_RELATIVE);
+ outrel.r_addend = relocation;
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel,
+ (((Elf32_External_Rela *)
+ srelgot->contents)
+ + srelgot->reloc_count));
+ ++srelgot->reloc_count;
+ }
+
+ local_got_offsets[r_symndx] |= 1;
+ }
+
+ relocation = sgot->output_offset + off - 4;
+ }
+ break;
+
+ /* Indirect .sdata relocation */
+ case (int)R_PPC_EMB_SDAI16:
+ BFD_ASSERT (sdata != NULL);
+ relocation = bfd_elf32_finish_pointer_linker_section (output_bfd, input_bfd, info,
+ sdata, h, relocation, rel,
+ R_PPC_RELATIVE);
+ break;
+
+ /* Indirect .sdata2 relocation */
+ case (int)R_PPC_EMB_SDA2I16:
+ BFD_ASSERT (sdata2 != NULL);
+ relocation = bfd_elf32_finish_pointer_linker_section (output_bfd, input_bfd, info,
+ sdata2, h, relocation, rel,
+ R_PPC_RELATIVE);
+ break;
+
+ /* Handle the TOC16 reloc. We want to use the offset within the .got
+ section, not the actual VMA. This is appropriate when generating
+ an embedded ELF object, for which the .got section acts like the
+ AIX .toc section. */
+ case (int)R_PPC_TOC16: /* phony GOT16 relocations */
+ BFD_ASSERT (sec != (asection *)0);
+ BFD_ASSERT (bfd_is_und_section (sec)
+ || strcmp (bfd_get_section_name (abfd, sec), ".got") == 0
+ || strcmp (bfd_get_section_name (abfd, sec), ".cgot") == 0)
+
+ addend -= sec->output_section->vma + sec->output_offset + 0x8000;
+ break;
+
+ case (int)R_PPC_PLTREL24:
+ /* Relocation is to the entry for this symbol in the
+ procedure linkage table. */
+ BFD_ASSERT (h != NULL);
+
+ if (h->plt.offset == (bfd_vma) -1
+ || splt == NULL)
+ {
+ /* We didn't make a PLT entry for this symbol. This
+ happens when statically linking PIC code, or when
+ using -Bsymbolic. */
+ break;
+ }
+
+ relocation = (splt->output_section->vma
+ + splt->output_offset
+ + h->plt.offset);
+ break;
+
+ /* relocate against _SDA_BASE_ */
+ case (int)R_PPC_SDAREL16:
+ {
+ const char *name;
+
+ BFD_ASSERT (sec != (asection *)0);
+ name = bfd_get_section_name (abfd, sec->output_section);
+ if (strcmp (name, ".sdata") != 0
+ && strcmp (name, ".sbss") != 0)
+ {
+ (*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"),
+ bfd_get_filename (input_bfd),
+ sym_name,
+ ppc_elf_howto_table[ (int)r_type ]->name,
+ name);
+ }
+ addend -= (sdata->sym_hash->root.u.def.value
+ + sdata->sym_hash->root.u.def.section->output_section->vma
+ + sdata->sym_hash->root.u.def.section->output_offset);
+ }
+ break;
+
+
+ /* relocate against _SDA2_BASE_ */
+ case (int)R_PPC_EMB_SDA2REL:
+ {
+ const char *name;
+
+ BFD_ASSERT (sec != (asection *)0);
+ name = bfd_get_section_name (abfd, sec->output_section);
+ if (strcmp (name, ".sdata2") != 0 && strcmp (name, ".sbss2") != 0)
+ {
+ (*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"),
+ bfd_get_filename (input_bfd),
+ sym_name,
+ ppc_elf_howto_table[ (int)r_type ]->name,
+ name);
+
+ bfd_set_error (bfd_error_bad_value);
+ ret = false;
+ continue;
+ }
+ addend -= (sdata2->sym_hash->root.u.def.value
+ + sdata2->sym_hash->root.u.def.section->output_section->vma
+ + sdata2->sym_hash->root.u.def.section->output_offset);
+ }
+ break;
+
+
+ /* relocate against either _SDA_BASE_, _SDA2_BASE_, or 0 */
+ case (int)R_PPC_EMB_SDA21:
+ case (int)R_PPC_EMB_RELSDA:
+ {
+ const char *name;
+ int reg;
+
+ BFD_ASSERT (sec != (asection *)0);
+ name = bfd_get_section_name (abfd, sec->output_section);
+ if (strcmp (name, ".sdata") == 0 || strcmp (name, ".sbss") == 0)
+ {
+ reg = 13;
+ addend -= (sdata->sym_hash->root.u.def.value
+ + sdata->sym_hash->root.u.def.section->output_section->vma
+ + sdata->sym_hash->root.u.def.section->output_offset);
+ }
+
+ else if (strcmp (name, ".sdata2") == 0 || strcmp (name, ".sbss2") == 0)
+ {
+ reg = 2;
+ addend -= (sdata2->sym_hash->root.u.def.value
+ + sdata2->sym_hash->root.u.def.section->output_section->vma
+ + sdata2->sym_hash->root.u.def.section->output_offset);
+ }
+
+ else if (strcmp (name, ".PPC.EMB.sdata0") == 0 || strcmp (name, ".PPC.EMB.sbss0") == 0)
+ {
+ reg = 0;
+ }
+
+ else
+ {
+ (*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"),
+ bfd_get_filename (input_bfd),
+ sym_name,
+ ppc_elf_howto_table[ (int)r_type ]->name,
+ name);
+
+ bfd_set_error (bfd_error_bad_value);
+ ret = false;
+ continue;
+ }
+
+ if (r_type == R_PPC_EMB_SDA21)
+ { /* fill in register field */
+ insn = bfd_get_32 (output_bfd, contents + offset);
+ insn = (insn & ~RA_REGISTER_MASK) | (reg << RA_REGISTER_SHIFT);
+ bfd_put_32 (output_bfd, insn, contents + offset);
+ }
+ }
+ break;
+
+ /* Relocate against the beginning of the section */
+ case (int)R_PPC_SECTOFF:
+ case (int)R_PPC_SECTOFF_LO:
+ case (int)R_PPC_SECTOFF_HI:
+ BFD_ASSERT (sec != (asection *)0);
+ addend -= sec->output_section->vma;
+ break;
+
+ case (int)R_PPC_SECTOFF_HA:
+ BFD_ASSERT (sec != (asection *)0);
+ addend -= sec->output_section->vma;
+ addend += ((relocation + addend) & 0x8000) << 1;
+ break;
+
+ /* Negative relocations */
+ case (int)R_PPC_EMB_NADDR32:
+ case (int)R_PPC_EMB_NADDR16:
+ case (int)R_PPC_EMB_NADDR16_LO:
+ case (int)R_PPC_EMB_NADDR16_HI:
+ addend -= 2*relocation;
+ break;
+
+ case (int)R_PPC_EMB_NADDR16_HA:
+ addend -= 2*relocation;
+ addend += ((relocation + addend) & 0x8000) << 1;
+ break;
+
+ /* NOP relocation that prevents garbage collecting linkers from omitting a
+ reference. */
+ case (int)R_PPC_EMB_MRKREF:
+ continue;
+
+ case (int)R_PPC_COPY:
+ case (int)R_PPC_GLOB_DAT:
+ case (int)R_PPC_JMP_SLOT:
+ case (int)R_PPC_RELATIVE:
+ case (int)R_PPC_PLT32:
+ case (int)R_PPC_PLTREL32:
+ case (int)R_PPC_PLT16_LO:
+ case (int)R_PPC_PLT16_HI:
+ case (int)R_PPC_PLT16_HA:
+ case (int)R_PPC_EMB_RELSEC16:
+ case (int)R_PPC_EMB_RELST_LO:
+ case (int)R_PPC_EMB_RELST_HI:
+ case (int)R_PPC_EMB_RELST_HA:
+ case (int)R_PPC_EMB_BIT_FLD:
+ (*_bfd_error_handler) (_("%s: Relocation %s is not yet supported for symbol %s."),
+ bfd_get_filename (input_bfd),
+ ppc_elf_howto_table[ (int)r_type ]->name,
+ sym_name);
+
+ bfd_set_error (bfd_error_invalid_operation);
+ ret = false;
+ continue;
+
+ case (int)R_PPC_GNU_VTINHERIT:
+ case (int)R_PPC_GNU_VTENTRY:
+ /* These are no-ops in the end. */
+ continue;
+ }
+
+
+#ifdef DEBUG
+ fprintf (stderr, "\ttype = %s (%d), name = %s, symbol index = %ld, offset = %ld, addend = %ld\n",
+ howto->name,
+ (int)r_type,
+ sym_name,
+ r_symndx,
+ (long)offset,
+ (long)addend);
+#endif
+
+ r = _bfd_final_link_relocate (howto,
+ input_bfd,
+ input_section,
+ contents,
+ offset,
+ relocation,
+ addend);
+
+ if (r == bfd_reloc_ok)
+ ;
+ else if (r == bfd_reloc_overflow)
+ {
+ const char *name;
+
+ if (h != NULL)
+ {
+ if (h->root.type == bfd_link_hash_undefweak
+ && howto->pc_relative)
+ {
+ /* Assume this is a call protected by other code that
+ detect the symbol is undefined. If this is the case,
+ we can safely ignore the overflow. If not, the
+ program is hosed anyway, and a little warning isn't
+ going to help. */
+
+ continue;
+ }
+
+ name = h->root.root.string;
+ }
+ else
+ {
+ name = bfd_elf_string_from_elf_section (input_bfd,
+ symtab_hdr->sh_link,
+ sym->st_name);
+ if (name == NULL)
+ continue;
+ if (*name == '\0')
+ name = bfd_section_name (input_bfd, sec);
+ }
+
+ if (! (*info->callbacks->reloc_overflow)(info,
+ name,
+ howto->name,
+ (bfd_vma) 0,
+ input_bfd,
+ input_section,
+ offset))
+ return false;
+ }
+ else
+ ret = false;
+ }
+
+#ifdef DEBUG
+ fprintf (stderr, "\n");
+#endif
+
+ return ret;
+}
+
+
+#define TARGET_LITTLE_SYM bfd_elf32_powerpcle_vec
+#define TARGET_LITTLE_NAME "elf32-powerpcle"
+#define TARGET_BIG_SYM bfd_elf32_powerpc_vec
+#define TARGET_BIG_NAME "elf32-powerpc"
+#define ELF_ARCH bfd_arch_powerpc
+#define ELF_MACHINE_CODE EM_PPC
+#define ELF_MAXPAGESIZE 0x10000
+#define elf_info_to_howto ppc_elf_info_to_howto
+
+#ifdef EM_CYGNUS_POWERPC
+#define ELF_MACHINE_ALT1 EM_CYGNUS_POWERPC
+#endif
+
+#ifdef EM_PPC_OLD
+#define ELF_MACHINE_ALT2 EM_PPC_OLD
+#endif
+
+#define elf_backend_plt_not_loaded 1
+#define elf_backend_got_symbol_offset 4
+#define elf_backend_can_gc_sections 1
+#define elf_backend_got_header_size 12
+#define elf_backend_plt_header_size PLT_INITIAL_ENTRY_SIZE
+
+#define bfd_elf32_bfd_copy_private_bfd_data ppc_elf_copy_private_bfd_data
+#define bfd_elf32_bfd_merge_private_bfd_data ppc_elf_merge_private_bfd_data
+#define bfd_elf32_bfd_relax_section ppc_elf_relax_section
+#define bfd_elf32_bfd_reloc_type_lookup ppc_elf_reloc_type_lookup
+#define bfd_elf32_bfd_set_private_flags ppc_elf_set_private_flags
+#define bfd_elf32_bfd_final_link _bfd_elf32_gc_common_final_link
+
+#define elf_backend_gc_mark_hook ppc_elf_gc_mark_hook
+#define elf_backend_gc_sweep_hook ppc_elf_gc_sweep_hook
+#define elf_backend_section_from_shdr ppc_elf_section_from_shdr
+#define elf_backend_relocate_section ppc_elf_relocate_section
+#define elf_backend_create_dynamic_sections ppc_elf_create_dynamic_sections
+#define elf_backend_check_relocs ppc_elf_check_relocs
+#define elf_backend_adjust_dynamic_symbol ppc_elf_adjust_dynamic_symbol
+#define elf_backend_add_symbol_hook ppc_elf_add_symbol_hook
+#define elf_backend_size_dynamic_sections ppc_elf_size_dynamic_sections
+#define elf_backend_finish_dynamic_symbol ppc_elf_finish_dynamic_symbol
+#define elf_backend_finish_dynamic_sections ppc_elf_finish_dynamic_sections
+#define elf_backend_fake_sections ppc_elf_fake_sections
+#define elf_backend_additional_program_headers ppc_elf_additional_program_headers
+#define elf_backend_modify_segment_map ppc_elf_modify_segment_map
+
+#include "elf32-target.h"
diff --git a/contrib/binutils/bfd/elf32-sparc.c b/contrib/binutils/bfd/elf32-sparc.c
index 736438bf5c08..e61a82fabeb5 100644
--- a/contrib/binutils/bfd/elf32-sparc.c
+++ b/contrib/binutils/bfd/elf32-sparc.c
@@ -1,5 +1,6 @@
/* SPARC-specific support for 32-bit ELF
- Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1993, 94, 95, 96, 97, 98, 99, 2000
+ Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -33,8 +34,6 @@ static boolean elf32_sparc_check_relocs
const Elf_Internal_Rela *));
static boolean elf32_sparc_adjust_dynamic_symbol
PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
-static boolean elf32_sparc_adjust_dynindx
- PARAMS ((struct elf_link_hash_entry *, PTR));
static boolean elf32_sparc_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
static boolean elf32_sparc_relocate_section
@@ -109,11 +108,27 @@ reloc_howto_type _bfd_sparc_elf_howto_table[] =
HOWTO(R_SPARC_UNUSED_42, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_UNUSED_42",false,0,0x00000000,true),
HOWTO(R_SPARC_7, 0,2, 7,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_7", false,0,0x0000007f,true),
HOWTO(R_SPARC_5, 0,2, 5,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_5", false,0,0x0000001f,true),
- HOWTO(R_SPARC_6, 0,2, 6,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_6", false,0,0x0000003f,true)
+ HOWTO(R_SPARC_6, 0,2, 6,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_6", false,0,0x0000003f,true),
+ HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true),
+ HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true),
+ HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true),
+ HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true),
+ HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true),
+ HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true),
+ HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true),
+ HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true),
+ HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true),
+ HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true),
+ HOWTO(R_SPARC_REV32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_REV32", false,0,0xffffffff,true),
};
+static reloc_howto_type elf32_sparc_vtinherit_howto =
+ HOWTO (R_SPARC_GNU_VTINHERIT, 0,2,0,false,0,complain_overflow_dont, NULL, "R_SPARC_GNU_VTINHERIT", false,0, 0, false);
+static reloc_howto_type elf32_sparc_vtentry_howto =
+ HOWTO (R_SPARC_GNU_VTENTRY, 0,2,0,false,0,complain_overflow_dont, _bfd_elf_rel_vtable_reloc_fn,"R_SPARC_GNU_VTENTRY", false,0,0, false);
+
struct elf_reloc_map {
- unsigned char bfd_reloc_val;
+ bfd_reloc_code_real_type bfd_reloc_val;
unsigned char elf_reloc_val;
};
@@ -158,21 +173,36 @@ static CONST struct elf_reloc_map sparc_reloc_map[] =
{BFD_RELOC_SPARC_WDISP19, R_SPARC_WDISP19},
{BFD_RELOC_SPARC_7, R_SPARC_7},
{BFD_RELOC_SPARC_5, R_SPARC_5},
- {BFD_RELOC_SPARC_6, R_SPARC_6}
+ {BFD_RELOC_SPARC_6, R_SPARC_6},
+ {BFD_RELOC_SPARC_REV32, R_SPARC_REV32 },
+ {BFD_RELOC_VTABLE_INHERIT, R_SPARC_GNU_VTINHERIT},
+ {BFD_RELOC_VTABLE_ENTRY, R_SPARC_GNU_VTENTRY},
};
static reloc_howto_type *
elf32_sparc_reloc_type_lookup (abfd, code)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
bfd_reloc_code_real_type code;
{
unsigned int i;
- for (i = 0; i < sizeof (sparc_reloc_map) / sizeof (struct elf_reloc_map); i++)
+
+ switch (code)
{
- if (sparc_reloc_map[i].bfd_reloc_val == code)
- return &_bfd_sparc_elf_howto_table[(int) sparc_reloc_map[i].elf_reloc_val];
+ case BFD_RELOC_VTABLE_INHERIT:
+ return &elf32_sparc_vtinherit_howto;
+
+ case BFD_RELOC_VTABLE_ENTRY:
+ return &elf32_sparc_vtentry_howto;
+
+ default:
+ for (i = 0; i < sizeof (sparc_reloc_map) / sizeof (struct elf_reloc_map); i++)
+ {
+ if (sparc_reloc_map[i].bfd_reloc_val == code)
+ return &_bfd_sparc_elf_howto_table[(int) sparc_reloc_map[i].elf_reloc_val];
+ }
}
- return 0;
+ bfd_set_error (bfd_error_bad_value);
+ return NULL;
}
/* We need to use ELF32_R_TYPE so we have our own copy of this function,
@@ -180,12 +210,24 @@ elf32_sparc_reloc_type_lookup (abfd, code)
static void
elf32_sparc_info_to_howto (abfd, cache_ptr, dst)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr;
Elf_Internal_Rela *dst;
{
- BFD_ASSERT (ELF32_R_TYPE(dst->r_info) < (unsigned int) R_SPARC_max);
- cache_ptr->howto = &_bfd_sparc_elf_howto_table[ELF32_R_TYPE(dst->r_info)];
+ switch (ELF32_R_TYPE(dst->r_info))
+ {
+ case R_SPARC_GNU_VTINHERIT:
+ cache_ptr->howto = &elf32_sparc_vtinherit_howto;
+ break;
+
+ case R_SPARC_GNU_VTENTRY:
+ cache_ptr->howto = &elf32_sparc_vtentry_howto;
+ break;
+
+ default:
+ BFD_ASSERT (ELF32_R_TYPE(dst->r_info) < (unsigned int) R_SPARC_max_std);
+ cache_ptr->howto = &_bfd_sparc_elf_howto_table[ELF32_R_TYPE(dst->r_info)];
+ }
}
/* For unsupported relocs. */
@@ -198,13 +240,13 @@ sparc_elf_notsupported_reloc (abfd,
input_section,
output_bfd,
error_message)
- bfd *abfd;
- arelent *reloc_entry;
- asymbol *symbol;
- PTR data;
- asection *input_section;
- bfd *output_bfd;
- char **error_message;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *reloc_entry ATTRIBUTE_UNUSED;
+ asymbol *symbol ATTRIBUTE_UNUSED;
+ PTR data ATTRIBUTE_UNUSED;
+ asection *input_section ATTRIBUTE_UNUSED;
+ bfd *output_bfd ATTRIBUTE_UNUSED;
+ char **error_message ATTRIBUTE_UNUSED;
{
return bfd_reloc_notsupported;
}
@@ -225,7 +267,7 @@ sparc_elf_wdisp16_reloc (abfd,
PTR data;
asection *input_section;
bfd *output_bfd;
- char **error_message;
+ char **error_message ATTRIBUTE_UNUSED;
{
bfd_vma relocation;
bfd_vma x;
@@ -380,12 +422,12 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
if (h != NULL)
{
- if (h->got_offset != (bfd_vma) -1)
+ if (h->got.offset != (bfd_vma) -1)
{
/* We have already allocated space in the .got. */
break;
}
- h->got_offset = sgot->_raw_size;
+ h->got.offset = sgot->_raw_size;
/* Make sure this symbol is output as a dynamic symbol. */
if (h->dynindx == -1)
@@ -449,10 +491,11 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
if (h == NULL)
{
- /* It does not make sense to have a procedure linkage
- table entry for a local symbol. */
- bfd_set_error (bfd_error_bad_value);
- return false;
+ /* The Solaris native assembler will generate a WPLT30
+ reloc for a local symbol if you assemble a call from
+ one section to another when using -K pic. We treat
+ it as WDISP30. */
+ break;
}
/* Make sure this symbol is output as a dynamic symbol. */
@@ -468,6 +511,9 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
case R_SPARC_PC10:
case R_SPARC_PC22:
+ if (h != NULL)
+ h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
+
if (h != NULL
&& strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
break;
@@ -479,6 +525,9 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
case R_SPARC_WDISP22:
case R_SPARC_WDISP19:
case R_SPARC_WDISP16:
+ if (h != NULL)
+ h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
+
/* If we are linking with -Bsymbolic, we do not need to copy
a PC relative reloc against a global symbol which is
defined in an object we are including in the link (i.e.,
@@ -501,6 +550,9 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
case R_SPARC_13:
case R_SPARC_LO10:
case R_SPARC_UA32:
+ if (h != NULL)
+ h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
+
if (info->shared)
{
/* When creating a shared object, we must copy these
@@ -543,6 +595,16 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
break;
+ case R_SPARC_GNU_VTINHERIT:
+ if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return false;
+ break;
+
+ case R_SPARC_GNU_VTENTRY:
+ if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return false;
+ break;
+
default:
break;
}
@@ -551,6 +613,114 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
return true;
}
+static asection *
+elf32_sparc_gc_mark_hook (abfd, info, rel, h, sym)
+ bfd *abfd;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ Elf_Internal_Rela *rel;
+ struct elf_link_hash_entry *h;
+ Elf_Internal_Sym *sym;
+{
+
+ if (h != NULL)
+ {
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ case R_SPARC_GNU_VTINHERIT:
+ case R_SPARC_GNU_VTENTRY:
+ break;
+
+ default:
+ switch (h->root.type)
+ {
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ return h->root.u.def.section;
+
+ case bfd_link_hash_common:
+ return h->root.u.c.p->section;
+
+ default:
+ break;
+ }
+ }
+ }
+ else
+ {
+ if (!(elf_bad_symtab (abfd)
+ && ELF_ST_BIND (sym->st_info) != STB_LOCAL)
+ && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE)
+ && sym->st_shndx != SHN_COMMON))
+ {
+ return bfd_section_from_elf_index (abfd, sym->st_shndx);
+ }
+ }
+
+ return NULL;
+}
+
+/* Update the got entry reference counts for the section being removed. */
+static boolean
+elf32_sparc_gc_sweep_hook (abfd, info, sec, relocs)
+ bfd *abfd;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ asection *sec;
+ const Elf_Internal_Rela *relocs;
+{
+
+ Elf_Internal_Shdr *symtab_hdr;
+ struct elf_link_hash_entry **sym_hashes;
+ bfd_signed_vma *local_got_refcounts;
+ const Elf_Internal_Rela *rel, *relend;
+ unsigned long r_symndx;
+ struct elf_link_hash_entry *h;
+
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (abfd);
+ local_got_refcounts = elf_local_got_refcounts (abfd);
+
+ relend = relocs + sec->reloc_count;
+ for (rel = relocs; rel < relend; rel++)
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ case R_SPARC_GOT10:
+ case R_SPARC_GOT13:
+ case R_SPARC_GOT22:
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ if (r_symndx >= symtab_hdr->sh_info)
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ if (h->got.refcount > 0)
+ h->got.refcount--;
+ }
+ else
+ {
+ if (local_got_refcounts[r_symndx] > 0)
+ local_got_refcounts[r_symndx]--;
+ }
+ break;
+
+ case R_SPARC_PLT32:
+ case R_SPARC_HIPLT22:
+ case R_SPARC_LOPLT10:
+ case R_SPARC_PCPLT32:
+ case R_SPARC_PCPLT10:
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ if (r_symndx >= symtab_hdr->sh_info)
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ if (h->plt.refcount > 0)
+ h->plt.refcount--;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ return true;
+}
+
/* Adjust a symbol defined by a dynamic object and referenced by a
regular object. The current definition is in some section of the
dynamic object, but we're not including those sections. We have to
@@ -638,7 +808,7 @@ elf32_sparc_adjust_dynamic_symbol (info, h)
h->root.u.def.value = s->_raw_size;
}
- h->plt_offset = s->_raw_size;
+ h->plt.offset = s->_raw_size;
/* Make room for this entry. */
s->_raw_size += PLT_ENTRY_SIZE;
@@ -674,6 +844,11 @@ elf32_sparc_adjust_dynamic_symbol (info, h)
if (info->shared)
return true;
+ /* If there are no references to this symbol that do not use the
+ GOT, we don't need to generate a copy reloc. */
+ if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
+ return true;
+
/* We must allocate the symbol in our .dynbss section, which will
become part of the .bss section of the executable. There will be
an entry for this symbol in the .dynsym section. The dynamic
@@ -836,15 +1011,7 @@ elf32_sparc_size_dynamic_sections (output_bfd, info)
if (strip)
{
- asection **spp;
-
- for (spp = &s->output_section->owner->sections;
- *spp != s->output_section;
- spp = &(*spp)->next)
- ;
- *spp = s->output_section->next;
- --s->output_section->owner->section_count;
-
+ _bfd_strip_section_from_output (info, s);
continue;
}
@@ -889,51 +1056,6 @@ elf32_sparc_size_dynamic_sections (output_bfd, info)
}
}
- /* If we are generating a shared library, we generate a section
- symbol for each output section for which we might need to copy
- relocs. These are local symbols, which means that they must come
- first in the dynamic symbol table. That means we must increment
- the dynamic symbol index of every other dynamic symbol. */
- if (info->shared)
- {
- int c;
-
- c = 0;
- for (s = output_bfd->sections; s != NULL; s = s->next)
- {
- if ((s->flags & SEC_LINKER_CREATED) != 0
- || (s->flags & SEC_ALLOC) == 0)
- continue;
-
- elf_section_data (s)->dynindx = c + 1;
-
- /* These symbols will have no names, so we don't need to
- fiddle with dynstr_index. */
-
- ++c;
- }
-
- elf_link_hash_traverse (elf_hash_table (info),
- elf32_sparc_adjust_dynindx,
- (PTR) &c);
- elf_hash_table (info)->dynsymcount += c;
- }
-
- return true;
-}
-
-/* Increment the index of a dynamic symbol by a given amount. Called
- via elf_link_hash_traverse. */
-
-static boolean
-elf32_sparc_adjust_dynindx (h, cparg)
- struct elf_link_hash_entry *h;
- PTR cparg;
-{
- int *cp = (int *) cparg;
-
- if (h->dynindx != -1)
- h->dynindx += *cp;
return true;
}
@@ -990,7 +1112,12 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_reloc_status_type r;
r_type = ELF32_R_TYPE (rel->r_info);
- if (r_type < 0 || r_type >= (int) R_SPARC_max)
+
+ if (r_type == R_SPARC_GNU_VTINHERIT
+ || r_type == R_SPARC_GNU_VTENTRY)
+ continue;
+
+ if (r_type < 0 || r_type >= (int) R_SPARC_max_std)
{
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1041,7 +1168,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
{
sec = h->root.u.def.section;
if ((r_type == R_SPARC_WPLT30
- && h->plt_offset != (bfd_vma) -1)
+ && h->plt.offset != (bfd_vma) -1)
|| ((r_type == R_SPARC_GOT10
|| r_type == R_SPARC_GOT13
|| r_type == R_SPARC_GOT22)
@@ -1086,13 +1213,14 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
- else if (info->shared && !info->symbolic)
+ else if (info->shared && !info->symbolic && !info->no_undefined)
relocation = 0;
else
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset,
+ (!info->shared || info->no_undefined))))
return false;
relocation = 0;
}
@@ -1115,7 +1243,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
{
bfd_vma off;
- off = h->got_offset;
+ off = h->got.offset;
BFD_ASSERT (off != (bfd_vma) -1);
if (! elf_hash_table (info)->dynamic_sections_created
@@ -1141,7 +1269,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
{
bfd_put_32 (output_bfd, relocation,
sgot->contents + off);
- h->got_offset |= 1;
+ h->got.offset |= 1;
}
}
@@ -1198,9 +1326,15 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
case R_SPARC_WPLT30:
/* Relocation is to the entry for this symbol in the
procedure linkage table. */
- BFD_ASSERT (h != NULL);
- if (h->plt_offset == (bfd_vma) -1)
+ /* The Solaris native assembler will generate a WPLT30 reloc
+ for a local symbol if you assemble a call from one
+ section to another when using -K pic. We treat it as
+ WDISP30. */
+ if (h == NULL)
+ break;
+
+ if (h->plt.offset == (bfd_vma) -1)
{
/* We didn't make a PLT entry for this symbol. This
happens when statically linking PIC code, or when
@@ -1216,7 +1350,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
relocation = (splt->output_section->vma
+ splt->output_offset
- + h->plt_offset);
+ + h->plt.offset);
break;
case R_SPARC_PC10:
@@ -1349,7 +1483,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
{
BFD_FAIL ();
(*_bfd_error_handler)
- ("%s: probably compiled without -fPIC?",
+ (_("%s: probably compiled without -fPIC?"),
bfd_get_filename (input_bfd));
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1381,11 +1515,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
break;
}
- if (r_type != R_SPARC_WDISP16)
- r = _bfd_final_link_relocate (howto, input_bfd, input_section,
- contents, rel->r_offset,
- relocation, rel->r_addend);
- else
+ if (r_type == R_SPARC_WDISP16)
{
bfd_vma x;
@@ -1405,6 +1535,22 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
else
r = bfd_reloc_ok;
}
+ else if (r_type == R_SPARC_REV32)
+ {
+ bfd_vma x;
+
+ relocation = relocation + rel->r_addend;
+
+ x = bfd_get_32 (input_bfd, contents + rel->r_offset);
+ x = x + relocation;
+ bfd_putl32 (/*input_bfd,*/ x, contents + rel->r_offset);
+ r = bfd_reloc_ok;
+ }
+ else
+ r = _bfd_final_link_relocate (howto, input_bfd, input_section,
+ contents, rel->r_offset,
+ relocation, rel->r_addend);
+
if (r != bfd_reloc_ok)
{
@@ -1456,7 +1602,7 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym)
dynobj = elf_hash_table (info)->dynobj;
- if (h->plt_offset != (bfd_vma) -1)
+ if (h->plt.offset != (bfd_vma) -1)
{
asection *splt;
asection *srela;
@@ -1473,24 +1619,24 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym)
/* Fill in the entry in the procedure linkage table. */
bfd_put_32 (output_bfd,
- PLT_ENTRY_WORD0 + h->plt_offset,
- splt->contents + h->plt_offset);
+ PLT_ENTRY_WORD0 + h->plt.offset,
+ splt->contents + h->plt.offset);
bfd_put_32 (output_bfd,
(PLT_ENTRY_WORD1
- + (((- (h->plt_offset + 4)) >> 2) & 0x3fffff)),
- splt->contents + h->plt_offset + 4);
+ + (((- (h->plt.offset + 4)) >> 2) & 0x3fffff)),
+ splt->contents + h->plt.offset + 4);
bfd_put_32 (output_bfd, PLT_ENTRY_WORD2,
- splt->contents + h->plt_offset + 8);
+ splt->contents + h->plt.offset + 8);
/* Fill in the entry in the .rela.plt section. */
rela.r_offset = (splt->output_section->vma
+ splt->output_offset
- + h->plt_offset);
+ + h->plt.offset);
rela.r_info = ELF32_R_INFO (h->dynindx, R_SPARC_JMP_SLOT);
rela.r_addend = 0;
bfd_elf32_swap_reloca_out (output_bfd, &rela,
((Elf32_External_Rela *) srela->contents
- + h->plt_offset / PLT_ENTRY_SIZE - 4));
+ + h->plt.offset / PLT_ENTRY_SIZE - 4));
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
{
@@ -1500,7 +1646,7 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym)
}
}
- if (h->got_offset != (bfd_vma) -1)
+ if (h->got.offset != (bfd_vma) -1)
{
asection *sgot;
asection *srela;
@@ -1515,7 +1661,7 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym)
rela.r_offset = (sgot->output_section->vma
+ sgot->output_offset
- + (h->got_offset &~ 1));
+ + (h->got.offset &~ 1));
/* If this is a -Bsymbolic link, and the symbol is defined
locally, we just want to emit a RELATIVE reloc. Likewise if
@@ -1528,7 +1674,7 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym)
rela.r_info = ELF32_R_INFO (0, R_SPARC_RELATIVE);
else
{
- bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got_offset);
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset);
rela.r_info = ELF32_R_INFO (h->dynindx, R_SPARC_GLOB_DAT);
}
@@ -1665,50 +1811,6 @@ elf32_sparc_finish_dynamic_sections (output_bfd, info)
elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4;
- if (info->shared)
- {
- asection *sdynsym;
- asection *s;
- Elf_Internal_Sym sym;
- int c;
-
- /* Set up the section symbols for the output sections. */
-
- sdynsym = bfd_get_section_by_name (dynobj, ".dynsym");
- BFD_ASSERT (sdynsym != NULL);
-
- sym.st_size = 0;
- sym.st_name = 0;
- sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
- sym.st_other = 0;
-
- c = 0;
- for (s = output_bfd->sections; s != NULL; s = s->next)
- {
- int indx;
-
- if (elf_section_data (s)->dynindx == 0)
- continue;
-
- sym.st_value = s->vma;
-
- indx = elf_section_data (s)->this_idx;
- BFD_ASSERT (indx > 0);
- sym.st_shndx = indx;
-
- bfd_elf32_swap_symbol_out (output_bfd, &sym,
- (PTR) (((Elf32_External_Sym *)
- sdynsym->contents)
- + elf_section_data (s)->dynindx));
-
- ++c;
- }
-
- /* Set the sh_info field of the output .dynsym section to the
- index of the first global symbol. */
- elf_section_data (sdynsym->output_section)->this_hdr.sh_info = c + 1;
- }
-
return true;
}
@@ -1728,6 +1830,8 @@ elf32_sparc_merge_private_bfd_data (ibfd, obfd)
bfd *obfd;
{
boolean error;
+ /* FIXME: This should not be static. */
+ static unsigned long previous_ibfd_e_flags = (unsigned long) -1;
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
@@ -1749,7 +1853,7 @@ elf32_sparc_merge_private_bfd_data (ibfd, obfd)
{
error = true;
(*_bfd_error_handler)
- ("%s: compiled for a v8plus system and target is v8",
+ (_("%s: compiled for a v8plus system and target is v8"),
bfd_get_filename (ibfd));
}
/* If the output machine is v9, we can't allow v9+vis input files. */
@@ -1758,7 +1862,7 @@ elf32_sparc_merge_private_bfd_data (ibfd, obfd)
{
error = true;
(*_bfd_error_handler)
- ("%s: compiled for a v8plusa system and target is v8plus",
+ (_("%s: compiled for a v8plusa system and target is v8plus"),
bfd_get_filename (ibfd));
}
#else
@@ -1766,13 +1870,27 @@ elf32_sparc_merge_private_bfd_data (ibfd, obfd)
{
error = true;
(*_bfd_error_handler)
- ("%s: compiled for a 64 bit system and target is 32 bit",
+ (_("%s: compiled for a 64 bit system and target is 32 bit"),
bfd_get_filename (ibfd));
}
- else if (bfd_get_mach (obfd) < bfd_get_mach (ibfd))
- bfd_set_arch_mach (obfd, bfd_arch_sparc, bfd_get_mach (ibfd));
+ else if ((ibfd->flags & DYNAMIC) == 0)
+ {
+ if (bfd_get_mach (obfd) < bfd_get_mach (ibfd))
+ bfd_set_arch_mach (obfd, bfd_arch_sparc, bfd_get_mach (ibfd));
+ }
#endif
+ if (((elf_elfheader (ibfd)->e_flags & EF_SPARC_LEDATA)
+ != previous_ibfd_e_flags)
+ && previous_ibfd_e_flags != (unsigned long) -1)
+ {
+ (*_bfd_error_handler)
+ (_("%s: linking little endian files with big endian files"),
+ bfd_get_filename (ibfd));
+ error = true;
+ }
+ previous_ibfd_e_flags = elf_elfheader (ibfd)->e_flags & EF_SPARC_LEDATA;
+
if (error)
{
bfd_set_error (bfd_error_bad_value);
@@ -1799,6 +1917,9 @@ elf32_sparc_object_p (abfd)
else
return false;
}
+ else if (elf_elfheader (abfd)->e_flags & EF_SPARC_LEDATA)
+ return bfd_default_set_arch_mach (abfd, bfd_arch_sparc,
+ bfd_mach_sparc_sparclite_le);
else
return bfd_default_set_arch_mach (abfd, bfd_arch_sparc, bfd_mach_sparc);
}
@@ -1809,7 +1930,7 @@ elf32_sparc_object_p (abfd)
static void
elf32_sparc_final_write_processing (abfd, linker)
bfd *abfd;
- boolean linker;
+ boolean linker ATTRIBUTE_UNUSED;
{
switch (bfd_get_mach (abfd))
{
@@ -1825,8 +1946,13 @@ elf32_sparc_final_write_processing (abfd, linker)
elf_elfheader (abfd)->e_flags &=~ EF_SPARC_32PLUS_MASK;
elf_elfheader (abfd)->e_flags |= EF_SPARC_32PLUS | EF_SPARC_SUN_US1;
break;
+ case bfd_mach_sparc_sparclite_le :
+ elf_elfheader (abfd)->e_machine = EM_SPARC;
+ elf_elfheader (abfd)->e_flags |= EF_SPARC_LEDATA;
+ break;
default :
abort ();
+ break;
}
}
@@ -1856,8 +1982,14 @@ elf32_sparc_final_write_processing (abfd, linker)
#define elf_backend_object_p elf32_sparc_object_p
#define elf_backend_final_write_processing \
elf32_sparc_final_write_processing
+#define elf_backend_gc_mark_hook elf32_sparc_gc_mark_hook
+#define elf_backend_gc_sweep_hook elf32_sparc_gc_sweep_hook
+
+#define elf_backend_can_gc_sections 1
#define elf_backend_want_got_plt 0
#define elf_backend_plt_readonly 0
#define elf_backend_want_plt_sym 1
+#define elf_backend_got_header_size 4
+#define elf_backend_plt_header_size (4*PLT_ENTRY_SIZE)
#include "elf32-target.h"
diff --git a/contrib/binutils/bfd/elf32-v850.c b/contrib/binutils/bfd/elf32-v850.c
index c66513a48e31..4fe28fc92b91 100644
--- a/contrib/binutils/bfd/elf32-v850.c
+++ b/contrib/binutils/bfd/elf32-v850.c
@@ -1,5 +1,5 @@
/* V850-specific support for 32-bit ELF
- Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -37,20 +37,52 @@ static reloc_howto_type *v850_elf_reloc_type_lookup
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
static void v850_elf_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *));
+static void v850_elf_info_to_howto_rela
+ PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *));
static bfd_reloc_status_type v850_elf_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static boolean v850_elf_is_local_label_name PARAMS ((bfd *, const char *));
-static boolean v850_elf_relocate_section PARAMS((bfd *,
- struct bfd_link_info *,
- bfd *,
- asection *,
- bfd_byte *,
- Elf_Internal_Rela *,
- Elf_Internal_Sym *,
- asection **));
-/* Try to minimize the amount of space occupied by relocation tables
- on the ROM (not that the ROM won't be swamped by other ELF overhead). */
-#define USE_REL
+static boolean v850_elf_is_local_label_name
+ PARAMS ((bfd *, const char *));
+static boolean v850_elf_relocate_section
+ PARAMS((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
+ Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
+static bfd_reloc_status_type v850_elf_perform_relocation
+ PARAMS ((bfd *, int, bfd_vma, bfd_byte *));
+static boolean v850_elf_check_relocs
+ PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *));
+static void remember_hi16s_reloc
+ PARAMS ((bfd *, bfd_vma, bfd_byte *));
+static bfd_byte * find_remembered_hi16s_reloc
+ PARAMS ((bfd_vma, boolean *));
+static bfd_reloc_status_type v850_elf_final_link_relocate
+ PARAMS ((reloc_howto_type *, bfd *, bfd *, asection *, bfd_byte *, bfd_vma,
+ bfd_vma, bfd_vma, struct bfd_link_info *, asection *, int));
+static boolean v850_elf_object_p
+ PARAMS ((bfd *));
+static boolean v850_elf_fake_sections
+ PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *));
+static void v850_elf_final_write_processing
+ PARAMS ((bfd *, boolean));
+static boolean v850_elf_set_private_flags
+ PARAMS ((bfd *, flagword));
+static boolean v850_elf_copy_private_bfd_data
+ PARAMS ((bfd *, bfd *));
+static boolean v850_elf_merge_private_bfd_data
+ PARAMS ((bfd *, bfd *));
+static boolean v850_elf_print_private_bfd_data
+ PARAMS ((bfd *, PTR));
+static boolean v850_elf_section_from_bfd_section
+ PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *, int *));
+static void v850_elf_symbol_processing
+ PARAMS ((bfd *, asymbol *));
+static boolean v850_elf_add_symbol_hook
+ PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
+ const char **, flagword *, asection **, bfd_vma *));
+static boolean v850_elf_link_output_symbol_hook
+ PARAMS ((bfd *, struct bfd_link_info *, const char *,
+ Elf_Internal_Sym *, asection *));
+static boolean v850_elf_section_from_shdr
+ PARAMS ((bfd *, Elf_Internal_Shdr *, char *));
/* Note: It is REQUIRED that the 'type' value of each entry in this array
match the index of the entry in the array. */
@@ -111,7 +143,7 @@ static reloc_howto_type v850_elf_howto_table[] =
complain_overflow_dont, /* complain_on_overflow */
v850_elf_reloc, /* special_function */
"R_V850_HI16_S", /* name */
- true, /* partial_inplace */
+ false, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
false), /* pcrel_offset */
@@ -126,7 +158,7 @@ static reloc_howto_type v850_elf_howto_table[] =
complain_overflow_dont, /* complain_on_overflow */
v850_elf_reloc, /* special_function */
"R_V850_HI16", /* name */
- true, /* partial_inplace */
+ false, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
false), /* pcrel_offset */
@@ -141,7 +173,7 @@ static reloc_howto_type v850_elf_howto_table[] =
complain_overflow_dont, /* complain_on_overflow */
v850_elf_reloc, /* special_function */
"R_V850_LO16", /* name */
- true, /* partial_inplace */
+ false, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
false), /* pcrel_offset */
@@ -156,7 +188,7 @@ static reloc_howto_type v850_elf_howto_table[] =
complain_overflow_dont, /* complain_on_overflow */
v850_elf_reloc, /* special_function */
"R_V850_32", /* name */
- true, /* partial_inplace */
+ false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
@@ -171,7 +203,7 @@ static reloc_howto_type v850_elf_howto_table[] =
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_V850_16", /* name */
- true, /* partial_inplace */
+ false, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
false), /* pcrel_offset */
@@ -186,7 +218,7 @@ static reloc_howto_type v850_elf_howto_table[] =
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_V850_8", /* name */
- true, /* partial_inplace */
+ false, /* partial_inplace */
0xff, /* src_mask */
0xff, /* dst_mask */
false), /* pcrel_offset */
@@ -311,13 +343,135 @@ static reloc_howto_type v850_elf_howto_table[] =
0xfff, /* dst_mask */
false), /* pcrel_offset */
+ /* 5 bit offset from the tiny data area pointer. */
+ HOWTO (R_V850_TDA_4_5_OFFSET, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 5, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ v850_elf_reloc, /* special_function */
+ "R_V850_TDA_4_5_OFFSET", /* name */
+ false, /* partial_inplace */
+ 0x0f, /* src_mask */
+ 0x0f, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 4 bit offset from the tiny data area pointer. */
+ HOWTO (R_V850_TDA_4_4_OFFSET, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 4, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ v850_elf_reloc, /* special_function */
+ "R_V850_TDA_4_4_OFFSET", /* name */
+ false, /* partial_inplace */
+ 0x0f, /* src_mask */
+ 0x0f, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 16 bit offset from the short data area pointer. */
+ HOWTO (R_V850_SDA_16_16_SPLIT_OFFSET, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ v850_elf_reloc, /* special_function */
+ "R_V850_SDA_16_16_SPLIT_OFFSET",/* name */
+ false, /* partial_inplace */
+ 0xfffe0020, /* src_mask */
+ 0xfffe0020, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 16 bit offset from the zero data area pointer. */
+ HOWTO (R_V850_ZDA_16_16_SPLIT_OFFSET, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ v850_elf_reloc, /* special_function */
+ "R_V850_ZDA_16_16_SPLIT_OFFSET",/* name */
+ false, /* partial_inplace */
+ 0xfffe0020, /* src_mask */
+ 0xfffe0020, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 6 bit offset from the call table base pointer. */
+ HOWTO (R_V850_CALLT_6_7_OFFSET, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 7, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ v850_elf_reloc, /* special_function */
+ "R_V850_CALLT_6_7_OFFSET", /* name */
+ false, /* partial_inplace */
+ 0x3f, /* src_mask */
+ 0x3f, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 16 bit offset from the call table base pointer. */
+ HOWTO (R_V850_CALLT_16_16_OFFSET, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ v850_elf_reloc, /* special_function */
+ "R_V850_CALLT_16_16_OFFSET", /* name */
+ false, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* GNU extension to record C++ vtable hierarchy */
+ HOWTO (R_V850_GNU_VTINHERIT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_V850_GNU_VTINHERIT", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* GNU extension to record C++ vtable member usage */
+ HOWTO (R_V850_GNU_VTENTRY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_V850_GNU_VTENTRY", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
};
/* Map BFD reloc types to V850 ELF reloc types. */
struct v850_elf_reloc_map
{
- unsigned char bfd_reloc_val;
+ /* BFD_RELOC_V850_CALLT_16_16_OFFSET is 258, which will not fix in an
+ unsigned char. */
+ bfd_reloc_code_real_type bfd_reloc_val;
unsigned char elf_reloc_val;
};
@@ -340,13 +494,22 @@ static const struct v850_elf_reloc_map v850_elf_reloc_map[] =
{ BFD_RELOC_V850_TDA_7_8_OFFSET, R_V850_TDA_7_8_OFFSET },
{ BFD_RELOC_V850_TDA_7_7_OFFSET, R_V850_TDA_7_7_OFFSET },
{ BFD_RELOC_V850_TDA_16_16_OFFSET, R_V850_TDA_16_16_OFFSET },
+ { BFD_RELOC_V850_TDA_4_5_OFFSET, R_V850_TDA_4_5_OFFSET },
+ { BFD_RELOC_V850_TDA_4_4_OFFSET, R_V850_TDA_4_4_OFFSET },
+ { BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET, R_V850_SDA_16_16_SPLIT_OFFSET },
+ { BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET, R_V850_ZDA_16_16_SPLIT_OFFSET },
+ { BFD_RELOC_V850_CALLT_6_7_OFFSET, R_V850_CALLT_6_7_OFFSET },
+ { BFD_RELOC_V850_CALLT_16_16_OFFSET, R_V850_CALLT_16_16_OFFSET },
+ { BFD_RELOC_VTABLE_INHERIT, R_V850_GNU_VTINHERIT },
+ { BFD_RELOC_VTABLE_ENTRY, R_V850_GNU_VTENTRY },
+
};
/* Map a bfd relocation into the appropriate howto structure */
static reloc_howto_type *
v850_elf_reloc_type_lookup (abfd, code)
- bfd * abfd;
+ bfd * abfd ATTRIBUTE_UNUSED;
bfd_reloc_code_real_type code;
{
unsigned int i;
@@ -370,7 +533,7 @@ v850_elf_reloc_type_lookup (abfd, code)
/* Set the howto pointer for an V850 ELF reloc. */
static void
v850_elf_info_to_howto_rel (abfd, cache_ptr, dst)
- bfd * abfd;
+ bfd * abfd ATTRIBUTE_UNUSED;
arelent * cache_ptr;
Elf32_Internal_Rel * dst;
{
@@ -381,6 +544,20 @@ v850_elf_info_to_howto_rel (abfd, cache_ptr, dst)
cache_ptr->howto = &v850_elf_howto_table[r_type];
}
+/* Set the howto pointer for a V850 ELF reloc (type RELA). */
+static void
+v850_elf_info_to_howto_rela (abfd, cache_ptr, dst)
+ bfd * abfd ATTRIBUTE_UNUSED;
+ arelent * cache_ptr;
+ Elf32_Internal_Rela *dst;
+{
+ unsigned int r_type;
+
+ r_type = ELF32_R_TYPE (dst->r_info);
+ BFD_ASSERT (r_type < (unsigned int) R_V850_max);
+ cache_ptr->howto = &v850_elf_howto_table[r_type];
+}
+
/* Look through the relocs for a section during the first phase, and
allocate space in the global offset table or procedure linkage
@@ -443,20 +620,40 @@ v850_elf_check_relocs (abfd, info, sec, relocs)
case R_V850_32:
case R_V850_16:
case R_V850_8:
+ case R_V850_CALLT_6_7_OFFSET:
+ case R_V850_CALLT_16_16_OFFSET:
break;
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_V850_GNU_VTINHERIT:
+ if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return false;
+ break;
+
+ /* This relocation describes which C++ vtable entries are actually
+ used. Record for later use during GC. */
+ case R_V850_GNU_VTENTRY:
+ if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return false;
+ break;
+
+ case R_V850_SDA_16_16_SPLIT_OFFSET:
case R_V850_SDA_16_16_OFFSET:
case R_V850_SDA_15_16_OFFSET:
other = V850_OTHER_SDA;
common = ".scommon";
goto small_data_common;
+ case R_V850_ZDA_16_16_SPLIT_OFFSET:
case R_V850_ZDA_16_16_OFFSET:
case R_V850_ZDA_15_16_OFFSET:
other = V850_OTHER_ZDA;
common = ".zcommon";
goto small_data_common;
+ case R_V850_TDA_4_5_OFFSET:
+ case R_V850_TDA_4_4_OFFSET:
case R_V850_TDA_6_8_OFFSET:
case R_V850_TDA_7_8_OFFSET:
case R_V850_TDA_7_7_OFFSET:
@@ -475,28 +672,28 @@ v850_elf_check_relocs (abfd, info, sec, relocs)
&& (h->other & V850_OTHER_ERROR) == 0)
{
const char * msg;
- static char buff[100]; /* XXX */
-
+ static char buff[200]; /* XXX */
+
switch (h->other & V850_OTHER_MASK)
{
default:
- msg = "cannot occupy in multiple small data regions";
+ msg = _("Variable `%s' cannot occupy in multiple small data regions");
break;
case V850_OTHER_SDA | V850_OTHER_ZDA | V850_OTHER_TDA:
- msg = "can only be in one of the small, zero, and tiny data regions";
+ msg = _("Variable `%s' can only be in one of the small, zero, and tiny data regions");
break;
case V850_OTHER_SDA | V850_OTHER_ZDA:
- msg = "cannot be in both small and zero data regions simultaneously";
+ msg = _("Variable `%s' cannot be in both small and zero data regions simultaneously");
break;
case V850_OTHER_SDA | V850_OTHER_TDA:
- msg = "cannot be in both small and tiny data regions simultaneously";
+ msg = _("Variable `%s' cannot be in both small and tiny data regions simultaneously");
break;
case V850_OTHER_ZDA | V850_OTHER_TDA:
- msg = "cannot be in both zero and tiny data regions simultaneously";
+ msg = _("Variable `%s' cannot be in both zero and tiny data regions simultaneously");
break;
}
- sprintf (buff, "Variable '%s' %s", h->root.root.string, msg );
+ sprintf (buff, msg, h->root.root.string);
info->callbacks->warning (info, buff, h->root.root.string,
abfd, h->root.u.def.section, 0);
@@ -527,56 +724,63 @@ v850_elf_check_relocs (abfd, info, sec, relocs)
return ret;
}
-typedef struct
+/*
+ * In the old version, when an entry was checked out from the table,
+ * it was deleted. This produced an error if the entry was needed
+ * more than once, as the second attempted retry failed.
+ *
+ * In the current version, the entry is not deleted, instead we set
+ * the field 'found' to true. If a second lookup matches the same
+ * entry, then we know that the hi16s reloc has already been updated
+ * and does not need to be updated a second time.
+ *
+ * TODO - TOFIX: If it is possible that we need to restore 2 different
+ * addresses from the same table entry, where the first generates an
+ * overflow, whilst the second do not, then this code will fail.
+ */
+
+typedef struct hi16s_location
{
- long addend;
+ bfd_vma addend;
bfd_byte * address;
unsigned long counter;
+ boolean found;
+ struct hi16s_location * next;
}
hi16s_location;
-static hi16s_location previous_hi16s[ 10 ]; /* XXX is this enough ? */
-static unsigned long hi16s_counter;
+static hi16s_location * previous_hi16s;
+static hi16s_location * free_hi16s;
+static unsigned long hi16s_counter;
static void
-remember_hi16s_reloc (addend, address)
- long addend;
+remember_hi16s_reloc (abfd, addend, address)
+ bfd * abfd;
+ bfd_vma addend;
bfd_byte * address;
{
- hi16s_location * oldest = NULL;
- int i;
+ hi16s_location * entry = NULL;
- /* Find a free slot. */
- for (i = sizeof (previous_hi16s) / sizeof (previous_hi16s[0]); i--;)
- {
- hi16s_location * entry = previous_hi16s + i;
-
- if (entry->addend == 0 && entry->address == 0)
- {
- /* Use this entry. */
- oldest = entry;
- break;
- }
-
- /* Remember the least recently added entry. */
- if (oldest == NULL || oldest->counter > entry->counter)
- oldest = entry;
- }
-
- oldest->addend = addend;
- oldest->address = address;
- oldest->counter = hi16s_counter ++;
+ /* Find a free structure. */
+ if (free_hi16s == NULL)
+ free_hi16s = (hi16s_location *) bfd_zalloc (abfd, sizeof (* free_hi16s));
+ entry = free_hi16s;
+ free_hi16s = free_hi16s->next;
+
+ entry->addend = addend;
+ entry->address = address;
+ entry->counter = hi16s_counter ++;
+ entry->found = false;
+ entry->next = previous_hi16s;
+ previous_hi16s = entry;
+
/* Cope with wrap around of our counter. */
if (hi16s_counter == 0)
{
/* XXX - Assume that all counter entries differ only in their low 16 bits. */
- for (i = sizeof (previous_hi16s) / sizeof (previous_hi16s[0]); i--;)
- {
- hi16s_location * entry = previous_hi16s + i;
-
- entry->counter &= 0xffff;
- }
+ for (entry = previous_hi16s; entry != NULL; entry = entry->next)
+ entry->counter &= 0xffff;
hi16s_counter = 0x10000;
}
@@ -585,49 +789,56 @@ remember_hi16s_reloc (addend, address)
}
static bfd_byte *
-find_remembered_hi16s_reloc (addend)
- long addend;
+find_remembered_hi16s_reloc (addend, already_found)
+ bfd_vma addend;
+ boolean * already_found;
{
hi16s_location * match = NULL;
- int i;
+ hi16s_location * entry;
+ hi16s_location * previous = NULL;
+ hi16s_location * prev;
+ bfd_byte * addr;
/* Search the table. Record the most recent entry that matches. */
- for (i = sizeof (previous_hi16s) / sizeof (previous_hi16s[0]); i--;)
+ for (entry = previous_hi16s; entry; entry = entry->next)
{
- hi16s_location * entry = previous_hi16s + i;
-
- if (entry->addend == addend)
+ if (entry->addend == addend
+ && (match == NULL || match->counter < entry->counter))
{
- if (match == NULL || match->counter < entry->counter)
- match = entry;
+ previous = prev;
+ match = entry;
}
+
+ prev = entry;
}
- if (match != NULL)
- {
- bfd_byte * addr;
+ if (match == NULL)
+ return NULL;
- /* Empty the table entry. */
- match->addend = 0;
-
- addr = match->address;
- match->address = NULL;
-
- return addr;
- }
+ /* Extract the address. */
+ addr = match->address;
+
+ /* Remeber if this entry has already been used before. */
+ if (already_found)
+ * already_found = match->found;
+
+ /* Note that this entry has now been used. */
+ match->found = true;
- return NULL;
+ return addr;
}
+/* FIXME: The code here probably ought to be removed and the code in reloc.c
+ allowed to do its stuff instead. At least for most of the relocs, anwyay. */
static bfd_reloc_status_type
-v850_elf_store_addend_in_insn (abfd, r_type, addend, address, replace)
+v850_elf_perform_relocation (abfd, r_type, addend, address)
bfd * abfd;
int r_type;
- long addend;
+ bfd_vma addend;
bfd_byte * address;
- boolean replace;
{
unsigned long insn;
+ bfd_signed_vma saddend = (bfd_signed_vma) addend;
switch (r_type)
{
@@ -636,14 +847,11 @@ v850_elf_store_addend_in_insn (abfd, r_type, addend, address, replace)
return bfd_reloc_notsupported;
case R_V850_32:
- if (! replace)
- addend += bfd_get_32 (abfd, address);
-
bfd_put_32 (abfd, addend, address);
return bfd_reloc_ok;
case R_V850_22_PCREL:
- if (addend > 0x1fffff || addend < -0x200000)
+ if (saddend > 0x1fffff || saddend < -0x200000)
return bfd_reloc_overflow;
if ((addend % 2) != 0)
@@ -656,7 +864,7 @@ v850_elf_store_addend_in_insn (abfd, r_type, addend, address, replace)
return bfd_reloc_ok;
case R_V850_9_PCREL:
- if (addend > 0xff || addend < -0x100)
+ if (saddend > 0xff || saddend < -0x100)
return bfd_reloc_overflow;
if ((addend % 2) != 0)
@@ -675,13 +883,13 @@ v850_elf_store_addend_in_insn (abfd, r_type, addend, address, replace)
case R_V850_HI16_S:
/* Remember where this relocation took place. */
- remember_hi16s_reloc (addend, address);
+ remember_hi16s_reloc (abfd, addend, address);
addend += (bfd_get_16 (abfd, address) << 16);
addend = (addend >> 16) + ((addend & 0x8000) != 0);
/* This relocation cannot overflow. */
- if (addend > 0x7fff || addend < -0x8000)
+ if (addend > 0x7fff)
addend = 0;
insn = addend;
@@ -843,18 +1051,23 @@ v850_elf_store_addend_in_insn (abfd, r_type, addend, address, replace)
|| (OVERFLOWS (addend, insn)
&& ((! BIT15_SET (insn)) || (BIT15_SET (addend)))))
{
- bfd_byte * hi16s_address = find_remembered_hi16s_reloc (addend);
+ boolean already_updated;
+ bfd_byte * hi16s_address = find_remembered_hi16s_reloc
+ (addend, & already_updated);
/* Amend the matching HI16_S relocation. */
if (hi16s_address != NULL)
{
- insn = bfd_get_16 (abfd, hi16s_address);
- insn += 1;
- bfd_put_16 (abfd, insn, hi16s_address);
+ if (! already_updated)
+ {
+ insn = bfd_get_16 (abfd, hi16s_address);
+ insn += 1;
+ bfd_put_16 (abfd, insn, hi16s_address);
+ }
}
else
{
- fprintf (stderr, "FAILED to find previous HI16 reloc\n");
+ fprintf (stderr, _("FAILED to find previous HI16 reloc\n"));
return bfd_reloc_overflow;
}
}
@@ -865,26 +1078,38 @@ v850_elf_store_addend_in_insn (abfd, r_type, addend, address, replace)
}
case R_V850_8:
- if (! replace)
- addend += (char) bfd_get_8 (abfd, address);
+ addend += (char) bfd_get_8 (abfd, address);
- if (addend > 0x7f || addend < -0x80)
+ saddend = (bfd_signed_vma) addend;
+
+ if (saddend > 0x7f || saddend < -0x80)
return bfd_reloc_overflow;
bfd_put_8 (abfd, addend, address);
return bfd_reloc_ok;
+ case R_V850_CALLT_16_16_OFFSET:
+ addend += bfd_get_16 (abfd, address);
+
+ saddend = (bfd_signed_vma) addend;
+
+ if (saddend > 0xffff || saddend < 0)
+ return bfd_reloc_overflow;
+
+ insn = addend;
+ break;
case R_V850_16:
- replace = false;
+
/* drop through */
case R_V850_SDA_16_16_OFFSET:
case R_V850_ZDA_16_16_OFFSET:
case R_V850_TDA_16_16_OFFSET:
- if (! replace)
- addend += bfd_get_16 (abfd, address);
+ addend += bfd_get_16 (abfd, address);
+
+ saddend = (bfd_signed_vma) addend;
- if (addend > 0x7fff || addend < -0x8000)
+ if (saddend > 0x7fff || saddend < -0x8000)
return bfd_reloc_overflow;
insn = addend;
@@ -893,26 +1118,26 @@ v850_elf_store_addend_in_insn (abfd, r_type, addend, address, replace)
case R_V850_SDA_15_16_OFFSET:
case R_V850_ZDA_15_16_OFFSET:
insn = bfd_get_16 (abfd, address);
-
- if (! replace)
- addend += (insn & 0xfffe);
+ addend += (insn & 0xfffe);
+
+ saddend = (bfd_signed_vma) addend;
- if (addend > 0x7ffe || addend < -0x8000)
+ if (saddend > 0x7ffe || saddend < -0x8000)
return bfd_reloc_overflow;
if (addend & 1)
- return bfd_reloc_dangerous;
+ return bfd_reloc_dangerous;
insn = (addend & ~1) | (insn & 1);
break;
case R_V850_TDA_6_8_OFFSET:
insn = bfd_get_16 (abfd, address);
-
- if (! replace)
- addend += ((insn & 0x7e) << 1);
+ addend += ((insn & 0x7e) << 1);
- if (addend > 0xfc || addend < 0)
+ saddend = (bfd_signed_vma) addend;
+
+ if (saddend > 0xfc || saddend < 0)
return bfd_reloc_overflow;
if (addend & 3)
@@ -924,11 +1149,11 @@ v850_elf_store_addend_in_insn (abfd, r_type, addend, address, replace)
case R_V850_TDA_7_8_OFFSET:
insn = bfd_get_16 (abfd, address);
-
- if (! replace)
- addend += ((insn & 0x7f) << 1);
+ addend += ((insn & 0x7f) << 1);
- if (addend > 0xfe || addend < 0)
+ saddend = (bfd_signed_vma) addend;
+
+ if (saddend > 0xfe || saddend < 0)
return bfd_reloc_overflow;
if (addend & 1)
@@ -940,17 +1165,83 @@ v850_elf_store_addend_in_insn (abfd, r_type, addend, address, replace)
case R_V850_TDA_7_7_OFFSET:
insn = bfd_get_16 (abfd, address);
-
- if (! replace)
- addend += insn & 0x7f;
+ addend += insn & 0x7f;
- if (addend > 0x7f || addend < 0)
+ saddend = (bfd_signed_vma) addend;
+
+ if (saddend > 0x7f || saddend < 0)
return bfd_reloc_overflow;
insn &= 0xff80;
insn |= addend;
break;
+ case R_V850_TDA_4_5_OFFSET:
+ insn = bfd_get_16 (abfd, address);
+ addend += ((insn & 0xf) << 1);
+
+ saddend = (bfd_signed_vma) addend;
+
+ if (saddend > 0x1e || saddend < 0)
+ return bfd_reloc_overflow;
+
+ if (addend & 1)
+ return bfd_reloc_dangerous;
+
+ insn &= 0xfff0;
+ insn |= (addend >> 1);
+ break;
+
+ case R_V850_TDA_4_4_OFFSET:
+ insn = bfd_get_16 (abfd, address);
+ addend += insn & 0xf;
+
+ saddend = (bfd_signed_vma) addend;
+
+ if (saddend > 0xf || saddend < 0)
+ return bfd_reloc_overflow;
+
+ insn &= 0xfff0;
+ insn |= addend;
+ break;
+
+ case R_V850_ZDA_16_16_SPLIT_OFFSET:
+ case R_V850_SDA_16_16_SPLIT_OFFSET:
+ insn = bfd_get_32 (abfd, address);
+ addend += ((insn & 0xfffe0000) >> 16) + ((insn & 0x20) >> 5);
+
+ saddend = (bfd_signed_vma) addend;
+
+ if (saddend > 0x7fff || saddend < -0x8000)
+ return bfd_reloc_overflow;
+
+ insn &= 0x0001ffdf;
+ insn |= (addend & 1) << 5;
+ insn |= (addend & ~1) << 16;
+
+ bfd_put_32 (abfd, insn, address);
+ return bfd_reloc_ok;
+
+ case R_V850_CALLT_6_7_OFFSET:
+ insn = bfd_get_16 (abfd, address);
+ addend += ((insn & 0x3f) << 1);
+
+ saddend = (bfd_signed_vma) addend;
+
+ if (saddend > 0x7e || saddend < 0)
+ return bfd_reloc_overflow;
+
+ if (addend & 1)
+ return bfd_reloc_dangerous;
+
+ insn &= 0xff80;
+ insn |= (addend >> 1);
+ break;
+
+ case R_V850_GNU_VTINHERIT:
+ case R_V850_GNU_VTENTRY:
+ return bfd_reloc_ok;
+
}
bfd_put_16 (abfd, insn, address);
@@ -961,13 +1252,13 @@ v850_elf_store_addend_in_insn (abfd, r_type, addend, address, replace)
/* Insert the addend into the instruction. */
static bfd_reloc_status_type
v850_elf_reloc (abfd, reloc, symbol, data, isection, obfd, err)
- bfd * abfd;
+ bfd * abfd ATTRIBUTE_UNUSED;
arelent * reloc;
asymbol * symbol;
- PTR data;
+ PTR data ATTRIBUTE_UNUSED;
asection * isection;
bfd * obfd;
- char ** err;
+ char ** err ATTRIBUTE_UNUSED;
{
long relocation;
@@ -1027,18 +1318,15 @@ v850_elf_reloc (abfd, reloc, symbol, data, isection, obfd, err)
relocation -= reloc->address;
}
- /* I've got no clue... */
- reloc->addend = 0;
-
- return v850_elf_store_addend_in_insn (abfd, reloc->howto->type, relocation,
- (bfd_byte *) data + reloc->address, true);
+ reloc->addend = relocation;
+ return bfd_reloc_ok;
}
/*ARGSUSED*/
static boolean
v850_elf_is_local_label_name (abfd, name)
- bfd * abfd;
+ bfd * abfd ATTRIBUTE_UNUSED;
const char * name;
{
return ( (name[0] == '.' && (name[1] == 'L' || name[1] == '.'))
@@ -1053,7 +1341,7 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd,
addend, info, sym_sec, is_local)
reloc_howto_type * howto;
bfd * input_bfd;
- bfd * output_bfd;
+ bfd * output_bfd ATTRIBUTE_UNUSED;
asection * input_section;
bfd_byte * contents;
bfd_vma offset;
@@ -1061,7 +1349,7 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd,
bfd_vma addend;
struct bfd_link_info * info;
asection * sym_sec;
- int is_local;
+ int is_local ATTRIBUTE_UNUSED;
{
unsigned long r_type = howto->type;
bfd_byte * hit_data = contents + offset;
@@ -1080,6 +1368,10 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd,
+ input_section->output_offset
+ offset);
+ /* If the sign extension will corrupt the value then we have overflowed. */
+ if (((value & 0xff000000) != 0x0) && ((value & 0xff000000) != 0xff000000))
+ return bfd_reloc_overflow;
+
value = SEXT24 (value); /* Only the bottom 24 bits of the PC are valid */
break;
@@ -1093,6 +1385,7 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd,
case R_V850_ZDA_15_16_OFFSET:
case R_V850_ZDA_16_16_OFFSET:
+ case R_V850_ZDA_16_16_SPLIT_OFFSET:
if (sym_sec == NULL)
return bfd_reloc_undefined;
@@ -1101,6 +1394,7 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd,
case R_V850_SDA_15_16_OFFSET:
case R_V850_SDA_16_16_OFFSET:
+ case R_V850_SDA_16_16_SPLIT_OFFSET:
{
unsigned long gp;
struct bfd_link_hash_entry * h;
@@ -1123,6 +1417,8 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd,
}
break;
+ case R_V850_TDA_4_4_OFFSET:
+ case R_V850_TDA_4_5_OFFSET:
case R_V850_TDA_16_16_OFFSET:
case R_V850_TDA_7_7_OFFSET:
case R_V850_TDA_7_8_OFFSET:
@@ -1145,8 +1441,50 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd,
}
break;
+ case R_V850_CALLT_6_7_OFFSET:
+ {
+ unsigned long ctbp;
+ struct bfd_link_hash_entry * h;
+
+ /* Get the value of __ctbp. */
+ h = bfd_link_hash_lookup (info->hash, "__ctbp", false, false, true);
+ if (h == (struct bfd_link_hash_entry *) NULL
+ || h->type != bfd_link_hash_defined)
+ return (bfd_reloc_dangerous + 1); /* Actually this indicates that __ctbp could not be found. */
+
+ ctbp = (h->u.def.value
+ + h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset);
+ value -= ctbp;
+ }
+ break;
+
+ case R_V850_CALLT_16_16_OFFSET:
+ {
+ unsigned long ctbp;
+ struct bfd_link_hash_entry * h;
+
+ if (sym_sec == NULL)
+ return bfd_reloc_undefined;
+
+ /* Get the value of __ctbp. */
+ h = bfd_link_hash_lookup (info->hash, "__ctbp", false, false, true);
+ if (h == (struct bfd_link_hash_entry *) NULL
+ || h->type != bfd_link_hash_defined)
+ return (bfd_reloc_dangerous + 1);
+
+ ctbp = (h->u.def.value
+ + h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset);
+
+ value -= sym_sec->output_section->vma;
+ value -= (ctbp - sym_sec->output_section->vma);
+ }
+ break;
case R_V850_NONE:
+ case R_V850_GNU_VTINHERIT:
+ case R_V850_GNU_VTENTRY:
return bfd_reloc_ok;
default:
@@ -1154,7 +1492,7 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd,
}
/* Perform the relocation. */
- return v850_elf_store_addend_in_insn (input_bfd, r_type, value, hit_data, false);
+ return v850_elf_perform_relocation (input_bfd, r_type, value + addend, hit_data);
}
@@ -1179,6 +1517,19 @@ v850_elf_relocate_section (output_bfd, info, input_bfd, input_section,
symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (input_bfd);
+ if (sym_hashes == NULL)
+ {
+ info->callbacks->warning
+ (info, "no hash table available", NULL, input_bfd, input_section, 0);
+
+ return false;
+ }
+
+ /* Reset the list of remembered HI16S relocs to empty. */
+ free_hi16s = previous_hi16s;
+ previous_hi16s = NULL;
+ hi16s_counter = 0;
+
rel = relocs;
relend = relocs + input_section->reloc_count;
for (; rel < relend; rel++)
@@ -1194,7 +1545,12 @@ v850_elf_relocate_section (output_bfd, info, input_bfd, input_section,
r_symndx = ELF32_R_SYM (rel->r_info);
r_type = ELF32_R_TYPE (rel->r_info);
- howto = v850_elf_howto_table + r_type;
+
+ if (r_type == R_V850_GNU_VTENTRY
+ || r_type == R_V850_GNU_VTINHERIT)
+ continue;
+
+ howto = v850_elf_howto_table + r_type;
if (info->relocateable)
{
@@ -1208,29 +1564,7 @@ v850_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
{
sec = local_sections[r_symndx];
-#ifdef USE_REL
- /* The Elf_Internal_Rel structure does not have space for the
- modified addend value, so we store it in the instruction
- instead. */
-
- if (sec->output_offset + sym->st_value != 0)
- {
- if (v850_elf_store_addend_in_insn (input_bfd, r_type,
- sec->output_offset +
- sym->st_value,
- contents + rel->r_offset,
- false)
- != bfd_reloc_ok)
- {
- info->callbacks->warning
- (info,
- "Unable to handle relocation during incremental link",
- NULL, input_bfd, input_section, rel->r_offset);
- }
- }
-#else
rel->r_addend += sec->output_offset + sym->st_value;
-#endif
}
}
@@ -1291,7 +1625,7 @@ fprintf (stderr, "undefined: sec: %s, name: %s\n",
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset, true)))
return false;
#if 0
fprintf (stderr, "unknown: name: %s\n", h->root.root.string);
@@ -1335,36 +1669,36 @@ fprintf (stderr, "unknown: name: %s\n", h->root.root.string);
case bfd_reloc_undefined:
if (! ((*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section,
- rel->r_offset)))
+ rel->r_offset, true)))
return false;
break;
case bfd_reloc_outofrange:
- msg = "internal error: out of range error";
+ msg = _("internal error: out of range error");
goto common_error;
case bfd_reloc_notsupported:
- msg = "internal error: unsupported relocation error";
+ msg = _("internal error: unsupported relocation error");
goto common_error;
case bfd_reloc_dangerous:
- msg = "internal error: dangerous relocation";
+ msg = _("internal error: dangerous relocation");
goto common_error;
case bfd_reloc_other:
- msg = "could not locate special linker symbol __gp";
+ msg = _("could not locate special linker symbol __gp");
goto common_error;
case bfd_reloc_continue:
- msg = "could not locate special linker symbol __ep";
+ msg = _("could not locate special linker symbol __ep");
goto common_error;
case (bfd_reloc_dangerous + 1):
- msg = "could not locate special linker symbol __ctbp";
+ msg = _("could not locate special linker symbol __ctbp");
goto common_error;
default:
- msg = "internal error: unknown error";
+ msg = _("internal error: unknown error");
/* fall through */
common_error:
@@ -1380,6 +1714,60 @@ fprintf (stderr, "unknown: name: %s\n", h->root.root.string);
return true;
}
+static boolean
+v850_elf_gc_sweep_hook (abfd, info, sec, relocs)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ asection *sec ATTRIBUTE_UNUSED;
+ const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED;
+{
+ /* No got and plt entries for v850-elf */
+ return true;
+}
+
+static asection *
+v850_elf_gc_mark_hook (abfd, info, rel, h, sym)
+ bfd *abfd;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+ Elf_Internal_Rela *rel;
+ struct elf_link_hash_entry *h;
+ Elf_Internal_Sym *sym;
+{
+ if (h != NULL)
+ {
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ case R_V850_GNU_VTINHERIT:
+ case R_V850_GNU_VTENTRY:
+ break;
+
+ default:
+ switch (h->root.type)
+ {
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ return h->root.u.def.section;
+
+ case bfd_link_hash_common:
+ return h->root.u.c.p->section;
+
+ default:
+ break;
+ }
+ }
+ }
+ else
+ {
+ if (!(elf_bad_symtab (abfd)
+ && ELF_ST_BIND (sym->st_info) != STB_LOCAL)
+ && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE)
+ && sym->st_shndx != SHN_COMMON))
+ {
+ return bfd_section_from_elf_index (abfd, sym->st_shndx);
+ }
+ }
+ return NULL;
+}
/* Set the right machine number. */
static boolean
v850_elf_object_p (abfd)
@@ -1389,15 +1777,17 @@ v850_elf_object_p (abfd)
{
default:
case E_V850_ARCH: (void) bfd_default_set_arch_mach (abfd, bfd_arch_v850, 0); break;
+ case E_V850E_ARCH: (void) bfd_default_set_arch_mach (abfd, bfd_arch_v850, bfd_mach_v850e); break;
+ case E_V850EA_ARCH: (void) bfd_default_set_arch_mach (abfd, bfd_arch_v850, bfd_mach_v850ea); break;
}
return true;
}
/* Store the machine number in the flags field. */
-void
+static void
v850_elf_final_write_processing (abfd, linker)
bfd * abfd;
- boolean linker;
+ boolean linker ATTRIBUTE_UNUSED;
{
unsigned long val;
@@ -1405,6 +1795,8 @@ v850_elf_final_write_processing (abfd, linker)
{
default:
case 0: val = E_V850_ARCH; break;
+ case bfd_mach_v850e: val = E_V850E_ARCH; break;
+ case bfd_mach_v850ea: val = E_V850EA_ARCH; break;
}
elf_elfheader (abfd)->e_flags &=~ EF_V850_ARCH;
@@ -1412,7 +1804,7 @@ v850_elf_final_write_processing (abfd, linker)
}
/* Function to keep V850 specific file flags. */
-boolean
+static boolean
v850_elf_set_private_flags (abfd, flags)
bfd * abfd;
flagword flags;
@@ -1426,7 +1818,7 @@ v850_elf_set_private_flags (abfd, flags)
}
/* Copy backend specific data from one object module to another */
-boolean
+static boolean
v850_elf_copy_private_bfd_data (ibfd, obfd)
bfd * ibfd;
bfd * obfd;
@@ -1447,7 +1839,7 @@ v850_elf_copy_private_bfd_data (ibfd, obfd)
/* Merge backend specific data from an object file to the output
object file when linking. */
-boolean
+static boolean
v850_elf_merge_private_bfd_data (ibfd, obfd)
bfd * ibfd;
bfd * obfd;
@@ -1491,7 +1883,7 @@ v850_elf_merge_private_bfd_data (ibfd, obfd)
if ((in_flags & EF_V850_ARCH) != (out_flags & EF_V850_ARCH)
&& (in_flags & EF_V850_ARCH) != E_V850_ARCH)
- _bfd_error_handler ("%s: Architecture mismatch with previous modules",
+ _bfd_error_handler (_("%s: Architecture mismatch with previous modules"),
bfd_get_filename (ibfd));
return true;
@@ -1505,14 +1897,19 @@ v850_elf_print_private_bfd_data (abfd, ptr)
{
FILE * file = (FILE *) ptr;
- BFD_ASSERT (abfd != NULL && ptr != NULL)
+ BFD_ASSERT (abfd != NULL && ptr != NULL);
- fprintf (file, "private flags = %lx", elf_elfheader (abfd)->e_flags);
+ _bfd_elf_print_private_bfd_data (abfd, ptr);
+
+ /* xgettext:c-format */
+ fprintf (file, _("private flags = %lx: "), elf_elfheader (abfd)->e_flags);
switch (elf_elfheader (abfd)->e_flags & EF_V850_ARCH)
{
default:
- case E_V850_ARCH: fprintf (file, ": v850 architecture"); break;
+ case E_V850_ARCH: fprintf (file, _("v850 architecture")); break;
+ case E_V850E_ARCH: fprintf (file, _("v850e architecture")); break;
+ case E_V850EA_ARCH: fprintf (file, _("v850ea architecture")); break;
}
fputc ('\n', file);
@@ -1543,27 +1940,21 @@ static asymbol * v850_elf_zcom_symbol_ptr;
static boolean
v850_elf_section_from_bfd_section (abfd, hdr, sec, retval)
- bfd * abfd;
- Elf32_Internal_Shdr * hdr;
+ bfd * abfd ATTRIBUTE_UNUSED;
+ Elf32_Internal_Shdr * hdr ATTRIBUTE_UNUSED;
asection * sec;
int * retval;
{
if (strcmp (bfd_get_section_name (abfd, sec), ".scommon") == 0)
- {
- *retval = SHN_V850_SCOMMON;
- return true;
- }
- if (strcmp (bfd_get_section_name (abfd, sec), ".tcommon") == 0)
- {
- *retval = SHN_V850_TCOMMON;
- return true;
- }
- if (strcmp (bfd_get_section_name (abfd, sec), ".zcommon") == 0)
- {
- *retval = SHN_V850_ZCOMMON;
- return true;
- }
- return false;
+ *retval = SHN_V850_SCOMMON;
+ else if (strcmp (bfd_get_section_name (abfd, sec), ".tcommon") == 0)
+ *retval = SHN_V850_TCOMMON;
+ else if (strcmp (bfd_get_section_name (abfd, sec), ".zcommon") == 0)
+ *retval = SHN_V850_ZCOMMON;
+ else
+ return false;
+
+ return true;
}
/* Handle the special V850 section numbers that a symbol may use. */
@@ -1574,8 +1965,36 @@ v850_elf_symbol_processing (abfd, asym)
asymbol * asym;
{
elf_symbol_type * elfsym = (elf_symbol_type *) asym;
+ unsigned short index;
+
+ index = elfsym->internal_elf_sym.st_shndx;
- switch (elfsym->internal_elf_sym.st_shndx)
+ /* If the section index is an "ordinary" index, then it may
+ refer to a v850 specific section created by the assembler.
+ Check the section's type and change the index it matches.
+
+ FIXME: Should we alter the st_shndx field as well ? */
+
+ if (index < elf_elfheader(abfd)[0].e_shnum)
+ switch (elf_elfsections(abfd)[index]->sh_type)
+ {
+ case SHT_V850_SCOMMON:
+ index = SHN_V850_SCOMMON;
+ break;
+
+ case SHT_V850_TCOMMON:
+ index = SHN_V850_TCOMMON;
+ break;
+
+ case SHT_V850_ZCOMMON:
+ index = SHN_V850_ZCOMMON;
+ break;
+
+ default:
+ break;
+ }
+
+ switch (index)
{
case SHN_V850_SCOMMON:
if (v850_elf_scom_section.name == NULL)
@@ -1634,20 +2053,47 @@ v850_elf_symbol_processing (abfd, asym)
}
/* Hook called by the linker routine which adds symbols from an object
- file. We must handle the special MIPS section numbers here. */
+ file. We must handle the special v850 section numbers here. */
/*ARGSUSED*/
static boolean
v850_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
bfd * abfd;
- struct bfd_link_info * info;
+ struct bfd_link_info * info ATTRIBUTE_UNUSED;
const Elf_Internal_Sym * sym;
- const char ** namep;
- flagword * flagsp;
+ const char ** namep ATTRIBUTE_UNUSED;
+ flagword * flagsp ATTRIBUTE_UNUSED;
asection ** secp;
bfd_vma * valp;
{
- switch (sym->st_shndx)
+ int index = sym->st_shndx;
+
+ /* If the section index is an "ordinary" index, then it may
+ refer to a v850 specific section created by the assembler.
+ Check the section's type and change the index it matches.
+
+ FIXME: Should we alter the st_shndx field as well ? */
+
+ if (index < elf_elfheader(abfd)[0].e_shnum)
+ switch (elf_elfsections(abfd)[index]->sh_type)
+ {
+ case SHT_V850_SCOMMON:
+ index = SHN_V850_SCOMMON;
+ break;
+
+ case SHT_V850_TCOMMON:
+ index = SHN_V850_TCOMMON;
+ break;
+
+ case SHT_V850_ZCOMMON:
+ index = SHN_V850_ZCOMMON;
+ break;
+
+ default:
+ break;
+ }
+
+ switch (index)
{
case SHN_V850_SCOMMON:
*secp = bfd_make_section_old_way (abfd, ".scommon");
@@ -1674,9 +2120,9 @@ v850_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
/*ARGSIGNORED*/
static boolean
v850_elf_link_output_symbol_hook (abfd, info, name, sym, input_sec)
- bfd * abfd;
- struct bfd_link_info * info;
- const char * name;
+ bfd * abfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info * info ATTRIBUTE_UNUSED;
+ const char * name ATTRIBUTE_UNUSED;
Elf_Internal_Sym * sym;
asection * input_sec;
{
@@ -1729,7 +2175,7 @@ v850_elf_section_from_shdr (abfd, hdr, name)
section name, which is a hack, but ought to work. */
static boolean
v850_elf_fake_sections (abfd, hdr, sec)
- bfd * abfd;
+ bfd * abfd ATTRIBUTE_UNUSED;
Elf32_Internal_Shdr * hdr;
asection * sec;
{
@@ -1759,7 +2205,7 @@ v850_elf_fake_sections (abfd, hdr, sec)
#define ELF_MACHINE_CODE EM_CYGNUS_V850
#define ELF_MAXPAGESIZE 0x1000
-#define elf_info_to_howto 0
+#define elf_info_to_howto v850_elf_info_to_howto_rela
#define elf_info_to_howto_rel v850_elf_info_to_howto_rel
#define elf_backend_check_relocs v850_elf_check_relocs
@@ -1772,6 +2218,11 @@ v850_elf_fake_sections (abfd, hdr, sec)
#define elf_backend_link_output_symbol_hook v850_elf_link_output_symbol_hook
#define elf_backend_section_from_shdr v850_elf_section_from_shdr
#define elf_backend_fake_sections v850_elf_fake_sections
+#define elf_backend_gc_mark_hook v850_elf_gc_mark_hook
+#define elf_backend_gc_sweep_hook v850_elf_gc_sweep_hook
+
+#define elf_backend_can_gc_sections 1
+
#define bfd_elf32_bfd_is_local_label_name v850_elf_is_local_label_name
#define bfd_elf32_bfd_reloc_type_lookup v850_elf_reloc_type_lookup
diff --git a/contrib/binutils/bfd/elf64-alpha.c b/contrib/binutils/bfd/elf64-alpha.c
index 6d9c5393f727..4da9e925c636 100644
--- a/contrib/binutils/bfd/elf64-alpha.c
+++ b/contrib/binutils/bfd/elf64-alpha.c
@@ -1,5 +1,5 @@
/* Alpha specific support for 64-bit ELF
- Copyright 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright 1996, 97, 98, 1999 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@tamu.edu>.
This file is part of BFD, the Binary File Descriptor library.
@@ -72,8 +72,6 @@ static boolean elf64_alpha_section_from_shdr
PARAMS((bfd *, Elf64_Internal_Shdr *, char *));
static boolean elf64_alpha_fake_sections
PARAMS((bfd *, Elf64_Internal_Shdr *, asection *));
-static int elf64_alpha_additional_program_headers
- PARAMS((bfd *));
static boolean elf64_alpha_create_got_section
PARAMS((bfd *, struct bfd_link_info *));
static boolean elf64_alpha_create_dynamic_sections
@@ -101,11 +99,15 @@ static void elf64_alpha_merge_gots
static boolean elf64_alpha_calc_got_offsets_for_symbol
PARAMS ((struct alpha_elf_link_hash_entry *, PTR));
static void elf64_alpha_calc_got_offsets PARAMS ((struct bfd_link_info *));
-static void elf64_alpha_strip_section_from_output PARAMS ((asection *));
+static boolean elf64_alpha_size_got_sections
+ PARAMS ((bfd *, struct bfd_link_info *));
static boolean elf64_alpha_always_size_sections
PARAMS ((bfd *, struct bfd_link_info *));
static boolean elf64_alpha_calc_dynrel_sizes
PARAMS ((struct alpha_elf_link_hash_entry *, struct bfd_link_info *));
+static boolean elf64_alpha_add_symbol_hook
+ PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
+ const char **, flagword *, asection **, bfd_vma *));
static boolean elf64_alpha_check_relocs
PARAMS((bfd *, struct bfd_link_info *, asection *sec,
const Elf_Internal_Rela *));
@@ -113,8 +115,6 @@ static boolean elf64_alpha_adjust_dynamic_symbol
PARAMS((struct bfd_link_info *, struct elf_link_hash_entry *));
static boolean elf64_alpha_size_dynamic_sections
PARAMS((bfd *, struct bfd_link_info *));
-static boolean elf64_alpha_adjust_dynindx
- PARAMS((struct elf_link_hash_entry *, PTR));
static boolean elf64_alpha_relocate_section
PARAMS((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
@@ -125,6 +125,10 @@ static boolean elf64_alpha_finish_dynamic_sections
PARAMS((bfd *, struct bfd_link_info *));
static boolean elf64_alpha_final_link
PARAMS((bfd *, struct bfd_link_info *));
+static boolean elf64_alpha_merge_ind_symbols
+ PARAMS((struct alpha_elf_link_hash_entry *, PTR));
+static Elf_Internal_Rela * elf64_alpha_find_reloc_at_ofs
+ PARAMS ((Elf_Internal_Rela *, Elf_Internal_Rela *, bfd_vma, int));
struct alpha_elf_link_hash_entry
@@ -161,6 +165,8 @@ struct alpha_elf_link_hash_entry
/* An additional flag. */
#define ALPHA_ELF_GOT_ENTRY_RELOCS_DONE 0x10
+
+ int use_count;
} *got_entries;
/* used to count non-got, non-plt relocations for delayed sizing
@@ -219,10 +225,13 @@ struct alpha_elf_link_hash_table
/* Should we do dynamic things to this symbol? */
#define alpha_elf_dynamic_symbol_p(h, info) \
- (((info)->shared && !(info)->symbolic && (h)->dynindx != -1) \
- || (((h)->elf_link_hash_flags \
- & (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)) \
- == (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)))
+ ((((info)->shared && !(info)->symbolic) \
+ || (((h)->elf_link_hash_flags \
+ & (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)) \
+ == (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)) \
+ || (h)->root.type == bfd_link_hash_undefweak \
+ || (h)->root.type == bfd_link_hash_defweak) \
+ && (h)->dynindx != -1)
/* Create an entry in a Alpha ELF linker hash table. */
@@ -639,51 +648,49 @@ static reloc_howto_type elf64_alpha_howto_table[] =
false), /* pcrel_offset */
/* The high 16 bits of the displacement from GP to the target. */
- /* XXX: Not implemented. */
HOWTO (R_ALPHA_GPRELHIGH,
0, /* rightshift */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
+ complain_overflow_signed, /* complain_on_overflow */
elf64_alpha_reloc_bad, /* special_function */
"GPRELHIGH", /* name */
false, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
false), /* pcrel_offset */
/* The low 16 bits of the displacement from GP to the target. */
- /* XXX: Not implemented. */
HOWTO (R_ALPHA_GPRELLOW,
0, /* rightshift */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
elf64_alpha_reloc_bad, /* special_function */
"GPRELLOW", /* name */
false, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
false), /* pcrel_offset */
/* A 16-bit displacement from the GP to the target. */
/* XXX: Not implemented. */
HOWTO (R_ALPHA_IMMED_GP_16,
0, /* rightshift */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- elf64_alpha_reloc_bad, /* special_function */
+ complain_overflow_signed, /* complain_on_overflow */
+ 0, /* special_function */
"IMMED_GP_16", /* name */
false, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
false), /* pcrel_offset */
/* The high bits of a 32-bit displacement from the GP to the target; the
@@ -883,8 +890,8 @@ elf64_alpha_do_reloc_gpdisp (abfd, gpdisp, p_ldah, p_lda)
gpdisp += addend;
- if ((bfd_signed_vma) gpdisp < -(bfd_signed_vma)0x80000000
- || gpdisp >= 0x7fff8000)
+ if ((bfd_signed_vma) gpdisp < -(bfd_signed_vma) 0x80000000
+ || (bfd_signed_vma) gpdisp >= (bfd_signed_vma) 0x7fff8000)
ret = bfd_reloc_overflow;
/* compensate for the sign extension again. */
@@ -941,7 +948,7 @@ elf64_alpha_reloc_gpdisp (abfd, reloc_entry, sym, data, input_section,
/* Complain if the instructions are not correct. */
if (ret == bfd_reloc_dangerous)
- *err_msg = "GPDISP relocation did not find ldah and lda instructions";
+ *err_msg = _("GPDISP relocation did not find ldah and lda instructions");
return ret;
}
@@ -969,6 +976,17 @@ static const struct elf_reloc_map elf64_alpha_reloc_map[] =
{BFD_RELOC_16_PCREL, R_ALPHA_SREL16},
{BFD_RELOC_32_PCREL, R_ALPHA_SREL32},
{BFD_RELOC_64_PCREL, R_ALPHA_SREL64},
+
+/* The BFD_RELOC_ALPHA_USER_* relocations are used by the assembler to process
+ the explicit !<reloc>!sequence relocations, and are mapped into the normal
+ relocations at the end of processing. */
+ {BFD_RELOC_ALPHA_USER_LITERAL, R_ALPHA_LITERAL},
+ {BFD_RELOC_ALPHA_USER_LITUSE_BASE, R_ALPHA_LITUSE},
+ {BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF, R_ALPHA_LITUSE},
+ {BFD_RELOC_ALPHA_USER_LITUSE_JSR, R_ALPHA_LITUSE},
+ {BFD_RELOC_ALPHA_USER_GPDISP, R_ALPHA_GPDISP},
+ {BFD_RELOC_ALPHA_USER_GPRELHIGH, R_ALPHA_GPRELHIGH},
+ {BFD_RELOC_ALPHA_USER_GPRELLOW, R_ALPHA_GPRELLOW},
};
/* Given a BFD reloc type, return a HOWTO structure. */
@@ -1004,6 +1022,641 @@ elf64_alpha_info_to_howto (abfd, cache_ptr, dst)
cache_ptr->howto = &elf64_alpha_howto_table[r_type];
}
+/* These functions do relaxation for Alpha ELF.
+
+ Currently I'm only handling what I can do with existing compiler
+ and assembler support, which means no instructions are removed,
+ though some may be nopped. At this time GCC does not emit enough
+ information to do all of the relaxing that is possible. It will
+ take some not small amount of work for that to happen.
+
+ There are a couple of interesting papers that I once read on this
+ subject, that I cannot find references to at the moment, that
+ related to Alpha in particular. They are by David Wall, then of
+ DEC WRL. */
+
+#define OP_LDA 0x08
+#define OP_LDAH 0x09
+#define INSN_JSR 0x68004000
+#define INSN_JSR_MASK 0xfc00c000
+#define OP_LDQ 0x29
+#define OP_BR 0x30
+#define OP_BSR 0x34
+#define INSN_UNOP 0x2fe00000
+
+struct alpha_relax_info
+{
+ bfd *abfd;
+ asection *sec;
+ bfd_byte *contents;
+ Elf_Internal_Rela *relocs, *relend;
+ struct bfd_link_info *link_info;
+ boolean changed_contents;
+ boolean changed_relocs;
+ bfd_vma gp;
+ bfd *gotobj;
+ asection *tsec;
+ struct alpha_elf_link_hash_entry *h;
+ struct alpha_elf_got_entry *gotent;
+ unsigned char other;
+};
+
+static Elf_Internal_Rela * elf64_alpha_relax_with_lituse
+ PARAMS((struct alpha_relax_info *info, bfd_vma symval,
+ Elf_Internal_Rela *irel, Elf_Internal_Rela *irelend));
+
+static boolean elf64_alpha_relax_without_lituse
+ PARAMS((struct alpha_relax_info *info, bfd_vma symval,
+ Elf_Internal_Rela *irel));
+
+static bfd_vma elf64_alpha_relax_opt_call
+ PARAMS((struct alpha_relax_info *info, bfd_vma symval));
+
+static boolean elf64_alpha_relax_section
+ PARAMS((bfd *abfd, asection *sec, struct bfd_link_info *link_info,
+ boolean *again));
+
+static Elf_Internal_Rela *
+elf64_alpha_find_reloc_at_ofs (rel, relend, offset, type)
+ Elf_Internal_Rela *rel, *relend;
+ bfd_vma offset;
+ int type;
+{
+ while (rel < relend)
+ {
+ if (rel->r_offset == offset && ELF64_R_TYPE (rel->r_info) == type)
+ return rel;
+ ++rel;
+ }
+ return NULL;
+}
+
+static Elf_Internal_Rela *
+elf64_alpha_relax_with_lituse (info, symval, irel, irelend)
+ struct alpha_relax_info *info;
+ bfd_vma symval;
+ Elf_Internal_Rela *irel, *irelend;
+{
+ Elf_Internal_Rela *urel;
+ int flags, count, i;
+ bfd_signed_vma disp;
+ boolean fits16;
+ boolean fits32;
+ boolean lit_reused = false;
+ boolean all_optimized = true;
+ unsigned int lit_insn;
+
+ lit_insn = bfd_get_32 (info->abfd, info->contents + irel->r_offset);
+ if (lit_insn >> 26 != OP_LDQ)
+ {
+ ((*_bfd_error_handler)
+ ("%s: %s+0x%lx: warning: LITERAL relocation against unexpected insn",
+ bfd_get_filename (info->abfd), info->sec->name,
+ (unsigned long)irel->r_offset));
+ return irel;
+ }
+
+ /* Summarize how this particular LITERAL is used. */
+ for (urel = irel+1, flags = count = 0; urel < irelend; ++urel, ++count)
+ {
+ if (ELF64_R_TYPE (urel->r_info) != R_ALPHA_LITUSE)
+ break;
+ if (urel->r_addend >= 0 && urel->r_addend <= 3)
+ flags |= 1 << urel->r_addend;
+ }
+
+ /* A little preparation for the loop... */
+ disp = symval - info->gp;
+ fits16 = (disp >= -(bfd_signed_vma)0x8000 && disp < 0x8000);
+ fits32 = (disp >= -(bfd_signed_vma)0x80000000 && disp < 0x7fff8000);
+
+ for (urel = irel+1, i = 0; i < count; ++i, ++urel)
+ {
+ unsigned int insn;
+ insn = bfd_get_32 (info->abfd, info->contents + urel->r_offset);
+
+ switch (urel->r_addend)
+ {
+ default: /* 0 = ADDRESS FORMAT */
+ /* This type is really just a placeholder to note that all
+ uses cannot be optimized, but to still allow some. */
+ all_optimized = false;
+ break;
+
+ case 1: /* MEM FORMAT */
+ /* We can always optimize 16-bit displacements. */
+ if (fits16)
+ {
+ /* FIXME: sanity check the insn for mem format with
+ zero addend. */
+
+ /* Take the op code and dest from this insn, take the base
+ register from the literal insn. Leave the offset alone. */
+ insn = (insn & 0xffe00000) | (lit_insn & 0x001f0000);
+ urel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info),
+ R_ALPHA_GPRELLOW);
+ urel->r_addend = irel->r_addend;
+ info->changed_relocs = true;
+
+ bfd_put_32 (info->abfd, insn, info->contents + urel->r_offset);
+ info->changed_contents = true;
+ }
+
+ /* If all mem+byte, we can optimize 32-bit mem displacements. */
+ else if (fits32 && !(flags & ~6))
+ {
+ /* FIXME: sanity check that lit insn Ra is mem insn Rb, and
+ that mem_insn disp is zero. */
+
+ irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info),
+ R_ALPHA_GPRELHIGH);
+ lit_insn = (OP_LDAH << 26) | (lit_insn & 0x03ff0000);
+ bfd_put_32 (info->abfd, lit_insn,
+ info->contents + irel->r_offset);
+ lit_reused = true;
+ info->changed_contents = true;
+
+ urel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info),
+ R_ALPHA_GPRELLOW);
+ urel->r_addend = irel->r_addend;
+ info->changed_relocs = true;
+ }
+ else
+ all_optimized = false;
+ break;
+
+ case 2: /* BYTE OFFSET FORMAT */
+ /* We can always optimize byte instructions. */
+
+ /* FIXME: sanity check the insn for byte op. Check that the
+ literal dest reg is indeed Rb in the byte insn. */
+
+ insn = (insn & ~0x001ff000) | ((symval & 7) << 13) | 0x1000;
+
+ urel->r_info = ELF64_R_INFO (0, R_ALPHA_NONE);
+ urel->r_addend = 0;
+ info->changed_relocs = true;
+
+ bfd_put_32 (info->abfd, insn, info->contents + urel->r_offset);
+ info->changed_contents = true;
+ break;
+
+ case 3: /* CALL FORMAT */
+ {
+ /* If not zero, place to jump without needing pv. */
+ bfd_vma optdest = elf64_alpha_relax_opt_call (info, symval);
+ bfd_vma org = (info->sec->output_section->vma
+ + info->sec->output_offset
+ + urel->r_offset + 4);
+ bfd_signed_vma odisp;
+
+ odisp = (optdest ? optdest : symval) - org;
+ if (odisp >= -0x400000 && odisp < 0x400000)
+ {
+ Elf_Internal_Rela *xrel;
+
+ /* Preserve branch prediction call stack when possible. */
+ if ((insn & INSN_JSR_MASK) == INSN_JSR)
+ insn = (OP_BSR << 26) | (insn & 0x03e00000);
+ else
+ insn = (OP_BR << 26) | (insn & 0x03e00000);
+
+ urel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info),
+ R_ALPHA_BRADDR);
+ urel->r_addend = irel->r_addend;
+
+ if (optdest)
+ urel->r_addend += optdest - symval;
+ else
+ all_optimized = false;
+
+ bfd_put_32 (info->abfd, insn, info->contents + urel->r_offset);
+
+ /* Kill any HINT reloc that might exist for this insn. */
+ xrel = (elf64_alpha_find_reloc_at_ofs
+ (info->relocs, info->relend, urel->r_offset,
+ R_ALPHA_HINT));
+ if (xrel)
+ xrel->r_info = ELF64_R_INFO (0, R_ALPHA_NONE);
+
+ info->changed_contents = true;
+ info->changed_relocs = true;
+ }
+ else
+ all_optimized = false;
+
+ /* ??? If target gp == current gp we can eliminate the gp reload.
+ This does depend on every place a gp could be reloaded will
+ be, which currently happens for all code produced by gcc, but
+ not necessarily by hand-coded assembly, or if sibling calls
+ are enabled in gcc.
+
+ Perhaps conditionalize this on a flag being set in the target
+ object file's header, and have gcc set it? */
+ }
+ break;
+ }
+ }
+
+ /* If all cases were optimized, we can reduce the use count on this
+ got entry by one, possibly eliminating it. */
+ if (all_optimized)
+ {
+ info->gotent->use_count -= 1;
+ alpha_elf_tdata (info->gotent->gotobj)->total_got_entries -= 1;
+ if (!info->h)
+ alpha_elf_tdata (info->gotent->gotobj)->n_local_got_entries -= 1;
+
+ /* If the literal instruction is no longer needed (it may have been
+ reused. We can eliminate it.
+ ??? For now, I don't want to deal with compacting the section,
+ so just nop it out. */
+ if (!lit_reused)
+ {
+ irel->r_info = ELF64_R_INFO (0, R_ALPHA_NONE);
+ info->changed_relocs = true;
+
+ bfd_put_32 (info->abfd, INSN_UNOP, info->contents + irel->r_offset);
+ info->changed_contents = true;
+ }
+ }
+
+ return irel + count;
+}
+
+static bfd_vma
+elf64_alpha_relax_opt_call (info, symval)
+ struct alpha_relax_info *info;
+ bfd_vma symval;
+{
+ /* If the function has the same gp, and we can identify that the
+ function does not use its function pointer, we can eliminate the
+ address load. */
+
+ /* If the symbol is marked NOPV, we are being told the function never
+ needs its procedure value. */
+ if (info->other == STO_ALPHA_NOPV)
+ return symval;
+
+ /* If the symbol is marked STD_GP, we are being told the function does
+ a normal ldgp in the first two words. */
+ else if (info->other == STO_ALPHA_STD_GPLOAD)
+ ;
+
+ /* Otherwise, we may be able to identify a GP load in the first two
+ words, which we can then skip. */
+ else
+ {
+ Elf_Internal_Rela *tsec_relocs, *tsec_relend, *tsec_free, *gpdisp;
+ bfd_vma ofs;
+
+ /* Load the relocations from the section that the target symbol is in. */
+ if (info->sec == info->tsec)
+ {
+ tsec_relocs = info->relocs;
+ tsec_relend = info->relend;
+ tsec_free = NULL;
+ }
+ else
+ {
+ tsec_relocs = (_bfd_elf64_link_read_relocs
+ (info->abfd, info->tsec, (PTR) NULL,
+ (Elf_Internal_Rela *) NULL,
+ info->link_info->keep_memory));
+ if (tsec_relocs == NULL)
+ return 0;
+ tsec_relend = tsec_relocs + info->tsec->reloc_count;
+ tsec_free = (info->link_info->keep_memory ? NULL : tsec_relocs);
+ }
+
+ /* Recover the symbol's offset within the section. */
+ ofs = (symval - info->tsec->output_section->vma
+ - info->tsec->output_offset);
+
+ /* Look for a GPDISP reloc. */
+ gpdisp = (elf64_alpha_find_reloc_at_ofs
+ (tsec_relocs, tsec_relend, ofs, R_ALPHA_GPDISP));
+
+ if (!gpdisp || gpdisp->r_addend != 4)
+ {
+ if (tsec_free)
+ free (tsec_free);
+ return 0;
+ }
+ if (tsec_free)
+ free (tsec_free);
+ }
+
+ /* We've now determined that we can skip an initial gp load. Verify
+ that the call and the target use the same gp. */
+ if (info->link_info->hash->creator != info->tsec->owner->xvec
+ || info->gotobj != alpha_elf_tdata (info->tsec->owner)->gotobj)
+ return 0;
+
+ return symval + 8;
+}
+
+static boolean
+elf64_alpha_relax_without_lituse (info, symval, irel)
+ struct alpha_relax_info *info;
+ bfd_vma symval;
+ Elf_Internal_Rela *irel;
+{
+ unsigned int insn;
+ bfd_signed_vma disp;
+
+ /* Get the instruction. */
+ insn = bfd_get_32 (info->abfd, info->contents + irel->r_offset);
+
+ if (insn >> 26 != OP_LDQ)
+ {
+ ((*_bfd_error_handler)
+ ("%s: %s+0x%lx: warning: LITERAL relocation against unexpected insn",
+ bfd_get_filename (info->abfd), info->sec->name,
+ (unsigned long) irel->r_offset));
+ return true;
+ }
+
+ /* So we aren't told much. Do what we can with the address load and
+ fake the rest. All of the optimizations here require that the
+ offset from the GP fit in 16 bits. */
+
+ disp = symval - info->gp;
+ if (disp < -0x8000 || disp >= 0x8000)
+ return true;
+
+ /* On the LITERAL instruction itself, consider exchanging
+ `ldq R,X(gp)' for `lda R,Y(gp)'. */
+
+ insn = (OP_LDA << 26) | (insn & 0x03ff0000);
+ bfd_put_32 (info->abfd, insn, info->contents + irel->r_offset);
+ info->changed_contents = true;
+
+ irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), R_ALPHA_GPRELLOW);
+ info->changed_relocs = true;
+
+ /* Reduce the use count on this got entry by one, possibly
+ eliminating it. */
+ info->gotent->use_count -= 1;
+ alpha_elf_tdata (info->gotent->gotobj)->total_got_entries -= 1;
+ if (!info->h)
+ alpha_elf_tdata (info->gotent->gotobj)->n_local_got_entries -= 1;
+
+ /* ??? Search forward through this basic block looking for insns
+ that use the target register. Stop after an insn modifying the
+ register is seen, or after a branch or call.
+
+ Any such memory load insn may be substituted by a load directly
+ off the GP. This allows the memory load insn to be issued before
+ the calculated GP register would otherwise be ready.
+
+ Any such jsr insn can be replaced by a bsr if it is in range.
+
+ This would mean that we'd have to _add_ relocations, the pain of
+ which gives one pause. */
+
+ return true;
+}
+
+static boolean
+elf64_alpha_relax_section (abfd, sec, link_info, again)
+ bfd *abfd;
+ asection *sec;
+ struct bfd_link_info *link_info;
+ boolean *again;
+{
+ Elf_Internal_Shdr *symtab_hdr;
+ Elf_Internal_Rela *internal_relocs;
+ Elf_Internal_Rela *free_relocs = NULL;
+ Elf_Internal_Rela *irel, *irelend;
+ bfd_byte *free_contents = NULL;
+ Elf64_External_Sym *extsyms = NULL;
+ Elf64_External_Sym *free_extsyms = NULL;
+ struct alpha_elf_got_entry **local_got_entries;
+ struct alpha_relax_info info;
+
+ /* We are not currently changing any sizes, so only one pass. */
+ *again = false;
+
+ if (link_info->relocateable
+ || (sec->flags & SEC_RELOC) == 0
+ || sec->reloc_count == 0)
+ return true;
+
+ /* If this is the first time we have been called for this section,
+ initialize the cooked size. */
+ if (sec->_cooked_size == 0)
+ sec->_cooked_size = sec->_raw_size;
+
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ local_got_entries = alpha_elf_tdata(abfd)->local_got_entries;
+
+ /* Load the relocations for this section. */
+ internal_relocs = (_bfd_elf64_link_read_relocs
+ (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
+ link_info->keep_memory));
+ if (internal_relocs == NULL)
+ goto error_return;
+ if (! link_info->keep_memory)
+ free_relocs = internal_relocs;
+
+ memset(&info, 0, sizeof(info));
+ info.abfd = abfd;
+ info.sec = sec;
+ info.link_info = link_info;
+ info.relocs = internal_relocs;
+ info.relend = irelend = internal_relocs + sec->reloc_count;
+
+ /* Find the GP for this object. */
+ info.gotobj = alpha_elf_tdata (abfd)->gotobj;
+ if (info.gotobj)
+ {
+ asection *sgot = alpha_elf_tdata (info.gotobj)->got;
+ info.gp = _bfd_get_gp_value (info.gotobj);
+ if (info.gp == 0)
+ {
+ info.gp = (sgot->output_section->vma
+ + sgot->output_offset
+ + 0x8000);
+ _bfd_set_gp_value (info.gotobj, info.gp);
+ }
+ }
+
+ for (irel = internal_relocs; irel < irelend; irel++)
+ {
+ bfd_vma symval;
+ Elf_Internal_Sym isym;
+ struct alpha_elf_got_entry *gotent;
+
+ if (ELF64_R_TYPE (irel->r_info) != (int) R_ALPHA_LITERAL)
+ continue;
+
+ /* Get the section contents. */
+ if (info.contents == NULL)
+ {
+ if (elf_section_data (sec)->this_hdr.contents != NULL)
+ info.contents = elf_section_data (sec)->this_hdr.contents;
+ else
+ {
+ info.contents = (bfd_byte *) bfd_malloc (sec->_raw_size);
+ if (info.contents == NULL)
+ goto error_return;
+ free_contents = info.contents;
+
+ if (! bfd_get_section_contents (abfd, sec, info.contents,
+ (file_ptr) 0, sec->_raw_size))
+ goto error_return;
+ }
+ }
+
+ /* Read this BFD's symbols if we haven't done so already. */
+ if (extsyms == NULL)
+ {
+ if (symtab_hdr->contents != NULL)
+ extsyms = (Elf64_External_Sym *) symtab_hdr->contents;
+ else
+ {
+ extsyms = ((Elf64_External_Sym *)
+ bfd_malloc (symtab_hdr->sh_size));
+ if (extsyms == NULL)
+ goto error_return;
+ free_extsyms = extsyms;
+ if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0
+ || (bfd_read (extsyms, 1, symtab_hdr->sh_size, abfd)
+ != symtab_hdr->sh_size))
+ goto error_return;
+ }
+ }
+
+ /* Get the value of the symbol referred to by the reloc. */
+ if (ELF64_R_SYM (irel->r_info) < symtab_hdr->sh_info)
+ {
+ /* A local symbol. */
+ bfd_elf64_swap_symbol_in (abfd,
+ extsyms + ELF64_R_SYM (irel->r_info),
+ &isym);
+ if (isym.st_shndx == SHN_UNDEF)
+ info.tsec = bfd_und_section_ptr;
+ else if (isym.st_shndx > 0 && isym.st_shndx < SHN_LORESERVE)
+ info.tsec = bfd_section_from_elf_index (abfd, isym.st_shndx);
+ else if (isym.st_shndx == SHN_ABS)
+ info.tsec = bfd_abs_section_ptr;
+ else if (isym.st_shndx == SHN_COMMON)
+ info.tsec = bfd_com_section_ptr;
+ else
+ continue; /* who knows. */
+
+ info.h = NULL;
+ info.other = isym.st_other;
+ gotent = local_got_entries[ELF64_R_SYM(irel->r_info)];
+ symval = isym.st_value;
+ }
+ else
+ {
+ unsigned long indx;
+ struct alpha_elf_link_hash_entry *h;
+
+ indx = ELF64_R_SYM (irel->r_info) - symtab_hdr->sh_info;
+ h = alpha_elf_sym_hashes (abfd)[indx];
+ BFD_ASSERT (h != NULL);
+
+ while (h->root.root.type == bfd_link_hash_indirect
+ || h->root.root.type == bfd_link_hash_warning)
+ h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link;
+
+ /* We can't do anthing with undefined or dynamic symbols. */
+ if (h->root.root.type == bfd_link_hash_undefined
+ || h->root.root.type == bfd_link_hash_undefweak
+ || alpha_elf_dynamic_symbol_p (&h->root, link_info))
+ continue;
+
+ info.h = h;
+ info.gotent = gotent;
+ info.tsec = h->root.root.u.def.section;
+ info.other = h->root.other;
+ gotent = h->got_entries;
+ symval = h->root.root.u.def.value;
+ }
+
+ /* Search for the got entry to be used by this relocation. */
+ while (gotent->gotobj != info.gotobj || gotent->addend != irel->r_addend)
+ gotent = gotent->next;
+ info.gotent = gotent;
+
+ symval += info.tsec->output_section->vma + info.tsec->output_offset;
+ symval += irel->r_addend;
+
+ BFD_ASSERT(info.gotent != NULL);
+
+ /* If there exist LITUSE relocations immediately following, this
+ opens up all sorts of interesting optimizations, because we
+ now know every location that this address load is used. */
+
+ if (irel+1 < irelend && ELF64_R_TYPE (irel[1].r_info) == R_ALPHA_LITUSE)
+ {
+ irel = elf64_alpha_relax_with_lituse (&info, symval, irel, irelend);
+ if (irel == NULL)
+ goto error_return;
+ }
+ else
+ {
+ if (!elf64_alpha_relax_without_lituse (&info, symval, irel))
+ goto error_return;
+ }
+ }
+
+ if (!elf64_alpha_size_got_sections (abfd, link_info))
+ return false;
+
+ if (info.changed_relocs)
+ {
+ elf_section_data (sec)->relocs = internal_relocs;
+ }
+ else if (free_relocs != NULL)
+ {
+ free (free_relocs);
+ }
+
+ if (info.changed_contents)
+ {
+ elf_section_data (sec)->this_hdr.contents = info.contents;
+ }
+ else if (free_contents != NULL)
+ {
+ if (! link_info->keep_memory)
+ free (free_contents);
+ else
+ {
+ /* Cache the section contents for elf_link_input_bfd. */
+ elf_section_data (sec)->this_hdr.contents = info.contents;
+ }
+ }
+
+ if (free_extsyms != NULL)
+ {
+ if (! link_info->keep_memory)
+ free (free_extsyms);
+ else
+ {
+ /* Cache the symbols for elf_link_input_bfd. */
+ symtab_hdr->contents = extsyms;
+ }
+ }
+
+ *again = info.changed_contents || info.changed_relocs;
+
+ return true;
+
+ error_return:
+ if (free_relocs != NULL)
+ free (free_relocs);
+ if (free_contents != NULL)
+ free (free_contents);
+ if (free_extsyms != NULL)
+ free (free_extsyms);
+ return false;
+}
+
/* PLT/GOT Stuff */
#define PLT_HEADER_SIZE 32
#define PLT_HEADER_WORD1 0xc3600000 /* br $27,.+4 */
@@ -1022,7 +1675,7 @@ elf64_alpha_info_to_howto (abfd, cache_ptr, dst)
/* Handle an Alpha specific section when reading an object file. This
is called when elfcode.h finds a section with an unknown type.
- FIXME: We need to handle the SHF_MIPS_GPREL flag, but I'm not sure
+ FIXME: We need to handle the SHF_ALPHA_GPREL flag, but I'm not sure
how to. */
static boolean
@@ -1143,32 +1796,43 @@ elf64_alpha_fake_sections (abfd, hdr, sec)
return true;
}
-/* Return the number of additional phdrs we will need. */
+/* Hook called by the linker routine which adds symbols from an object
+ file. We use it to put .comm items in .sbss, and not .bss. */
-static int
-elf64_alpha_additional_program_headers (abfd)
+static boolean
+elf64_alpha_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
bfd *abfd;
+ struct bfd_link_info *info;
+ const Elf_Internal_Sym *sym;
+ const char **namep;
+ flagword *flagsp;
+ asection **secp;
+ bfd_vma *valp;
{
- asection *s;
- int ret;
+ if (sym->st_shndx == SHN_COMMON
+ && !info->relocateable
+ && sym->st_size <= bfd_get_gp_size (abfd))
+ {
+ /* Common symbols less than or equal to -G nn bytes are
+ automatically put into .sbss. */
- ret = 0;
+ asection *scomm = bfd_get_section_by_name (abfd, ".scommon");
- s = bfd_get_section_by_name (abfd, ".reginfo");
- if (s != NULL && (s->flags & SEC_LOAD) != 0)
- {
- /* We need a PT_ALPHA_REGINFO segment. */
- ++ret;
- }
+ if (scomm == NULL)
+ {
+ scomm = bfd_make_section (abfd, ".scommon");
+ if (scomm == NULL
+ || !bfd_set_section_flags (abfd, scomm, (SEC_ALLOC
+ | SEC_IS_COMMON
+ | SEC_LINKER_CREATED)))
+ return false;
+ }
- if (bfd_get_section_by_name (abfd, ".dynamic") != NULL
- && bfd_get_section_by_name (abfd, ".mdebug") != NULL)
- {
- /* We need a PT_ALPHA_RTPROC segment. */
- ++ret;
+ *secp = scomm;
+ *valp = sym->st_size;
}
- return ret;
+ return true;
}
/* Create the .got section. */
@@ -1298,6 +1962,7 @@ elf64_alpha_read_ecoff_info (abfd, section, debug)
char *ext_hdr = NULL;
swap = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap;
+ memset (debug, 0, sizeof(*debug));
ext_hdr = (char *) bfd_malloc ((size_t) swap->external_hdr_size);
if (ext_hdr == NULL && swap->external_hdr_size != 0)
@@ -1614,7 +2279,7 @@ elf64_alpha_output_extsym (h, data)
{
output_section = sec->output_section;
if (output_section != NULL)
- h->esym.asym.value = (h->root.plt_offset
+ h->esym.asym.value = (h->root.plt.offset
+ sec->output_offset
+ output_section->vma);
else
@@ -1727,12 +2392,15 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs)
gotent->addend = rel->r_addend;
gotent->got_offset = -1;
gotent->flags = 0;
+ gotent->use_count = 1;
gotent->next = h->got_entries;
h->got_entries = gotent;
alpha_elf_tdata (abfd)->total_got_entries++;
}
+ else
+ gotent->use_count += 1;
}
else
{
@@ -1769,6 +2437,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs)
gotent->addend = rel->r_addend;
gotent->got_offset = -1;
gotent->flags = 0;
+ gotent->use_count = 1;
gotent->next = local_got_entries[ELF64_R_SYM(rel->r_info)];
local_got_entries[ELF64_R_SYM(rel->r_info)] = gotent;
@@ -1776,6 +2445,8 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs)
alpha_elf_tdata(abfd)->total_got_entries++;
alpha_elf_tdata(abfd)->n_local_got_entries++;
}
+ else
+ gotent->use_count += 1;
}
/* Remember how this literal is used from its LITUSEs.
@@ -1814,6 +2485,8 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs)
case R_ALPHA_GPDISP:
case R_ALPHA_GPREL32:
+ case R_ALPHA_GPRELHIGH:
+ case R_ALPHA_GPRELLOW:
/* We don't actually use the .got here, but the sections must
be created before the linker maps input sections to output
sections. */
@@ -1908,9 +2581,10 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs)
else
rent->count++;
}
- else if (info->shared)
+ else if (info->shared && (sec->flags & SEC_ALLOC))
{
- /* If this is a shared library, we need a RELATIVE reloc. */
+ /* If this is a shared library, and the section is to be
+ loaded into memory, we need a RELATIVE reloc. */
sreloc->_raw_size += sizeof (Elf64_External_Rela);
}
break;
@@ -1963,17 +2637,18 @@ elf64_alpha_adjust_dynamic_symbol (info, h)
if (s->_raw_size == 0)
s->_raw_size = PLT_HEADER_SIZE;
- h->plt_offset = s->_raw_size;
+ h->plt.offset = s->_raw_size;
s->_raw_size += PLT_ENTRY_SIZE;
/* If this symbol is not defined in a regular file, and we are not
generating a shared library, then set the symbol to the location
in the .plt. This is required to make function pointers compare
equal between the normal executable and the shared library. */
- if (!info->shared)
+ if (! info->shared
+ && h->root.type != bfd_link_hash_defweak)
{
h->root.u.def.section = s;
- h->root.u.def.value = h->plt_offset;
+ h->root.u.def.value = h->plt.offset;
}
/* We also need a JMP_SLOT entry in the .rela.plt section. */
@@ -2042,7 +2717,7 @@ elf64_alpha_merge_ind_symbols (hi, dummy)
{
gin = gi->next;
for (gs = gsh; gs ; gs = gs->next)
- if (gi->gotobj == gs->gotobj && gi->addend == gs->addend )
+ if (gi->gotobj == gs->gotobj && gi->addend == gs->addend)
goto got_found;
gi->next = hs->got_entries;
hs->got_entries = gi;
@@ -2086,6 +2761,7 @@ elf64_alpha_can_merge_gots (a, b)
bfd *a, *b;
{
int total = alpha_elf_tdata (a)->total_got_entries;
+ bfd *bsub;
/* Trivial quick fallout test. */
if (total + alpha_elf_tdata (b)->total_got_entries <= MAX_GOT_ENTRIES)
@@ -2098,37 +2774,40 @@ elf64_alpha_can_merge_gots (a, b)
/* Failing the common trivial comparison, we must effectively
perform the merge. Not actually performing the merge means that
we don't have to store undo information in case we fail. */
- {
- struct alpha_elf_link_hash_entry **hashes = alpha_elf_sym_hashes(b);
- Elf_Internal_Shdr *symtab_hdr = &elf_tdata(b)->symtab_hdr;
- int i, n;
+ for (bsub = b; bsub ; bsub = alpha_elf_tdata (bsub)->in_got_link_next)
+ {
+ struct alpha_elf_link_hash_entry **hashes = alpha_elf_sym_hashes (bsub);
+ Elf_Internal_Shdr *symtab_hdr = &elf_tdata (bsub)->symtab_hdr;
+ int i, n;
- n = symtab_hdr->sh_size / symtab_hdr->sh_entsize - symtab_hdr->sh_info;
- for (i = 0; i < n; ++i)
- {
- struct alpha_elf_got_entry *ae, *be;
- struct alpha_elf_link_hash_entry *h;
+ n = symtab_hdr->sh_size / symtab_hdr->sh_entsize - symtab_hdr->sh_info;
+ for (i = 0; i < n; ++i)
+ {
+ struct alpha_elf_got_entry *ae, *be;
+ struct alpha_elf_link_hash_entry *h;
- h = hashes[i];
- while (h->root.root.type == bfd_link_hash_indirect
- || h->root.root.type == bfd_link_hash_warning)
- h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link;
+ h = hashes[i];
+ while (h->root.root.type == bfd_link_hash_indirect
+ || h->root.root.type == bfd_link_hash_warning)
+ h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link;
- for (be = h->got_entries; be ; be = be->next)
- {
- if (be->gotobj != b)
- continue;
+ for (be = h->got_entries; be ; be = be->next)
+ {
+ if (be->use_count == 0)
+ continue;
+ if (be->gotobj != b)
+ continue;
- for (ae = h->got_entries; ae ; ae = ae->next)
- if (ae->gotobj == a && ae->addend == be->addend)
- goto global_found;
+ for (ae = h->got_entries; ae ; ae = ae->next)
+ if (ae->gotobj == a && ae->addend == be->addend)
+ goto global_found;
- if (++total > MAX_GOT_ENTRIES)
- return false;
- global_found:;
- }
- }
- }
+ if (++total > MAX_GOT_ENTRIES)
+ return false;
+ global_found:;
+ }
+ }
+ }
return true;
}
@@ -2139,73 +2818,91 @@ static void
elf64_alpha_merge_gots (a, b)
bfd *a, *b;
{
- int total = alpha_elf_tdata(a)->total_got_entries;
+ int total = alpha_elf_tdata (a)->total_got_entries;
+ bfd *bsub;
/* Remember local expansion. */
{
- int e = alpha_elf_tdata(b)->n_local_got_entries;
+ int e = alpha_elf_tdata (b)->n_local_got_entries;
total += e;
- alpha_elf_tdata(a)->n_local_got_entries += e;
+ alpha_elf_tdata (a)->n_local_got_entries += e;
}
- /* Let the local .got entries know they are part of a new subsegment. */
- {
- struct alpha_elf_got_entry **local_got_entries;
- local_got_entries = alpha_elf_tdata(b)->local_got_entries;
- if (local_got_entries)
- {
- int i, n;
+ for (bsub = b; bsub ; bsub = alpha_elf_tdata (bsub)->in_got_link_next)
+ {
+ struct alpha_elf_got_entry **local_got_entries;
+ struct alpha_elf_link_hash_entry **hashes;
+ Elf_Internal_Shdr *symtab_hdr;
+ int i, n;
+
+ /* Let the local .got entries know they are part of a new subsegment. */
+ local_got_entries = alpha_elf_tdata (bsub)->local_got_entries;
+ if (local_got_entries)
+ {
+ n = elf_tdata (bsub)->symtab_hdr.sh_info;
+ for (i = 0; i < n; ++i)
+ {
+ struct alpha_elf_got_entry *ent;
+ for (ent = local_got_entries[i]; ent; ent = ent->next)
+ ent->gotobj = a;
+ }
+ }
- n = elf_tdata(b)->symtab_hdr.sh_info;
- for (i = 0; i < n; ++i)
- {
- struct alpha_elf_got_entry *gotent;
- for (gotent = local_got_entries[i]; gotent; gotent = gotent->next)
- gotent->gotobj = a;
- }
- }
- }
+ /* Merge the global .got entries. */
+ hashes = alpha_elf_sym_hashes (bsub);
+ symtab_hdr = &elf_tdata (bsub)->symtab_hdr;
- /* Merge the global .got entries. */
- {
- struct alpha_elf_link_hash_entry **hashes = alpha_elf_sym_hashes(b);
- Elf_Internal_Shdr *symtab_hdr = &elf_tdata(b)->symtab_hdr;
- int i, n;
+ n = symtab_hdr->sh_size / symtab_hdr->sh_entsize - symtab_hdr->sh_info;
+ for (i = 0; i < n; ++i)
+ {
+ struct alpha_elf_got_entry *ae, *be, **pbe, **start;
+ struct alpha_elf_link_hash_entry *h;
- n = symtab_hdr->sh_size / symtab_hdr->sh_entsize - symtab_hdr->sh_info;
- for (i = 0; i < n; ++i)
- {
- struct alpha_elf_got_entry *ae, *be, **pbe, **start;
- struct alpha_elf_link_hash_entry *h;
+ h = hashes[i];
+ while (h->root.root.type == bfd_link_hash_indirect
+ || h->root.root.type == bfd_link_hash_warning)
+ h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link;
- h = hashes[i];
- while (h->root.root.type == bfd_link_hash_indirect
- || h->root.root.type == bfd_link_hash_warning)
- h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link;
+ start = &h->got_entries;
+ for (pbe = start, be = *start; be ; pbe = &be->next, be = be->next)
+ {
+ if (be->use_count == 0)
+ {
+ *pbe = be->next;
+ continue;
+ }
+ if (be->gotobj != b)
+ continue;
- start = &h->got_entries;
- for (pbe = start, be = *start; be ; pbe = &be->next, be = be->next)
- {
- if (be->gotobj != b)
- continue;
+ for (ae = *start; ae ; ae = ae->next)
+ if (ae->gotobj == a && ae->addend == be->addend)
+ {
+ ae->flags |= be->flags;
+ ae->use_count += be->use_count;
+ *pbe = be->next;
+ goto global_found;
+ }
+ be->gotobj = a;
+ total += 1;
- for (ae = *start; ae ; ae = ae->next)
- if (ae->gotobj == a && ae->addend == be->addend)
- {
- ae->flags |= be->flags;
- *pbe = be->next;
- goto global_found;
- }
- be->gotobj = a;
- total += 1;
+ global_found:;
+ }
+ }
- global_found:;
- }
- }
- }
+ alpha_elf_tdata (bsub)->gotobj = a;
+ }
+ alpha_elf_tdata (a)->total_got_entries = total;
+
+ /* Merge the two in_got chains. */
+ {
+ bfd *next;
+
+ bsub = a;
+ while ((next = alpha_elf_tdata (bsub)->in_got_link_next) != NULL)
+ bsub = next;
- alpha_elf_tdata(a)->total_got_entries = total;
- alpha_elf_tdata(b)->gotobj = a;
+ alpha_elf_tdata (bsub)->in_got_link_next = b;
+ }
}
/* Calculate the offsets for the got entries. */
@@ -2218,11 +2915,14 @@ elf64_alpha_calc_got_offsets_for_symbol (h, arg)
struct alpha_elf_got_entry *gotent;
for (gotent = h->got_entries; gotent; gotent = gotent->next)
- {
- bfd_size_type *plge = &alpha_elf_tdata (gotent->gotobj)->got->_raw_size;
- gotent->got_offset = *plge;
- *plge += 8;
- }
+ if (gotent->use_count > 0)
+ {
+ bfd_size_type *plge
+ = &alpha_elf_tdata (gotent->gotobj)->got->_raw_size;
+
+ gotent->got_offset = *plge;
+ *plge += 8;
+ }
return true;
}
@@ -2260,111 +2960,117 @@ elf64_alpha_calc_got_offsets (info)
for (k = 0, n = elf_tdata(j)->symtab_hdr.sh_info; k < n; ++k)
for (gotent = local_got_entries[k]; gotent; gotent = gotent->next)
- {
- gotent->got_offset = got_offset;
- got_offset += 8;
- }
+ if (gotent->use_count > 0)
+ {
+ gotent->got_offset = got_offset;
+ got_offset += 8;
+ }
}
alpha_elf_tdata(i)->got->_raw_size = got_offset;
+ alpha_elf_tdata(i)->got->_cooked_size = got_offset;
}
}
-/* Remove a section from the output BFD. */
-
-static void
-elf64_alpha_strip_section_from_output (s)
- asection *s;
-{
- asection **spp;
-
- for (spp = &s->output_section->owner->sections;
- *spp != s->output_section;
- spp = &(*spp)->next)
- continue;
- *spp = s->output_section->next;
- --s->output_section->owner->section_count;
-}
-
/* Constructs the gots. */
static boolean
-elf64_alpha_always_size_sections (output_bfd, info)
+elf64_alpha_size_got_sections (output_bfd, info)
bfd *output_bfd;
struct bfd_link_info *info;
{
- bfd *i, *got_list, *cur_got_obj, **cur_got_tail;
- int ngots;
+ bfd *i, *got_list, *cur_got_obj;
+ int something_changed = 0;
- if (info->relocateable)
- return true;
-
- /* First, take care of the indirect symbols created by versioning. */
- alpha_elf_link_hash_traverse (alpha_elf_hash_table (info),
- elf64_alpha_merge_ind_symbols,
- NULL);
+ got_list = alpha_elf_hash_table (info)->got_list;
- ngots = 0;
- got_list = NULL;
- cur_got_obj = NULL;
- cur_got_tail = NULL;
- for (i = info->input_bfds; i ; i = i->link_next)
+ /* On the first time through, pretend we have an existing got list
+ consisting of all of the input files. */
+ if (got_list == NULL)
{
- bfd *this_got = alpha_elf_tdata (i)->gotobj;
-
- /* Don't play if there is no .got for this input file. */
- if (this_got == NULL)
- continue;
-
- if (alpha_elf_tdata (this_got)->total_got_entries > MAX_GOT_ENTRIES)
+ for (i = info->input_bfds; i ; i = i->link_next)
{
- /* Yikes! A single object file has too many entries. */
- (*_bfd_error_handler)
- ("%s: .got subsegment exceeds 64K (size %d)",
- bfd_get_filename(i),
- alpha_elf_tdata(this_got)->total_got_entries * 8);
- return false;
- }
+ bfd *this_got = alpha_elf_tdata (i)->gotobj;
+ if (this_got == NULL)
+ continue;
- if (cur_got_obj)
- {
- if (elf64_alpha_can_merge_gots (cur_got_obj, i))
+ /* We are assuming no merging has yet ocurred. */
+ BFD_ASSERT (this_got == i);
+
+ if (alpha_elf_tdata (this_got)->total_got_entries > MAX_GOT_ENTRIES)
{
- elf64_alpha_merge_gots (cur_got_obj, i);
- *cur_got_tail = i;
+ /* Yikes! A single object file has too many entries. */
+ (*_bfd_error_handler)
+ (_("%s: .got subsegment exceeds 64K (size %d)"),
+ bfd_get_filename (i),
+ alpha_elf_tdata (this_got)->total_got_entries * 8);
+ return false;
}
+
+ if (got_list == NULL)
+ got_list = this_got;
else
- {
- if (++ngots == 2)
- {
- (*info->callbacks->warning)
- (info, "using multiple gp values", (char *) NULL,
- output_bfd, (asection *) NULL, (bfd_vma) 0);
- }
- *cur_got_tail = NULL;
- alpha_elf_tdata(cur_got_obj)->got_link_next = got_list;
- got_list = cur_got_obj;
- cur_got_obj = i;
- }
+ alpha_elf_tdata(cur_got_obj)->got_link_next = this_got;
+ cur_got_obj = this_got;
+ }
+
+ /* Strange degenerate case of no got references. */
+ if (got_list == NULL)
+ return true;
+
+ alpha_elf_hash_table (info)->got_list = got_list;
+
+ /* Force got offsets to be recalculated. */
+ something_changed = 1;
+ }
+
+ cur_got_obj = got_list;
+ i = alpha_elf_tdata(cur_got_obj)->got_link_next;
+ while (i != NULL)
+ {
+ if (elf64_alpha_can_merge_gots (cur_got_obj, i))
+ {
+ elf64_alpha_merge_gots (cur_got_obj, i);
+ i = alpha_elf_tdata(i)->got_link_next;
+ alpha_elf_tdata(cur_got_obj)->got_link_next = i;
+ something_changed = 1;
}
else
{
- ++ngots;
cur_got_obj = i;
+ i = alpha_elf_tdata(i)->got_link_next;
}
- cur_got_tail = &alpha_elf_tdata(i)->in_got_link_next;
}
- if (cur_got_obj)
- alpha_elf_tdata (cur_got_obj)->got_link_next = got_list;
- alpha_elf_hash_table (info)->got_list = got_list = cur_got_obj;
+ /* Once the gots have been merged, fill in the got offsets for
+ everything therein. */
+ if (1 || something_changed)
+ elf64_alpha_calc_got_offsets (info);
- /* Once the gots have been merged, fill in the got offsets for everything
- therein. */
- elf64_alpha_calc_got_offsets (info);
+ return true;
+}
+
+static boolean
+elf64_alpha_always_size_sections (output_bfd, info)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+{
+ bfd *i;
+
+ if (info->relocateable)
+ return true;
+
+ /* First, take care of the indirect symbols created by versioning. */
+ alpha_elf_link_hash_traverse (alpha_elf_hash_table (info),
+ elf64_alpha_merge_ind_symbols,
+ NULL);
+
+ if (!elf64_alpha_size_got_sections (output_bfd, info))
+ return false;
/* Allocate space for all of the .got subsections. */
- for (i = got_list; i ; i = alpha_elf_tdata(i)->got_link_next)
+ i = alpha_elf_hash_table (info)->got_list;
+ for ( ; i ; i = alpha_elf_tdata(i)->got_link_next)
{
asection *s = alpha_elf_tdata(i)->got;
if (s->_raw_size > 0)
@@ -2405,42 +3111,16 @@ elf64_alpha_calc_dynrel_sizes (h, info)
}
/* If the symbol is dynamic, we'll need all the relocations in their
- natural form. If it has been forced local, we'll need the same
- number of RELATIVE relocations. */
- if (alpha_elf_dynamic_symbol_p (&h->root, info)
- || (info->shared && h->root.dynindx == -1))
- {
- struct alpha_elf_reloc_entry *relent;
+ natural form. If this is a shared object, and it has been forced
+ local, we'll need the same number of RELATIVE relocations. */
- for (relent = h->reloc_entries; relent; relent = relent->next)
- {
- relent->srel->_raw_size +=
- sizeof (Elf64_External_Rela) * relent->count;
- }
-
- /* Only add a .rela.got entry if we're not using a .plt entry. */
- if (h->root.plt_offset == MINUS_ONE)
- {
- bfd *dynobj = elf_hash_table(info)->dynobj;
- struct alpha_elf_got_entry *gotent;
- bfd_size_type count = 0;
- asection *srel;
-
- for (gotent = h->got_entries; gotent ; gotent = gotent->next)
- count++;
- if (count > 0)
- {
- srel = bfd_get_section_by_name (dynobj, ".rela.got");
- BFD_ASSERT (srel != NULL);
- srel->_raw_size += sizeof (Elf64_External_Rela) * count;
- }
- }
- }
- /* Otherwise, shared objects require RELATIVE relocs for all REFQUAD
- and REFLONG relocations. */
- else if (info->shared)
+ if (alpha_elf_dynamic_symbol_p (&h->root, info) || info->shared)
{
struct alpha_elf_reloc_entry *relent;
+ bfd *dynobj;
+ struct alpha_elf_got_entry *gotent;
+ bfd_size_type count;
+ asection *srel;
for (relent = h->reloc_entries; relent; relent = relent->next)
if (relent->rtype == R_ALPHA_REFLONG
@@ -2449,6 +3129,24 @@ elf64_alpha_calc_dynrel_sizes (h, info)
relent->srel->_raw_size +=
sizeof(Elf64_External_Rela) * relent->count;
}
+
+ dynobj = elf_hash_table(info)->dynobj;
+ count = 0;
+
+ for (gotent = h->got_entries; gotent ; gotent = gotent->next)
+ count++;
+
+ /* If we are using a .plt entry, subtract one, as the first
+ reference uses a .rela.plt entry instead. */
+ if (h->root.plt.offset != MINUS_ONE)
+ count--;
+
+ if (count > 0)
+ {
+ srel = bfd_get_section_by_name (dynobj, ".rela.got");
+ BFD_ASSERT (srel != NULL);
+ srel->_raw_size += sizeof (Elf64_External_Rela) * count;
+ }
}
return true;
@@ -2570,7 +3268,7 @@ elf64_alpha_size_dynamic_sections (output_bfd, info)
}
if (strip)
- elf64_alpha_strip_section_from_output (s);
+ _bfd_strip_section_from_output (info, s);
else
{
/* Allocate memory for the section contents. */
@@ -2580,34 +3278,6 @@ elf64_alpha_size_dynamic_sections (output_bfd, info)
}
}
- /* If we are generating a shared library, we generate a section
- symbol for each output section. These are local symbols, which
- means that they must come first in the dynamic symbol table.
- That means we must increment the dynamic symbol index of every
- other dynamic symbol. */
- if (info->shared)
- {
- long c[2], i;
- asection *p;
-
- c[0] = 0;
- c[1] = bfd_count_sections (output_bfd);
-
- elf_hash_table (info)->dynsymcount += c[1];
- elf_link_hash_traverse (elf_hash_table(info),
- elf64_alpha_adjust_dynindx,
- (PTR) c);
-
- for (i = 1, p = output_bfd->sections;
- p != NULL;
- p = p->next, i++)
- {
- elf_section_data (p)->dynindx = i;
- /* These symbols will have no names, so we don't need to
- fiddle with dynstr_index. */
- }
- }
-
if (elf_hash_table (info)->dynamic_sections_created)
{
/* Add some entries to the .dynamic section. We fill in the
@@ -2648,22 +3318,6 @@ elf64_alpha_size_dynamic_sections (output_bfd, info)
return true;
}
-/* Increment the index of a dynamic symbol by a given amount. Called
- via elf_link_hash_traverse. */
-
-static boolean
-elf64_alpha_adjust_dynindx (h, cparg)
- struct elf_link_hash_entry *h;
- PTR cparg;
-{
- long *cp = (long *)cparg;
-
- if (h->dynindx >= cp[0])
- h->dynindx += cp[1];
-
- return true;
-}
-
/* Relocate an Alpha ELF section. */
static boolean
@@ -2739,6 +3393,12 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
anything, unless the reloc is against a section symbol,
in which case we have to adjust according to where the
section symbol winds up in the output section. */
+
+ /* The symbol associated with GPDISP and LITUSE is
+ immaterial. Only the addend is significant. */
+ if (r_type == R_ALPHA_GPDISP || r_type == R_ALPHA_LITUSE)
+ continue;
+
if (r_symndx < symtab_hdr->sh_info)
{
sym = local_syms + r_symndx;
@@ -2815,13 +3475,14 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.root.type == bfd_link_hash_undefweak)
relocation = 0;
- else if (info->shared && !info->symbolic)
+ else if (info->shared && !info->symbolic && !info->no_undefined)
relocation = 0;
else
{
if (!((*info->callbacks->undefined_symbol)
(info, h->root.root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset,
+ (!info->shared || info->no_undefined))))
return false;
relocation = 0;
}
@@ -2858,6 +3519,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
case R_ALPHA_LITERAL:
{
struct alpha_elf_got_entry *gotent;
+ boolean dynamic_symbol;
BFD_ASSERT(sgot != NULL);
BFD_ASSERT(gp != 0);
@@ -2865,75 +3527,53 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
if (h != NULL)
{
gotent = h->got_entries;
- BFD_ASSERT(gotent != NULL);
-
- while (gotent->gotobj != gotobj || gotent->addend != addend)
- gotent = gotent->next;
-
- /* Initialize the .got entry's value. */
- if (!(gotent->flags & ALPHA_ELF_GOT_ENTRY_RELOCS_DONE))
- {
- bfd_put_64 (output_bfd, relocation+addend,
- sgot->contents + gotent->got_offset);
-
- /* If the symbol has been forced local, output a
- RELATIVE reloc, otherwise it will be handled in
- finish_dynamic_symbol. */
- if (info->shared && h->root.dynindx == -1)
- {
- Elf_Internal_Rela outrel;
-
- BFD_ASSERT(srelgot != NULL);
-
- outrel.r_offset = (sgot->output_section->vma
- + sgot->output_offset
- + gotent->got_offset);
- outrel.r_info = ELF64_R_INFO(0, R_ALPHA_RELATIVE);
- outrel.r_addend = 0;
-
- bfd_elf64_swap_reloca_out (output_bfd, &outrel,
- ((Elf64_External_Rela *)
- srelgot->contents)
- + srelgot->reloc_count++);
- }
-
- gotent->flags |= ALPHA_ELF_GOT_ENTRY_RELOCS_DONE;
- }
+ dynamic_symbol = alpha_elf_dynamic_symbol_p (&h->root, info);
}
else
{
gotent = (alpha_elf_tdata(input_bfd)->
local_got_entries[r_symndx]);
- while (gotent->addend != addend)
- gotent = gotent->next;
+ dynamic_symbol = false;
+ }
+
+ BFD_ASSERT(gotent != NULL);
+
+ while (gotent->gotobj != gotobj || gotent->addend != addend)
+ gotent = gotent->next;
+
+ BFD_ASSERT(gotent->use_count >= 1);
- if (!(gotent->flags & ALPHA_ELF_GOT_ENTRY_RELOCS_DONE))
+ /* Initialize the .got entry's value. */
+ if (!(gotent->flags & ALPHA_ELF_GOT_ENTRY_RELOCS_DONE))
+ {
+ bfd_put_64 (output_bfd, relocation+addend,
+ sgot->contents + gotent->got_offset);
+
+ /* If the symbol has been forced local, output a
+ RELATIVE reloc, otherwise it will be handled in
+ finish_dynamic_symbol. */
+ if (info->shared && !dynamic_symbol)
{
- bfd_put_64 (output_bfd, relocation+addend,
- sgot->contents + gotent->got_offset);
-
- /* Local got entries need RELATIVE relocs in shared
- libraries. */
- if (info->shared)
- {
- Elf_Internal_Rela outrel;
-
- BFD_ASSERT(srelgot != NULL);
-
- outrel.r_offset = (sgot->output_section->vma
- + sgot->output_offset
- + gotent->got_offset);
- outrel.r_info = ELF64_R_INFO(0, R_ALPHA_RELATIVE);
- outrel.r_addend = 0;
-
- bfd_elf64_swap_reloca_out (output_bfd, &outrel,
- ((Elf64_External_Rela *)
- srelgot->contents)
- + srelgot->reloc_count++);
- }
-
- gotent->flags |= ALPHA_ELF_GOT_ENTRY_RELOCS_DONE;
+ Elf_Internal_Rela outrel;
+
+ BFD_ASSERT(srelgot != NULL);
+
+ outrel.r_offset = (sgot->output_section->vma
+ + sgot->output_offset
+ + gotent->got_offset);
+ outrel.r_info = ELF64_R_INFO(0, R_ALPHA_RELATIVE);
+ outrel.r_addend = 0;
+
+ bfd_elf64_swap_reloca_out (output_bfd, &outrel,
+ ((Elf64_External_Rela *)
+ srelgot->contents)
+ + srelgot->reloc_count++);
+ BFD_ASSERT (sizeof(Elf64_External_Rela)
+ * srelgot->reloc_count
+ <= srelgot->_cooked_size);
}
+
+ gotent->flags |= ALPHA_ELF_GOT_ENTRY_RELOCS_DONE;
}
/* Figure the gprel relocation. */
@@ -2947,8 +3587,18 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
goto default_reloc;
case R_ALPHA_GPREL32:
+ case R_ALPHA_GPRELLOW:
+ BFD_ASSERT(gp != 0);
+ relocation -= gp;
+ goto default_reloc;
+
+ case R_ALPHA_GPRELHIGH:
BFD_ASSERT(gp != 0);
relocation -= gp;
+ relocation += addend;
+ addend = 0;
+ relocation = (((bfd_signed_vma) relocation >> 16)
+ + ((relocation >> 15) & 1));
goto default_reloc;
case R_ALPHA_BRADDR:
@@ -2974,7 +3624,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
outrel.r_addend = addend;
addend = 0, relocation = 0;
}
- else if (info->shared)
+ else if (info->shared && (input_section->flags & SEC_ALLOC))
{
outrel.r_info = ELF64_R_INFO(0, R_ALPHA_RELATIVE);
outrel.r_addend = 0;
@@ -3023,6 +3673,8 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
((Elf64_External_Rela *)
srel->contents)
+ srel->reloc_count++);
+ BFD_ASSERT (sizeof(Elf64_External_Rela) * srel->reloc_count
+ <= srel->_cooked_size);
}
goto default_reloc;
@@ -3082,7 +3734,7 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym)
{
bfd *dynobj = elf_hash_table(info)->dynobj;
- if (h->plt_offset != MINUS_ONE)
+ if (h->plt.offset != MINUS_ONE)
{
/* Fill in the .plt entry for this symbol. */
asection *splt, *sgot, *srel;
@@ -3110,21 +3762,21 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym)
+ gotent->got_offset);
plt_addr = (splt->output_section->vma
+ splt->output_offset
- + h->plt_offset);
+ + h->plt.offset);
- plt_index = (h->plt_offset - PLT_HEADER_SIZE) / PLT_ENTRY_SIZE;
+ plt_index = (h->plt.offset - PLT_HEADER_SIZE) / PLT_ENTRY_SIZE;
/* Fill in the entry in the procedure linkage table. */
{
unsigned insn1, insn2, insn3;
- insn1 = PLT_ENTRY_WORD1 | ((-(h->plt_offset + 4) >> 2) & 0x1fffff);
+ insn1 = PLT_ENTRY_WORD1 | ((-(h->plt.offset + 4) >> 2) & 0x1fffff);
insn2 = PLT_ENTRY_WORD2;
insn3 = PLT_ENTRY_WORD3;
- bfd_put_32 (output_bfd, insn1, splt->contents + h->plt_offset);
- bfd_put_32 (output_bfd, insn2, splt->contents + h->plt_offset + 4);
- bfd_put_32 (output_bfd, insn3, splt->contents + h->plt_offset + 8);
+ bfd_put_32 (output_bfd, insn1, splt->contents + h->plt.offset);
+ bfd_put_32 (output_bfd, insn2, splt->contents + h->plt.offset + 4);
+ bfd_put_32 (output_bfd, insn3, splt->contents + h->plt.offset + 8);
}
/* Fill in the entry in the .rela.plt section. */
@@ -3147,14 +3799,40 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym)
bfd_put_64 (output_bfd, plt_addr, sgot->contents + gotent->got_offset);
/* Subsequent .got entries will continue to bounce through the .plt. */
- while ((gotent = gotent->next) != NULL)
+ if (gotent->next)
{
- sgot = alpha_elf_tdata(gotent->gotobj)->got;
- BFD_ASSERT(sgot != NULL);
- BFD_ASSERT(gotent->addend == 0);
+ srel = bfd_get_section_by_name (dynobj, ".rela.got");
+ BFD_ASSERT (! info->shared || srel != NULL);
+
+ gotent = gotent->next;
+ do
+ {
+ sgot = alpha_elf_tdata(gotent->gotobj)->got;
+ BFD_ASSERT(sgot != NULL);
+ BFD_ASSERT(gotent->addend == 0);
+
+ bfd_put_64 (output_bfd, plt_addr,
+ sgot->contents + gotent->got_offset);
+
+ if (info->shared)
+ {
+ outrel.r_offset = (sgot->output_section->vma
+ + sgot->output_offset
+ + gotent->got_offset);
+ outrel.r_info = ELF64_R_INFO(0, R_ALPHA_RELATIVE);
+ outrel.r_addend = 0;
+
+ bfd_elf64_swap_reloca_out (output_bfd, &outrel,
+ ((Elf64_External_Rela *)
+ srel->contents)
+ + srel->reloc_count++);
+ BFD_ASSERT (sizeof(Elf64_External_Rela) * srel->reloc_count
+ <= srel->_cooked_size);
+ }
- bfd_put_64 (output_bfd, plt_addr,
- sgot->contents + gotent->got_offset);
+ gotent = gotent->next;
+ }
+ while (gotent != NULL);
}
}
else if (alpha_elf_dynamic_symbol_p (h, info))
@@ -3181,6 +3859,8 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym)
bfd_elf64_swap_reloca_out (output_bfd, &outrel,
((Elf64_External_Rela *)srel->contents
+ srel->reloc_count++));
+ BFD_ASSERT (sizeof(Elf64_External_Rela) * srel->reloc_count
+ <= srel->_cooked_size);
}
}
@@ -3282,44 +3962,6 @@ elf64_alpha_finish_dynamic_sections (output_bfd, info)
}
}
- if (info->shared)
- {
- asection *sdynsym;
- asection *s;
- Elf_Internal_Sym sym;
-
- /* Set up the section symbols for the output sections. */
-
- sdynsym = bfd_get_section_by_name (dynobj, ".dynsym");
- BFD_ASSERT (sdynsym != NULL);
-
- sym.st_size = 0;
- sym.st_name = 0;
- sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
- sym.st_other = 0;
-
- for (s = output_bfd->sections; s != NULL; s = s->next)
- {
- int indx;
-
- sym.st_value = s->vma;
-
- indx = elf_section_data (s)->this_idx;
- BFD_ASSERT (indx > 0);
- sym.st_shndx = indx;
-
- bfd_elf64_swap_symbol_out (output_bfd, &sym,
- (PTR) (((Elf64_External_Sym *)
- sdynsym->contents)
- + elf_section_data (s)->dynindx));
- }
-
- /* Set the sh_info field of the output .dynsym section to the
- index of the first global symbol. */
- elf_section_data (sdynsym->output_section)->this_hdr.sh_info =
- bfd_count_sections (output_bfd) + 1;
- }
-
return true;
}
@@ -3341,6 +3983,15 @@ elf64_alpha_final_link (abfd, info)
HDRR *symhdr = &debug.symbolic_header;
PTR mdebug_handle = NULL;
+#if 0
+ if (++ngots == 2)
+ {
+ (*info->callbacks->warning)
+ (info, _("using multiple gp values"), (char *) NULL,
+ output_bfd, (asection *) NULL, (bfd_vma) 0);
+ }
+#endif
+
/* Go through the sections and collect the .reginfo and .mdebug
information. */
reginfo_sec = NULL;
@@ -3710,7 +4361,7 @@ elf64_alpha_final_link (abfd, info)
else
{
(*_bfd_error_handler)
- ("%s: illegal section name `%s'",
+ (_("%s: illegal section name `%s'"),
bfd_get_filename (abfd), o->name);
bfd_set_error (bfd_error_nonrepresentable_section);
return false;
@@ -4012,14 +4663,16 @@ elf64_alpha_ecoff_debug_swap =
elf64_alpha_section_from_shdr
#define elf_backend_fake_sections \
elf64_alpha_fake_sections
-#define elf_backend_additional_program_headers \
- elf64_alpha_additional_program_headers
#define bfd_elf64_bfd_is_local_label_name \
elf64_alpha_is_local_label_name
#define bfd_elf64_find_nearest_line \
elf64_alpha_find_nearest_line
+#define bfd_elf64_bfd_relax_section \
+ elf64_alpha_relax_section
+#define elf_backend_add_symbol_hook \
+ elf64_alpha_add_symbol_hook
#define elf_backend_check_relocs \
elf64_alpha_check_relocs
#define elf_backend_create_dynamic_sections \
@@ -4048,5 +4701,7 @@ elf64_alpha_ecoff_debug_swap =
#define elf_backend_want_got_plt 0
#define elf_backend_plt_readonly 0
#define elf_backend_want_plt_sym 1
+#define elf_backend_got_header_size 0
+#define elf_backend_plt_header_size PLT_HEADER_SIZE
#include "elf64-target.h"
diff --git a/contrib/binutils/bfd/elf64-gen.c b/contrib/binutils/bfd/elf64-gen.c
index 5daf4ee9f17d..78dc09d39788 100644
--- a/contrib/binutils/bfd/elf64-gen.c
+++ b/contrib/binutils/bfd/elf64-gen.c
@@ -1,5 +1,5 @@
/* Generic support for 64-bit ELF
- Copyright 1993 Free Software Foundation, Inc.
+ Copyright 1993, 1995, 1998 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -22,8 +22,41 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "libbfd.h"
#include "elf-bfd.h"
-/* This does not include any relocations, but should be good enough
- for GDB to read the file. */
+/* This does not include any relocation information, but should be
+ good enough for GDB or objdump to read the file. */
+
+static reloc_howto_type dummy =
+ HOWTO (0, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "UNKNOWN", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false); /* pcrel_offset */
+
+static void
+elf_generic_info_to_howto (abfd, bfd_reloc, elf_reloc)
+ bfd *abfd;
+ arelent *bfd_reloc;
+ Elf64_Internal_Rela *elf_reloc;
+{
+ bfd_reloc->howto = &dummy;
+}
+
+static void
+elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc)
+ bfd *abfd;
+ arelent *bfd_reloc;
+ Elf64_Internal_Rel *elf_reloc;
+{
+ bfd_reloc->howto = &dummy;
+}
#define TARGET_LITTLE_SYM bfd_elf64_little_generic_vec
#define TARGET_LITTLE_NAME "elf64-little"
@@ -31,7 +64,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define TARGET_BIG_NAME "elf64-big"
#define ELF_ARCH bfd_arch_unknown
#define ELF_MACHINE_CODE EM_NONE
+#define ELF_MAXPAGESIZE 0x1
#define bfd_elf64_bfd_reloc_type_lookup bfd_default_reloc_type_lookup
-#define elf_info_to_howto _bfd_elf_no_info_to_howto
+#define elf_info_to_howto elf_generic_info_to_howto
+#define elf_info_to_howto_rel elf_generic_info_to_howto_rel
#include "elf64-target.h"
diff --git a/contrib/binutils/bfd/elf64-mips.c b/contrib/binutils/bfd/elf64-mips.c
index c513dea34846..6fc0dcdf0e4b 100644
--- a/contrib/binutils/bfd/elf64-mips.c
+++ b/contrib/binutils/bfd/elf64-mips.c
@@ -1,6 +1,8 @@
/* MIPS-specific support for 64-bit ELF
- Copyright 1996, 1997 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
Ian Lance Taylor, Cygnus Support
+ Linker support added by Mark Mitchell, CodeSourcery, LLC.
+ <mark@codesourcery.com>
This file is part of BFD, the Binary File Descriptor library.
@@ -52,14 +54,20 @@ static void mips_elf64_swap_reloc_in
static void mips_elf64_swap_reloca_in
PARAMS ((bfd *, const Elf64_Mips_External_Rela *,
Elf64_Mips_Internal_Rela *));
-#if 0
static void mips_elf64_swap_reloc_out
PARAMS ((bfd *, const Elf64_Mips_Internal_Rel *,
Elf64_Mips_External_Rel *));
-#endif
static void mips_elf64_swap_reloca_out
PARAMS ((bfd *, const Elf64_Mips_Internal_Rela *,
Elf64_Mips_External_Rela *));
+static void mips_elf64_be_swap_reloc_in
+ PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rel *));
+static void mips_elf64_be_swap_reloc_out
+ PARAMS ((bfd *, const Elf_Internal_Rel *, bfd_byte *));
+static void mips_elf64_be_swap_reloca_in
+ PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
+static void mips_elf64_be_swap_reloca_out
+ PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
static reloc_howto_type *mips_elf64_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type));
static long mips_elf64_get_reloc_upper_bound PARAMS ((bfd *, asection *));
@@ -68,63 +76,17 @@ static boolean mips_elf64_slurp_one_reloc_table
static boolean mips_elf64_slurp_reloc_table
PARAMS ((bfd *, asection *, asymbol **, boolean));
static void mips_elf64_write_relocs PARAMS ((bfd *, asection *, PTR));
-static boolean mips_elf64_section_from_shdr
- PARAMS ((bfd *, Elf_Internal_Shdr *, char *));
-static boolean mips_elf64_section_processing
- PARAMS ((bfd *, Elf_Internal_Shdr *));
static boolean mips_elf64_slurp_armap PARAMS ((bfd *));
static boolean mips_elf64_write_armap
PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int));
-/* The relocation types. */
-
-enum mips_elf64_reloc_type
-{
- R_MIPS_NONE = 0,
- R_MIPS_16 = 1,
- R_MIPS_32 = 2,
- R_MIPS_ADD = 2,
- R_MIPS_REL32 = 3,
- R_MIPS_REL = 3,
- R_MIPS_26 = 4,
- R_MIPS_HI16 = 5,
- R_MIPS_LO16 = 6,
- R_MIPS_GPREL16 = 7,
- R_MIPS_GPREL = 7,
- R_MIPS_LITERAL = 8,
- R_MIPS_GOT16 = 9,
- R_MIPS_GOT = 9,
- R_MIPS_PC16 = 10,
- R_MIPS_CALL16 = 11,
- R_MIPS_CALL = 11,
- R_MIPS_GPREL32 = 12,
- R_MIPS_SHIFT5 = 16,
- R_MIPS_SHIFT6 = 17,
- R_MIPS_64 = 18,
- R_MIPS_GOT_DISP = 19,
- R_MIPS_GOT_PAGE = 20,
- R_MIPS_GOT_OFST = 21,
- R_MIPS_GOT_HI16 = 22,
- R_MIPS_GOT_LO16 = 23,
- R_MIPS_SUB = 24,
- R_MIPS_INSERT_A = 25,
- R_MIPS_INSERT_B = 26,
- R_MIPS_DELETE = 27,
- R_MIPS_HIGHER = 28,
- R_MIPS_HIGHEST = 29,
- R_MIPS_CALL_HI16 = 30,
- R_MIPS_CALL_LO16 = 31,
- R_MIPS_SCN_DISP = 32,
- R_MIPS_REL16 = 33,
- R_MIPS_ADD_IMMEDIATE = 34,
- R_MIPS_PJUMP = 35,
- R_MIPS_RELGOT = 36
-};
-
/* In case we're on a 32-bit machine, construct a 64-bit "-1" value
from smaller values. Start with zero, widen, *then* decrement. */
#define MINUS_ONE (((bfd_vma)0) - 1)
+/* The number of local .got entries we reserve. */
+#define MIPS_RESERVED_GOTNO (2)
+
/* The relocation table used for SHT_REL sections. */
static reloc_howto_type mips_elf64_howto_table_rel[] =
@@ -659,7 +621,23 @@ static reloc_howto_type mips_elf64_howto_table_rel[] =
false, /* partial_inplace */
0, /* src_mask */
0, /* dst_mask */
- false) /* pcrel_offset */
+ false), /* pcrel_offset */
+
+ /* Protected jump conversion. This is an optimization hint. No
+ relocation is required for correctness. */
+ HOWTO (R_MIPS_JALR, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_MIPS_JALR", /* name */
+ false, /* partial_inplace */
+ 0x00000000, /* src_mask */
+ 0x00000000, /* dst_mask */
+ false), /* pcrel_offset */
};
/* The relocation table used for SHT_RELA sections. */
@@ -1197,7 +1175,23 @@ static reloc_howto_type mips_elf64_howto_table_rela[] =
false, /* partial_inplace */
0, /* src_mask */
0, /* dst_mask */
- false) /* pcrel_offset */
+ false), /* pcrel_offset */
+
+ /* Protected jump conversion. This is an optimization hint. No
+ relocation is required for correctness. */
+ HOWTO (R_MIPS_JALR, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_MIPS_JALR", /* name */
+ false, /* partial_inplace */
+ 0x00000000, /* src_mask */
+ 0x00000000, /* dst_mask */
+ false), /* pcrel_offset */
};
/* Swap in a MIPS 64-bit Rel reloc. */
@@ -1233,10 +1227,6 @@ mips_elf64_swap_reloca_in (abfd, src, dst)
dst->r_addend = bfd_h_get_signed_64 (abfd, (bfd_byte *) src->r_addend);
}
-#if 0
-
-/* This is not currently used. */
-
/* Swap out a MIPS 64-bit Rel reloc. */
static void
@@ -1253,8 +1243,6 @@ mips_elf64_swap_reloc_out (abfd, src, dst)
bfd_h_put_8 (abfd, src->r_type, (bfd_byte *) dst->r_type);
}
-#endif /* 0 */
-
/* Swap out a MIPS 64-bit Rela reloc. */
static void
@@ -1272,12 +1260,102 @@ mips_elf64_swap_reloca_out (abfd, src, dst)
bfd_h_put_64 (abfd, src->r_addend, (bfd_byte *) dst->r_addend);
}
+/* Swap in a MIPS 64-bit Rel reloc. */
+
+static void
+mips_elf64_be_swap_reloc_in (abfd, src, dst)
+ bfd *abfd;
+ const bfd_byte *src;
+ Elf_Internal_Rel *dst;
+{
+ Elf64_Mips_Internal_Rel mirel;
+
+ mips_elf64_swap_reloc_in (abfd,
+ (const Elf64_Mips_External_Rel *) src,
+ &mirel);
+
+ dst[0].r_offset = mirel.r_offset;
+ dst[0].r_info = ELF32_R_INFO (mirel.r_sym, mirel.r_type);
+ dst[1].r_offset = mirel.r_offset;
+ dst[1].r_info = ELF32_R_INFO (mirel.r_ssym, mirel.r_type2);
+ dst[2].r_offset = mirel.r_offset;
+ dst[2].r_info = ELF32_R_INFO (STN_UNDEF, mirel.r_type3);
+}
+
+/* Swap in a MIPS 64-bit Rela reloc. */
+
+static void
+mips_elf64_be_swap_reloca_in (abfd, src, dst)
+ bfd *abfd;
+ const bfd_byte *src;
+ Elf_Internal_Rela *dst;
+{
+ Elf64_Mips_Internal_Rela mirela;
+
+ mips_elf64_swap_reloca_in (abfd,
+ (const Elf64_Mips_External_Rela *) src,
+ &mirela);
+
+ dst[0].r_offset = mirela.r_offset;
+ dst[0].r_info = ELF32_R_INFO (mirela.r_sym, mirela.r_type);
+ dst[0].r_addend = mirela.r_addend;
+ dst[1].r_offset = mirela.r_offset;
+ dst[1].r_info = ELF32_R_INFO (mirela.r_ssym, mirela.r_type2);
+ dst[1].r_addend = 0;
+ dst[2].r_offset = mirela.r_offset;
+ dst[2].r_info = ELF32_R_INFO (STN_UNDEF, mirela.r_type3);
+ dst[2].r_addend = 0;
+}
+
+/* Swap out a MIPS 64-bit Rel reloc. */
+
+static void
+mips_elf64_be_swap_reloc_out (abfd, src, dst)
+ bfd *abfd;
+ const Elf_Internal_Rel *src;
+ bfd_byte *dst;
+{
+ Elf64_Mips_Internal_Rel mirel;
+
+ mirel.r_offset = src->r_offset;
+ mirel.r_type = ELF32_R_TYPE (src->r_info);
+ mirel.r_sym = ELF32_R_SYM (src->r_info);
+ mirel.r_type2 = R_MIPS_NONE;
+ mirel.r_ssym = STN_UNDEF;
+ mirel.r_type3 = R_MIPS_NONE;
+
+ mips_elf64_swap_reloc_out (abfd, &mirel,
+ (Elf64_Mips_External_Rel *) dst);
+}
+
+/* Swap out a MIPS 64-bit Rela reloc. */
+
+static void
+mips_elf64_be_swap_reloca_out (abfd, src, dst)
+ bfd *abfd;
+ const Elf_Internal_Rela *src;
+ bfd_byte *dst;
+{
+ Elf64_Mips_Internal_Rela mirela;
+
+ mirela.r_offset = src->r_offset;
+ mirela.r_type = ELF32_R_TYPE (src->r_info);
+ mirela.r_addend = src->r_addend;
+ mirela.r_sym = ELF32_R_SYM (src->r_info);
+ mirela.r_type2 = R_MIPS_NONE;
+ mirela.r_ssym = STN_UNDEF;
+ mirela.r_type3 = R_MIPS_NONE;
+
+ mips_elf64_swap_reloca_out (abfd, &mirela,
+ (Elf64_Mips_External_Rela *) dst);
+}
+
/* A mapping from BFD reloc types to MIPS ELF reloc types. */
struct elf_reloc_map
{
bfd_reloc_code_real_type bfd_reloc_val;
- enum mips_elf64_reloc_type elf_reloc_val;
+ enum elf_mips_reloc_type elf_reloc_val;
};
static CONST struct elf_reloc_map mips_reloc_map[] =
@@ -1300,7 +1378,11 @@ static CONST struct elf_reloc_map mips_reloc_map[] =
{ BFD_RELOC_MIPS_GOT_HI16, R_MIPS_GOT_HI16 },
{ BFD_RELOC_MIPS_GOT_LO16, R_MIPS_GOT_LO16 },
{ BFD_RELOC_MIPS_CALL_HI16, R_MIPS_CALL_HI16 },
- { BFD_RELOC_MIPS_CALL_LO16, R_MIPS_CALL_LO16 }
+ { BFD_RELOC_MIPS_CALL_LO16, R_MIPS_CALL_LO16 },
+ { BFD_RELOC_MIPS_SUB, R_MIPS_SUB },
+ { BFD_RELOC_MIPS_GOT_PAGE, R_MIPS_GOT_PAGE },
+ { BFD_RELOC_MIPS_GOT_OFST, R_MIPS_GOT_OFST },
+ { BFD_RELOC_MIPS_GOT_DISP, R_MIPS_GOT_DISP }
};
/* Given a BFD reloc type, return a howto structure. */
@@ -1411,20 +1493,20 @@ mips_elf64_slurp_one_reloc_table (abfd, asect, symbols, rel_hdr)
used_ssym = false;
for (ir = 0; ir < 3; ir++)
{
- enum mips_elf64_reloc_type type;
+ enum elf_mips_reloc_type type;
switch (ir)
{
default:
abort ();
case 0:
- type = (enum mips_elf64_reloc_type) rela.r_type;
+ type = (enum elf_mips_reloc_type) rela.r_type;
break;
case 1:
- type = (enum mips_elf64_reloc_type) rela.r_type2;
+ type = (enum elf_mips_reloc_type) rela.r_type2;
break;
case 2:
- type = (enum mips_elf64_reloc_type) rela.r_type3;
+ type = (enum elf_mips_reloc_type) rela.r_type3;
break;
}
@@ -1733,115 +1815,6 @@ mips_elf64_write_relocs (abfd, sec, data)
== count);
}
-/* Handle a 64-bit MIPS ELF specific section. */
-
-static boolean
-mips_elf64_section_from_shdr (abfd, hdr, name)
- bfd *abfd;
- Elf_Internal_Shdr *hdr;
- char *name;
-{
- if (! _bfd_mips_elf_section_from_shdr (abfd, hdr, name))
- return false;
-
- /* For a SHT_MIPS_OPTIONS section, look for a ODK_REGINFO entry, and
- set the gp value based on what we find. We may see both
- SHT_MIPS_REGINFO and SHT_MIPS_OPTIONS/ODK_REGINFO; in that case,
- they should agree. */
- if (hdr->sh_type == SHT_MIPS_OPTIONS)
- {
- bfd_byte *contents, *l, *lend;
-
- contents = (bfd_byte *) bfd_malloc (hdr->sh_size);
- if (contents == NULL)
- return false;
- if (! bfd_get_section_contents (abfd, hdr->bfd_section, contents,
- (file_ptr) 0, hdr->sh_size))
- {
- free (contents);
- return false;
- }
- l = contents;
- lend = contents + hdr->sh_size;
- while (l + sizeof (Elf_External_Options) <= lend)
- {
- Elf_Internal_Options intopt;
-
- bfd_mips_elf_swap_options_in (abfd, (Elf_External_Options *) l,
- &intopt);
- if (intopt.kind == ODK_REGINFO)
- {
- Elf64_Internal_RegInfo intreg;
-
- bfd_mips_elf64_swap_reginfo_in
- (abfd,
- ((Elf64_External_RegInfo *)
- (l + sizeof (Elf_External_Options))),
- &intreg);
- elf_gp (abfd) = intreg.ri_gp_value;
- }
- l += intopt.size;
- }
- free (contents);
- }
-
- return true;
-}
-
-/* Work over a section just before writing it out. We update the GP
- value in the SHT_MIPS_OPTIONS section based on the value we are
- using. */
-
-static boolean
-mips_elf64_section_processing (abfd, hdr)
- bfd *abfd;
- Elf_Internal_Shdr *hdr;
-{
- if (hdr->sh_type == SHT_MIPS_OPTIONS
- && hdr->bfd_section != NULL
- && elf_section_data (hdr->bfd_section) != NULL
- && elf_section_data (hdr->bfd_section)->tdata != NULL)
- {
- bfd_byte *contents, *l, *lend;
-
- /* We stored the section contents in the elf_section_data tdata
- field in the set_section_contents routine. We save the
- section contents so that we don't have to read them again.
- At this point we know that elf_gp is set, so we can look
- through the section contents to see if there is an
- ODK_REGINFO structure. */
-
- contents = (bfd_byte *) elf_section_data (hdr->bfd_section)->tdata;
- l = contents;
- lend = contents + hdr->sh_size;
- while (l + sizeof (Elf_External_Options) <= lend)
- {
- Elf_Internal_Options intopt;
-
- bfd_mips_elf_swap_options_in (abfd, (Elf_External_Options *) l,
- &intopt);
- if (intopt.kind == ODK_REGINFO)
- {
- bfd_byte buf[8];
-
- if (bfd_seek (abfd,
- (hdr->sh_offset
- + (l - contents)
- + sizeof (Elf_External_Options)
- + (sizeof (Elf64_External_RegInfo) - 8)),
- SEEK_SET) == -1)
- return false;
- bfd_h_put_64 (abfd, elf_gp (abfd), buf);
- if (bfd_write (buf, 1, 8, abfd) != 8)
- return false;
- }
- l += intopt.size;
- }
- }
-
- return _bfd_mips_elf_section_processing (abfd, hdr);
-}
-
/* Irix 6 defines a brand new archive map format, so that they can
have archives more than 4 GB in size. */
@@ -2108,6 +2081,8 @@ const struct elf_size_info mips_elf64_size_info =
sizeof (Elf64_External_Sym),
sizeof (Elf64_External_Dyn),
sizeof (Elf_External_Note),
+ 4, /* hash-table entry size */
+ 3, /* internal relocations per external relocations */
64, /* arch_size */
8, /* file_align */
ELFCLASS64,
@@ -2118,7 +2093,12 @@ const struct elf_size_info mips_elf64_size_info =
bfd_elf64_swap_symbol_out,
mips_elf64_slurp_reloc_table,
bfd_elf64_slurp_symbol_table,
- bfd_elf64_swap_dyn_in
+ bfd_elf64_swap_dyn_in,
+ bfd_elf64_swap_dyn_out,
+ mips_elf64_be_swap_reloc_in,
+ mips_elf64_be_swap_reloc_out,
+ mips_elf64_be_swap_reloca_in,
+ mips_elf64_be_swap_reloca_out
};
#define TARGET_LITTLE_SYM bfd_elf64_littlemips_vec
@@ -2127,29 +2107,67 @@ const struct elf_size_info mips_elf64_size_info =
#define TARGET_BIG_NAME "elf64-bigmips"
#define ELF_ARCH bfd_arch_mips
#define ELF_MACHINE_CODE EM_MIPS
+
#define ELF_MAXPAGESIZE 0x1000
+
+#define elf_backend_collect true
+#define elf_backend_type_change_ok true
+#define elf_backend_can_gc_sections true
#define elf_backend_size_info mips_elf64_size_info
#define elf_backend_object_p _bfd_mips_elf_object_p
-#define elf_backend_section_from_shdr mips_elf64_section_from_shdr
+#define elf_backend_section_from_shdr _bfd_mips_elf_section_from_shdr
#define elf_backend_fake_sections _bfd_mips_elf_fake_sections
#define elf_backend_section_from_bfd_section \
_bfd_mips_elf_section_from_bfd_section
-#define elf_backend_section_processing mips_elf64_section_processing
+#define elf_backend_section_processing _bfd_mips_elf_section_processing
#define elf_backend_symbol_processing _bfd_mips_elf_symbol_processing
+#define elf_backend_additional_program_headers \
+ _bfd_mips_elf_additional_program_headers
+#define elf_backend_modify_segment_map _bfd_mips_elf_modify_segment_map
#define elf_backend_final_write_processing \
_bfd_mips_elf_final_write_processing
#define elf_backend_ecoff_debug_swap &mips_elf64_ecoff_debug_swap
-
+#define elf_backend_add_symbol_hook _bfd_mips_elf_add_symbol_hook
+#define elf_backend_create_dynamic_sections \
+ _bfd_mips_elf_create_dynamic_sections
+#define elf_backend_check_relocs _bfd_mips_elf_check_relocs
+#define elf_backend_adjust_dynamic_symbol \
+ _bfd_mips_elf_adjust_dynamic_symbol
+#define elf_backend_always_size_sections \
+ _bfd_mips_elf_always_size_sections
+#define elf_backend_size_dynamic_sections \
+ _bfd_mips_elf_size_dynamic_sections
+#define elf_backend_relocate_section _bfd_mips_elf_relocate_section
+#define elf_backend_link_output_symbol_hook \
+ _bfd_mips_elf_link_output_symbol_hook
+#define elf_backend_finish_dynamic_symbol \
+ _bfd_mips_elf_finish_dynamic_symbol
+#define elf_backend_finish_dynamic_sections \
+ _bfd_mips_elf_finish_dynamic_sections
+#define elf_backend_gc_mark_hook _bfd_mips_elf_gc_mark_hook
+#define elf_backend_gc_sweep_hook _bfd_mips_elf_gc_sweep_hook
+#define elf_backend_got_header_size (4*MIPS_RESERVED_GOTNO)
+#define elf_backend_plt_header_size 0
+#define elf_backend_may_use_rel_p 1
+
+/* We don't set bfd_elf64_bfd_is_local_label_name because the 32-bit
+ MIPS-specific function only applies to IRIX5, which had no 64-bit
+ ABI. */
#define bfd_elf64_find_nearest_line _bfd_mips_elf_find_nearest_line
-#define bfd_elf64_get_reloc_upper_bound mips_elf64_get_reloc_upper_bound
-#define bfd_elf64_bfd_reloc_type_lookup mips_elf64_reloc_type_lookup
#define bfd_elf64_set_section_contents _bfd_mips_elf_set_section_contents
+#define bfd_elf64_bfd_link_hash_table_create \
+ _bfd_mips_elf_link_hash_table_create
+#define bfd_elf64_bfd_final_link _bfd_mips_elf_final_link
#define bfd_elf64_bfd_copy_private_bfd_data \
_bfd_mips_elf_copy_private_bfd_data
#define bfd_elf64_bfd_merge_private_bfd_data \
_bfd_mips_elf_merge_private_bfd_data
#define bfd_elf64_bfd_set_private_flags _bfd_mips_elf_set_private_flags
+#define bfd_elf64_bfd_print_private_bfd_data \
+ _bfd_mips_elf_print_private_bfd_data
+#define bfd_elf64_get_reloc_upper_bound mips_elf64_get_reloc_upper_bound
+#define bfd_elf64_bfd_reloc_type_lookup mips_elf64_reloc_type_lookup
#define bfd_elf64_archive_functions
#define bfd_elf64_archive_slurp_armap mips_elf64_slurp_armap
#define bfd_elf64_archive_slurp_extended_name_table \
diff --git a/contrib/binutils/bfd/elf64-sparc.c b/contrib/binutils/bfd/elf64-sparc.c
index 85dabaa06b1e..46e777552f2a 100644
--- a/contrib/binutils/bfd/elf64-sparc.c
+++ b/contrib/binutils/bfd/elf64-sparc.c
@@ -1,5 +1,6 @@
/* SPARC-specific support for 64-bit ELF
- Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1993, 95, 96, 97, 98, 99, 2000
+ Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -32,6 +33,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* In case we're on a 32-bit machine, construct a 64-bit "-1" value. */
#define MINUS_ONE (~ (bfd_vma) 0)
+static struct bfd_link_hash_table * sparc64_elf_bfd_link_hash_table_create
+ PARAMS((bfd *));
static reloc_howto_type *sparc64_elf_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type));
static void sparc64_elf_info_to_howto
@@ -51,8 +54,13 @@ static boolean sparc64_elf_adjust_dynamic_symbol
PARAMS((struct bfd_link_info *, struct elf_link_hash_entry *));
static boolean sparc64_elf_size_dynamic_sections
PARAMS((bfd *, struct bfd_link_info *));
-static boolean sparc64_elf_adjust_dynindx
- PARAMS((struct elf_link_hash_entry *, PTR));
+static int sparc64_elf_get_symbol_type
+ PARAMS (( Elf_Internal_Sym *, int));
+static boolean sparc64_elf_add_symbol_hook
+ PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
+ const char **, flagword *, asection **, bfd_vma *));
+static void sparc64_elf_symbol_processing
+ PARAMS ((bfd *, asymbol *));
static boolean sparc64_elf_merge_private_bfd_data
PARAMS ((bfd *, bfd *));
@@ -61,6 +69,15 @@ static boolean sparc64_elf_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
static boolean sparc64_elf_object_p PARAMS ((bfd *));
+static long sparc64_elf_get_reloc_upper_bound PARAMS ((bfd *, asection *));
+static long sparc64_elf_get_dynamic_reloc_upper_bound PARAMS ((bfd *));
+static boolean sparc64_elf_slurp_one_reloc_table
+ PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, asymbol **, boolean));
+static boolean sparc64_elf_slurp_reloc_table
+ PARAMS ((bfd *, asection *, asymbol **, boolean));
+static long sparc64_elf_canonicalize_dynamic_reloc
+ PARAMS ((bfd *, arelent **, asymbol **));
+static void sparc64_elf_write_relocs PARAMS ((bfd *, asection *, PTR));
/* The relocation "howto" table. */
@@ -137,7 +154,7 @@ static reloc_howto_type sparc64_elf_howto_table[] =
};
struct elf_reloc_map {
- unsigned char bfd_reloc_val;
+ bfd_reloc_code_real_type bfd_reloc_val;
unsigned char elf_reloc_val;
};
@@ -213,10 +230,428 @@ sparc64_elf_info_to_howto (abfd, cache_ptr, dst)
arelent *cache_ptr;
Elf64_Internal_Rela *dst;
{
- BFD_ASSERT (ELF64_R_TYPE (dst->r_info) < (unsigned int) R_SPARC_max);
- cache_ptr->howto = &sparc64_elf_howto_table[ELF64_R_TYPE (dst->r_info)];
+ BFD_ASSERT (ELF64_R_TYPE_ID (dst->r_info) < (unsigned int) R_SPARC_max_std);
+ cache_ptr->howto = &sparc64_elf_howto_table[ELF64_R_TYPE_ID (dst->r_info)];
}
+/* Due to the way how we handle R_SPARC_OLO10, each entry in a SHT_RELA
+ section can represent up to two relocs, we must tell the user to allocate
+ more space. */
+
+static long
+sparc64_elf_get_reloc_upper_bound (abfd, sec)
+ bfd *abfd;
+ asection *sec;
+{
+ return (sec->reloc_count * 2 + 1) * sizeof (arelent *);
+}
+
+static long
+sparc64_elf_get_dynamic_reloc_upper_bound (abfd)
+ bfd *abfd;
+{
+ return _bfd_elf_get_dynamic_reloc_upper_bound (abfd) * 2;
+}
+
+/* Read relocations for ASECT from REL_HDR. There are RELOC_COUNT of
+ them. We cannot use generic elf routines for this, because R_SPARC_OLO10
+ has secondary addend in ELF64_R_TYPE_DATA. We handle it as two relocations
+ for the same location, R_SPARC_LO10 and R_SPARC_13. */
+
+static boolean
+sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr, symbols, dynamic)
+ bfd *abfd;
+ asection *asect;
+ Elf_Internal_Shdr *rel_hdr;
+ asymbol **symbols;
+ boolean dynamic;
+{
+ struct elf_backend_data * const ebd = get_elf_backend_data (abfd);
+ PTR allocated = NULL;
+ bfd_byte *native_relocs;
+ arelent *relent;
+ unsigned int i;
+ int entsize;
+ bfd_size_type count;
+ arelent *relents;
+
+ allocated = (PTR) bfd_malloc ((size_t) rel_hdr->sh_size);
+ if (allocated == NULL)
+ goto error_return;
+
+ if (bfd_seek (abfd, rel_hdr->sh_offset, SEEK_SET) != 0
+ || (bfd_read (allocated, 1, rel_hdr->sh_size, abfd)
+ != rel_hdr->sh_size))
+ goto error_return;
+
+ native_relocs = (bfd_byte *) allocated;
+
+ relents = asect->relocation + asect->reloc_count;
+
+ entsize = rel_hdr->sh_entsize;
+ BFD_ASSERT (entsize == sizeof (Elf64_External_Rela));
+
+ count = rel_hdr->sh_size / entsize;
+
+ for (i = 0, relent = relents; i < count;
+ i++, relent++, native_relocs += entsize)
+ {
+ Elf_Internal_Rela rela;
+
+ bfd_elf64_swap_reloca_in (abfd, (Elf64_External_Rela *) native_relocs, &rela);
+
+ /* The address of an ELF reloc is section relative for an object
+ file, and absolute for an executable file or shared library.
+ The address of a normal BFD reloc is always section relative,
+ and the address of a dynamic reloc is absolute.. */
+ if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0 || dynamic)
+ relent->address = rela.r_offset;
+ else
+ relent->address = rela.r_offset - asect->vma;
+
+ if (ELF64_R_SYM (rela.r_info) == 0)
+ relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
+ else
+ {
+ asymbol **ps, *s;
+
+ ps = symbols + ELF64_R_SYM (rela.r_info) - 1;
+ s = *ps;
+
+ /* Canonicalize ELF section symbols. FIXME: Why? */
+ if ((s->flags & BSF_SECTION_SYM) == 0)
+ relent->sym_ptr_ptr = ps;
+ else
+ relent->sym_ptr_ptr = s->section->symbol_ptr_ptr;
+ }
+
+ relent->addend = rela.r_addend;
+
+ BFD_ASSERT (ELF64_R_TYPE_ID (rela.r_info) < (unsigned int) R_SPARC_max_std);
+ if (ELF64_R_TYPE_ID (rela.r_info) == R_SPARC_OLO10)
+ {
+ relent->howto = &sparc64_elf_howto_table[R_SPARC_LO10];
+ relent[1].address = relent->address;
+ relent++;
+ relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
+ relent->addend = ELF64_R_TYPE_DATA (rela.r_info);
+ relent->howto = &sparc64_elf_howto_table[R_SPARC_13];
+ }
+ else
+ relent->howto = &sparc64_elf_howto_table[ELF64_R_TYPE_ID (rela.r_info)];
+ }
+
+ asect->reloc_count += relent - relents;
+
+ if (allocated != NULL)
+ free (allocated);
+
+ return true;
+
+ error_return:
+ if (allocated != NULL)
+ free (allocated);
+ return false;
+}
+
+/* Read in and swap the external relocs. */
+
+static boolean
+sparc64_elf_slurp_reloc_table (abfd, asect, symbols, dynamic)
+ bfd *abfd;
+ asection *asect;
+ asymbol **symbols;
+ boolean dynamic;
+{
+ struct bfd_elf_section_data * const d = elf_section_data (asect);
+ Elf_Internal_Shdr *rel_hdr;
+ Elf_Internal_Shdr *rel_hdr2;
+
+ if (asect->relocation != NULL)
+ return true;
+
+ if (! dynamic)
+ {
+ if ((asect->flags & SEC_RELOC) == 0
+ || asect->reloc_count == 0)
+ return true;
+
+ rel_hdr = &d->rel_hdr;
+ rel_hdr2 = d->rel_hdr2;
+
+ BFD_ASSERT (asect->rel_filepos == rel_hdr->sh_offset
+ || (rel_hdr2 && asect->rel_filepos == rel_hdr2->sh_offset));
+ }
+ else
+ {
+ /* Note that ASECT->RELOC_COUNT tends not to be accurate in this
+ case because relocations against this section may use the
+ dynamic symbol table, and in that case bfd_section_from_shdr
+ in elf.c does not update the RELOC_COUNT. */
+ if (asect->_raw_size == 0)
+ return true;
+
+ rel_hdr = &d->this_hdr;
+ asect->reloc_count = rel_hdr->sh_size / rel_hdr->sh_entsize;
+ rel_hdr2 = NULL;
+ }
+
+ asect->relocation = ((arelent *)
+ bfd_alloc (abfd,
+ asect->reloc_count * 2 * sizeof (arelent)));
+ if (asect->relocation == NULL)
+ return false;
+
+ /* The sparc64_elf_slurp_one_reloc_table routine increments reloc_count. */
+ asect->reloc_count = 0;
+
+ if (!sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr, symbols,
+ dynamic))
+ return false;
+
+ if (rel_hdr2
+ && !sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr2, symbols,
+ dynamic))
+ return false;
+
+ return true;
+}
+
+/* Canonicalize the dynamic relocation entries. Note that we return
+ the dynamic relocations as a single block, although they are
+ actually associated with particular sections; the interface, which
+ was designed for SunOS style shared libraries, expects that there
+ is only one set of dynamic relocs. Any section that was actually
+ installed in the BFD, and has type SHT_REL or SHT_RELA, and uses
+ the dynamic symbol table, is considered to be a dynamic reloc
+ section. */
+
+static long
+sparc64_elf_canonicalize_dynamic_reloc (abfd, storage, syms)
+ bfd *abfd;
+ arelent **storage;
+ asymbol **syms;
+{
+ asection *s;
+ long ret;
+
+ if (elf_dynsymtab (abfd) == 0)
+ {
+ bfd_set_error (bfd_error_invalid_operation);
+ return -1;
+ }
+
+ ret = 0;
+ for (s = abfd->sections; s != NULL; s = s->next)
+ {
+ if (elf_section_data (s)->this_hdr.sh_link == elf_dynsymtab (abfd)
+ && (elf_section_data (s)->this_hdr.sh_type == SHT_RELA))
+ {
+ arelent *p;
+ long count, i;
+
+ if (! sparc64_elf_slurp_reloc_table (abfd, s, syms, true))
+ return -1;
+ count = s->reloc_count;
+ p = s->relocation;
+ for (i = 0; i < count; i++)
+ *storage++ = p++;
+ ret += count;
+ }
+ }
+
+ *storage = NULL;
+
+ return ret;
+}
+
+/* Write out the relocs. */
+
+static void
+sparc64_elf_write_relocs (abfd, sec, data)
+ bfd *abfd;
+ asection *sec;
+ PTR data;
+{
+ boolean *failedp = (boolean *) data;
+ Elf_Internal_Shdr *rela_hdr;
+ Elf64_External_Rela *outbound_relocas, *src_rela;
+ unsigned int idx, count;
+ asymbol *last_sym = 0;
+ int last_sym_idx = 0;
+
+ /* If we have already failed, don't do anything. */
+ if (*failedp)
+ return;
+
+ if ((sec->flags & SEC_RELOC) == 0)
+ return;
+
+ /* The linker backend writes the relocs out itself, and sets the
+ reloc_count field to zero to inhibit writing them here. Also,
+ sometimes the SEC_RELOC flag gets set even when there aren't any
+ relocs. */
+ if (sec->reloc_count == 0)
+ return;
+
+ /* We can combine two relocs that refer to the same address
+ into R_SPARC_OLO10 if first one is R_SPARC_LO10 and the
+ latter is R_SPARC_13 with no associated symbol. */
+ count = 0;
+ for (idx = 0; idx < sec->reloc_count; idx++)
+ {
+ bfd_vma addr;
+ unsigned int i;
+
+ ++count;
+
+ addr = sec->orelocation[idx]->address;
+ if (sec->orelocation[idx]->howto->type == R_SPARC_LO10
+ && idx < sec->reloc_count - 1)
+ {
+ arelent *r = sec->orelocation[idx + 1];
+
+ if (r->howto->type == R_SPARC_13
+ && r->address == addr
+ && bfd_is_abs_section ((*r->sym_ptr_ptr)->section)
+ && (*r->sym_ptr_ptr)->value == 0)
+ ++idx;
+ }
+ }
+
+ rela_hdr = &elf_section_data (sec)->rel_hdr;
+
+ rela_hdr->sh_size = rela_hdr->sh_entsize * count;
+ rela_hdr->contents = (PTR) bfd_alloc (abfd, rela_hdr->sh_size);
+ if (rela_hdr->contents == NULL)
+ {
+ *failedp = true;
+ return;
+ }
+
+ /* Figure out whether the relocations are RELA or REL relocations. */
+ if (rela_hdr->sh_type != SHT_RELA)
+ abort ();
+
+ /* orelocation has the data, reloc_count has the count... */
+ outbound_relocas = (Elf64_External_Rela *) rela_hdr->contents;
+ src_rela = outbound_relocas;
+
+ for (idx = 0; idx < sec->reloc_count; idx++)
+ {
+ Elf_Internal_Rela dst_rela;
+ arelent *ptr;
+ asymbol *sym;
+ int n;
+
+ ptr = sec->orelocation[idx];
+
+ /* The address of an ELF reloc is section relative for an object
+ file, and absolute for an executable file or shared library.
+ The address of a BFD reloc is always section relative. */
+ if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0)
+ dst_rela.r_offset = ptr->address;
+ else
+ dst_rela.r_offset = ptr->address + sec->vma;
+
+ sym = *ptr->sym_ptr_ptr;
+ if (sym == last_sym)
+ n = last_sym_idx;
+ else if (bfd_is_abs_section (sym->section) && sym->value == 0)
+ n = STN_UNDEF;
+ else
+ {
+ last_sym = sym;
+ n = _bfd_elf_symbol_from_bfd_symbol (abfd, &sym);
+ if (n < 0)
+ {
+ *failedp = true;
+ return;
+ }
+ last_sym_idx = n;
+ }
+
+ if ((*ptr->sym_ptr_ptr)->the_bfd != NULL
+ && (*ptr->sym_ptr_ptr)->the_bfd->xvec != abfd->xvec
+ && ! _bfd_elf_validate_reloc (abfd, ptr))
+ {
+ *failedp = true;
+ return;
+ }
+
+ if (ptr->howto->type == R_SPARC_LO10
+ && idx < sec->reloc_count - 1)
+ {
+ arelent *r = sec->orelocation[idx + 1];
+
+ if (r->howto->type == R_SPARC_13
+ && r->address == ptr->address
+ && bfd_is_abs_section ((*r->sym_ptr_ptr)->section)
+ && (*r->sym_ptr_ptr)->value == 0)
+ {
+ idx++;
+ dst_rela.r_info
+ = ELF64_R_INFO (n, ELF64_R_TYPE_INFO (r->addend,
+ R_SPARC_OLO10));
+ }
+ else
+ dst_rela.r_info = ELF64_R_INFO (n, R_SPARC_LO10);
+ }
+ else
+ dst_rela.r_info = ELF64_R_INFO (n, ptr->howto->type);
+
+ dst_rela.r_addend = ptr->addend;
+ bfd_elf64_swap_reloca_out (abfd, &dst_rela, src_rela);
+ ++src_rela;
+ }
+}
+
+/* Sparc64 ELF linker hash table. */
+
+struct sparc64_elf_app_reg
+{
+ unsigned char bind;
+ unsigned short shndx;
+ bfd *abfd;
+ char *name;
+};
+
+struct sparc64_elf_link_hash_table
+{
+ struct elf_link_hash_table root;
+
+ struct sparc64_elf_app_reg app_regs [4];
+};
+
+/* Get the Sparc64 ELF linker hash table from a link_info structure. */
+
+#define sparc64_elf_hash_table(p) \
+ ((struct sparc64_elf_link_hash_table *) ((p)->hash))
+
+/* Create a Sparc64 ELF linker hash table. */
+
+static struct bfd_link_hash_table *
+sparc64_elf_bfd_link_hash_table_create (abfd)
+ bfd *abfd;
+{
+ struct sparc64_elf_link_hash_table *ret;
+
+ ret = ((struct sparc64_elf_link_hash_table *)
+ bfd_zalloc (abfd, sizeof (struct sparc64_elf_link_hash_table)));
+ if (ret == (struct sparc64_elf_link_hash_table *) NULL)
+ return NULL;
+
+ if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
+ _bfd_elf_link_hash_newfunc))
+ {
+ bfd_release (abfd, ret);
+ return NULL;
+ }
+
+ return &ret->root.root;
+}
+
+
/* Utility for performing the standard initial work of an instruction
relocation.
*PRELOCATION will contain the relocated item.
@@ -441,8 +876,8 @@ sparc64_elf_build_plt (output_bfd, contents, nentries)
/* sethi (. - plt0), %g1 */
sethi = 0x03000000 | (i * PLT_ENTRY_SIZE);
- /* ba,a,pt %icc, plt1 */
- ba = 0x30480000 | (((contents+PLT_ENTRY_SIZE) - (entry+4)) / 4 & 0x7ffff);
+ /* ba,a,pt %xcc, plt1 */
+ ba = 0x30680000 | (((contents+PLT_ENTRY_SIZE) - (entry+4)) / 4 & 0x7ffff);
bfd_put_32 (output_bfd, sethi, entry);
bfd_put_32 (output_bfd, ba, entry+4);
@@ -479,7 +914,7 @@ sparc64_elf_build_plt (output_bfd, contents, nentries)
bfd_put_32 (output_bfd, 0x83c3c001, entry+16); /* jmpl %o7+%g1,%g1 */
bfd_put_32 (output_bfd, 0x9e100005, entry+20); /* mov %g5,%o7 */
- bfd_put_64 (output_bfd, contents - entry+4, ptr);
+ bfd_put_64 (output_bfd, contents - (entry+4), ptr);
}
}
}
@@ -514,11 +949,15 @@ sparc64_elf_plt_ptr_offset (index, max)
/* See above for details. */
- block = (index - LARGE_PLT_THRESHOLD) / 160;
- ofs = (index - LARGE_PLT_THRESHOLD) % 160;
- last = (max - LARGE_PLT_THRESHOLD) % 160;
+ block = (((index - LARGE_PLT_THRESHOLD) / 160) * 160)
+ + LARGE_PLT_THRESHOLD;
+ ofs = index - block;
+ if (block + 160 > max)
+ last = (max - LARGE_PLT_THRESHOLD) % 160;
+ else
+ last = 160;
- return ((LARGE_PLT_THRESHOLD + block*160) * PLT_ENTRY_SIZE
+ return (block * PLT_ENTRY_SIZE
+ last * 6*4
+ ofs * 8);
}
@@ -570,7 +1009,7 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs)
else
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- switch (ELF64_R_TYPE (rel->r_info))
+ switch (ELF64_R_TYPE_ID (rel->r_info))
{
case R_SPARC_GOT10:
case R_SPARC_GOT13:
@@ -612,12 +1051,12 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs)
if (h != NULL)
{
- if (h->got_offset != (bfd_vma) -1)
+ if (h->got.offset != (bfd_vma) -1)
{
/* We have already allocated space in the .got. */
break;
}
- h->got_offset = sgot->_raw_size;
+ h->got.offset = sgot->_raw_size;
/* Make sure this symbol is output as a dynamic symbol. */
if (h->dynindx == -1)
@@ -807,16 +1246,233 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs)
break;
default:
- (*_bfd_error_handler)("%s: check_relocs: unhandled reloc type %d",
+ (*_bfd_error_handler)(_("%s: check_relocs: unhandled reloc type %d"),
bfd_get_filename(abfd),
- ELF64_R_TYPE (rel->r_info));
+ ELF64_R_TYPE_ID (rel->r_info));
+ return false;
+ }
+ }
+
+ return true;
+}
+
+/* Hook called by the linker routine which adds symbols from an object
+ file. We use it for STT_REGISTER symbols. */
+
+static boolean
+sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
+ bfd *abfd;
+ struct bfd_link_info *info;
+ const Elf_Internal_Sym *sym;
+ const char **namep;
+ flagword *flagsp;
+ asection **secp;
+ bfd_vma *valp;
+{
+ static char *stt_types[] = { "NOTYPE", "OBJECT", "FUNCTION" };
+
+ if (ELF_ST_TYPE (sym->st_info) == STT_REGISTER)
+ {
+ int reg;
+ struct sparc64_elf_app_reg *p;
+
+ reg = (int)sym->st_value;
+ switch (reg & ~1)
+ {
+ case 2: reg -= 2; break;
+ case 6: reg -= 4; break;
+ default:
+ (*_bfd_error_handler)
+ (_("%s: Only registers %%g[2367] can be declared using STT_REGISTER"),
+ bfd_get_filename (abfd));
+ return false;
+ }
+
+ if (info->hash->creator != abfd->xvec
+ || (abfd->flags & DYNAMIC) != 0)
+ {
+ /* STT_REGISTER only works when linking an elf64_sparc object.
+ If STT_REGISTER comes from a dynamic object, don't put it into
+ the output bfd. The dynamic linker will recheck it. */
+ *namep = NULL;
+ return true;
+ }
+
+ p = sparc64_elf_hash_table(info)->app_regs + reg;
+
+ if (p->name != NULL && strcmp (p->name, *namep))
+ {
+ (*_bfd_error_handler)
+ (_("Register %%g%d used incompatibly: "
+ "previously declared in %s to %s, in %s redefined to %s"),
+ (int)sym->st_value,
+ bfd_get_filename (p->abfd), *p->name ? p->name : "#scratch",
+ bfd_get_filename (abfd), **namep ? *namep : "#scratch");
return false;
}
+
+ if (p->name == NULL)
+ {
+ if (**namep)
+ {
+ struct elf_link_hash_entry *h;
+
+ h = (struct elf_link_hash_entry *)
+ bfd_link_hash_lookup (info->hash, *namep, false, false, false);
+
+ if (h != NULL)
+ {
+ unsigned char type = h->type;
+
+ if (type > STT_FUNC) type = 0;
+ (*_bfd_error_handler)
+ (_("Symbol `%s' has differing types: "
+ "previously %s, REGISTER in %s"),
+ *namep, stt_types [type], bfd_get_filename (abfd));
+ return false;
+ }
+
+ p->name = bfd_hash_allocate (&info->hash->table,
+ strlen (*namep) + 1);
+ if (!p->name)
+ return false;
+
+ strcpy (p->name, *namep);
+ }
+ else
+ p->name = "";
+ p->bind = ELF_ST_BIND (sym->st_info);
+ p->abfd = abfd;
+ p->shndx = sym->st_shndx;
+ }
+ else
+ {
+ if (p->bind == STB_WEAK
+ && ELF_ST_BIND (sym->st_info) == STB_GLOBAL)
+ {
+ p->bind = STB_GLOBAL;
+ p->abfd = abfd;
+ }
+ }
+ *namep = NULL;
+ return true;
}
+ else if (! *namep || ! **namep)
+ return true;
+ else
+ {
+ int i;
+ struct sparc64_elf_app_reg *p;
+ p = sparc64_elf_hash_table(info)->app_regs;
+ for (i = 0; i < 4; i++, p++)
+ if (p->name != NULL && ! strcmp (p->name, *namep))
+ {
+ unsigned char type = ELF_ST_TYPE (sym->st_info);
+
+ if (type > STT_FUNC) type = 0;
+ (*_bfd_error_handler)
+ (_("Symbol `%s' has differing types: "
+ "REGISTER in %s, %s in %s"),
+ *namep, bfd_get_filename (p->abfd), stt_types [type],
+ bfd_get_filename (abfd));
+ return false;
+ }
+ }
return true;
}
+/* This function takes care of emiting STT_REGISTER symbols
+ which we cannot easily keep in the symbol hash table. */
+
+static boolean
+sparc64_elf_output_arch_syms (output_bfd, info, finfo, func)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+ PTR finfo;
+ boolean (*func) PARAMS ((PTR, const char *,
+ Elf_Internal_Sym *, asection *));
+{
+ int reg;
+ struct sparc64_elf_app_reg *app_regs =
+ sparc64_elf_hash_table(info)->app_regs;
+ Elf_Internal_Sym sym;
+
+ /* We arranged in size_dynamic_sections to put the STT_REGISTER entries
+ at the end of the dynlocal list, so they came at the end of the local
+ symbols in the symtab. Except that they aren't STB_LOCAL, so we need
+ to back up symtab->sh_info. */
+ if (elf_hash_table (info)->dynlocal)
+ {
+ bfd * dynobj = elf_hash_table (info)->dynobj;
+ asection *dynsymsec = bfd_get_section_by_name (dynobj, ".dynsym");
+ struct elf_link_local_dynamic_entry *e;
+
+ for (e = elf_hash_table (info)->dynlocal; e ; e = e->next)
+ if (e->input_indx == -1)
+ break;
+ if (e)
+ {
+ elf_section_data (dynsymsec->output_section)->this_hdr.sh_info
+ = e->dynindx;
+ }
+ }
+
+ if (info->strip == strip_all)
+ return true;
+
+ for (reg = 0; reg < 4; reg++)
+ if (app_regs [reg].name != NULL)
+ {
+ if (info->strip == strip_some
+ && bfd_hash_lookup (info->keep_hash,
+ app_regs [reg].name,
+ false, false) == NULL)
+ continue;
+
+ sym.st_value = reg < 2 ? reg + 2 : reg + 4;
+ sym.st_size = 0;
+ sym.st_other = 0;
+ sym.st_info = ELF_ST_INFO (app_regs [reg].bind, STT_REGISTER);
+ sym.st_shndx = app_regs [reg].shndx;
+ if (! (*func) (finfo, app_regs [reg].name, &sym,
+ sym.st_shndx == SHN_ABS
+ ? bfd_abs_section_ptr : bfd_und_section_ptr))
+ return false;
+ }
+
+ return true;
+}
+
+static int
+sparc64_elf_get_symbol_type (elf_sym, type)
+ Elf_Internal_Sym * elf_sym;
+ int type;
+{
+ if (ELF_ST_TYPE (elf_sym->st_info) == STT_REGISTER)
+ return STT_REGISTER;
+ else
+ return type;
+}
+
+/* A STB_GLOBAL,STT_REGISTER symbol should be BSF_GLOBAL
+ even in SHN_UNDEF section. */
+
+static void
+sparc64_elf_symbol_processing (abfd, asym)
+ bfd *abfd;
+ asymbol *asym;
+{
+ elf_symbol_type *elfsym;
+
+ elfsym = (elf_symbol_type *) asym;
+ if (elfsym->internal_elf_sym.st_info
+ == ELF_ST_INFO (STB_GLOBAL, STT_REGISTER))
+ {
+ asym->flags |= BSF_GLOBAL;
+ }
+}
+
/* Adjust a symbol defined by a dynamic object and referenced by a
regular object. The current definition is in some section of the
dynamic object, but we're not including those sections. We have to
@@ -890,7 +1546,7 @@ sparc64_elf_adjust_dynamic_symbol (info, h)
}
/* To simplify matters later, just store the plt index here. */
- h->plt_offset = s->_raw_size / PLT_ENTRY_SIZE;
+ h->plt.offset = s->_raw_size / PLT_ENTRY_SIZE;
/* Make room for this entry. */
s->_raw_size += PLT_ENTRY_SIZE;
@@ -1097,15 +1753,7 @@ sparc64_elf_size_dynamic_sections (output_bfd, info)
if (strip)
{
- asection **spp;
-
- for (spp = &s->output_section->owner->sections;
- *spp != s->output_section;
- spp = &(*spp)->next)
- ;
- *spp = s->output_section->next;
- --s->output_section->owner->section_count;
-
+ _bfd_strip_section_from_output (info, s);
continue;
}
@@ -1124,6 +1772,11 @@ sparc64_elf_size_dynamic_sections (output_bfd, info)
must add the entries now so that we get the correct size for
the .dynamic section. The DT_DEBUG entry is filled in by the
dynamic linker and used by the debugger. */
+ int reg;
+ struct sparc64_elf_app_reg * app_regs;
+ struct bfd_strtab_hash *dynstr;
+ struct elf_link_hash_table *eht = elf_hash_table (info);
+
if (! info->shared)
{
if (! bfd_elf64_add_dynamic_entry (info, DT_DEBUG, 0))
@@ -1135,9 +1788,7 @@ sparc64_elf_size_dynamic_sections (output_bfd, info)
if (! bfd_elf64_add_dynamic_entry (info, DT_PLTGOT, 0)
|| ! bfd_elf64_add_dynamic_entry (info, DT_PLTRELSZ, 0)
|| ! bfd_elf64_add_dynamic_entry (info, DT_PLTREL, DT_RELA)
- || ! bfd_elf64_add_dynamic_entry (info, DT_JMPREL, 0)
- || ! bfd_elf64_add_dynamic_entry (info, DT_SPARC_PLTFMT,
- (info->shared != 0) + 1))
+ || ! bfd_elf64_add_dynamic_entry (info, DT_JMPREL, 0))
return false;
}
@@ -1152,56 +1803,57 @@ sparc64_elf_size_dynamic_sections (output_bfd, info)
if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0))
return false;
}
- }
-
- /* If we are generating a shared library, we generate a section
- symbol for each output section for which we might need to copy
- relocs. These are local symbols, which means that they must come
- first in the dynamic symbol table. That means we must increment
- the dynamic symbol index of every other dynamic symbol. */
- if (info->shared)
- {
- int c;
- c = 0;
- for (s = output_bfd->sections; s != NULL; s = s->next)
- {
- if ((s->flags & SEC_LINKER_CREATED) != 0
- || (s->flags & SEC_ALLOC) == 0)
- continue;
-
- elf_section_data (s)->dynindx = c + 1;
+ /* Add dynamic STT_REGISTER symbols and corresponding DT_SPARC_REGISTER
+ entries if needed. */
+ app_regs = sparc64_elf_hash_table (info)->app_regs;
+ dynstr = eht->dynstr;
- /* These symbols will have no names, so we don't need to
- fiddle with dynstr_index. */
+ for (reg = 0; reg < 4; reg++)
+ if (app_regs [reg].name != NULL)
+ {
+ struct elf_link_local_dynamic_entry *entry, *e;
+
+ if (! bfd_elf64_add_dynamic_entry (info, DT_SPARC_REGISTER, 0))
+ return false;
- ++c;
- }
+ entry = (struct elf_link_local_dynamic_entry *)
+ bfd_hash_allocate (&info->hash->table, sizeof (*entry));
+ if (entry == NULL)
+ return false;
- elf_link_hash_traverse (elf_hash_table (info),
- sparc64_elf_adjust_dynindx,
- (PTR) &c);
- elf_hash_table (info)->dynsymcount += c;
+ /* We cheat here a little bit: the symbol will not be local, so we
+ put it at the end of the dynlocal linked list. We will fix it
+ later on, as we have to fix other fields anyway. */
+ entry->isym.st_value = reg < 2 ? reg + 2 : reg + 4;
+ entry->isym.st_size = 0;
+ if (*app_regs [reg].name != '\0')
+ entry->isym.st_name
+ = _bfd_stringtab_add (dynstr, app_regs[reg].name, true, false);
+ else
+ entry->isym.st_name = 0;
+ entry->isym.st_other = 0;
+ entry->isym.st_info = ELF_ST_INFO (app_regs [reg].bind,
+ STT_REGISTER);
+ entry->isym.st_shndx = app_regs [reg].shndx;
+ entry->next = NULL;
+ entry->input_bfd = output_bfd;
+ entry->input_indx = -1;
+
+ if (eht->dynlocal == NULL)
+ eht->dynlocal = entry;
+ else
+ {
+ for (e = eht->dynlocal; e->next; e = e->next)
+ ;
+ e->next = entry;
+ }
+ eht->dynsymcount++;
+ }
}
return true;
}
-
-/* Increment the index of a dynamic symbol by a given amount. Called
- via elf_link_hash_traverse. */
-
-static boolean
-sparc64_elf_adjust_dynindx (h, cparg)
- struct elf_link_hash_entry *h;
- PTR cparg;
-{
- int *cp = (int *) cparg;
-
- if (h->dynindx != -1)
- h->dynindx += *cp;
- return true;
-}
-
/* Relocate a SPARC64 ELF section. */
@@ -1253,8 +1905,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_vma relocation;
bfd_reloc_status_type r;
- r_type = ELF64_R_TYPE (rel->r_info);
- if (r_type < 0 || r_type >= (int) R_SPARC_max)
+ r_type = ELF64_R_TYPE_ID (rel->r_info);
+ if (r_type < 0 || r_type >= (int) R_SPARC_max_std)
{
bfd_set_error (bfd_error_bad_value);
return false;
@@ -1316,7 +1968,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
case R_SPARC_PCPLT22:
case R_SPARC_PCPLT10:
case R_SPARC_PLT64:
- if (h->plt_offset != (bfd_vma) -1)
+ if (h->plt.offset != (bfd_vma) -1)
skip_it = true;
break;
@@ -1397,13 +2049,14 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
- else if (info->shared && !info->symbolic)
+ else if (info->shared && !info->symbolic && !info->no_undefined)
relocation = 0;
else
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset,
+ (!info->shared || info->no_undefined))))
return false;
relocation = 0;
}
@@ -1539,7 +2192,11 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
& ELF_LINK_HASH_DEF_REGULAR) == 0))
{
BFD_ASSERT (h->dynindx != -1);
- outrel.r_info = ELF64_R_INFO (h->dynindx, r_type);
+ outrel.r_info
+ = ELF64_R_INFO (h->dynindx,
+ ELF64_R_TYPE_INFO (
+ ELF64_R_TYPE_DATA (rel->r_info),
+ r_type));
outrel.r_addend = rel->r_addend;
}
else
@@ -1582,14 +2239,18 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
{
BFD_FAIL ();
(*_bfd_error_handler)
- ("%s: probably compiled without -fPIC?",
+ (_("%s: probably compiled without -fPIC?"),
bfd_get_filename (input_bfd));
bfd_set_error (bfd_error_bad_value);
return false;
}
}
- outrel.r_info = ELF64_R_INFO (indx, r_type);
+ outrel.r_info
+ = ELF64_R_INFO (indx,
+ ELF64_R_TYPE_INFO (
+ ELF64_R_TYPE_DATA (rel->r_info),
+ r_type));
outrel.r_addend = relocation + rel->r_addend;
}
}
@@ -1605,7 +2266,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
reloc in an unallocated section. */
if (skip
|| (input_section->flags & SEC_ALLOC) != 0
- || ELF64_R_TYPE (outrel.r_info) != R_SPARC_RELATIVE)
+ || ELF64_R_TYPE_ID (outrel.r_info) != R_SPARC_RELATIVE)
continue;
}
break;
@@ -1627,7 +2288,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (h != NULL)
{
- bfd_vma off = h->got_offset;
+ bfd_vma off = h->got.offset;
BFD_ASSERT (off != (bfd_vma) -1);
if (! elf_hash_table (info)->dynamic_sections_created
@@ -1654,7 +2315,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
{
bfd_put_64 (output_bfd, relocation,
sgot->contents + off);
- h->got_offset |= 1;
+ h->got.offset |= 1;
}
}
relocation = sgot->output_offset + off - got_base;
@@ -1715,7 +2376,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
procedure linkage table. */
BFD_ASSERT (h != NULL);
- if (h->plt_offset == (bfd_vma) -1)
+ if (h->plt.offset == (bfd_vma) -1)
{
/* We didn't make a PLT entry for this symbol. This
happens when statically linking PIC code, or when
@@ -1731,7 +2392,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
relocation = (splt->output_section->vma
+ splt->output_offset
- + sparc64_elf_plt_entry_offset (h->plt_offset));
+ + sparc64_elf_plt_entry_offset (h->plt.offset));
goto do_default;
case R_SPARC_OLO10:
@@ -1747,6 +2408,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
r = bfd_check_overflow (howto->complain_on_overflow,
howto->bitsize, howto->rightshift,
+ bfd_arch_bits_per_address (input_bfd),
relocation);
}
break;
@@ -1768,6 +2430,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
r = bfd_check_overflow (howto->complain_on_overflow,
howto->bitsize, howto->rightshift,
+ bfd_arch_bits_per_address (input_bfd),
relocation);
}
break;
@@ -1785,6 +2448,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
r = bfd_check_overflow (howto->complain_on_overflow,
howto->bitsize, howto->rightshift,
+ bfd_arch_bits_per_address (input_bfd),
relocation);
}
break;
@@ -1877,7 +2541,7 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
dynobj = elf_hash_table (info)->dynobj;
- if (h->plt_offset != (bfd_vma) -1)
+ if (h->plt.offset != (bfd_vma) -1)
{
asection *splt;
asection *srela;
@@ -1893,22 +2557,24 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
/* Fill in the entry in the .rela.plt section. */
- if (h->plt_offset < LARGE_PLT_THRESHOLD)
+ if (h->plt.offset < LARGE_PLT_THRESHOLD)
{
- rela.r_offset = sparc64_elf_plt_entry_offset (h->plt_offset);
+ rela.r_offset = sparc64_elf_plt_entry_offset (h->plt.offset);
rela.r_addend = 0;
}
else
{
int max = splt->_raw_size / PLT_ENTRY_SIZE;
- rela.r_offset = sparc64_elf_plt_ptr_offset (h->plt_offset, max);
- rela.r_addend = -(sparc64_elf_plt_entry_offset (h->plt_offset) + 4);
+ rela.r_offset = sparc64_elf_plt_ptr_offset (h->plt.offset, max);
+ rela.r_addend = -(sparc64_elf_plt_entry_offset (h->plt.offset) + 4)
+ -(splt->output_section->vma + splt->output_offset);
}
+ rela.r_offset += (splt->output_section->vma + splt->output_offset);
rela.r_info = ELF64_R_INFO (h->dynindx, R_SPARC_JMP_SLOT);
bfd_elf64_swap_reloca_out (output_bfd, &rela,
((Elf64_External_Rela *) srela->contents
- + h->plt_offset));
+ + h->plt.offset));
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
{
@@ -1918,7 +2584,7 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
}
}
- if (h->got_offset != (bfd_vma) -1)
+ if (h->got.offset != (bfd_vma) -1)
{
asection *sgot;
asection *srela;
@@ -1932,7 +2598,7 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
rela.r_offset = (sgot->output_section->vma
+ sgot->output_offset
- + (h->got_offset &~ 1));
+ + (h->got.offset &~ 1));
/* If this is a -Bsymbolic link, and the symbol is defined
locally, we just want to emit a RELATIVE reloc. Likewise if
@@ -1951,7 +2617,7 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
}
else
{
- bfd_put_64 (output_bfd, (bfd_vma) 0, sgot->contents + h->got_offset);
+ bfd_put_64 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset);
rela.r_info = ELF64_R_INFO (h->dynindx, R_SPARC_GLOB_DAT);
rela.r_addend = 0;
}
@@ -2003,6 +2669,7 @@ sparc64_elf_finish_dynamic_sections (output_bfd, info)
struct bfd_link_info *info;
{
bfd *dynobj;
+ int stt_regidx = -1;
asection *sdyn;
asection *sgot;
@@ -2033,6 +2700,17 @@ sparc64_elf_finish_dynamic_sections (output_bfd, info)
case DT_PLTGOT: name = ".plt"; size = false; break;
case DT_PLTRELSZ: name = ".rela.plt"; size = true; break;
case DT_JMPREL: name = ".rela.plt"; size = false; break;
+ case DT_SPARC_REGISTER:
+ if (stt_regidx == -1)
+ {
+ stt_regidx =
+ _bfd_elf_link_lookup_local_dynindx (info, output_bfd, -1);
+ if (stt_regidx == -1)
+ return false;
+ }
+ dyn.d_un.d_val = stt_regidx++;
+ bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
+ /* fallthrough */
default: name = NULL; size = false; break;
}
@@ -2086,50 +2764,6 @@ sparc64_elf_finish_dynamic_sections (output_bfd, info)
elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 8;
- if (info->shared)
- {
- asection *sdynsym;
- asection *s;
- Elf_Internal_Sym sym;
- int c;
-
- /* Set up the section symbols for the output sections. */
-
- sdynsym = bfd_get_section_by_name (dynobj, ".dynsym");
- BFD_ASSERT (sdynsym != NULL);
-
- sym.st_size = 0;
- sym.st_name = 0;
- sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
- sym.st_other = 0;
-
- c = 0;
- for (s = output_bfd->sections; s != NULL; s = s->next)
- {
- int indx;
-
- if (elf_section_data (s)->dynindx == 0)
- continue;
-
- sym.st_value = s->vma;
-
- indx = elf_section_data (s)->this_idx;
- BFD_ASSERT (indx > 0);
- sym.st_shndx = indx;
-
- bfd_elf64_swap_symbol_out (output_bfd, &sym,
- (PTR) (((Elf64_External_Sym *)
- sdynsym->contents)
- + elf_section_data (s)->dynindx));
-
- ++c;
- }
-
- /* Set the sh_info field of the output .dynsym section to the
- index of the first global symbol. */
- elf_section_data (sdynsym->output_section)->this_hdr.sh_info = c + 1;
- }
-
return true;
}
@@ -2167,32 +2801,47 @@ sparc64_elf_merge_private_bfd_data (ibfd, obfd)
{
error = false;
- old_flags |= (new_flags & (EF_SPARC_SUN_US1|EF_SPARC_HAL_R1));
- new_flags |= (old_flags & (EF_SPARC_SUN_US1|EF_SPARC_HAL_R1));
- if ((old_flags & (EF_SPARC_SUN_US1|EF_SPARC_HAL_R1)) ==
- (EF_SPARC_SUN_US1|EF_SPARC_HAL_R1))
- {
- error = true;
- (*_bfd_error_handler)
- ("%s: linking UltraSPARC specific with HAL specific code",
- bfd_get_filename (ibfd));
- }
-
- /* Choose the most restrictive memory ordering */
- old_mm = (old_flags & EF_SPARCV9_MM);
- new_mm = (new_flags & EF_SPARCV9_MM);
- old_flags &= ~EF_SPARCV9_MM;
- new_flags &= ~EF_SPARCV9_MM;
- if (new_mm < old_mm) old_mm = new_mm;
- old_flags |= old_mm;
- new_flags |= old_mm;
+ if ((ibfd->flags & DYNAMIC) != 0)
+ {
+ /* We don't want dynamic objects memory ordering and
+ architecture to have any role. That's what dynamic linker
+ should do. */
+ old_flags &= ~(EF_SPARCV9_MM | EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1);
+ old_flags |= (new_flags
+ & (EF_SPARCV9_MM
+ | EF_SPARC_SUN_US1
+ | EF_SPARC_HAL_R1));
+ }
+ else
+ {
+ /* Choose the highest architecture requirements. */
+ old_flags |= (new_flags & (EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1));
+ new_flags |= (old_flags & (EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1));
+ if ((old_flags & (EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1))
+ == (EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1))
+ {
+ error = true;
+ (*_bfd_error_handler)
+ (_("%s: linking UltraSPARC specific with HAL specific code"),
+ bfd_get_filename (ibfd));
+ }
+ /* Choose the most restrictive memory ordering. */
+ old_mm = (old_flags & EF_SPARCV9_MM);
+ new_mm = (new_flags & EF_SPARCV9_MM);
+ old_flags &= ~EF_SPARCV9_MM;
+ new_flags &= ~EF_SPARCV9_MM;
+ if (new_mm < old_mm)
+ old_mm = new_mm;
+ old_flags |= old_mm;
+ new_flags |= old_mm;
+ }
/* Warn about any other mismatches */
if (new_flags != old_flags)
{
error = true;
(*_bfd_error_handler)
- ("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)",
+ (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"),
bfd_get_filename (ibfd), (long)new_flags, (long)old_flags);
}
@@ -2206,7 +2855,34 @@ sparc64_elf_merge_private_bfd_data (ibfd, obfd)
}
return true;
}
+
+/* Print a STT_REGISTER symbol to file FILE. */
+static const char *
+sparc64_elf_print_symbol_all (abfd, filep, symbol)
+ bfd *abfd;
+ PTR filep;
+ asymbol *symbol;
+{
+ FILE *file = (FILE *) filep;
+ int reg, type;
+
+ if (ELF_ST_TYPE (((elf_symbol_type *) symbol)->internal_elf_sym.st_info)
+ != STT_REGISTER)
+ return NULL;
+
+ reg = ((elf_symbol_type *) symbol)->internal_elf_sym.st_value;
+ type = symbol->flags;
+ fprintf (file, "REG_%c%c%11s%c%c R", "GOLI" [reg / 8], '0' + (reg & 7), "",
+ ((type & BSF_LOCAL)
+ ? (type & BSF_GLOBAL) ? '!' : 'l'
+ : (type & BSF_GLOBAL) ? 'g' : ' '),
+ (type & BSF_WEAK) ? 'w' : ' ');
+ if (symbol->name == NULL || symbol->name [0] == '\0')
+ return "#scratch";
+ else
+ return symbol->name;
+}
/* Set the right machine number for a SPARC64 ELF file. */
@@ -2221,19 +2897,78 @@ sparc64_elf_object_p (abfd)
return bfd_default_set_arch_mach (abfd, bfd_arch_sparc, mach);
}
+/* Relocations in the 64 bit SPARC ELF ABI are more complex than in
+ standard ELF, because R_SPARC_OLO10 has secondary addend in
+ ELF64_R_TYPE_DATA field. This structure is used to redirect the
+ relocation handling routines. */
+
+const struct elf_size_info sparc64_elf_size_info =
+{
+ sizeof (Elf64_External_Ehdr),
+ sizeof (Elf64_External_Phdr),
+ sizeof (Elf64_External_Shdr),
+ sizeof (Elf64_External_Rel),
+ sizeof (Elf64_External_Rela),
+ sizeof (Elf64_External_Sym),
+ sizeof (Elf64_External_Dyn),
+ sizeof (Elf_External_Note),
+ 4, /* hash-table entry size */
+ /* internal relocations per external relocations.
+ For link purposes we use just 1 internal per
+ 1 external, for assembly and slurp symbol table
+ we use 2. */
+ 1,
+ 64, /* arch_size */
+ 8, /* file_align */
+ ELFCLASS64,
+ EV_CURRENT,
+ bfd_elf64_write_out_phdrs,
+ bfd_elf64_write_shdrs_and_ehdr,
+ sparc64_elf_write_relocs,
+ bfd_elf64_swap_symbol_out,
+ sparc64_elf_slurp_reloc_table,
+ bfd_elf64_slurp_symbol_table,
+ bfd_elf64_swap_dyn_in,
+ bfd_elf64_swap_dyn_out,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
#define TARGET_BIG_SYM bfd_elf64_sparc_vec
#define TARGET_BIG_NAME "elf64-sparc"
#define ELF_ARCH bfd_arch_sparc
-#define ELF_MACHINE_CODE EM_SPARC64
#define ELF_MAXPAGESIZE 0x100000
+/* This is the official ABI value. */
+#define ELF_MACHINE_CODE EM_SPARCV9
+
+/* This is the value that we used before the ABI was released. */
+#define ELF_MACHINE_ALT1 EM_OLD_SPARCV9
+
+#define bfd_elf64_bfd_link_hash_table_create \
+ sparc64_elf_bfd_link_hash_table_create
+
#define elf_info_to_howto \
sparc64_elf_info_to_howto
+#define bfd_elf64_get_reloc_upper_bound \
+ sparc64_elf_get_reloc_upper_bound
+#define bfd_elf64_get_dynamic_reloc_upper_bound \
+ sparc64_elf_get_dynamic_reloc_upper_bound
+#define bfd_elf64_canonicalize_dynamic_reloc \
+ sparc64_elf_canonicalize_dynamic_reloc
#define bfd_elf64_bfd_reloc_type_lookup \
sparc64_elf_reloc_type_lookup
#define elf_backend_create_dynamic_sections \
_bfd_elf_create_dynamic_sections
+#define elf_backend_add_symbol_hook \
+ sparc64_elf_add_symbol_hook
+#define elf_backend_get_symbol_type \
+ sparc64_elf_get_symbol_type
+#define elf_backend_symbol_processing \
+ sparc64_elf_symbol_processing
#define elf_backend_check_relocs \
sparc64_elf_check_relocs
#define elf_backend_adjust_dynamic_symbol \
@@ -2246,10 +2981,16 @@ sparc64_elf_object_p (abfd)
sparc64_elf_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections \
sparc64_elf_finish_dynamic_sections
+#define elf_backend_print_symbol_all \
+ sparc64_elf_print_symbol_all
+#define elf_backend_output_arch_syms \
+ sparc64_elf_output_arch_syms
#define bfd_elf64_bfd_merge_private_bfd_data \
sparc64_elf_merge_private_bfd_data
+#define elf_backend_size_info \
+ sparc64_elf_size_info
#define elf_backend_object_p \
sparc64_elf_object_p
@@ -2260,4 +3001,7 @@ sparc64_elf_object_p (abfd)
/* Section 5.2.4 of the ABI specifies a 256-byte boundary for the table. */
#define elf_backend_plt_alignment 8
+#define elf_backend_got_header_size 8
+#define elf_backend_plt_header_size PLT_HEADER_SIZE
+
#include "elf64-target.h"
diff --git a/contrib/binutils/bfd/elfarm-nabi.c b/contrib/binutils/bfd/elfarm-nabi.c
new file mode 100644
index 000000000000..38778b73be3a
--- /dev/null
+++ b/contrib/binutils/bfd/elfarm-nabi.c
@@ -0,0 +1,672 @@
+/* 32-bit ELF support for ARM new abi option.
+ Copyright 1999 Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "elf/arm.h"
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+
+#ifndef NUM_ELEM
+#define NUM_ELEM(a) (sizeof (a) / (sizeof (a)[0]))
+#endif
+
+#define USE_REL
+
+#define TARGET_LITTLE_SYM bfd_elf32_littlearm_vec
+#define TARGET_LITTLE_NAME "elf32-littlearm"
+#define TARGET_BIG_SYM bfd_elf32_bigarm_vec
+#define TARGET_BIG_NAME "elf32-bigarm"
+
+#define elf_info_to_howto 0
+#define elf_info_to_howto_rel elf32_arm_info_to_howto
+
+#define ARM_ELF_ABI_VERSION 0
+#define ARM_ELF_OS_ABI_VERSION ELFOSABI_ARM
+
+static reloc_howto_type * elf32_arm_reloc_type_lookup
+ PARAMS ((bfd * abfd, bfd_reloc_code_real_type code));
+
+static reloc_howto_type elf32_arm_howto_table[] =
+{
+ /* No relocation */
+ HOWTO (R_ARM_NONE, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_NONE", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_PC24, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 24, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_PC24", /* name */
+ false, /* partial_inplace */
+ 0x00ffffff, /* src_mask */
+ 0x00ffffff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* 32 bit absolute */
+ HOWTO (R_ARM_ABS32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_ABS32", /* name */
+ false, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* standard 32bit pc-relative reloc */
+ HOWTO (R_ARM_REL32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_REL32", /* name */
+ false, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* 8 bit absolute */
+ HOWTO (R_ARM_PC13, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_PC13", /* name */
+ false, /* partial_inplace */
+ 0x000000ff, /* src_mask */
+ 0x000000ff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 16 bit absolute */
+ HOWTO (R_ARM_ABS16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_ABS16", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 12 bit absolute */
+ HOWTO (R_ARM_ABS12, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 12, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_ABS12", /* name */
+ false, /* partial_inplace */
+ 0x000008ff, /* src_mask */
+ 0x000008ff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_THM_ABS5, /* type */
+ 6, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 5, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_THM_ABS5", /* name */
+ false, /* partial_inplace */
+ 0x000007e0, /* src_mask */
+ 0x000007e0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 8 bit absolute */
+ HOWTO (R_ARM_ABS8, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_ABS8", /* name */
+ false, /* partial_inplace */
+ 0x000000ff, /* src_mask */
+ 0x000000ff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_SBREL32, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_SBREL32", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_THM_PC22, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 23, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_THM_PC22", /* name */
+ false, /* partial_inplace */
+ 0x07ff07ff, /* src_mask */
+ 0x07ff07ff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ HOWTO (R_ARM_THM_PC8, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_THM_PC8", /* name */
+ false, /* partial_inplace */
+ 0x000000ff, /* src_mask */
+ 0x000000ff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ HOWTO (R_ARM_AMP_VCALL9, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_AMP_VCALL9", /* name */
+ false, /* partial_inplace */
+ 0x000000ff, /* src_mask */
+ 0x000000ff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ HOWTO (R_ARM_SWI24, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_SWI24", /* name */
+ false, /* partial_inplace */
+ 0x00000000, /* src_mask */
+ 0x00000000, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_THM_SWI8, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_SWI8", /* name */
+ false, /* partial_inplace */
+ 0x00000000, /* src_mask */
+ 0x00000000, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* These next two relocs are defined, but I do not know what they do. */
+
+ HOWTO (R_ARM_XPC25, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_XPC25", /* name */
+ false, /* partial_inplace */
+ 0x00000000, /* src_mask */
+ 0x00000000, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_THM_XPC22, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_THM_XPC22", /* name */
+ false, /* partial_inplace */
+ 0x00000000, /* src_mask */
+ 0x00000000, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* These next three relocs are not defined, but we need to fill the space. */
+
+ HOWTO (R_ARM_NONE, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_unknown_17", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_NONE, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_unknown_18", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_NONE, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_unknown_19", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* Relocs used in ARM Linux */
+
+ HOWTO (R_ARM_COPY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_COPY", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_GLOB_DAT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_GLOB_DAT", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_JUMP_SLOT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_JUMP_SLOT", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_RELATIVE, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_RELATIVE", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_GOTOFF, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_GOTOFF", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_GOTPC, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_GOTPC", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ HOWTO (R_ARM_GOT32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_GOT32", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_PLT32, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_PLT32", /* name */
+ true, /* partial_inplace */
+ 0x00ffffff, /* src_mask */
+ 0x00ffffff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* End of relocs used in ARM Linux */
+
+ HOWTO (R_ARM_RREL32, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_RREL32", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_RABS32, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_RABS32", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_RPC24, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_RPC24", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_RBASE, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_RBASE", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+};
+
+ /* GNU extension to record C++ vtable hierarchy */
+static reloc_howto_type elf32_arm_vtinherit_howto =
+ HOWTO (R_ARM_GNU_VTINHERIT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_ARM_GNU_VTINHERIT", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false); /* pcrel_offset */
+
+ /* GNU extension to record C++ vtable member usage */
+static reloc_howto_type elf32_arm_vtentry_howto =
+ HOWTO (R_ARM_GNU_VTENTRY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_ARM_GNU_VTENTRY", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false); /* pcrel_offset */
+
+ /* 12 bit pc relative */
+static reloc_howto_type elf32_arm_thm_pc11_howto =
+ HOWTO (R_ARM_THM_PC11, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 11, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_THM_PC11", /* name */
+ false, /* partial_inplace */
+ 0x000007ff, /* src_mask */
+ 0x000007ff, /* dst_mask */
+ true); /* pcrel_offset */
+
+ /* 12 bit pc relative */
+static reloc_howto_type elf32_arm_thm_pc9_howto =
+ HOWTO (R_ARM_THM_PC9, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_THM_PC9", /* name */
+ false, /* partial_inplace */
+ 0x000000ff, /* src_mask */
+ 0x000000ff, /* dst_mask */
+ true); /* pcrel_offset */
+
+
+static void
+elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc)
+ bfd * abfd ATTRIBUTE_UNUSED;
+ arelent * bfd_reloc;
+ Elf32_Internal_Rel * elf_reloc;
+{
+ unsigned int r_type;
+
+ r_type = ELF32_R_TYPE (elf_reloc->r_info);
+
+ switch (r_type)
+ {
+ case R_ARM_GNU_VTINHERIT:
+ bfd_reloc->howto = & elf32_arm_vtinherit_howto;
+ break;
+
+ case R_ARM_GNU_VTENTRY:
+ bfd_reloc->howto = & elf32_arm_vtentry_howto;
+ break;
+
+ case R_ARM_THM_PC11:
+ bfd_reloc->howto = & elf32_arm_thm_pc11_howto;
+ break;
+
+ case R_ARM_THM_PC9:
+ bfd_reloc->howto = & elf32_arm_thm_pc9_howto;
+ break;
+
+ default:
+ if (r_type >= NUM_ELEM (elf32_arm_howto_table))
+ bfd_reloc->howto = NULL;
+ else
+ bfd_reloc->howto = & elf32_arm_howto_table[r_type];
+ break;
+ }
+}
+
+struct elf32_arm_reloc_map
+ {
+ bfd_reloc_code_real_type bfd_reloc_val;
+ unsigned char elf_reloc_val;
+ };
+
+static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] =
+{
+ {BFD_RELOC_NONE, R_ARM_NONE},
+ {BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24},
+ {BFD_RELOC_32, R_ARM_ABS32},
+ {BFD_RELOC_32_PCREL, R_ARM_REL32},
+ {BFD_RELOC_8, R_ARM_ABS8},
+ {BFD_RELOC_16, R_ARM_ABS16},
+ {BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12},
+ {BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5},
+ {BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22},
+ {BFD_RELOC_ARM_COPY, R_ARM_COPY},
+ {BFD_RELOC_ARM_GLOB_DAT, R_ARM_GLOB_DAT},
+ {BFD_RELOC_ARM_JUMP_SLOT, R_ARM_JUMP_SLOT},
+ {BFD_RELOC_ARM_RELATIVE, R_ARM_RELATIVE},
+ {BFD_RELOC_ARM_GOTOFF, R_ARM_GOTOFF},
+ {BFD_RELOC_ARM_GOTPC, R_ARM_GOTPC},
+ {BFD_RELOC_ARM_GOT32, R_ARM_GOT32},
+ {BFD_RELOC_ARM_PLT32, R_ARM_PLT32}
+};
+
+static reloc_howto_type *
+elf32_arm_reloc_type_lookup (abfd, code)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ bfd_reloc_code_real_type code;
+{
+ unsigned int i;
+
+ switch (code)
+ {
+ case BFD_RELOC_VTABLE_INHERIT:
+ return & elf32_arm_vtinherit_howto;
+
+ case BFD_RELOC_VTABLE_ENTRY:
+ return & elf32_arm_vtentry_howto;
+
+ case BFD_RELOC_THUMB_PCREL_BRANCH12:
+ return & elf32_arm_thm_pc11_howto;
+
+ case BFD_RELOC_THUMB_PCREL_BRANCH9:
+ return & elf32_arm_thm_pc9_howto;
+
+ default:
+ for (i = 0; i < NUM_ELEM (elf32_arm_reloc_map); i ++)
+ if (elf32_arm_reloc_map[i].bfd_reloc_val == code)
+ return & elf32_arm_howto_table[elf32_arm_reloc_map[i].elf_reloc_val];
+
+ return NULL;
+ }
+}
+
+#include "elf32-arm.h"
diff --git a/contrib/binutils/bfd/elfarm-oabi.c b/contrib/binutils/bfd/elfarm-oabi.c
new file mode 100644
index 000000000000..72f62f238095
--- /dev/null
+++ b/contrib/binutils/bfd/elfarm-oabi.c
@@ -0,0 +1,420 @@
+/* 32-bit ELF support for ARM old abi option.
+ Copyright 1999 Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "elf/arm-oabi.h"
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+
+#ifndef NUM_ELEM
+#define NUM_ELEM(a) (sizeof (a) / sizeof (a)[0])
+#endif
+
+#define USE_RELA
+
+#define TARGET_LITTLE_SYM bfd_elf32_littlearm_oabi_vec
+#define TARGET_LITTLE_NAME "elf32-littlearm-oabi"
+#define TARGET_BIG_SYM bfd_elf32_bigarm_oabi_vec
+#define TARGET_BIG_NAME "elf32-bigarm-oabi"
+
+#define elf_info_to_howto elf32_arm_info_to_howto
+#define elf_info_to_howto_rel 0
+
+#define ARM_ELF_ABI_VERSION 0
+#define ARM_ELF_OS_ABI_VERSION 0
+
+static reloc_howto_type elf32_arm_howto_table[] =
+{
+ /* No relocation */
+ HOWTO (R_ARM_NONE, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_NONE", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_PC24, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 24, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_PC24", /* name */
+ false, /* partial_inplace */
+ 0x00ffffff, /* src_mask */
+ 0x00ffffff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* 32 bit absolute */
+ HOWTO (R_ARM_ABS32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_ABS32", /* name */
+ false, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* standard 32bit pc-relative reloc */
+ HOWTO (R_ARM_REL32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_REL32", /* name */
+ false, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* 8 bit absolute */
+ HOWTO (R_ARM_ABS8, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_ABS8", /* name */
+ false, /* partial_inplace */
+ 0x000000ff, /* src_mask */
+ 0x000000ff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 16 bit absolute */
+ HOWTO (R_ARM_ABS16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_ABS16", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* 12 bit absolute */
+ HOWTO (R_ARM_ABS12, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 12, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_ABS12", /* name */
+ false, /* partial_inplace */
+ 0x000008ff, /* src_mask */
+ 0x000008ff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_THM_ABS5, /* type */
+ 6, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 5, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_THM_ABS5", /* name */
+ false, /* partial_inplace */
+ 0x000007e0, /* src_mask */
+ 0x000007e0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_THM_PC22, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 23, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_THM_PC22", /* name */
+ false, /* partial_inplace */
+ 0x07ff07ff, /* src_mask */
+ 0x07ff07ff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ HOWTO (R_ARM_SBREL32, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_SBREL32", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_AMP_VCALL9, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_AMP_VCALL9", /* name */
+ false, /* partial_inplace */
+ 0x000000ff, /* src_mask */
+ 0x000000ff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* 12 bit pc relative */
+ HOWTO (R_ARM_THM_PC11, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 11, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_THM_PC11", /* name */
+ false, /* partial_inplace */
+ 0x000007ff, /* src_mask */
+ 0x000007ff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* 12 bit pc relative */
+ HOWTO (R_ARM_THM_PC9, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_THM_PC9", /* name */
+ false, /* partial_inplace */
+ 0x000000ff, /* src_mask */
+ 0x000000ff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* GNU extension to record C++ vtable hierarchy */
+ HOWTO (R_ARM_GNU_VTINHERIT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_ARM_GNU_VTINHERIT", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* GNU extension to record C++ vtable member usage */
+ HOWTO (R_ARM_GNU_VTENTRY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_ARM_GNU_VTENTRY", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* XXX - gap in index numbering here. */
+
+ HOWTO (R_ARM_PLT32, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ true, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_PLT32", /* name */
+ true, /* partial_inplace */
+ 0x00ffffff, /* src_mask */
+ 0x00ffffff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ /* XXX - gap in index numbering here. */
+
+ HOWTO (R_ARM_RREL32, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_RREL32", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_RABS32, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_RABS32", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_RPC24, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_RPC24", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ HOWTO (R_ARM_RBASE, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_RBASE", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false) /* pcrel_offset */
+};
+
+/* Locate a reloc in the howto table. This function must be used
+ when the entry number is is > R_ARM_GNU_VTINHERIT. */
+static reloc_howto_type *
+find_howto (r_type)
+ unsigned int r_type;
+{
+ int i;
+
+ for (i = NUM_ELEM (elf32_arm_howto_table); i--;)
+ if (elf32_arm_howto_table [i].type == r_type)
+ return elf32_arm_howto_table + i;
+
+ return NULL;
+}
+
+static void
+elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ arelent *bfd_reloc;
+ Elf32_Internal_Rela *elf_reloc;
+{
+ unsigned int r_type;
+
+ r_type = ELF32_R_TYPE (elf_reloc->r_info);
+
+ if (r_type <= R_ARM_GNU_VTINHERIT)
+ bfd_reloc->howto = & elf32_arm_howto_table[r_type];
+ else
+ bfd_reloc->howto = find_howto (r_type);
+}
+
+struct elf32_arm_reloc_map
+ {
+ bfd_reloc_code_real_type bfd_reloc_val;
+ unsigned char elf_reloc_val;
+ };
+
+static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] =
+{
+ {BFD_RELOC_NONE, R_ARM_NONE },
+ {BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24 },
+ {BFD_RELOC_32, R_ARM_ABS32 },
+ {BFD_RELOC_32_PCREL, R_ARM_REL32 },
+ {BFD_RELOC_8, R_ARM_ABS8 },
+ {BFD_RELOC_16, R_ARM_ABS16 },
+ {BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12 },
+ {BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5 },
+ {BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_PC22 },
+ {BFD_RELOC_NONE, R_ARM_SBREL32 },
+ {BFD_RELOC_NONE, R_ARM_AMP_VCALL9 },
+ {BFD_RELOC_THUMB_PCREL_BRANCH12, R_ARM_THM_PC11 },
+ {BFD_RELOC_THUMB_PCREL_BRANCH9, R_ARM_THM_PC9 },
+ {BFD_RELOC_VTABLE_INHERIT, R_ARM_GNU_VTINHERIT },
+ {BFD_RELOC_VTABLE_ENTRY, R_ARM_GNU_VTENTRY }
+};
+
+static reloc_howto_type *
+elf32_arm_reloc_type_lookup (abfd, code)
+ bfd * abfd ATTRIBUTE_UNUSED;
+ bfd_reloc_code_real_type code;
+{
+ unsigned int i;
+
+ for (i = NUM_ELEM (elf32_arm_reloc_map); i--;)
+ if (elf32_arm_reloc_map[i].bfd_reloc_val == code)
+ return & elf32_arm_howto_table [elf32_arm_reloc_map[i].elf_reloc_val];
+
+ if (code == BFD_RELOC_ARM_PLT32)
+ return find_howto (R_ARM_PLT32);
+
+ return NULL;
+}
+
+#define bfd_elf32_arm_allocate_interworking_sections \
+ bfd_elf32_arm_oabi_allocate_interworking_sections
+#define bfd_elf32_arm_get_bfd_for_interworking \
+ bfd_elf32_arm_oabi_get_bfd_for_interworking
+#define bfd_elf32_arm_process_before_allocation \
+ bfd_elf32_arm_oabi_process_before_allocation
+
+#include "elf32-arm.h"
diff --git a/contrib/binutils/bfd/elfcode.h b/contrib/binutils/bfd/elfcode.h
index 4591e5fc5b61..c5edf9b82507 100644
--- a/contrib/binutils/bfd/elfcode.h
+++ b/contrib/binutils/bfd/elfcode.h
@@ -1,5 +1,6 @@
/* ELF executable support for BFD.
- Copyright 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+ Copyright 1991, 92, 93, 94, 95, 96, 97, 98, 1999 Free Software
+ Foundation, Inc.
Written by Fred Fish @ Cygnus Support, from information published
in "UNIX System V Release 4, Programmers Guide: ANSI C and
@@ -68,7 +69,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfdlink.h"
#include "libbfd.h"
#include "elf-bfd.h"
-#include "fnmatch.h"
/* Renaming structures, typedefs, macros and functions to be size-specific. */
#define Elf_External_Ehdr NAME(Elf,External_Ehdr)
@@ -124,6 +124,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define elf_bfd_final_link NAME(bfd_elf,bfd_final_link)
#define elf_create_pointer_linker_section NAME(bfd_elf,create_pointer_linker_section)
#define elf_finish_pointer_linker_section NAME(bfd_elf,finish_pointer_linker_section)
+#define elf_gc_sections NAME(_bfd_elf,gc_sections)
+#define elf_gc_common_finalize_got_offsets \
+ NAME(_bfd_elf,gc_common_finalize_got_offsets)
+#define elf_gc_common_final_link NAME(_bfd_elf,gc_common_final_link)
+#define elf_gc_record_vtinherit NAME(_bfd_elf,gc_record_vtinherit)
+#define elf_gc_record_vtentry NAME(_bfd_elf,gc_record_vtentry)
+#define elf_link_record_local_dynamic_symbol \
+ NAME(_bfd_elf,link_record_local_dynamic_symbol)
#if ARCH_SIZE == 64
#define ELF_R_INFO(X,Y) ELF64_R_INFO(X,Y)
@@ -157,6 +165,9 @@ static void elf_swap_shdr_out
#define section_from_elf_index bfd_section_from_elf_index
+static boolean elf_slurp_reloc_table_from_section
+ PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, bfd_size_type,
+ arelent *, asymbol **, boolean));
static boolean elf_slurp_reloc_table
PARAMS ((bfd *, asection *, asymbol **, boolean));
@@ -196,8 +207,13 @@ elf_swap_symbol_in (abfd, src, dst)
const Elf_External_Sym *src;
Elf_Internal_Sym *dst;
{
+ int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma;
+
dst->st_name = bfd_h_get_32 (abfd, (bfd_byte *) src->st_name);
- dst->st_value = get_word (abfd, (bfd_byte *) src->st_value);
+ if (signed_vma)
+ dst->st_value = get_signed_word (abfd, (bfd_byte *) src->st_value);
+ else
+ dst->st_value = get_word (abfd, (bfd_byte *) src->st_value);
dst->st_size = get_word (abfd, (bfd_byte *) src->st_size);
dst->st_info = bfd_h_get_8 (abfd, (bfd_byte *) src->st_info);
dst->st_other = bfd_h_get_8 (abfd, (bfd_byte *) src->st_other);
@@ -284,10 +300,15 @@ elf_swap_shdr_in (abfd, src, dst)
const Elf_External_Shdr *src;
Elf_Internal_Shdr *dst;
{
+ int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma;
+
dst->sh_name = bfd_h_get_32 (abfd, (bfd_byte *) src->sh_name);
dst->sh_type = bfd_h_get_32 (abfd, (bfd_byte *) src->sh_type);
dst->sh_flags = get_word (abfd, (bfd_byte *) src->sh_flags);
- dst->sh_addr = get_word (abfd, (bfd_byte *) src->sh_addr);
+ if (signed_vma)
+ dst->sh_addr = get_signed_word (abfd, (bfd_byte *) src->sh_addr);
+ else
+ dst->sh_addr = get_word (abfd, (bfd_byte *) src->sh_addr);
dst->sh_offset = get_word (abfd, (bfd_byte *) src->sh_offset);
dst->sh_size = get_word (abfd, (bfd_byte *) src->sh_size);
dst->sh_link = bfd_h_get_32 (abfd, (bfd_byte *) src->sh_link);
@@ -330,11 +351,21 @@ elf_swap_phdr_in (abfd, src, dst)
const Elf_External_Phdr *src;
Elf_Internal_Phdr *dst;
{
+ int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma;
+
dst->p_type = bfd_h_get_32 (abfd, (bfd_byte *) src->p_type);
dst->p_flags = bfd_h_get_32 (abfd, (bfd_byte *) src->p_flags);
dst->p_offset = get_word (abfd, (bfd_byte *) src->p_offset);
- dst->p_vaddr = get_word (abfd, (bfd_byte *) src->p_vaddr);
- dst->p_paddr = get_word (abfd, (bfd_byte *) src->p_paddr);
+ if (signed_vma)
+ {
+ dst->p_vaddr = get_signed_word (abfd, (bfd_byte *) src->p_vaddr);
+ dst->p_paddr = get_signed_word (abfd, (bfd_byte *) src->p_paddr);
+ }
+ else
+ {
+ dst->p_vaddr = get_word (abfd, (bfd_byte *) src->p_vaddr);
+ dst->p_paddr = get_word (abfd, (bfd_byte *) src->p_paddr);
+ }
dst->p_filesz = get_word (abfd, (bfd_byte *) src->p_filesz);
dst->p_memsz = get_word (abfd, (bfd_byte *) src->p_memsz);
dst->p_align = get_word (abfd, (bfd_byte *) src->p_align);
@@ -414,11 +445,13 @@ elf_swap_dyn_in (abfd, p, dst)
}
INLINE void
-elf_swap_dyn_out (abfd, src, dst)
+elf_swap_dyn_out (abfd, src, p)
bfd *abfd;
const Elf_Internal_Dyn *src;
- Elf_External_Dyn *dst;
+ PTR p;
{
+ Elf_External_Dyn *dst = (Elf_External_Dyn *) p;
+
put_word (abfd, src->d_tag, dst->d_tag);
put_word (abfd, src->d_un.d_val, dst->d_un.d_val);
}
@@ -517,6 +550,10 @@ elf_object_p (abfd)
elf_debug_file (i_ehdrp);
#endif
+ /* Reject ET_CORE (header indicates core file, not object file) */
+ if (i_ehdrp->e_type == ET_CORE)
+ goto got_wrong_format_error;
+
/* If there is no section header table, we're hosed. */
if (i_ehdrp->e_shoff == 0)
goto got_wrong_format_error;
@@ -571,7 +608,11 @@ elf_object_p (abfd)
abfd->flags |= D_PAGED;
if (! bfd_default_set_arch_mach (abfd, ebd->arch, 0))
- goto got_no_match;
+ {
+ /* It's OK if this fails for the generic target. */
+ if (ebd->elf_machine_code != EM_NONE)
+ goto got_no_match;
+ }
/* Remember the entry point specified in the ELF file header. */
bfd_get_start_address (abfd) = i_ehdrp->e_entry;
@@ -687,10 +728,9 @@ elf_object_p (abfd)
return (abfd->xvec);
-got_wrong_format_error:
+ got_wrong_format_error:
bfd_set_error (bfd_error_wrong_format);
- goto got_no_match;
-got_no_match:
+ got_no_match:
if (new_tdata != NULL
&& new_tdata->elf_sect_ptr != NULL)
bfd_release (abfd, new_tdata->elf_sect_ptr);
@@ -717,7 +757,7 @@ write_relocs (abfd, sec, data)
Elf_External_Rela *outbound_relocas;
Elf_External_Rel *outbound_relocs;
unsigned int idx;
- int use_rela_p = get_elf_backend_data (abfd)->use_rela_p;
+ int use_rela_p;
asymbol *last_sym = 0;
int last_sym_idx = 0;
@@ -745,6 +785,16 @@ write_relocs (abfd, sec, data)
return;
}
+ /* Figure out whether the relocations are RELA or REL relocations. */
+ if (rela_hdr->sh_type == SHT_RELA)
+ use_rela_p = true;
+ else if (rela_hdr->sh_type == SHT_REL)
+ use_rela_p = false;
+ else
+ /* Every relocation section should be either an SHT_RELA or an
+ SHT_REL section. */
+ abort ();
+
/* orelocation has the data, reloc_count has the count... */
if (use_rela_p)
{
@@ -827,6 +877,8 @@ write_relocs (abfd, sec, data)
if (sym == last_sym)
n = last_sym_idx;
+ else if (bfd_is_abs_section (sym->section) && sym->value == 0)
+ n = STN_UNDEF;
else
{
last_sym = sym;
@@ -839,7 +891,8 @@ write_relocs (abfd, sec, data)
last_sym_idx = n;
}
- if ((*ptr->sym_ptr_ptr)->the_bfd->xvec != abfd->xvec
+ if ((*ptr->sym_ptr_ptr)->the_bfd != NULL
+ && (*ptr->sym_ptr_ptr)->the_bfd->xvec != abfd->xvec
&& ! _bfd_elf_validate_reloc (abfd, ptr))
{
*failedp = true;
@@ -1005,7 +1058,7 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
&& verhdr->sh_size / sizeof (Elf_External_Versym) != symcount)
{
(*_bfd_error_handler)
- ("%s: version count (%ld) does not match symbol count (%ld)",
+ (_("%s: version count (%ld) does not match symbol count (%ld)"),
abfd->filename,
(long) (verhdr->sh_size / sizeof (Elf_External_Versym)),
symcount);
@@ -1173,50 +1226,27 @@ error_return:
return -1;
}
-/* Read in and swap the external relocs. */
+/* Read relocations for ASECT from REL_HDR. There are RELOC_COUNT of
+ them. */
static boolean
-elf_slurp_reloc_table (abfd, asect, symbols, dynamic)
+elf_slurp_reloc_table_from_section (abfd, asect, rel_hdr, reloc_count,
+ relents, symbols, dynamic)
bfd *abfd;
asection *asect;
+ Elf_Internal_Shdr *rel_hdr;
+ bfd_size_type reloc_count;
+ arelent *relents;
asymbol **symbols;
boolean dynamic;
{
struct elf_backend_data * const ebd = get_elf_backend_data (abfd);
- struct bfd_elf_section_data * const d = elf_section_data (asect);
- Elf_Internal_Shdr *rel_hdr;
- bfd_size_type reloc_count;
PTR allocated = NULL;
bfd_byte *native_relocs;
- arelent *relents;
arelent *relent;
unsigned int i;
int entsize;
- if (asect->relocation != NULL)
- return true;
-
- if (! dynamic)
- {
- if ((asect->flags & SEC_RELOC) == 0
- || asect->reloc_count == 0)
- return true;
-
- rel_hdr = &d->rel_hdr;
- reloc_count = asect->reloc_count;
-
- BFD_ASSERT (asect->rel_filepos == rel_hdr->sh_offset
- && reloc_count == rel_hdr->sh_size / rel_hdr->sh_entsize);
- }
- else
- {
- if (asect->_raw_size == 0)
- return true;
-
- rel_hdr = &d->this_hdr;
- reloc_count = rel_hdr->sh_size / rel_hdr->sh_entsize;
- }
-
allocated = (PTR) bfd_malloc ((size_t) rel_hdr->sh_size);
if (allocated == NULL)
goto error_return;
@@ -1228,10 +1258,6 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic)
native_relocs = (bfd_byte *) allocated;
- relents = (arelent *) bfd_alloc (abfd, reloc_count * sizeof (arelent));
- if (relents == NULL)
- goto error_return;
-
entsize = rel_hdr->sh_entsize;
BFD_ASSERT (entsize == sizeof (Elf_External_Rel)
|| entsize == sizeof (Elf_External_Rela));
@@ -1286,8 +1312,6 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic)
(*ebd->elf_info_to_howto_rel) (abfd, relent, &rel);
}
- asect->relocation = relents;
-
if (allocated != NULL)
free (allocated);
@@ -1299,6 +1323,82 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic)
return false;
}
+/* Read in and swap the external relocs. */
+
+static boolean
+elf_slurp_reloc_table (abfd, asect, symbols, dynamic)
+ bfd *abfd;
+ asection *asect;
+ asymbol **symbols;
+ boolean dynamic;
+{
+ struct bfd_elf_section_data * const d = elf_section_data (asect);
+ Elf_Internal_Shdr *rel_hdr;
+ Elf_Internal_Shdr *rel_hdr2;
+ bfd_size_type reloc_count;
+ bfd_size_type reloc_count2;
+ arelent *relents;
+
+ if (asect->relocation != NULL)
+ return true;
+
+ if (! dynamic)
+ {
+ if ((asect->flags & SEC_RELOC) == 0
+ || asect->reloc_count == 0)
+ return true;
+
+ rel_hdr = &d->rel_hdr;
+ reloc_count = rel_hdr->sh_size / rel_hdr->sh_entsize;
+ rel_hdr2 = d->rel_hdr2;
+ reloc_count2 = (rel_hdr2
+ ? (rel_hdr2->sh_size / rel_hdr2->sh_entsize)
+ : 0);
+
+ BFD_ASSERT (asect->reloc_count == reloc_count + reloc_count2);
+ BFD_ASSERT (asect->rel_filepos == rel_hdr->sh_offset
+ || (rel_hdr2 && asect->rel_filepos == rel_hdr2->sh_offset));
+
+ }
+ else
+ {
+ /* Note that ASECT->RELOC_COUNT tends not to be accurate in this
+ case because relocations against this section may use the
+ dynamic symbol table, and in that case bfd_section_from_shdr
+ in elf.c does not update the RELOC_COUNT. */
+ if (asect->_raw_size == 0)
+ return true;
+
+ rel_hdr = &d->this_hdr;
+ reloc_count = rel_hdr->sh_size / rel_hdr->sh_entsize;
+ rel_hdr2 = NULL;
+ reloc_count2 = 0;
+ }
+
+ relents = ((arelent *)
+ bfd_alloc (abfd,
+ (reloc_count + reloc_count2) * sizeof (arelent)));
+ if (relents == NULL)
+ return false;
+
+ if (!elf_slurp_reloc_table_from_section (abfd, asect,
+ rel_hdr, reloc_count,
+ relents,
+ symbols, dynamic))
+ return false;
+
+ if (rel_hdr2
+ && !elf_slurp_reloc_table_from_section (abfd, asect,
+ rel_hdr2, reloc_count2,
+ relents + reloc_count,
+ symbols, dynamic))
+ return false;
+
+
+ asect->relocation = relents;
+ return true;
+}
+
#ifdef DEBUG
static void
elf_debug_section (num, hdr)
@@ -1427,7 +1527,8 @@ const struct elf_size_info NAME(_bfd_elf,size_info) = {
sizeof (Elf_External_Sym),
sizeof (Elf_External_Dyn),
sizeof (Elf_External_Note),
-
+ ARCH_SIZE / 8,
+ 1,
ARCH_SIZE, FILE_ALIGN,
ELFCLASS, EV_CURRENT,
elf_write_out_phdrs,
@@ -1436,5 +1537,10 @@ const struct elf_size_info NAME(_bfd_elf,size_info) = {
elf_swap_symbol_out,
elf_slurp_reloc_table,
elf_slurp_symbol_table,
- elf_swap_dyn_in
+ elf_swap_dyn_in,
+ elf_swap_dyn_out,
+ NULL,
+ NULL,
+ NULL,
+ NULL
};
diff --git a/contrib/binutils/bfd/elfcore.h b/contrib/binutils/bfd/elfcore.h
index 5bea812e013b..e4454aac9d0f 100644
--- a/contrib/binutils/bfd/elfcore.h
+++ b/contrib/binutils/bfd/elfcore.h
@@ -1,5 +1,5 @@
/* ELF core file support for BFD.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -16,216 +16,31 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-/* Core file support */
-#ifdef HAVE_SYS_PROCFS_H /* Some core file support requires host /proc files */
-#include <signal.h>
-#include <sys/procfs.h>
-/* Solaris includes the field pr_who that indicates the thread number within
- the process. */
-
-#ifdef PIOCOPENLWP
-#define get_thread(STATUS) ((((prstatus_t *)(STATUS))->pr_who << 16) \
- | ((prstatus_t *)(STATUS))->pr_pid)
-#else
-#define get_thread(STATUS) (((prstatus_t *)(STATUS))->pr_pid)
-#endif
-
-static boolean bfd_prstatus PARAMS ((bfd *, char *, int, long, int));
-static boolean bfd_prpsinfo PARAMS ((bfd *, char *, int, long));
-static boolean bfd_fpregset PARAMS ((bfd *, char *, int, long, int));
-
-#else
-#define bfd_prstatus(abfd, descdata, descsz, filepos, thread) true
-#define bfd_fpregset(abfd, descdata, descsz, filepos, thread) true
-#define bfd_prpsinfo(abfd, descdata, descsz, filepos) true
-#define get_thread(STATUS) (1)
-#endif
-
-static boolean elf_corefile_note PARAMS ((bfd *, Elf_Internal_Phdr *));
-
-#ifdef HAVE_SYS_PROCFS_H
-
-static int did_reg;
-static int did_reg2;
-
-static boolean
-bfd_prstatus (abfd, descdata, descsz, filepos, thread)
- bfd *abfd;
- char *descdata;
- int descsz;
- long filepos;
- int thread;
-{
- asection *newsect;
- prstatus_t *status = (prstatus_t *) 0;
-
- if (descsz == sizeof (prstatus_t))
- {
- char secname[100];
- char *p;
-
- sprintf (secname, ".reg/%d", thread);
- p = bfd_alloc (abfd, strlen (secname) + 1);
- if (!p)
- return false;
- strcpy (p, secname);
-
- newsect = bfd_make_section (abfd, p);
- if (newsect == NULL)
- return false;
- newsect->_raw_size = sizeof (status->pr_reg);
- newsect->filepos = filepos + (long) &status->pr_reg;
- newsect->flags = SEC_HAS_CONTENTS;
- newsect->alignment_power = LOG_FILE_ALIGN;
- if ((core_prstatus (abfd) = bfd_alloc (abfd, descsz)) != NULL)
- {
- memcpy (core_prstatus (abfd), descdata, descsz);
- }
-
- if (!did_reg++)
- {
- asection *regsect;
-
- regsect = bfd_make_section (abfd, ".reg");
- if (regsect == NULL)
- return false;
- regsect->_raw_size = newsect->_raw_size;
- regsect->filepos = newsect->filepos;
- regsect->flags = newsect->flags;
- regsect->alignment_power = newsect->alignment_power;
- }
- }
- return true;
-}
-
-/* Stash a copy of the prpsinfo structure away for future use. */
-
-static boolean
-bfd_prpsinfo (abfd, descdata, descsz, filepos)
- bfd *abfd;
- char *descdata;
- int descsz;
- long filepos;
-{
- if (descsz == sizeof (prpsinfo_t))
- {
- if ((core_prpsinfo (abfd) = bfd_alloc (abfd, descsz)) == NULL)
- return false;
- memcpy (core_prpsinfo (abfd), descdata, descsz);
- }
- return true;
-}
-
-static boolean
-bfd_fpregset (abfd, descdata, descsz, filepos, thread)
- bfd *abfd;
- char *descdata;
- int descsz;
- long filepos;
- int thread;
-{
- asection *newsect;
- char secname[100];
- char *p;
-
- sprintf (secname, ".reg2/%d", thread);
- p = bfd_alloc (abfd, strlen (secname) + 1);
- if (!p)
- return false;
- strcpy (p, secname);
-
- newsect = bfd_make_section (abfd, p);
- if (newsect == NULL)
- return false;
- newsect->_raw_size = descsz;
- newsect->filepos = filepos;
- newsect->flags = SEC_HAS_CONTENTS;
- newsect->alignment_power = 2;
-
- if (!did_reg2++)
- {
- asection *regsect;
-
- regsect = bfd_make_section (abfd, ".reg2");
- if (regsect == NULL)
- return false;
- regsect->_raw_size = newsect->_raw_size;
- regsect->filepos = newsect->filepos;
- regsect->flags = newsect->flags;
- regsect->alignment_power = newsect->alignment_power;
- }
-
- return true;
-}
-
-#endif /* HAVE_SYS_PROCFS_H */
-
-/* Return a pointer to the args (including the command name) that were
- seen by the program that generated the core dump. Note that for
- some reason, a spurious space is tacked onto the end of the args
- in some (at least one anyway) implementations, so strip it off if
- it exists. */
-
-char *
+char*
elf_core_file_failing_command (abfd)
bfd *abfd;
{
-#ifdef HAVE_SYS_PROCFS_H
- if (core_prpsinfo (abfd))
- {
- prpsinfo_t *p = core_prpsinfo (abfd);
- char *scan = p->pr_psargs;
- while (*scan++)
- {;
- }
- scan -= 2;
- if ((scan > p->pr_psargs) && (*scan == ' '))
- {
- *scan = '\000';
- }
- return p->pr_psargs;
- }
-#endif
- return NULL;
+ return elf_tdata (abfd)->core_command;
}
-/* Return the number of the signal that caused the core dump. Presumably,
- since we have a core file, we got a signal of some kind, so don't bother
- checking the other process status fields, just return the signal number.
- */
-
int
elf_core_file_failing_signal (abfd)
bfd *abfd;
{
-#ifdef HAVE_SYS_PROCFS_H
- if (core_prstatus (abfd))
- {
- return ((prstatus_t *) (core_prstatus (abfd)))->pr_cursig;
- }
-#endif
- return -1;
+ return elf_tdata (abfd)->core_signal;
}
-/* Check to see if the core file could reasonably be expected to have
- come for the current executable file. Note that by default we return
- true unless we find something that indicates that there might be a
- problem.
- */
boolean
elf_core_file_matches_executable_p (core_bfd, exec_bfd)
bfd *core_bfd;
bfd *exec_bfd;
{
-#ifdef HAVE_SYS_PROCFS_H
- char *corename;
- char *execname;
-#endif
+ char* corename;
- /* First, xvecs must match since both are ELF files for the same target. */
+ /* xvecs must match if both are ELF files for the same target. */
if (core_bfd->xvec != exec_bfd->xvec)
{
@@ -233,151 +48,21 @@ elf_core_file_matches_executable_p (core_bfd, exec_bfd)
return false;
}
-#ifdef HAVE_SYS_PROCFS_H
-
- /* If no prpsinfo, just return true. Otherwise, grab the last component
- of the exec'd pathname from the prpsinfo. */
+ /* See if the name in the corefile matches the executable name. */
- if (core_prpsinfo (core_bfd))
+ corename = elf_tdata (core_bfd)->core_program;
+ if (corename != NULL)
{
- corename = (((prpsinfo_t *) core_prpsinfo (core_bfd))->pr_fname);
- }
- else
- {
- return true;
- }
-
- /* Find the last component of the executable pathname. */
+ const char* execname = strrchr (exec_bfd->filename, '/');
+ execname = execname ? execname + 1 : exec_bfd->filename;
- if ((execname = strrchr (exec_bfd->filename, '/')) != NULL)
- {
- execname++;
- }
- else
- {
- execname = (char *) exec_bfd->filename;
+ if (strcmp(execname, corename) != 0)
+ return false;
}
- /* See if they match */
-
- return strcmp (execname, corename) ? false : true;
-
-#else
-
return true;
-
-#endif /* HAVE_SYS_PROCFS_H */
}
-/* ELF core files contain a segment of type PT_NOTE, that holds much of
- the information that would normally be available from the /proc interface
- for the process, at the time the process dumped core. Currently this
- includes copies of the prstatus, prpsinfo, and fpregset structures.
-
- Since these structures are potentially machine dependent in size and
- ordering, bfd provides two levels of support for them. The first level,
- available on all machines since it does not require that the host
- have /proc support or the relevant include files, is to create a bfd
- section for each of the prstatus, prpsinfo, and fpregset structures,
- without any interpretation of their contents. With just this support,
- the bfd client will have to interpret the structures itself. Even with
- /proc support, it might want these full structures for it's own reasons.
-
- In the second level of support, where HAVE_SYS_PROCFS_H is defined,
- bfd will pick apart the structures to gather some additional
- information that clients may want, such as the general register
- set, the name of the exec'ed file and its arguments, the signal (if
- any) that caused the core dump, etc.
-
- */
-
-static boolean
-elf_corefile_note (abfd, hdr)
- bfd *abfd;
- Elf_Internal_Phdr *hdr;
-{
- Elf_External_Note *x_note_p; /* Elf note, external form */
- Elf_Internal_Note i_note; /* Elf note, internal form */
- char *buf = NULL; /* Entire note segment contents */
- char *namedata; /* Name portion of the note */
- char *descdata; /* Descriptor portion of the note */
- char *sectname; /* Name to use for new section */
- long filepos; /* File offset to descriptor data */
- asection *newsect;
- int thread = 1; /* Current thread number */
-
-#ifdef HAVE_SYS_PROCFS_H
- did_reg = 0; /* Non-zero if we made .reg section */
- did_reg2 = 0; /* Ditto for .reg2 */
-#endif
-
- if (hdr->p_filesz > 0
- && (buf = (char *) bfd_malloc ((size_t) hdr->p_filesz)) != NULL
- && bfd_seek (abfd, hdr->p_offset, SEEK_SET) != -1
- && bfd_read ((PTR) buf, hdr->p_filesz, 1, abfd) == hdr->p_filesz)
- {
- x_note_p = (Elf_External_Note *) buf;
- while ((char *) x_note_p < (buf + hdr->p_filesz))
- {
- i_note.namesz = bfd_h_get_32 (abfd, (bfd_byte *) x_note_p->namesz);
- i_note.descsz = bfd_h_get_32 (abfd, (bfd_byte *) x_note_p->descsz);
- i_note.type = bfd_h_get_32 (abfd, (bfd_byte *) x_note_p->type);
- namedata = x_note_p->name;
- descdata = namedata + BFD_ALIGN (i_note.namesz, 4);
- filepos = hdr->p_offset + (descdata - buf);
- switch (i_note.type)
- {
- case NT_PRSTATUS:
- /* process descdata as prstatus info */
- thread = get_thread (descdata);
- if (! bfd_prstatus (abfd, descdata, i_note.descsz, filepos,
- thread))
- return false;
- sectname = NULL;
- break;
- case NT_FPREGSET:
- /* process descdata as fpregset info */
- if (! bfd_fpregset (abfd, descdata, i_note.descsz, filepos,
- thread))
- return false;
- sectname = NULL;
- break;
- case NT_PRPSINFO:
- /* process descdata as prpsinfo */
- if (! bfd_prpsinfo (abfd, descdata, i_note.descsz, filepos))
- return false;
- sectname = ".prpsinfo";
- break;
- default:
- /* Unknown descriptor, just ignore it. */
- sectname = NULL;
- break;
- }
- if (sectname != NULL)
- {
- newsect = bfd_make_section (abfd, sectname);
- if (newsect == NULL)
- return false;
- newsect->_raw_size = i_note.descsz;
- newsect->filepos = filepos;
- newsect->flags = SEC_ALLOC | SEC_HAS_CONTENTS;
- newsect->alignment_power = 2;
- }
- x_note_p = (Elf_External_Note *)
- (descdata + BFD_ALIGN (i_note.descsz, 4));
- }
- }
- if (buf != NULL)
- {
- free (buf);
- }
- else if (hdr->p_filesz > 0)
- {
- return false;
- }
- return true;
-
-}
/* Core files are simply standard ELF formatted files that partition
the file using the execution view of the file (program header table)
@@ -398,13 +83,11 @@ elf_core_file_p (abfd)
{
Elf_External_Ehdr x_ehdr; /* Elf file header, external form */
Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form */
- Elf_External_Phdr x_phdr; /* Program header table entry, external form */
- Elf_Internal_Phdr *i_phdrp; /* Program header table, internal form */
+ Elf_Internal_Phdr *i_phdrp; /* Elf program header, internal form */
unsigned int phindex;
struct elf_backend_data *ebd;
/* Read in the ELF header in external format. */
-
if (bfd_read ((PTR) & x_ehdr, sizeof (x_ehdr), 1, abfd) != sizeof (x_ehdr))
{
if (bfd_get_error () != bfd_error_system_call)
@@ -412,12 +95,7 @@ elf_core_file_p (abfd)
return NULL;
}
- /* Now check to see if we have a valid ELF file, and one that BFD can
- make use of. The magic number must match, the address size ('class')
- and byte-swapping must match our XVEC entry, and it must have a
- program header table (FIXME: See comments re segments at top of this
- file). */
-
+ /* Check the magic number. */
if (elf_file_p (&x_ehdr) == false)
{
wrong:
@@ -425,21 +103,13 @@ elf_core_file_p (abfd)
return NULL;
}
- /* FIXME, Check EI_VERSION here ! */
-
- {
-#if ARCH_SIZE == 32
- int desired_address_size = ELFCLASS32;
-#endif
-#if ARCH_SIZE == 64
- int desired_address_size = ELFCLASS64;
-#endif
+ /* FIXME: Check EI_VERSION here ! */
- if (x_ehdr.e_ident[EI_CLASS] != desired_address_size)
- goto wrong;
- }
+ /* Check the address size ("class"). */
+ if (x_ehdr.e_ident[EI_CLASS] != ELFCLASS)
+ goto wrong;
- /* Switch xvec to match the specified byte order. */
+ /* Check the byteorder. */
switch (x_ehdr.e_ident[EI_DATA])
{
case ELFDATA2MSB: /* Big-endian */
@@ -450,24 +120,22 @@ elf_core_file_p (abfd)
if (! bfd_little_endian (abfd))
goto wrong;
break;
- case ELFDATANONE: /* No data encoding specified */
- default: /* Unknown data encoding specified */
+ default:
goto wrong;
}
- /* Allocate an instance of the elf_obj_tdata structure and hook it up to
- the tdata pointer in the bfd. */
-
+ /* Give abfd an elf_obj_tdata. */
elf_tdata (abfd) =
(struct elf_obj_tdata *) bfd_zalloc (abfd, sizeof (struct elf_obj_tdata));
if (elf_tdata (abfd) == NULL)
return NULL;
- /* FIXME, `wrong' returns from this point onward, leak memory. */
+ /* FIXME: from here on down, "goto wrong" will leak memory. */
- /* Now that we know the byte order, swap in the rest of the header */
+ /* Swap in the rest of the header, now that we have the byte order. */
i_ehdrp = elf_elfheader (abfd);
elf_swap_ehdr_in (abfd, &x_ehdr, i_ehdrp);
+
#if DEBUG & 1
elf_debug_file (i_ehdrp);
#endif
@@ -476,9 +144,12 @@ elf_core_file_p (abfd)
/* Check that the ELF e_machine field matches what this particular
BFD format expects. */
+
if (ebd->elf_machine_code != i_ehdrp->e_machine
- && (ebd->elf_machine_alt1 == 0 || i_ehdrp->e_machine != ebd->elf_machine_alt1)
- && (ebd->elf_machine_alt2 == 0 || i_ehdrp->e_machine != ebd->elf_machine_alt2))
+ && (ebd->elf_machine_alt1 == 0
+ || i_ehdrp->e_machine != ebd->elf_machine_alt1)
+ && (ebd->elf_machine_alt2 == 0
+ || i_ehdrp->e_machine != ebd->elf_machine_alt2))
{
const bfd_target * const *target_ptr;
@@ -487,6 +158,7 @@ elf_core_file_p (abfd)
/* This is the generic ELF target. Let it match any ELF target
for which we do not have a specific backend. */
+
for (target_ptr = bfd_target_vector; *target_ptr != NULL; target_ptr++)
{
struct elf_backend_data *back;
@@ -508,43 +180,46 @@ elf_core_file_p (abfd)
if (i_ehdrp->e_phoff == 0 || i_ehdrp->e_type != ET_CORE)
goto wrong;
- /* Allocate space for a copy of the program header table in
- internal form, seek to the program header table in the file,
- read it in, and convert it to internal form. As a simple sanity
- check, verify that the what BFD thinks is the size of each program
- header table entry actually matches the size recorded in the file. */
-
- if (i_ehdrp->e_phentsize != sizeof (x_phdr))
+ /* Does BFD's idea of the phdr size match the size
+ recorded in the file? */
+ if (i_ehdrp->e_phentsize != sizeof (Elf_External_Phdr))
goto wrong;
+
+ /* Allocate space for the program headers. */
i_phdrp = (Elf_Internal_Phdr *)
bfd_alloc (abfd, sizeof (*i_phdrp) * i_ehdrp->e_phnum);
if (!i_phdrp)
return NULL;
- if (bfd_seek (abfd, i_ehdrp->e_phoff, SEEK_SET) == -1)
- return NULL;
- for (phindex = 0; phindex < i_ehdrp->e_phnum; phindex++)
+
+ elf_tdata (abfd)->phdr = i_phdrp;
+
+ /* Read and convert to internal form. */
+ for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex)
{
- if (bfd_read ((PTR) & x_phdr, sizeof (x_phdr), 1, abfd)
+ Elf_External_Phdr x_phdr;
+ if (bfd_read ((PTR) &x_phdr, sizeof (x_phdr), 1, abfd)
!= sizeof (x_phdr))
return NULL;
+
elf_swap_phdr_in (abfd, &x_phdr, i_phdrp + phindex);
}
- /* Once all of the program headers have been read and converted, we
- can start processing them. */
-
- for (phindex = 0; phindex < i_ehdrp->e_phnum; phindex++)
+ /* Process each program header. */
+ for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex)
{
- bfd_section_from_phdr (abfd, i_phdrp + phindex, phindex);
- if ((i_phdrp + phindex)->p_type == PT_NOTE)
- {
- if (! elf_corefile_note (abfd, i_phdrp + phindex))
- return NULL;
- }
+ if (!_bfd_elfcore_section_from_phdr (abfd, i_phdrp + phindex, phindex))
+ return NULL;
}
- /* Remember the entry point specified in the ELF file header. */
+ /* Set the machine architecture. */
+ if (! bfd_default_set_arch_mach (abfd, ebd->arch, 0))
+ {
+ /* It's OK if this fails for the generic target. */
+ if (ebd->elf_machine_code != EM_NONE)
+ return NULL;
+ }
+ /* Save the entry point from the ELF header. */
bfd_get_start_address (abfd) = i_ehdrp->e_entry;
return abfd->xvec;
diff --git a/contrib/binutils/bfd/elflink.c b/contrib/binutils/bfd/elflink.c
index 92e8d17cf7c2..6534d84b18a0 100644
--- a/contrib/binutils/bfd/elflink.c
+++ b/contrib/binutils/bfd/elflink.c
@@ -1,5 +1,5 @@
/* ELF linking support for BFD.
- Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -83,9 +83,8 @@ _bfd_elf_create_got_section (abfd, info)
elf_hash_table (info)->hgot = h;
- /* The first three global offset table entries after
- '_GLOBAL_OFFSET_TABLE_' are reserved. */
- s->_raw_size += (3 << ptralign) + bed->got_symbol_offset;
+ /* The first bit of the global offset table is the header. */
+ s->_raw_size += bed->got_header_size + bed->got_symbol_offset;
return true;
}
@@ -101,7 +100,7 @@ _bfd_elf_create_dynamic_sections (abfd, info)
flagword flags, pltflags;
register asection *s;
struct elf_backend_data *bed = get_elf_backend_data (abfd);
- int ptralign;
+ int ptralign = 0;
switch (bed->s->arch_size)
{
@@ -148,7 +147,8 @@ _bfd_elf_create_dynamic_sections (abfd, info)
return false;
}
- s = bfd_make_section (abfd, bed->use_rela_p ? ".rela.plt" : ".rel.plt");
+ s = bfd_make_section (abfd,
+ bed->default_use_rela_p ? ".rela.plt" : ".rel.plt");
if (s == NULL
|| ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
|| ! bfd_set_section_alignment (abfd, s, ptralign))
@@ -157,18 +157,20 @@ _bfd_elf_create_dynamic_sections (abfd, info)
if (! _bfd_elf_create_got_section (abfd, info))
return false;
- /* The .dynbss section is a place to put symbols which are defined
- by dynamic objects, are referenced by regular objects, and are
- not functions. We must allocate space for them in the process
- image and use a R_*_COPY reloc to tell the dynamic linker to
- initialize them at run time. The linker script puts the .dynbss
- section into the .bss section of the final image. */
- s = bfd_make_section (abfd, ".dynbss");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, SEC_ALLOC))
- return false;
+ if (bed->want_dynbss)
+ {
+ /* The .dynbss section is a place to put symbols which are defined
+ by dynamic objects, are referenced by regular objects, and are
+ not functions. We must allocate space for them in the process
+ image and use a R_*_COPY reloc to tell the dynamic linker to
+ initialize them at run time. The linker script puts the .dynbss
+ section into the .bss section of the final image. */
+ s = bfd_make_section (abfd, ".dynbss");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, SEC_ALLOC))
+ return false;
- /* The .rel[a].bss section holds copy relocs. This section is not
+ /* The .rel[a].bss section holds copy relocs. This section is not
normally needed. We need to create it here, though, so that the
linker will map it to an output section. We can't just create it
only if we need it, because we will not know whether we need it
@@ -179,13 +181,16 @@ _bfd_elf_create_dynamic_sections (abfd, info)
be needed, we can discard it later. We will never need this
section when generating a shared object, since they do not use
copy relocs. */
- if (! info->shared)
- {
- s = bfd_make_section (abfd, bed->use_rela_p ? ".rela.bss" : ".rel.bss");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || ! bfd_set_section_alignment (abfd, s, ptralign))
- return false;
+ if (! info->shared)
+ {
+ s = bfd_make_section (abfd,
+ (bed->default_use_rela_p
+ ? ".rela.bss" : ".rel.bss"));
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+ || ! bfd_set_section_alignment (abfd, s, ptralign))
+ return false;
+ }
}
return true;
@@ -213,6 +218,32 @@ _bfd_elf_link_record_dynamic_symbol (info, h)
boolean copy;
bfd_size_type indx;
+ /* XXX: The ABI draft says the linker must turn hidden and
+ internal symbols into STB_LOCAL symbols when producing the
+ DSO. However, if ld.so honors st_other in the dynamic table,
+ this would not be necessary. */
+ switch (ELF_ST_VISIBILITY (h->other))
+ {
+ case STV_INTERNAL:
+ case STV_HIDDEN:
+ /* This symbol must be defined in the shared object or
+ executable. */
+ if (h->root.type == bfd_link_hash_undefined)
+ {
+ bfd * abfd = h->root.u.undef.abfd;
+ const char * name = h->root.root.string;
+
+ (*info->callbacks->undefined_symbol)
+ (info, name, abfd, bfd_und_section_ptr, 0, true);
+ }
+
+ h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
+ break;
+
+ default:
+ break;
+ }
+
h->dynindx = elf_hash_table (info)->dynsymcount;
++elf_hash_table (info)->dynsymcount;
@@ -257,8 +288,84 @@ _bfd_elf_link_record_dynamic_symbol (info, h)
return true;
}
+
+/* Return the dynindex of a local dynamic symbol. */
+
+long
+_bfd_elf_link_lookup_local_dynindx (info, input_bfd, input_indx)
+ struct bfd_link_info *info;
+ bfd *input_bfd;
+ long input_indx;
+{
+ struct elf_link_local_dynamic_entry *e;
+
+ for (e = elf_hash_table (info)->dynlocal; e ; e = e->next)
+ if (e->input_bfd == input_bfd && e->input_indx == input_indx)
+ return e->dynindx;
+ return -1;
+}
+
+/* This function is used to renumber the dynamic symbols, if some of
+ them are removed because they are marked as local. This is called
+ via elf_link_hash_traverse. */
+
+static boolean elf_link_renumber_hash_table_dynsyms
+ PARAMS ((struct elf_link_hash_entry *, PTR));
+
+static boolean
+elf_link_renumber_hash_table_dynsyms (h, data)
+ struct elf_link_hash_entry *h;
+ PTR data;
+{
+ size_t *count = (size_t *) data;
+
+ if (h->dynindx != -1)
+ h->dynindx = ++(*count);
+
+ return true;
+}
+
+/* Assign dynsym indicies. In a shared library we generate a section
+ symbol for each output section, which come first. Next come all of
+ the back-end allocated local dynamic syms, followed by the rest of
+ the global symbols. */
+
+unsigned long
+_bfd_elf_link_renumber_dynsyms (output_bfd, info)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+{
+ unsigned long dynsymcount = 0;
+
+ if (info->shared)
+ {
+ asection *p;
+ for (p = output_bfd->sections; p ; p = p->next)
+ elf_section_data (p)->dynindx = ++dynsymcount;
+ }
+
+ if (elf_hash_table (info)->dynlocal)
+ {
+ struct elf_link_local_dynamic_entry *p;
+ for (p = elf_hash_table (info)->dynlocal; p ; p = p->next)
+ p->dynindx = ++dynsymcount;
+ }
+
+ elf_link_hash_traverse (elf_hash_table (info),
+ elf_link_renumber_hash_table_dynsyms,
+ &dynsymcount);
+
+ /* There is an unused NULL entry at the head of the table which
+ we must account for in our count. Unless there weren't any
+ symbols, which means we'll have no table at all. */
+ if (dynsymcount != 0)
+ ++dynsymcount;
+
+ return elf_hash_table (info)->dynsymcount = dynsymcount;
+}
-/* Create a special linker section, or return a pointer to a linker section already created */
+/* Create a special linker section, or return a pointer to a linker
+ section already created */
elf_linker_section_t *
_bfd_elf_create_linker_section (abfd, info, which, defaults)
@@ -313,7 +420,7 @@ _bfd_elf_create_linker_section (abfd, info, which, defaults)
s->_raw_size += lsect->hole_size;
if (lsect->hole_offset > lsect->max_hole_offset)
{
- (*_bfd_error_handler) ("%s: Section %s is already to large to put hole of %ld bytes in",
+ (*_bfd_error_handler) (_("%s: Section %s is already to large to put hole of %ld bytes in"),
bfd_get_filename (abfd),
lsect->name,
(long)lsect->hole_size);
diff --git a/contrib/binutils/bfd/elflink.h b/contrib/binutils/bfd/elflink.h
index 21bd270c0a44..bddf29071198 100644
--- a/contrib/binutils/bfd/elflink.h
+++ b/contrib/binutils/bfd/elflink.h
@@ -1,5 +1,5 @@
/* ELF linker support.
- Copyright 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -48,8 +48,17 @@ static boolean elf_link_find_version_dependencies
PARAMS ((struct elf_link_hash_entry *, PTR));
static boolean elf_link_assign_sym_version
PARAMS ((struct elf_link_hash_entry *, PTR));
-static boolean elf_link_renumber_dynsyms
+static boolean elf_collect_hash_codes
PARAMS ((struct elf_link_hash_entry *, PTR));
+static boolean elf_link_read_relocs_from_section
+ PARAMS ((bfd *, Elf_Internal_Shdr *, PTR, Elf_Internal_Rela *));
+static void elf_link_output_relocs
+ PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *));
+static boolean elf_link_size_reloc_section
+ PARAMS ((bfd *, Elf_Internal_Shdr *, asection *));
+static void elf_link_adjust_relocs
+ PARAMS ((bfd *, Elf_Internal_Shdr *, unsigned int,
+ struct elf_link_hash_entry **));
/* Given an ELF BFD, add symbols to the global hash table as
appropriate. */
@@ -71,6 +80,138 @@ elf_bfd_link_add_symbols (abfd, info)
}
}
+/* Return true iff this is a non-common definition of a symbol. */
+static boolean
+is_global_symbol_definition (abfd, sym)
+ bfd * abfd ATTRIBUTE_UNUSED;
+ Elf_Internal_Sym * sym;
+{
+ /* Local symbols do not count, but target specific ones might. */
+ if (ELF_ST_BIND (sym->st_info) != STB_GLOBAL
+ && ELF_ST_BIND (sym->st_info) < STB_LOOS)
+ return false;
+
+ /* If the section is undefined, then so is the symbol. */
+ if (sym->st_shndx == SHN_UNDEF)
+ return false;
+
+ /* If the symbol is defined in the common section, then
+ it is a common definition and so does not count. */
+ if (sym->st_shndx == SHN_COMMON)
+ return false;
+
+ /* If the symbol is in a target specific section then we
+ must rely upon the backend to tell us what it is. */
+ if (sym->st_shndx >= SHN_LORESERVE && sym->st_shndx < SHN_ABS)
+ /* FIXME - this function is not coded yet:
+
+ return _bfd_is_global_symbol_definition (abfd, sym);
+
+ Instead for now assume that the definition is not global,
+ Even if this is wrong, at least the linker will behave
+ in the same way that it used to do. */
+ return false;
+
+ return true;
+}
+
+
+/* Search the symbol table of the archive element of the archive ABFD
+ whoes archove map contains a mention of SYMDEF, and determine if
+ the symbol is defined in this element. */
+static boolean
+elf_link_is_defined_archive_symbol (abfd, symdef)
+ bfd * abfd;
+ carsym * symdef;
+{
+ Elf_Internal_Shdr * hdr;
+ Elf_External_Sym * esym;
+ Elf_External_Sym * esymend;
+ Elf_External_Sym * buf = NULL;
+ size_t symcount;
+ size_t extsymcount;
+ size_t extsymoff;
+ boolean result = false;
+
+ abfd = _bfd_get_elt_at_filepos (abfd, symdef->file_offset);
+ if (abfd == (bfd *) NULL)
+ return false;
+
+ if (! bfd_check_format (abfd, bfd_object))
+ return false;
+
+ /* If we have already included the element containing this symbol in the
+ link then we do not need to include it again. Just claim that any symbol
+ it contains is not a definition, so that our caller will not decide to
+ (re)include this element. */
+ if (abfd->archive_pass)
+ return false;
+
+ /* Select the appropriate symbol table. */
+ if ((abfd->flags & DYNAMIC) == 0 || elf_dynsymtab (abfd) == 0)
+ hdr = &elf_tdata (abfd)->symtab_hdr;
+ else
+ hdr = &elf_tdata (abfd)->dynsymtab_hdr;
+
+ symcount = hdr->sh_size / sizeof (Elf_External_Sym);
+
+ /* The sh_info field of the symtab header tells us where the
+ external symbols start. We don't care about the local symbols. */
+ if (elf_bad_symtab (abfd))
+ {
+ extsymcount = symcount;
+ extsymoff = 0;
+ }
+ else
+ {
+ extsymcount = symcount - hdr->sh_info;
+ extsymoff = hdr->sh_info;
+ }
+
+ buf = ((Elf_External_Sym *)
+ bfd_malloc (extsymcount * sizeof (Elf_External_Sym)));
+ if (buf == NULL && extsymcount != 0)
+ return false;
+
+ /* Read in the symbol table.
+ FIXME: This ought to be cached somewhere. */
+ if (bfd_seek (abfd,
+ hdr->sh_offset + extsymoff * sizeof (Elf_External_Sym),
+ SEEK_SET) != 0
+ || (bfd_read ((PTR) buf, sizeof (Elf_External_Sym), extsymcount, abfd)
+ != extsymcount * sizeof (Elf_External_Sym)))
+ {
+ free (buf);
+ return false;
+ }
+
+ /* Scan the symbol table looking for SYMDEF. */
+ esymend = buf + extsymcount;
+ for (esym = buf;
+ esym < esymend;
+ esym++)
+ {
+ Elf_Internal_Sym sym;
+ const char * name;
+
+ elf_swap_symbol_in (abfd, esym, & sym);
+
+ name = bfd_elf_string_from_elf_section (abfd, hdr->sh_link, sym.st_name);
+ if (name == (const char *) NULL)
+ break;
+
+ if (strcmp (name, symdef->name) == 0)
+ {
+ result = is_global_symbol_definition (abfd, & sym);
+ break;
+ }
+ }
+
+ free (buf);
+
+ return result;
+}
+
/* Add symbols from an ELF archive file to the linker hash table. We
don't use _bfd_generic_link_add_archive_symbols because of a
@@ -191,7 +332,24 @@ elf_link_add_archive_symbols (abfd, info)
if (h == NULL)
continue;
- if (h->root.type != bfd_link_hash_undefined)
+ if (h->root.type == bfd_link_hash_common)
+ {
+ /* We currently have a common symbol. The archive map contains
+ a reference to this symbol, so we may want to include it. We
+ only want to include it however, if this archive element
+ contains a definition of the symbol, not just another common
+ declaration of it.
+
+ Unfortunately some archivers (including GNU ar) will put
+ declarations of common symbols into their archive maps, as
+ well as real definitions, so we cannot just go by the archive
+ map alone. Instead we must read in the element's symbol
+ table and check that to see what kind of symbol definition
+ this is. */
+ if (! elf_link_is_defined_archive_symbol (abfd, symdef))
+ continue;
+ }
+ else if (h->root.type != bfd_link_hash_undefined)
{
if (h->root.type != bfd_link_hash_undefweak)
defined[i] = true;
@@ -299,8 +457,6 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
boolean newdyn, olddyn, olddef, newdef, newdyncommon, olddyncommon;
*override = false;
- *type_change_ok = false;
- *size_change_ok = false;
sec = *psec;
bind = ELF_ST_BIND (sym->st_info);
@@ -358,6 +514,17 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
break;
}
+ /* In cases involving weak versioned symbols, we may wind up trying
+ to merge a symbol with itself. Catch that here, to avoid the
+ confusion that results if we try to override a symbol with
+ itself. The additional tests catch cases like
+ _GLOBAL_OFFSET_TABLE_, which are regular symbols defined in a
+ dynamic object, which we do want to handle here. */
+ if (abfd == oldbfd
+ && ((abfd->flags & DYNAMIC) == 0
+ || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0))
+ return true;
+
/* NEWDYN and OLDDYN indicate whether the new or old symbol,
respectively, is from a dynamic object. */
@@ -366,10 +533,35 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
else
newdyn = false;
- if (oldbfd == NULL || (oldbfd->flags & DYNAMIC) == 0)
- olddyn = false;
+ if (oldbfd != NULL)
+ olddyn = (oldbfd->flags & DYNAMIC) != 0;
else
- olddyn = true;
+ {
+ asection *hsec;
+
+ /* This code handles the special SHN_MIPS_{TEXT,DATA} section
+ indices used by MIPS ELF. */
+ switch (h->root.type)
+ {
+ default:
+ hsec = NULL;
+ break;
+
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ hsec = h->root.u.def.section;
+ break;
+
+ case bfd_link_hash_common:
+ hsec = h->root.u.c.p->section;
+ break;
+ }
+
+ if (hsec == NULL)
+ olddyn = false;
+ else
+ olddyn = (hsec->symbol->flags & BSF_DYNAMIC) != 0;
+ }
/* NEWDEF and OLDDEF indicate whether the new or old symbol,
respectively, appear to be a definition rather than reference. */
@@ -484,14 +676,19 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
represent variables; this can cause confusion in principle, but
any such confusion would seem to indicate an erroneous program or
shared library. We also permit a common symbol in a regular
- object to override a weak symbol in a shared object. */
+ object to override a weak symbol in a shared object.
+
+ We prefer a non-weak definition in a shared library to a weak
+ definition in the executable. */
if (newdyn
&& newdef
&& (olddef
|| (h->root.type == bfd_link_hash_common
&& (bind == STB_WEAK
- || ELF_ST_TYPE (sym->st_info) == STT_FUNC))))
+ || ELF_ST_TYPE (sym->st_info) == STT_FUNC)))
+ && (h->root.type != bfd_link_hash_defweak
+ || bind == STB_WEAK))
{
*override = true;
newdef = false;
@@ -535,7 +732,10 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
As above, we again permit a common symbol in a regular object to
override a definition in a shared object if the shared object
- symbol is a function or is weak. */
+ symbol is a function or is weak.
+
+ As above, we permit a non-weak definition in a shared object to
+ override a weak definition in a regular object. */
if (! newdyn
&& (newdef
@@ -544,7 +744,9 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
|| h->type == STT_FUNC)))
&& olddyn
&& olddef
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ && (bind != STB_WEAK
+ || h->root.type == bfd_link_hash_defweak))
{
/* Change the hash table entry to undefined, and let
_bfd_generic_link_add_one_symbol do the right thing with the
@@ -618,6 +820,45 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
h->verinfo.vertree = NULL;
}
+ /* Handle the special case of a weak definition in a regular object
+ followed by a non-weak definition in a shared object. In this
+ case, we prefer the definition in the shared object. */
+ if (olddef
+ && h->root.type == bfd_link_hash_defweak
+ && newdef
+ && newdyn
+ && bind != STB_WEAK)
+ {
+ /* To make this work we have to frob the flags so that the rest
+ of the code does not think we are using the regular
+ definition. */
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
+ h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
+ else if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)
+ h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
+ h->elf_link_hash_flags &= ~ (ELF_LINK_HASH_DEF_REGULAR
+ | ELF_LINK_HASH_DEF_DYNAMIC);
+
+ /* If H is the target of an indirection, we want the caller to
+ use H rather than the indirect symbol. Otherwise if we are
+ defining a new indirect symbol we will wind up attaching it
+ to the entry we are overriding. */
+ *sym_hash = h;
+ }
+
+ /* Handle the special case of a non-weak definition in a shared
+ object followed by a weak definition in a regular object. In
+ this case we prefer to definition in the shared object. To make
+ this work we have to tell the caller to not treat the new symbol
+ as a definition. */
+ if (olddef
+ && olddyn
+ && h->root.type != bfd_link_hash_defweak
+ && newdef
+ && ! newdyn
+ && bind == STB_WEAK)
+ *override = true;
+
return true;
}
@@ -649,9 +890,11 @@ elf_link_add_object_symbols (abfd, info)
struct elf_link_hash_entry *weaks;
Elf_External_Sym *esym;
Elf_External_Sym *esymend;
+ struct elf_backend_data *bed;
- add_symbol_hook = get_elf_backend_data (abfd)->elf_add_symbol_hook;
- collect = get_elf_backend_data (abfd)->collect;
+ bed = get_elf_backend_data (abfd);
+ add_symbol_hook = bed->elf_add_symbol_hook;
+ collect = bed->collect;
if ((abfd->flags & DYNAMIC) == 0)
dynamic = false;
@@ -719,13 +962,15 @@ elf_link_add_object_symbols (abfd, info)
}
sz = bfd_section_size (abfd, s);
- msg = (char *) bfd_alloc (abfd, sz);
+ msg = (char *) bfd_alloc (abfd, sz + 1);
if (msg == NULL)
goto error_return;
if (! bfd_get_section_contents (abfd, s, msg, (file_ptr) 0, sz))
goto error_return;
+ msg[sz] = '\0';
+
if (! (_bfd_generic_link_add_one_symbol
(info, abfd, name, BSF_WARNING, s, (bfd_vma) 0, msg,
false, collect, (struct bfd_link_hash_entry **) NULL)))
@@ -864,6 +1109,23 @@ elf_link_add_object_symbols (abfd, info)
goto error_return;
link = elf_elfsections (abfd)[elfsec]->sh_link;
+ {
+ /* The shared libraries distributed with hpux11 have a bogus
+ sh_link field for the ".dynamic" section. This code detects
+ when LINK refers to a section that is not a string table and
+ tries to find the string table for the ".dynsym" section
+ instead. */
+ Elf_Internal_Shdr *hdr = elf_elfsections (abfd)[link];
+ if (hdr->sh_type != SHT_STRTAB)
+ {
+ asection *s = bfd_get_section_by_name (abfd, ".dynsym");
+ int elfsec = _bfd_elf_section_from_bfd_section (abfd, s);
+ if (elfsec == -1)
+ goto error_return;
+ link = elf_elfsections (abfd)[elfsec]->sh_link;
+ }
+ }
+
extdyn = dynbuf;
extdynend = extdyn + s->_raw_size / sizeof (Elf_External_Dyn);
for (; extdyn < extdynend; extdyn++)
@@ -1123,8 +1385,8 @@ elf_link_add_object_symbols (abfd, info)
if (vernum > elf_tdata (abfd)->dynverdef_hdr.sh_info)
{
(*_bfd_error_handler)
- ("%s: %s: invalid version %u (max %d)",
- abfd->filename, name, vernum,
+ (_("%s: %s: invalid version %u (max %d)"),
+ bfd_get_filename (abfd), name, vernum,
elf_tdata (abfd)->dynverdef_hdr.sh_info);
bfd_set_error (bfd_error_bad_value);
goto error_return;
@@ -1164,8 +1426,8 @@ elf_link_add_object_symbols (abfd, info)
if (verstr == NULL)
{
(*_bfd_error_handler)
- ("%s: %s: invalid needed version %d",
- abfd->filename, name, vernum);
+ (_("%s: %s: invalid needed version %d"),
+ bfd_get_filename (abfd), name, vernum);
bfd_set_error (bfd_error_bad_value);
goto error_return;
}
@@ -1182,7 +1444,11 @@ elf_link_add_object_symbols (abfd, info)
strcpy (newname, name);
p = newname + namelen;
*p++ = ELF_VER_CHR;
- if ((iver.vs_vers & VERSYM_HIDDEN) == 0)
+ /* If this is a defined non-hidden version symbol,
+ we add another @ to the name. This indicates the
+ default version of the symbol. */
+ if ((iver.vs_vers & VERSYM_HIDDEN) == 0
+ && sym.st_shndx != SHN_UNDEF)
*p++ = ELF_VER_CHR;
strcpy (p, verstr);
@@ -1277,7 +1543,7 @@ elf_link_add_object_symbols (abfd, info)
{
if (h->size != 0 && h->size != sym.st_size && ! size_change_ok)
(*_bfd_error_handler)
- ("Warning: size of symbol `%s' changed from %lu to %lu in %s",
+ (_("Warning: size of symbol `%s' changed from %lu to %lu in %s"),
name, (unsigned long) h->size, (unsigned long) sym.st_size,
bfd_get_filename (abfd));
@@ -1299,16 +1565,31 @@ elf_link_add_object_symbols (abfd, info)
&& h->type != ELF_ST_TYPE (sym.st_info)
&& ! type_change_ok)
(*_bfd_error_handler)
- ("Warning: type of symbol `%s' changed from %d to %d in %s",
+ (_("Warning: type of symbol `%s' changed from %d to %d in %s"),
name, h->type, ELF_ST_TYPE (sym.st_info),
bfd_get_filename (abfd));
h->type = ELF_ST_TYPE (sym.st_info);
}
- if (sym.st_other != 0
- && (definition || h->other == 0))
- h->other = sym.st_other;
+ /* If st_other has a processor-specific meaning, specific code
+ might be needed here. */
+ if (sym.st_other != 0)
+ {
+ /* Combine visibilities, using the most constraining one. */
+ unsigned char hvis = ELF_ST_VISIBILITY (h->other);
+ unsigned char symvis = ELF_ST_VISIBILITY (sym.st_other);
+
+ if (symvis && (hvis > symvis || hvis == 0))
+ h->other = sym.st_other;
+
+ /* If neither has visibility, use the st_other of the
+ definition. This is an arbitrary choice, since the
+ other bits have no general meaning. */
+ if (!symvis && !hvis
+ && (definition || h->other == 0))
+ h->other = sym.st_other;
+ }
/* Set a flag in the hash table entry indicating the type of
reference or definition we just found. Keep a count of
@@ -1320,7 +1601,11 @@ elf_link_add_object_symbols (abfd, info)
if (! dynamic)
{
if (! definition)
- new_flag = ELF_LINK_HASH_REF_REGULAR;
+ {
+ new_flag = ELF_LINK_HASH_REF_REGULAR;
+ if (bind != STB_WEAK)
+ new_flag |= ELF_LINK_HASH_REF_REGULAR_NONWEAK;
+ }
else
new_flag = ELF_LINK_HASH_DEF_REGULAR;
if (info->shared
@@ -1372,6 +1657,8 @@ elf_link_add_object_symbols (abfd, info)
purposes of the merge, act as though we were
defining the symbol we just defined, although we
actually going to define an indirect symbol. */
+ type_change_ok = false;
+ size_change_ok = false;
if (! elf_merge_symbol (abfd, info, shortname, &sym, &sec,
&value, &hi, &override,
&type_change_ok, &size_change_ok))
@@ -1421,8 +1708,14 @@ elf_link_add_object_symbols (abfd, info)
{
h->elf_link_hash_flags &=~ ELF_LINK_HASH_DEF_DYNAMIC;
hi->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
- if (! _bfd_elf_link_record_dynamic_symbol (info, hi))
- goto error_return;
+ if (hi->elf_link_hash_flags
+ & (ELF_LINK_HASH_REF_REGULAR
+ | ELF_LINK_HASH_DEF_REGULAR))
+ {
+ if (! _bfd_elf_link_record_dynamic_symbol (info,
+ hi))
+ goto error_return;
+ }
}
/* Now set HI to H, so that the following code
@@ -1447,36 +1740,7 @@ elf_link_add_object_symbols (abfd, info)
== 0);
ht = (struct elf_link_hash_entry *) hi->root.u.i.link;
-
- /* Copy down any references that we may have
- already seen to the symbol which just became
- indirect. */
- ht->elf_link_hash_flags |=
- (hi->elf_link_hash_flags
- & (ELF_LINK_HASH_REF_DYNAMIC
- | ELF_LINK_HASH_REF_REGULAR));
-
- /* Copy over the global table offset entry.
- This may have been already set up by a
- check_relocs routine. */
- if (ht->got_offset == (bfd_vma) -1)
- {
- ht->got_offset = hi->got_offset;
- hi->got_offset = (bfd_vma) -1;
- }
- BFD_ASSERT (hi->got_offset == (bfd_vma) -1);
-
- if (ht->dynindx == -1)
- {
- ht->dynindx = hi->dynindx;
- ht->dynstr_index = hi->dynstr_index;
- hi->dynindx = -1;
- hi->dynstr_index = 0;
- }
- BFD_ASSERT (hi->dynindx == -1);
-
- /* FIXME: There may be other information to copy
- over for particular targets. */
+ (*bed->elf_backend_copy_indirect_symbol) (ht, hi);
/* See if the new flags lead us to realize that
the symbol must be dynamic. */
@@ -1510,6 +1774,8 @@ elf_link_add_object_symbols (abfd, info)
strcpy (shortname + (p - name), p + 1);
/* Once again, merge with any existing symbol. */
+ type_change_ok = false;
+ size_change_ok = false;
if (! elf_merge_symbol (abfd, info, shortname, &sym, &sec,
&value, &hi, &override,
&type_change_ok, &size_change_ok))
@@ -1521,7 +1787,7 @@ elf_link_add_object_symbols (abfd, info)
don't expect to see the type of override we
do in the case above. */
(*_bfd_error_handler)
- ("%s: warning: unexpected redefinition of `%s'",
+ (_("%s: warning: unexpected redefinition of `%s'"),
bfd_get_filename (abfd), shortname);
}
else
@@ -1547,35 +1813,7 @@ elf_link_add_object_symbols (abfd, info)
| ELF_LINK_HASH_DEF_REGULAR))
== 0);
- /* Copy down any references that we may have
- already seen to the symbol which just
- became indirect. */
- h->elf_link_hash_flags |=
- (hi->elf_link_hash_flags
- & (ELF_LINK_HASH_REF_DYNAMIC
- | ELF_LINK_HASH_REF_REGULAR));
-
- /* Copy over the global table offset entry.
- This may have been already set up by a
- check_relocs routine. */
- if (h->got_offset == (bfd_vma) -1)
- {
- h->got_offset = hi->got_offset;
- hi->got_offset = (bfd_vma) -1;
- }
- BFD_ASSERT (hi->got_offset == (bfd_vma) -1);
-
- if (h->dynindx == -1)
- {
- h->dynindx = hi->dynindx;
- h->dynstr_index = hi->dynstr_index;
- hi->dynindx = -1;
- hi->dynstr_index = 0;
- }
- BFD_ASSERT (hi->dynindx == -1);
-
- /* FIXME: There may be other information to
- copy over for particular targets. */
+ (*bed->elf_backend_copy_indirect_symbol) (h, hi);
/* See if the new flags lead us to realize
that the symbol must be dynamic. */
@@ -1905,16 +2143,18 @@ elf_link_create_dynamic_sections (abfd, info)
&& ! _bfd_elf_link_record_dynamic_symbol (info, h))
return false;
+ bed = get_elf_backend_data (abfd);
+
s = bfd_make_section (abfd, ".hash");
if (s == NULL
|| ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
|| ! bfd_set_section_alignment (abfd, s, LOG_FILE_ALIGN))
return false;
+ elf_section_data (s)->this_hdr.sh_entsize = bed->s->sizeof_hash_entry;
/* Let the backend create the rest of the sections. This lets the
backend set the right flags. The backend will normally create
the .got and .plt sections. */
- bed = get_elf_backend_data (abfd);
if (! (*bed->elf_backend_create_dynamic_sections) (abfd, info))
return false;
@@ -1957,14 +2197,174 @@ elf_add_dynamic_entry (info, tag, val)
return true;
}
+
+/* Record a new local dynamic symbol. */
+
+boolean
+elf_link_record_local_dynamic_symbol (info, input_bfd, input_indx)
+ struct bfd_link_info *info;
+ bfd *input_bfd;
+ long input_indx;
+{
+ struct elf_link_local_dynamic_entry *entry;
+ struct elf_link_hash_table *eht;
+ struct bfd_strtab_hash *dynstr;
+ Elf_External_Sym esym;
+ unsigned long dynstr_index;
+ char *name;
+
+ /* See if the entry exists already. */
+ for (entry = elf_hash_table (info)->dynlocal; entry ; entry = entry->next)
+ if (entry->input_bfd == input_bfd && entry->input_indx == input_indx)
+ return true;
+
+ entry = (struct elf_link_local_dynamic_entry *)
+ bfd_alloc (input_bfd, sizeof (*entry));
+ if (entry == NULL)
+ return false;
+
+ /* Go find the symbol, so that we can find it's name. */
+ if (bfd_seek (input_bfd,
+ (elf_tdata (input_bfd)->symtab_hdr.sh_offset
+ + input_indx * sizeof (Elf_External_Sym)),
+ SEEK_SET) != 0
+ || (bfd_read (&esym, sizeof (Elf_External_Sym), 1, input_bfd)
+ != sizeof (Elf_External_Sym)))
+ return false;
+ elf_swap_symbol_in (input_bfd, &esym, &entry->isym);
+
+ name = (bfd_elf_string_from_elf_section
+ (input_bfd, elf_tdata (input_bfd)->symtab_hdr.sh_link,
+ entry->isym.st_name));
+
+ dynstr = elf_hash_table (info)->dynstr;
+ if (dynstr == NULL)
+ {
+ /* Create a strtab to hold the dynamic symbol names. */
+ elf_hash_table (info)->dynstr = dynstr = _bfd_elf_stringtab_init ();
+ if (dynstr == NULL)
+ return false;
+ }
+
+ dynstr_index = _bfd_stringtab_add (dynstr, name, true, false);
+ if (dynstr_index == (unsigned long) -1)
+ return false;
+ entry->isym.st_name = dynstr_index;
+
+ eht = elf_hash_table (info);
+
+ entry->next = eht->dynlocal;
+ eht->dynlocal = entry;
+ entry->input_bfd = input_bfd;
+ entry->input_indx = input_indx;
+ eht->dynsymcount++;
+
+ /* Whatever binding the symbol had before, it's now local. */
+ entry->isym.st_info
+ = ELF_ST_INFO (STB_LOCAL, ELF_ST_TYPE (entry->isym.st_info));
+
+ /* The dynindx will be set at the end of size_dynamic_sections. */
+
+ return true;
+}
-/* Read and swap the relocs for a section. They may have been cached.
- If the EXTERNAL_RELOCS and INTERNAL_RELOCS arguments are not NULL,
- they are used as buffers to read into. They are known to be large
- enough. If the INTERNAL_RELOCS relocs argument is NULL, the return
- value is allocated using either malloc or bfd_alloc, according to
- the KEEP_MEMORY argument. */
+/* Read and swap the relocs from the section indicated by SHDR. This
+ may be either a REL or a RELA section. The relocations are
+ translated into RELA relocations and stored in INTERNAL_RELOCS,
+ which should have already been allocated to contain enough space.
+ The EXTERNAL_RELOCS are a buffer where the external form of the
+ relocations should be stored.
+
+ Returns false if something goes wrong. */
+
+static boolean
+elf_link_read_relocs_from_section (abfd, shdr, external_relocs,
+ internal_relocs)
+ bfd *abfd;
+ Elf_Internal_Shdr *shdr;
+ PTR external_relocs;
+ Elf_Internal_Rela *internal_relocs;
+{
+ struct elf_backend_data *bed;
+
+ /* If there aren't any relocations, that's OK. */
+ if (!shdr)
+ return true;
+
+ /* Position ourselves at the start of the section. */
+ if (bfd_seek (abfd, shdr->sh_offset, SEEK_SET) != 0)
+ return false;
+
+ /* Read the relocations. */
+ if (bfd_read (external_relocs, 1, shdr->sh_size, abfd)
+ != shdr->sh_size)
+ return false;
+
+ bed = get_elf_backend_data (abfd);
+
+ /* Convert the external relocations to the internal format. */
+ if (shdr->sh_entsize == sizeof (Elf_External_Rel))
+ {
+ Elf_External_Rel *erel;
+ Elf_External_Rel *erelend;
+ Elf_Internal_Rela *irela;
+ Elf_Internal_Rel *irel;
+
+ erel = (Elf_External_Rel *) external_relocs;
+ erelend = erel + shdr->sh_size / shdr->sh_entsize;
+ irela = internal_relocs;
+ irel = bfd_alloc (abfd, (bed->s->int_rels_per_ext_rel
+ * sizeof (Elf_Internal_Rel)));
+ for (; erel < erelend; erel++, irela += bed->s->int_rels_per_ext_rel)
+ {
+ unsigned char i;
+
+ if (bed->s->swap_reloc_in)
+ (*bed->s->swap_reloc_in) (abfd, (bfd_byte *) erel, irel);
+ else
+ elf_swap_reloc_in (abfd, erel, irel);
+
+ for (i = 0; i < bed->s->int_rels_per_ext_rel; ++i)
+ {
+ irela[i].r_offset = irel[i].r_offset;
+ irela[i].r_info = irel[i].r_info;
+ irela[i].r_addend = 0;
+ }
+ }
+ }
+ else
+ {
+ Elf_External_Rela *erela;
+ Elf_External_Rela *erelaend;
+ Elf_Internal_Rela *irela;
+
+ BFD_ASSERT (shdr->sh_entsize == sizeof (Elf_External_Rela));
+
+ erela = (Elf_External_Rela *) external_relocs;
+ erelaend = erela + shdr->sh_size / shdr->sh_entsize;
+ irela = internal_relocs;
+ for (; erela < erelaend; erela++, irela += bed->s->int_rels_per_ext_rel)
+ {
+ if (bed->s->swap_reloca_in)
+ (*bed->s->swap_reloca_in) (abfd, (bfd_byte *) erela, irela);
+ else
+ elf_swap_reloca_in (abfd, erela, irela);
+ }
+ }
+
+ return true;
+}
+
+/* Read and swap the relocs for a section O. They may have been
+ cached. If the EXTERNAL_RELOCS and INTERNAL_RELOCS arguments are
+ not NULL, they are used as buffers to read into. They are known to
+ be large enough. If the INTERNAL_RELOCS relocs argument is NULL,
+ the return value is allocated using either malloc or bfd_alloc,
+ according to the KEEP_MEMORY argument. If O has two relocation
+ sections (both REL and RELA relocations), then the REL_HDR
+ relocations will appear first in INTERNAL_RELOCS, followed by the
+ REL_HDR2 relocations. */
Elf_Internal_Rela *
NAME(_bfd_elf,link_read_relocs) (abfd, o, external_relocs, internal_relocs,
@@ -1978,6 +2378,7 @@ NAME(_bfd_elf,link_read_relocs) (abfd, o, external_relocs, internal_relocs,
Elf_Internal_Shdr *rel_hdr;
PTR alloc1 = NULL;
Elf_Internal_Rela *alloc2 = NULL;
+ struct elf_backend_data *bed = get_elf_backend_data (abfd);
if (elf_section_data (o)->relocs != NULL)
return elf_section_data (o)->relocs;
@@ -1991,7 +2392,8 @@ NAME(_bfd_elf,link_read_relocs) (abfd, o, external_relocs, internal_relocs,
{
size_t size;
- size = o->reloc_count * sizeof (Elf_Internal_Rela);
+ size = (o->reloc_count * bed->s->int_rels_per_ext_rel
+ * sizeof (Elf_Internal_Rela));
if (keep_memory)
internal_relocs = (Elf_Internal_Rela *) bfd_alloc (abfd, size);
else
@@ -2002,53 +2404,27 @@ NAME(_bfd_elf,link_read_relocs) (abfd, o, external_relocs, internal_relocs,
if (external_relocs == NULL)
{
- alloc1 = (PTR) bfd_malloc ((size_t) rel_hdr->sh_size);
+ size_t size = (size_t) rel_hdr->sh_size;
+
+ if (elf_section_data (o)->rel_hdr2)
+ size += (size_t) elf_section_data (o)->rel_hdr2->sh_size;
+ alloc1 = (PTR) bfd_malloc (size);
if (alloc1 == NULL)
goto error_return;
external_relocs = alloc1;
}
- if ((bfd_seek (abfd, rel_hdr->sh_offset, SEEK_SET) != 0)
- || (bfd_read (external_relocs, 1, rel_hdr->sh_size, abfd)
- != rel_hdr->sh_size))
+ if (!elf_link_read_relocs_from_section (abfd, rel_hdr,
+ external_relocs,
+ internal_relocs))
+ goto error_return;
+ if (!elf_link_read_relocs_from_section
+ (abfd,
+ elf_section_data (o)->rel_hdr2,
+ ((bfd_byte *) external_relocs) + rel_hdr->sh_size,
+ internal_relocs + (rel_hdr->sh_size / rel_hdr->sh_entsize
+ * bed->s->int_rels_per_ext_rel)))
goto error_return;
-
- /* Swap in the relocs. For convenience, we always produce an
- Elf_Internal_Rela array; if the relocs are Rel, we set the addend
- to 0. */
- if (rel_hdr->sh_entsize == sizeof (Elf_External_Rel))
- {
- Elf_External_Rel *erel;
- Elf_External_Rel *erelend;
- Elf_Internal_Rela *irela;
-
- erel = (Elf_External_Rel *) external_relocs;
- erelend = erel + o->reloc_count;
- irela = internal_relocs;
- for (; erel < erelend; erel++, irela++)
- {
- Elf_Internal_Rel irel;
-
- elf_swap_reloc_in (abfd, erel, &irel);
- irela->r_offset = irel.r_offset;
- irela->r_info = irel.r_info;
- irela->r_addend = 0;
- }
- }
- else
- {
- Elf_External_Rela *erela;
- Elf_External_Rela *erelaend;
- Elf_Internal_Rela *irela;
-
- BFD_ASSERT (rel_hdr->sh_entsize == sizeof (Elf_External_Rela));
-
- erela = (Elf_External_Rela *) external_relocs;
- erelaend = erela + o->reloc_count;
- irela = internal_relocs;
- for (; erela < erelaend; erela++, irela++)
- elf_swap_reloca_in (abfd, erela, irela);
- }
/* Cache the results for next time, if we can. */
if (keep_memory)
@@ -2077,7 +2453,7 @@ NAME(_bfd_elf,link_read_relocs) (abfd, o, external_relocs, internal_relocs,
/*ARGSUSED*/
boolean
NAME(bfd_elf,record_link_assignment) (output_bfd, info, name, provide)
- bfd *output_bfd;
+ bfd *output_bfd ATTRIBUTE_UNUSED;
struct bfd_link_info *info;
const char *name;
boolean provide;
@@ -2113,7 +2489,10 @@ NAME(bfd_elf,record_link_assignment) (output_bfd, info, name, provide)
h->verinfo.verdef = NULL;
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
- h->type = STT_OBJECT;
+
+ /* When possible, keep the original type of the symbol */
+ if (h->type == STT_NOTYPE)
+ h->type = STT_OBJECT;
if (((h->elf_link_hash_flags & (ELF_LINK_HASH_DEF_DYNAMIC
| ELF_LINK_HASH_REF_DYNAMIC)) != 0
@@ -2150,8 +2529,6 @@ struct elf_assign_sym_version_info
struct bfd_elf_version_tree *verdefs;
/* Whether we are exporting all dynamic symbols. */
boolean export_dynamic;
- /* Whether we removed any symbols from the dynamic symbol table. */
- boolean removed_dynamic;
/* Whether we had a failure. */
boolean failed;
};
@@ -2183,6 +2560,149 @@ static const size_t elf_buckets[] =
16411, 32771, 0
};
+/* Compute bucket count for hashing table. We do not use a static set
+ of possible tables sizes anymore. Instead we determine for all
+ possible reasonable sizes of the table the outcome (i.e., the
+ number of collisions etc) and choose the best solution. The
+ weighting functions are not too simple to allow the table to grow
+ without bounds. Instead one of the weighting factors is the size.
+ Therefore the result is always a good payoff between few collisions
+ (= short chain lengths) and table size. */
+static size_t
+compute_bucket_count (info)
+ struct bfd_link_info *info;
+{
+ size_t dynsymcount = elf_hash_table (info)->dynsymcount;
+ size_t best_size = 0;
+ unsigned long int *hashcodes;
+ unsigned long int *hashcodesp;
+ unsigned long int i;
+
+ /* Compute the hash values for all exported symbols. At the same
+ time store the values in an array so that we could use them for
+ optimizations. */
+ hashcodes = (unsigned long int *) bfd_malloc (dynsymcount
+ * sizeof (unsigned long int));
+ if (hashcodes == NULL)
+ return 0;
+ hashcodesp = hashcodes;
+
+ /* Put all hash values in HASHCODES. */
+ elf_link_hash_traverse (elf_hash_table (info),
+ elf_collect_hash_codes, &hashcodesp);
+
+/* We have a problem here. The following code to optimize the table
+ size requires an integer type with more the 32 bits. If
+ BFD_HOST_U_64_BIT is set we know about such a type. */
+#ifdef BFD_HOST_U_64_BIT
+ if (info->optimize == true)
+ {
+ unsigned long int nsyms = hashcodesp - hashcodes;
+ size_t minsize;
+ size_t maxsize;
+ BFD_HOST_U_64_BIT best_chlen = ~((BFD_HOST_U_64_BIT) 0);
+ unsigned long int *counts ;
+
+ /* Possible optimization parameters: if we have NSYMS symbols we say
+ that the hashing table must at least have NSYMS/4 and at most
+ 2*NSYMS buckets. */
+ minsize = nsyms / 4;
+ if (minsize == 0)
+ minsize = 1;
+ best_size = maxsize = nsyms * 2;
+
+ /* Create array where we count the collisions in. We must use bfd_malloc
+ since the size could be large. */
+ counts = (unsigned long int *) bfd_malloc (maxsize
+ * sizeof (unsigned long int));
+ if (counts == NULL)
+ {
+ free (hashcodes);
+ return 0;
+ }
+
+ /* Compute the "optimal" size for the hash table. The criteria is a
+ minimal chain length. The minor criteria is (of course) the size
+ of the table. */
+ for (i = minsize; i < maxsize; ++i)
+ {
+ /* Walk through the array of hashcodes and count the collisions. */
+ BFD_HOST_U_64_BIT max;
+ unsigned long int j;
+ unsigned long int fact;
+
+ memset (counts, '\0', i * sizeof (unsigned long int));
+
+ /* Determine how often each hash bucket is used. */
+ for (j = 0; j < nsyms; ++j)
+ ++counts[hashcodes[j] % i];
+
+ /* For the weight function we need some information about the
+ pagesize on the target. This is information need not be 100%
+ accurate. Since this information is not available (so far) we
+ define it here to a reasonable default value. If it is crucial
+ to have a better value some day simply define this value. */
+# ifndef BFD_TARGET_PAGESIZE
+# define BFD_TARGET_PAGESIZE (4096)
+# endif
+
+ /* We in any case need 2 + NSYMS entries for the size values and
+ the chains. */
+ max = (2 + nsyms) * (ARCH_SIZE / 8);
+
+# if 1
+ /* Variant 1: optimize for short chains. We add the squares
+ of all the chain lengths (which favous many small chain
+ over a few long chains). */
+ for (j = 0; j < i; ++j)
+ max += counts[j] * counts[j];
+
+ /* This adds penalties for the overall size of the table. */
+ fact = i / (BFD_TARGET_PAGESIZE / (ARCH_SIZE / 8)) + 1;
+ max *= fact * fact;
+# else
+ /* Variant 2: Optimize a lot more for small table. Here we
+ also add squares of the size but we also add penalties for
+ empty slots (the +1 term). */
+ for (j = 0; j < i; ++j)
+ max += (1 + counts[j]) * (1 + counts[j]);
+
+ /* The overall size of the table is considered, but not as
+ strong as in variant 1, where it is squared. */
+ fact = i / (BFD_TARGET_PAGESIZE / (ARCH_SIZE / 8)) + 1;
+ max *= fact;
+# endif
+
+ /* Compare with current best results. */
+ if (max < best_chlen)
+ {
+ best_chlen = max;
+ best_size = i;
+ }
+ }
+
+ free (counts);
+ }
+ else
+#endif /* defined (BFD_HOST_U_64_BIT) */
+ {
+ /* This is the fallback solution if no 64bit type is available or if we
+ are not supposed to spend much time on optimizations. We select the
+ bucket count using a fixed set of numbers. */
+ for (i = 0; elf_buckets[i] != 0; i++)
+ {
+ best_size = elf_buckets[i];
+ if (dynsymcount < elf_buckets[i + 1])
+ break;
+ }
+ }
+
+ /* Free the arrays we needed. */
+ free (hashcodes);
+
+ return best_size;
+}
+
/* Set up the sizes and contents of the ELF dynamic sections. This is
called by the ELF linker emulation before_allocation routine. We
must set the sizes of the sections before the linker sets the
@@ -2206,7 +2726,6 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
bfd_size_type soname_indx;
bfd *dynobj;
struct elf_backend_data *bed;
- bfd_size_type old_dynsymcount;
struct elf_assign_sym_version_info asvinfo;
*sinterpptr = NULL;
@@ -2230,20 +2749,6 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
if (dynobj == NULL)
return true;
- /* If we are supposed to export all symbols into the dynamic symbol
- table (this is not the normal case), then do so. */
- if (export_dynamic)
- {
- struct elf_info_failed eif;
-
- eif.failed = false;
- eif.info = info;
- elf_link_hash_traverse (elf_hash_table (info), elf_export_symbol,
- (PTR) &eif);
- if (eif.failed)
- return false;
- }
-
if (elf_hash_table (info)->dynamic_sections_created)
{
struct elf_info_failed eif;
@@ -2306,12 +2811,25 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
}
}
+ /* If we are supposed to export all symbols into the dynamic symbol
+ table (this is not the normal case), then do so. */
+ if (export_dynamic)
+ {
+ struct elf_info_failed eif;
+
+ eif.failed = false;
+ eif.info = info;
+ elf_link_hash_traverse (elf_hash_table (info), elf_export_symbol,
+ (PTR) &eif);
+ if (eif.failed)
+ return false;
+ }
+
/* Attach all the symbols to their version information. */
asvinfo.output_bfd = output_bfd;
asvinfo.info = info;
asvinfo.verdefs = verdefs;
asvinfo.export_dynamic = export_dynamic;
- asvinfo.removed_dynamic = false;
asvinfo.failed = false;
elf_link_hash_traverse (elf_hash_table (info),
@@ -2333,8 +2851,14 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
/* Add some entries to the .dynamic section. We fill in some of the
values later, in elf_bfd_final_link, but we must add the entries
now so that we know the final size of the .dynamic section. */
- h = elf_link_hash_lookup (elf_hash_table (info), "_init", false,
- false, false);
+
+ /* If there are initialization and/or finalization functions to
+ call then add the corresponding DT_INIT/DT_FINI entries. */
+ h = (info->init_function
+ ? elf_link_hash_lookup (elf_hash_table (info),
+ info->init_function, false,
+ false, false)
+ : NULL);
if (h != NULL
&& (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR
| ELF_LINK_HASH_DEF_REGULAR)) != 0)
@@ -2342,8 +2866,11 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
if (! elf_add_dynamic_entry (info, DT_INIT, 0))
return false;
}
- h = elf_link_hash_lookup (elf_hash_table (info), "_fini", false,
- false, false);
+ h = (info->fini_function
+ ? elf_link_hash_lookup (elf_hash_table (info),
+ info->fini_function, false,
+ false, false)
+ : NULL);
if (h != NULL
&& (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR
| ELF_LINK_HASH_DEF_REGULAR)) != 0)
@@ -2351,6 +2878,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
if (! elf_add_dynamic_entry (info, DT_FINI, 0))
return false;
}
+
strsize = _bfd_stringtab_size (elf_hash_table (info)->dynstr);
if (! elf_add_dynamic_entry (info, DT_HASH, 0)
|| ! elf_add_dynamic_entry (info, DT_STRTAB, 0)
@@ -2363,17 +2891,17 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
/* The backend must work out the sizes of all the other dynamic
sections. */
- old_dynsymcount = elf_hash_table (info)->dynsymcount;
- if (! (*bed->elf_backend_size_dynamic_sections) (output_bfd, info))
+ if (bed->elf_backend_size_dynamic_sections
+ && ! (*bed->elf_backend_size_dynamic_sections) (output_bfd, info))
return false;
if (elf_hash_table (info)->dynamic_sections_created)
{
size_t dynsymcount;
asection *s;
- size_t i;
size_t bucketcount = 0;
Elf_Internal_Sym isym;
+ size_t hash_entry_size;
/* Set up the version definition section. */
s = bfd_get_section_by_name (dynobj, ".gnu.version_d");
@@ -2384,17 +2912,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
verdefs = asvinfo.verdefs;
if (verdefs == NULL)
- {
- asection **spp;
-
- /* Don't include this section in the output file. */
- for (spp = &output_bfd->sections;
- *spp != s->output_section;
- spp = &(*spp)->next)
- ;
- *spp = s->output_section->next;
- --output_bfd->section_count;
- }
+ _bfd_strip_section_from_output (info, s);
else
{
unsigned int cdefs;
@@ -2404,23 +2922,6 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
Elf_Internal_Verdef def;
Elf_Internal_Verdaux defaux;
- if (asvinfo.removed_dynamic)
- {
- /* Some dynamic symbols were changed to be local
- symbols. In this case, we renumber all of the
- dynamic symbols, so that we don't have a hole. If
- the backend changed dynsymcount, then assume that the
- new symbols are at the start. This is the case on
- the MIPS. FIXME: The names of the removed symbols
- will still be in the dynamic string table, wasting
- space. */
- elf_hash_table (info)->dynsymcount =
- 1 + (elf_hash_table (info)->dynsymcount - old_dynsymcount);
- elf_link_hash_traverse (elf_hash_table (info),
- elf_link_renumber_dynsyms,
- (PTR) info);
- }
-
cdefs = 0;
size = 0;
@@ -2460,7 +2961,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
if (soname_indx != (bfd_size_type) -1)
{
- def.vd_hash = bfd_elf_hash ((const unsigned char *) soname);
+ def.vd_hash = bfd_elf_hash (soname);
defaux.vda_name = soname_indx;
}
else
@@ -2469,7 +2970,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
bfd_size_type indx;
name = output_bfd->filename;
- def.vd_hash = bfd_elf_hash ((const unsigned char *) name);
+ def.vd_hash = bfd_elf_hash (name);
indx = _bfd_stringtab_add (elf_hash_table (info)->dynstr,
name, true, false);
if (indx == (bfd_size_type) -1)
@@ -2517,7 +3018,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
def.vd_flags |= VER_FLG_WEAK;
def.vd_ndx = t->vernum + 1;
def.vd_cnt = cdeps + 1;
- def.vd_hash = bfd_elf_hash ((const unsigned char *) t->name);
+ def.vd_hash = bfd_elf_hash (t->name);
def.vd_aux = sizeof (Elf_External_Verdef);
if (t->next != NULL)
def.vd_next = (sizeof (Elf_External_Verdef)
@@ -2587,19 +3088,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
(PTR) &sinfo);
if (elf_tdata (output_bfd)->verref == NULL)
- {
- asection **spp;
-
- /* We don't have any version definitions, so we can just
- remove the section. */
-
- for (spp = &output_bfd->sections;
- *spp != s->output_section;
- spp = &(*spp)->next)
- ;
- *spp = s->output_section->next;
- --output_bfd->section_count;
- }
+ _bfd_strip_section_from_output (info, s);
else
{
Elf_Internal_Verneed *t;
@@ -2665,8 +3154,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr)
{
- a->vna_hash = bfd_elf_hash ((const unsigned char *)
- a->vna_nodename);
+ a->vna_hash = bfd_elf_hash (a->vna_nodename);
indx = _bfd_stringtab_add (elf_hash_table (info)->dynstr,
a->vna_nodename, true, false);
if (indx == (bfd_size_type) -1)
@@ -2691,7 +3179,12 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
}
}
- dynsymcount = elf_hash_table (info)->dynsymcount;
+ /* Assign dynsym indicies. In a shared library we generate a
+ section symbol for each output section, which come first.
+ Next come all of the back-end allocated local dynamic syms,
+ followed by the rest of the global symbols. */
+
+ dynsymcount = _bfd_elf_link_renumber_dynsyms (output_bfd, info);
/* Work out the size of the symbol version section. */
s = bfd_get_section_by_name (dynobj, ".gnu.version");
@@ -2699,16 +3192,10 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
if (dynsymcount == 0
|| (verdefs == NULL && elf_tdata (output_bfd)->verref == NULL))
{
- asection **spp;
-
- /* We don't need any symbol versions; just discard the
- section. */
- for (spp = &output_bfd->sections;
- *spp != s->output_section;
- spp = &(*spp)->next)
- ;
- *spp = s->output_section->next;
- --output_bfd->section_count;
+ _bfd_strip_section_from_output (info, s);
+ /* The DYNSYMCOUNT might have changed if we were going to
+ output a dynamic symbol table entry for S. */
+ dynsymcount = _bfd_elf_link_renumber_dynsyms (output_bfd, info);
}
else
{
@@ -2744,23 +3231,22 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
elf_swap_symbol_out (output_bfd, &isym,
(PTR) (Elf_External_Sym *) s->contents);
- for (i = 0; elf_buckets[i] != 0; i++)
- {
- bucketcount = elf_buckets[i];
- if (dynsymcount < elf_buckets[i + 1])
- break;
- }
+ /* Compute the size of the hashing table. As a side effect this
+ computes the hash values for all the names we export. */
+ bucketcount = compute_bucket_count (info);
s = bfd_get_section_by_name (dynobj, ".hash");
BFD_ASSERT (s != NULL);
- s->_raw_size = (2 + bucketcount + dynsymcount) * (ARCH_SIZE / 8);
+ hash_entry_size = elf_section_data (s)->this_hdr.sh_entsize;
+ s->_raw_size = ((2 + bucketcount + dynsymcount) * hash_entry_size);
s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size);
if (s->contents == NULL)
return false;
memset (s->contents, 0, (size_t) s->_raw_size);
- put_word (output_bfd, bucketcount, s->contents);
- put_word (output_bfd, dynsymcount, s->contents + (ARCH_SIZE / 8));
+ bfd_put (8 * hash_entry_size, output_bfd, bucketcount, s->contents);
+ bfd_put (8 * hash_entry_size, output_bfd, dynsymcount,
+ s->contents + hash_entry_size);
elf_hash_table (info)->bucketcount = bucketcount;
@@ -2794,13 +3280,15 @@ elf_fix_symbol_flags (h, eif)
{
if (h->root.type != bfd_link_hash_defined
&& h->root.type != bfd_link_hash_defweak)
- h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
+ h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR
+ | ELF_LINK_HASH_REF_REGULAR_NONWEAK);
else
{
if (h->root.u.def.section->owner != NULL
&& (bfd_get_flavour (h->root.u.def.section->owner)
== bfd_target_elf_flavour))
- h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
+ h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR
+ | ELF_LINK_HASH_REF_REGULAR_NONWEAK);
else
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
}
@@ -2816,6 +3304,25 @@ elf_fix_symbol_flags (h, eif)
}
}
}
+ else
+ {
+ /* Unfortunately, ELF_LINK_NON_ELF is only correct if the symbol
+ was first seen in a non-ELF file. Fortunately, if the symbol
+ was first seen in an ELF file, we're probably OK unless the
+ symbol was defined in a non-ELF file. Catch that case here.
+ FIXME: We're still in trouble if the symbol was first seen in
+ a dynamic object, and then later in a non-ELF regular object. */
+ if ((h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
+ && (h->root.u.def.section->owner != NULL
+ ? (bfd_get_flavour (h->root.u.def.section->owner)
+ != bfd_target_elf_flavour)
+ : (bfd_is_abs_section (h->root.u.def.section)
+ && (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_DYNAMIC) == 0)))
+ h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
+ }
/* If this is a final link, and the symbol was defined as a common
symbol in a regular object file, and there was no definition in
@@ -2837,7 +3344,37 @@ elf_fix_symbol_flags (h, eif)
&& eif->info->shared
&& eif->info->symbolic
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
- h->elf_link_hash_flags &=~ ELF_LINK_HASH_NEEDS_PLT;
+ {
+ h->elf_link_hash_flags &=~ ELF_LINK_HASH_NEEDS_PLT;
+ h->plt.offset = (bfd_vma) -1;
+ }
+
+ /* If this is a weak defined symbol in a dynamic object, and we know
+ the real definition in the dynamic object, copy interesting flags
+ over to the real definition. */
+ if (h->weakdef != NULL)
+ {
+ struct elf_link_hash_entry *weakdef;
+
+ BFD_ASSERT (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak);
+ weakdef = h->weakdef;
+ BFD_ASSERT (weakdef->root.type == bfd_link_hash_defined
+ || weakdef->root.type == bfd_link_hash_defweak);
+ BFD_ASSERT (weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC);
+
+ /* If the real definition is defined by a regular object file,
+ don't do anything special. See the longer description in
+ elf_adjust_dynamic_symbol, below. */
+ if ((weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
+ h->weakdef = NULL;
+ else
+ weakdef->elf_link_hash_flags |=
+ (h->elf_link_hash_flags
+ & (ELF_LINK_HASH_REF_REGULAR
+ | ELF_LINK_HASH_REF_REGULAR_NONWEAK
+ | ELF_LINK_NON_GOT_REF));
+ }
return true;
}
@@ -2875,7 +3412,10 @@ elf_adjust_dynamic_symbol (h, data)
|| (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
|| ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0
&& (h->weakdef == NULL || h->weakdef->dynindx == -1))))
- return true;
+ {
+ h->plt.offset = (bfd_vma) -1;
+ return true;
+ }
/* If we've already adjusted this symbol, don't do it again. This
can happen via a recursive call. */
@@ -2918,31 +3458,28 @@ elf_adjust_dynamic_symbol (h, data)
if (h->weakdef != NULL)
{
- struct elf_link_hash_entry *weakdef;
+ /* If we get to this point, we know there is an implicit
+ reference by a regular object file via the weak symbol H.
+ FIXME: Is this really true? What if the traversal finds
+ H->WEAKDEF before it finds H? */
+ h->weakdef->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
- BFD_ASSERT (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak);
- weakdef = h->weakdef;
- BFD_ASSERT (weakdef->root.type == bfd_link_hash_defined
- || weakdef->root.type == bfd_link_hash_defweak);
- BFD_ASSERT (weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC);
- if ((weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
- {
- /* This symbol is defined by a regular object file, so we
- will not do anything special. Clear weakdef for the
- convenience of the processor backend. */
- h->weakdef = NULL;
- }
- else
- {
- /* There is an implicit reference by a regular object file
- via the weak symbol. */
- weakdef->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
- if (! elf_adjust_dynamic_symbol (weakdef, (PTR) eif))
- return false;
- }
+ if (! elf_adjust_dynamic_symbol (h->weakdef, (PTR) eif))
+ return false;
}
+ /* If a symbol has no type and no size and does not require a PLT
+ entry, then we are probably about to do the wrong thing here: we
+ are probably going to create a COPY reloc for an empty object.
+ This case can arise when a shared object is built with assembly
+ code, and the assembly code fails to set the symbol type. */
+ if (h->size == 0
+ && h->type == STT_NOTYPE
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0)
+ (*_bfd_error_handler)
+ (_("warning: type and size of dynamic symbol `%s' are not defined"),
+ h->root.root.string);
+
dynobj = elf_hash_table (eif->info)->dynobj;
bed = get_elf_backend_data (dynobj);
if (! (*bed->elf_backend_adjust_dynamic_symbol) (eif->info, h))
@@ -3067,6 +3604,7 @@ elf_link_assign_sym_version (h, data)
struct elf_assign_sym_version_info *sinfo =
(struct elf_assign_sym_version_info *) data;
struct bfd_link_info *info = sinfo->info;
+ struct elf_backend_data *bed;
struct elf_info_failed eif;
char *p;
@@ -3085,6 +3623,7 @@ elf_link_assign_sym_version (h, data)
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
return true;
+ bed = get_elf_backend_data (sinfo->output_bfd);
p = strchr (h->root.root.string, ELF_VER_CHR);
if (p != NULL && h->verinfo.vertree == NULL)
{
@@ -3135,11 +3674,8 @@ elf_link_assign_sym_version (h, data)
if (t->globals != NULL)
{
for (d = t->globals; d != NULL; d = d->next)
- {
- if ((d->match[0] == '*' && d->match[1] == '\0')
- || fnmatch (d->match, alc, 0) == 0)
- break;
- }
+ if ((*d->match) (d, alc))
+ break;
}
/* See if there is anything to force this symbol to
@@ -3148,18 +3684,14 @@ elf_link_assign_sym_version (h, data)
{
for (d = t->locals; d != NULL; d = d->next)
{
- if ((d->match[0] == '*' && d->match[1] == '\0')
- || fnmatch (d->match, alc, 0) == 0)
+ if ((*d->match) (d, alc))
{
if (h->dynindx != -1
&& info->shared
&& ! sinfo->export_dynamic)
{
- sinfo->removed_dynamic = true;
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
- h->elf_link_hash_flags &=~
- ELF_LINK_HASH_NEEDS_PLT;
- h->dynindx = -1;
+ (*bed->elf_backend_hide_symbol) (h);
/* FIXME: The name of the symbol has
already been recorded in the dynamic
string table section. */
@@ -3217,7 +3749,7 @@ elf_link_assign_sym_version (h, data)
/* We could not find the version for a symbol when
generating a shared archive. Return an error. */
(*_bfd_error_handler)
- ("%s: undefined versioned symbol name %s",
+ (_("%s: undefined versioned symbol name %s"),
bfd_get_filename (sinfo->output_bfd), h->root.root.string);
bfd_set_error (bfd_error_bad_value);
sinfo->failed = true;
@@ -3246,7 +3778,7 @@ elf_link_assign_sym_version (h, data)
{
for (d = t->globals; d != NULL; d = d->next)
{
- if (fnmatch (d->match, h->root.root.string, 0) == 0)
+ if ((*d->match) (d, h->root.root.string))
{
h->verinfo.vertree = t;
break;
@@ -3261,19 +3793,17 @@ elf_link_assign_sym_version (h, data)
{
for (d = t->locals; d != NULL; d = d->next)
{
- if (d->match[0] == '*' && d->match[1] == '\0')
+ if (d->pattern[0] == '*' && d->pattern[1] == '\0')
deflt = t;
- else if (fnmatch (d->match, h->root.root.string, 0) == 0)
+ else if ((*d->match) (d, h->root.root.string))
{
h->verinfo.vertree = t;
if (h->dynindx != -1
&& info->shared
&& ! sinfo->export_dynamic)
{
- sinfo->removed_dynamic = true;
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
- h->elf_link_hash_flags &=~ ELF_LINK_HASH_NEEDS_PLT;
- h->dynindx = -1;
+ (*bed->elf_backend_hide_symbol) (h);
/* FIXME: The name of the symbol has already
been recorded in the dynamic string table
section. */
@@ -3294,10 +3824,8 @@ elf_link_assign_sym_version (h, data)
&& info->shared
&& ! sinfo->export_dynamic)
{
- sinfo->removed_dynamic = true;
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
- h->elf_link_hash_flags &=~ ELF_LINK_HASH_NEEDS_PLT;
- h->dynindx = -1;
+ (*bed->elf_backend_hide_symbol) (h);
/* FIXME: The name of the symbol has already been
recorded in the dynamic string table section. */
}
@@ -3306,26 +3834,6 @@ elf_link_assign_sym_version (h, data)
return true;
}
-
-/* This function is used to renumber the dynamic symbols, if some of
- them are removed because they are marked as local. This is called
- via elf_link_hash_traverse. */
-
-static boolean
-elf_link_renumber_dynsyms (h, data)
- struct elf_link_hash_entry *h;
- PTR data;
-{
- struct bfd_link_info *info = (struct bfd_link_info *) data;
-
- if (h->dynindx != -1)
- {
- h->dynindx = elf_hash_table (info)->dynsymcount;
- ++elf_hash_table (info)->dynsymcount;
- }
-
- return true;
-}
/* Final phase of ELF linker. */
@@ -3393,6 +3901,101 @@ struct elf_outext_info
struct elf_final_link_info *finfo;
};
+/* Compute the size of, and allocate space for, REL_HDR which is the
+ section header for a section containing relocations for O. */
+
+static boolean
+elf_link_size_reloc_section (abfd, rel_hdr, o)
+ bfd *abfd;
+ Elf_Internal_Shdr *rel_hdr;
+ asection *o;
+{
+ register struct elf_link_hash_entry **p, **pend;
+ unsigned reloc_count;
+
+ /* Figure out how many relocations there will be. */
+ if (rel_hdr == &elf_section_data (o)->rel_hdr)
+ reloc_count = elf_section_data (o)->rel_count;
+ else
+ reloc_count = elf_section_data (o)->rel_count2;
+
+ /* That allows us to calculate the size of the section. */
+ rel_hdr->sh_size = rel_hdr->sh_entsize * reloc_count;
+
+ /* The contents field must last into write_object_contents, so we
+ allocate it with bfd_alloc rather than malloc. */
+ rel_hdr->contents = (PTR) bfd_alloc (abfd, rel_hdr->sh_size);
+ if (rel_hdr->contents == NULL && rel_hdr->sh_size != 0)
+ return false;
+
+ /* We only allocate one set of hash entries, so we only do it the
+ first time we are called. */
+ if (elf_section_data (o)->rel_hashes == NULL)
+ {
+ p = ((struct elf_link_hash_entry **)
+ bfd_malloc (o->reloc_count
+ * sizeof (struct elf_link_hash_entry *)));
+ if (p == NULL && o->reloc_count != 0)
+ return false;
+
+ elf_section_data (o)->rel_hashes = p;
+ pend = p + o->reloc_count;
+ for (; p < pend; p++)
+ *p = NULL;
+ }
+
+ return true;
+}
+
+/* When performing a relocateable link, the input relocations are
+ preserved. But, if they reference global symbols, the indices
+ referenced must be updated. Update all the relocations in
+ REL_HDR (there are COUNT of them), using the data in REL_HASH. */
+
+static void
+elf_link_adjust_relocs (abfd, rel_hdr, count, rel_hash)
+ bfd *abfd;
+ Elf_Internal_Shdr *rel_hdr;
+ unsigned int count;
+ struct elf_link_hash_entry **rel_hash;
+{
+ unsigned int i;
+
+ for (i = 0; i < count; i++, rel_hash++)
+ {
+ if (*rel_hash == NULL)
+ continue;
+
+ BFD_ASSERT ((*rel_hash)->indx >= 0);
+
+ if (rel_hdr->sh_entsize == sizeof (Elf_External_Rel))
+ {
+ Elf_External_Rel *erel;
+ Elf_Internal_Rel irel;
+
+ erel = (Elf_External_Rel *) rel_hdr->contents + i;
+ elf_swap_reloc_in (abfd, erel, &irel);
+ irel.r_info = ELF_R_INFO ((*rel_hash)->indx,
+ ELF_R_TYPE (irel.r_info));
+ elf_swap_reloc_out (abfd, &irel, erel);
+ }
+ else
+ {
+ Elf_External_Rela *erela;
+ Elf_Internal_Rela irela;
+
+ BFD_ASSERT (rel_hdr->sh_entsize
+ == sizeof (Elf_External_Rela));
+
+ erela = (Elf_External_Rela *) rel_hdr->contents + i;
+ elf_swap_reloca_in (abfd, erela, &irela);
+ irela.r_info = ELF_R_INFO ((*rel_hash)->indx,
+ ELF_R_TYPE (irela.r_info));
+ elf_swap_reloca_out (abfd, &irela, erela);
+ }
+ }
+}
+
/* Do the final step of an ELF link. */
boolean
@@ -3543,44 +4146,81 @@ elf_bfd_final_link (abfd, info)
/* Figure out the file positions for everything but the symbol table
and the relocs. We set symcount to force assign_section_numbers
to create a symbol table. */
- abfd->symcount = info->strip == strip_all ? 0 : 1;
+ bfd_get_symcount (abfd) = info->strip == strip_all ? 0 : 1;
BFD_ASSERT (! abfd->output_has_begun);
if (! _bfd_elf_compute_section_file_positions (abfd, info))
goto error_return;
+ /* Figure out how many relocations we will have in each section.
+ Just using RELOC_COUNT isn't good enough since that doesn't
+ maintain a separate value for REL vs. RELA relocations. */
+ if (info->relocateable)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ for (o = sub->sections; o != NULL; o = o->next)
+ {
+ asection *output_section;
+
+ if (! o->linker_mark)
+ {
+ /* This section was omitted from the link. */
+ continue;
+ }
+
+ output_section = o->output_section;
+
+ if (output_section != NULL
+ && (o->flags & SEC_RELOC) != 0)
+ {
+ struct bfd_elf_section_data *esdi
+ = elf_section_data (o);
+ struct bfd_elf_section_data *esdo
+ = elf_section_data (output_section);
+ unsigned int *rel_count;
+ unsigned int *rel_count2;
+
+ /* We must be careful to add the relocation froms the
+ input section to the right output count. */
+ if (esdi->rel_hdr.sh_entsize == esdo->rel_hdr.sh_entsize)
+ {
+ rel_count = &esdo->rel_count;
+ rel_count2 = &esdo->rel_count2;
+ }
+ else
+ {
+ rel_count = &esdo->rel_count2;
+ rel_count2 = &esdo->rel_count;
+ }
+
+ *rel_count += (esdi->rel_hdr.sh_size
+ / esdi->rel_hdr.sh_entsize);
+ if (esdi->rel_hdr2)
+ *rel_count2 += (esdi->rel_hdr2->sh_size
+ / esdi->rel_hdr2->sh_entsize);
+ }
+ }
+
/* That created the reloc sections. Set their sizes, and assign
them file positions, and allocate some buffers. */
for (o = abfd->sections; o != NULL; o = o->next)
{
if ((o->flags & SEC_RELOC) != 0)
{
- Elf_Internal_Shdr *rel_hdr;
- register struct elf_link_hash_entry **p, **pend;
-
- rel_hdr = &elf_section_data (o)->rel_hdr;
-
- rel_hdr->sh_size = rel_hdr->sh_entsize * o->reloc_count;
-
- /* The contents field must last into write_object_contents,
- so we allocate it with bfd_alloc rather than malloc. */
- rel_hdr->contents = (PTR) bfd_alloc (abfd, rel_hdr->sh_size);
- if (rel_hdr->contents == NULL && rel_hdr->sh_size != 0)
+ if (!elf_link_size_reloc_section (abfd,
+ &elf_section_data (o)->rel_hdr,
+ o))
goto error_return;
- p = ((struct elf_link_hash_entry **)
- bfd_malloc (o->reloc_count
- * sizeof (struct elf_link_hash_entry *)));
- if (p == NULL && o->reloc_count != 0)
+ if (elf_section_data (o)->rel_hdr2
+ && !elf_link_size_reloc_section (abfd,
+ elf_section_data (o)->rel_hdr2,
+ o))
goto error_return;
- elf_section_data (o)->rel_hashes = p;
- pend = p + o->reloc_count;
- for (; p < pend; p++)
- *p = NULL;
-
- /* Use the reloc_count field as an index when outputting the
- relocs. */
- o->reloc_count = 0;
}
+
+ /* Now, reset REL_COUNT and REL_COUNT2 so that we can use them
+ to count upwards while actually outputting the relocations. */
+ elf_section_data (o)->rel_count = 0;
+ elf_section_data (o)->rel_count2 = 0;
}
_bfd_elf_assign_file_positions_for_relocs (abfd);
@@ -3589,7 +4229,7 @@ elf_bfd_final_link (abfd, info)
.symtab and .strtab. We start the .symtab section at the current
file position, and write directly to it. We build the .strtab
section in memory. */
- abfd->symcount = 0;
+ bfd_get_symcount (abfd) = 0;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* sh_name is set in prep_headers. */
symtab_hdr->sh_type = SHT_SYMTAB;
@@ -3664,7 +4304,7 @@ elf_bfd_final_link (abfd, info)
{
o = section_from_elf_index (abfd, i);
if (o != NULL)
- o->target_index = abfd->symcount;
+ o->target_index = bfd_get_symcount (abfd);
elfsym.st_shndx = i;
if (info->relocateable || o == NULL)
elfsym.st_value = 0;
@@ -3682,7 +4322,8 @@ elf_bfd_final_link (abfd, info)
finfo.external_relocs = (PTR) bfd_malloc (max_external_reloc_size);
finfo.internal_relocs = ((Elf_Internal_Rela *)
bfd_malloc (max_internal_reloc_count
- * sizeof (Elf_Internal_Rela)));
+ * sizeof (Elf_Internal_Rela)
+ * bed->s->int_rels_per_ext_rel));
finfo.external_syms = ((Elf_External_Sym *)
bfd_malloc (max_sym_count
* sizeof (Elf_External_Sym)));
@@ -3721,7 +4362,7 @@ elf_bfd_final_link (abfd, info)
we could write the relocs out and then read them again; I don't
know how bad the memory loss will be. */
- for (sub = info->input_bfds; sub != NULL; sub = sub->next)
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
sub->output_has_begun = false;
for (o = abfd->sections; o != NULL; o = o->next)
{
@@ -3754,9 +4395,11 @@ elf_bfd_final_link (abfd, info)
}
/* That wrote out all the local symbols. Finish up the symbol table
- with the global symbols. */
+ with the global symbols. Even if we want to strip everything we
+ can, we still need to deal with those global symbols that got
+ converted to local in a version script. */
- if (info->strip != strip_all && info->shared)
+ if (info->shared)
{
/* Output any global symbols that got converted to local in a
version script. We do this in a separate step since ELF
@@ -3773,11 +4416,79 @@ elf_bfd_final_link (abfd, info)
return false;
}
- /* The sh_info field records the index of the first non local
- symbol. */
- symtab_hdr->sh_info = abfd->symcount;
+ /* The sh_info field records the index of the first non local symbol. */
+ symtab_hdr->sh_info = bfd_get_symcount (abfd);
+
if (dynamic)
- elf_section_data (finfo.dynsym_sec->output_section)->this_hdr.sh_info = 1;
+ {
+ Elf_Internal_Sym sym;
+ Elf_External_Sym *dynsym =
+ (Elf_External_Sym *)finfo.dynsym_sec->contents;
+ long last_local = 0;
+
+ /* Write out the section symbols for the output sections. */
+ if (info->shared)
+ {
+ asection *s;
+
+ sym.st_size = 0;
+ sym.st_name = 0;
+ sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
+ sym.st_other = 0;
+
+ for (s = abfd->sections; s != NULL; s = s->next)
+ {
+ int indx;
+ indx = elf_section_data (s)->this_idx;
+ BFD_ASSERT (indx > 0);
+ sym.st_shndx = indx;
+ sym.st_value = s->vma;
+
+ elf_swap_symbol_out (abfd, &sym,
+ dynsym + elf_section_data (s)->dynindx);
+ }
+
+ last_local = bfd_count_sections (abfd);
+ }
+
+ /* Write out the local dynsyms. */
+ if (elf_hash_table (info)->dynlocal)
+ {
+ struct elf_link_local_dynamic_entry *e;
+ for (e = elf_hash_table (info)->dynlocal; e ; e = e->next)
+ {
+ asection *s;
+
+ sym.st_size = e->isym.st_size;
+ sym.st_other = e->isym.st_other;
+
+ /* Copy the internal symbol as is.
+ Note that we saved a word of storage and overwrote
+ the original st_name with the dynstr_index. */
+ sym = e->isym;
+
+ if (e->isym.st_shndx > 0 && e->isym.st_shndx < SHN_LORESERVE)
+ {
+ s = bfd_section_from_elf_index (e->input_bfd,
+ e->isym.st_shndx);
+
+ sym.st_shndx =
+ elf_section_data (s->output_section)->this_idx;
+ sym.st_value = (s->output_section->vma
+ + s->output_offset
+ + e->isym.st_value);
+ }
+
+ if (last_local < e->dynindx)
+ last_local = e->dynindx;
+
+ elf_swap_symbol_out (abfd, &sym, dynsym + e->dynindx);
+ }
+ }
+
+ elf_section_data (finfo.dynsym_sec->output_section)->this_hdr.sh_info =
+ last_local + 1;
+ }
/* We get the global symbols from the hash table. */
eoinfo.failed = false;
@@ -3788,6 +4499,18 @@ elf_bfd_final_link (abfd, info)
if (eoinfo.failed)
return false;
+ /* If backend needs to output some symbols not present in the hash
+ table, do it now. */
+ if (bed->elf_backend_output_arch_syms)
+ {
+ if (! (*bed->elf_backend_output_arch_syms)
+ (abfd, info, (PTR) &finfo,
+ (boolean (*) PARAMS ((PTR, const char *,
+ Elf_Internal_Sym *, asection *)))
+ elf_link_output_sym))
+ return false;
+ }
+
/* Flush all symbols to the file. */
if (! elf_link_flush_output_syms (&finfo))
return false;
@@ -3812,7 +4535,7 @@ elf_bfd_final_link (abfd, info)
off = _bfd_elf_assign_file_position_for_section (symstrtab_hdr, off, true);
elf_tdata (abfd)->next_file_pos = off;
- if (abfd->symcount > 0)
+ if (bfd_get_symcount (abfd) > 0)
{
if (bfd_seek (abfd, symstrtab_hdr->sh_offset, SEEK_SET) != 0
|| ! _bfd_stringtab_emit (abfd, finfo.symstrtab))
@@ -3822,47 +4545,17 @@ elf_bfd_final_link (abfd, info)
/* Adjust the relocs to have the correct symbol indices. */
for (o = abfd->sections; o != NULL; o = o->next)
{
- struct elf_link_hash_entry **rel_hash;
- Elf_Internal_Shdr *rel_hdr;
-
if ((o->flags & SEC_RELOC) == 0)
continue;
- rel_hash = elf_section_data (o)->rel_hashes;
- rel_hdr = &elf_section_data (o)->rel_hdr;
- for (i = 0; i < o->reloc_count; i++, rel_hash++)
- {
- if (*rel_hash == NULL)
- continue;
-
- BFD_ASSERT ((*rel_hash)->indx >= 0);
-
- if (rel_hdr->sh_entsize == sizeof (Elf_External_Rel))
- {
- Elf_External_Rel *erel;
- Elf_Internal_Rel irel;
-
- erel = (Elf_External_Rel *) rel_hdr->contents + i;
- elf_swap_reloc_in (abfd, erel, &irel);
- irel.r_info = ELF_R_INFO ((*rel_hash)->indx,
- ELF_R_TYPE (irel.r_info));
- elf_swap_reloc_out (abfd, &irel, erel);
- }
- else
- {
- Elf_External_Rela *erela;
- Elf_Internal_Rela irela;
-
- BFD_ASSERT (rel_hdr->sh_entsize
- == sizeof (Elf_External_Rela));
-
- erela = (Elf_External_Rela *) rel_hdr->contents + i;
- elf_swap_reloca_in (abfd, erela, &irela);
- irela.r_info = ELF_R_INFO ((*rel_hash)->indx,
- ELF_R_TYPE (irela.r_info));
- elf_swap_reloca_out (abfd, &irela, erela);
- }
- }
+ elf_link_adjust_relocs (abfd, &elf_section_data (o)->rel_hdr,
+ elf_section_data (o)->rel_count,
+ elf_section_data (o)->rel_hashes);
+ if (elf_section_data (o)->rel_hdr2 != NULL)
+ elf_link_adjust_relocs (abfd, elf_section_data (o)->rel_hdr2,
+ elf_section_data (o)->rel_count2,
+ (elf_section_data (o)->rel_hashes
+ + elf_section_data (o)->rel_count));
/* Set the reloc_count field to 0 to prevent write_relocs from
trying to swap the relocs out itself. */
@@ -3893,15 +4586,11 @@ elf_bfd_final_link (abfd, info)
{
default:
break;
-
- /* SVR4 linkers seem to set DT_INIT and DT_FINI based on
- magic _init and _fini symbols. This is pretty ugly,
- but we are compatible. */
case DT_INIT:
- name = "_init";
+ name = info->init_function;
goto get_sym;
case DT_FINI:
- name = "_fini";
+ name = info->fini_function;
get_sym:
{
struct elf_link_hash_entry *h;
@@ -4118,6 +4807,8 @@ elf_link_output_sym (finfo, name, elfsym, input_sec)
if (name == (const char *) NULL || *name == '\0')
elfsym->st_name = 0;
+ else if (input_sec->flags & SEC_EXCLUDE)
+ elfsym->st_name = 0;
else
{
elfsym->st_name = (unsigned long) _bfd_stringtab_add (finfo->symstrtab,
@@ -4137,7 +4828,7 @@ elf_link_output_sym (finfo, name, elfsym, input_sec)
(PTR) (finfo->symbuf + finfo->symbuf_count));
++finfo->symbuf_count;
- ++finfo->output_bfd->symcount;
+ ++ bfd_get_symcount (finfo->output_bfd);
return true;
}
@@ -4207,14 +4898,15 @@ elf_link_output_extsym (h, data)
referenced by regular files, because we will already have issued
warnings for them. */
if (! finfo->info->relocateable
- && ! finfo->info->shared
+ && ! (finfo->info->shared
+ && !finfo->info->no_undefined)
&& h->root.type == bfd_link_hash_undefined
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
{
if (! ((*finfo->info->callbacks->undefined_symbol)
(finfo->info, h->root.root.string, h->root.u.undef.abfd,
- (asection *) NULL, 0)))
+ (asection *) NULL, 0, true)))
{
eoinfo->failed = true;
return false;
@@ -4242,8 +4934,10 @@ elf_link_output_extsym (h, data)
strip = false;
/* If we're stripping it, and it's not a dynamic symbol, there's
- nothing else to do. */
- if (strip && h->dynindx == -1)
+ nothing else to do unless it is a forced local symbol. */
+ if (strip
+ && h->dynindx == -1
+ && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
return true;
sym.st_value = 0;
@@ -4285,6 +4979,11 @@ elf_link_output_extsym (h, data)
input_sec->output_section);
if (sym.st_shndx == (unsigned short) -1)
{
+ (*_bfd_error_handler)
+ (_("%s: could not find output section %s for input section %s"),
+ bfd_get_filename (finfo->output_bfd),
+ input_sec->output_section->name,
+ input_sec->name);
eoinfo->failed = true;
return false;
}
@@ -4353,16 +5052,35 @@ elf_link_output_extsym (h, data)
}
}
+ /* If we are marking the symbol as undefined, and there are no
+ non-weak references to this symbol from a regular object, then
+ mark the symbol as weak undefined; if there are non-weak
+ references, mark the symbol as strong. We can't do this earlier,
+ because it might not be marked as undefined until the
+ finish_dynamic_symbol routine gets through with it. */
+ if (sym.st_shndx == SHN_UNDEF
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) != 0
+ && (ELF_ST_BIND(sym.st_info) == STB_GLOBAL
+ || ELF_ST_BIND(sym.st_info) == STB_WEAK))
+ {
+ int bindtype;
+
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK) != 0)
+ bindtype = STB_GLOBAL;
+ else
+ bindtype = STB_WEAK;
+ sym.st_info = ELF_ST_INFO (bindtype, ELF_ST_TYPE (sym.st_info));
+ }
+
/* If this symbol should be put in the .dynsym section, then put it
there now. We have already know the symbol index. We also fill
in the entry in the .hash section. */
if (h->dynindx != -1
&& elf_hash_table (finfo->info)->dynamic_sections_created)
{
- char *p, *copy;
- const char *name;
size_t bucketcount;
size_t bucket;
+ size_t hash_entry_size;
bfd_byte *bucketpos;
bfd_vma chain;
@@ -4373,32 +5091,17 @@ elf_link_output_extsym (h, data)
finfo->dynsym_sec->contents)
+ h->dynindx));
- /* We didn't include the version string in the dynamic string
- table, so we must not consider it in the hash table. */
- name = h->root.root.string;
- p = strchr (name, ELF_VER_CHR);
- if (p == NULL)
- copy = NULL;
- else
- {
- copy = bfd_alloc (finfo->output_bfd, p - name + 1);
- strncpy (copy, name, p - name);
- copy[p - name] = '\0';
- name = copy;
- }
-
bucketcount = elf_hash_table (finfo->info)->bucketcount;
- bucket = bfd_elf_hash ((const unsigned char *) name) % bucketcount;
+ bucket = h->elf_hash_value % bucketcount;
+ hash_entry_size
+ = elf_section_data (finfo->hash_sec)->this_hdr.sh_entsize;
bucketpos = ((bfd_byte *) finfo->hash_sec->contents
- + (bucket + 2) * (ARCH_SIZE / 8));
- chain = get_word (finfo->output_bfd, bucketpos);
- put_word (finfo->output_bfd, h->dynindx, bucketpos);
- put_word (finfo->output_bfd, chain,
- ((bfd_byte *) finfo->hash_sec->contents
- + (bucketcount + 2 + h->dynindx) * (ARCH_SIZE / 8)));
-
- if (copy != NULL)
- bfd_release (finfo->output_bfd, copy);
+ + (bucket + 2) * hash_entry_size);
+ chain = bfd_get (8 * hash_entry_size, finfo->output_bfd, bucketpos);
+ bfd_put (8 * hash_entry_size, finfo->output_bfd, h->dynindx, bucketpos);
+ bfd_put (8 * hash_entry_size, finfo->output_bfd, chain,
+ ((bfd_byte *) finfo->hash_sec->contents
+ + (bucketcount + 2 + h->dynindx) * hash_entry_size));
if (finfo->symver_sec != NULL && finfo->symver_sec->contents != NULL)
{
@@ -4434,7 +5137,7 @@ elf_link_output_extsym (h, data)
if (strip)
return true;
- h->indx = finfo->output_bfd->symcount;
+ h->indx = bfd_get_symcount (finfo->output_bfd);
if (! elf_link_output_sym (finfo, h->root.root.string, &sym, input_sec))
{
@@ -4445,6 +5148,76 @@ elf_link_output_extsym (h, data)
return true;
}
+/* Copy the relocations indicated by the INTERNAL_RELOCS (which
+ originated from the section given by INPUT_REL_HDR) to the
+ OUTPUT_BFD. */
+
+static void
+elf_link_output_relocs (output_bfd, input_section, input_rel_hdr,
+ internal_relocs)
+ bfd *output_bfd;
+ asection *input_section;
+ Elf_Internal_Shdr *input_rel_hdr;
+ Elf_Internal_Rela *internal_relocs;
+{
+ Elf_Internal_Rela *irela;
+ Elf_Internal_Rela *irelaend;
+ Elf_Internal_Shdr *output_rel_hdr;
+ asection *output_section;
+ unsigned int *rel_countp = NULL;
+
+ output_section = input_section->output_section;
+ output_rel_hdr = NULL;
+
+ if (elf_section_data (output_section)->rel_hdr.sh_entsize
+ == input_rel_hdr->sh_entsize)
+ {
+ output_rel_hdr = &elf_section_data (output_section)->rel_hdr;
+ rel_countp = &elf_section_data (output_section)->rel_count;
+ }
+ else if (elf_section_data (output_section)->rel_hdr2
+ && (elf_section_data (output_section)->rel_hdr2->sh_entsize
+ == input_rel_hdr->sh_entsize))
+ {
+ output_rel_hdr = elf_section_data (output_section)->rel_hdr2;
+ rel_countp = &elf_section_data (output_section)->rel_count2;
+ }
+
+ BFD_ASSERT (output_rel_hdr != NULL);
+
+ irela = internal_relocs;
+ irelaend = irela + input_rel_hdr->sh_size / input_rel_hdr->sh_entsize;
+ if (input_rel_hdr->sh_entsize == sizeof (Elf_External_Rel))
+ {
+ Elf_External_Rel *erel;
+
+ erel = ((Elf_External_Rel *) output_rel_hdr->contents + *rel_countp);
+ for (; irela < irelaend; irela++, erel++)
+ {
+ Elf_Internal_Rel irel;
+
+ irel.r_offset = irela->r_offset;
+ irel.r_info = irela->r_info;
+ BFD_ASSERT (irela->r_addend == 0);
+ elf_swap_reloc_out (output_bfd, &irel, erel);
+ }
+ }
+ else
+ {
+ Elf_External_Rela *erela;
+
+ BFD_ASSERT (input_rel_hdr->sh_entsize
+ == sizeof (Elf_External_Rela));
+ erela = ((Elf_External_Rela *) output_rel_hdr->contents + *rel_countp);
+ for (; irela < irelaend; irela++, erela++)
+ elf_swap_reloca_out (output_bfd, irela, erela);
+ }
+
+ /* Bump the counter, so that we know where to add the next set of
+ relocations. */
+ *rel_countp += input_rel_hdr->sh_size / input_rel_hdr->sh_entsize;
+}
+
/* Link an input file into the linker output file. This function
handles all the sections and relocations of the input file at once.
This is so that we only have to read the local symbols once, and
@@ -4470,10 +5243,11 @@ elf_link_input_bfd (finfo, input_bfd)
long *pindex;
asection **ppsection;
asection *o;
+ struct elf_backend_data *bed;
output_bfd = finfo->output_bfd;
- relocate_section =
- get_elf_backend_data (output_bfd)->elf_backend_relocate_section;
+ bed = get_elf_backend_data (output_bfd);
+ relocate_section = bed->elf_backend_relocate_section;
/* If this is a dynamic object, we don't want to do anything here:
we don't want the local symbols, and we don't want the section
@@ -4608,7 +5382,7 @@ elf_link_input_bfd (finfo, input_bfd)
if (osym.st_shndx == (unsigned short) -1)
return false;
- *pindex = output_bfd->symcount;
+ *pindex = bfd_get_symcount (output_bfd);
/* ELF symbols in relocateable files are section relative, but
in executable files they are virtual addresses. Note that
@@ -4706,14 +5480,15 @@ elf_link_input_bfd (finfo, input_bfd)
Elf_Internal_Rela *irelaend;
struct elf_link_hash_entry **rel_hash;
Elf_Internal_Shdr *input_rel_hdr;
- Elf_Internal_Shdr *output_rel_hdr;
/* Adjust the reloc addresses and symbol indices. */
irela = internal_relocs;
- irelaend = irela + o->reloc_count;
+ irelaend =
+ irela + o->reloc_count * bed->s->int_rels_per_ext_rel;
rel_hash = (elf_section_data (o->output_section)->rel_hashes
- + o->output_section->reloc_count);
+ + elf_section_data (o->output_section)->rel_count
+ + elf_section_data (o->output_section)->rel_count2);
for (; irela < irelaend; irela++, rel_hash++)
{
unsigned long r_symndx;
@@ -4822,7 +5597,7 @@ elf_link_input_bfd (finfo, input_bfd)
if (! finfo->info->relocateable)
isym->st_value += osec->vma;
- finfo->indices[r_symndx] = output_bfd->symcount;
+ finfo->indices[r_symndx] = bfd_get_symcount (output_bfd);
if (! elf_link_output_sym (finfo, name, isym, sec))
return false;
@@ -4837,47 +5612,24 @@ elf_link_input_bfd (finfo, input_bfd)
/* Swap out the relocs. */
input_rel_hdr = &elf_section_data (o)->rel_hdr;
- output_rel_hdr = &elf_section_data (o->output_section)->rel_hdr;
- BFD_ASSERT (output_rel_hdr->sh_entsize
- == input_rel_hdr->sh_entsize);
- irela = internal_relocs;
- irelaend = irela + o->reloc_count;
- if (input_rel_hdr->sh_entsize == sizeof (Elf_External_Rel))
- {
- Elf_External_Rel *erel;
-
- erel = ((Elf_External_Rel *) output_rel_hdr->contents
- + o->output_section->reloc_count);
- for (; irela < irelaend; irela++, erel++)
- {
- Elf_Internal_Rel irel;
-
- irel.r_offset = irela->r_offset;
- irel.r_info = irela->r_info;
- BFD_ASSERT (irela->r_addend == 0);
- elf_swap_reloc_out (output_bfd, &irel, erel);
- }
- }
- else
- {
- Elf_External_Rela *erela;
-
- BFD_ASSERT (input_rel_hdr->sh_entsize
- == sizeof (Elf_External_Rela));
- erela = ((Elf_External_Rela *) output_rel_hdr->contents
- + o->output_section->reloc_count);
- for (; irela < irelaend; irela++, erela++)
- elf_swap_reloca_out (output_bfd, irela, erela);
- }
-
- o->output_section->reloc_count += o->reloc_count;
+ elf_link_output_relocs (output_bfd, o,
+ input_rel_hdr,
+ internal_relocs);
+ internal_relocs
+ += input_rel_hdr->sh_size / input_rel_hdr->sh_entsize;
+ input_rel_hdr = elf_section_data (o)->rel_hdr2;
+ if (input_rel_hdr)
+ elf_link_output_relocs (output_bfd, o,
+ input_rel_hdr,
+ internal_relocs);
}
}
/* Write out the modified section contents. */
if (elf_section_data (o)->stab_info == NULL)
{
- if (! bfd_set_section_contents (output_bfd, o->output_section,
+ if (! (o->flags & SEC_EXCLUDE) &&
+ ! bfd_set_section_contents (output_bfd, o->output_section,
contents, o->output_offset,
(o->_cooked_size != 0
? o->_cooked_size
@@ -4926,7 +5678,8 @@ elf_reloc_link_order (output_bfd, info, output_section, link_order)
/* Figure out the symbol index. */
rel_hash_ptr = (elf_section_data (output_section)->rel_hashes
- + output_section->reloc_count);
+ + elf_section_data (output_section)->rel_count
+ + elf_section_data (output_section)->rel_count2);
if (link_order->type == bfd_section_reloc_link_order)
{
indx = link_order->u.reloc.p->u.section->target_index;
@@ -5035,7 +5788,7 @@ elf_reloc_link_order (output_bfd, info, output_section, link_order)
irel.r_offset = offset;
irel.r_info = ELF_R_INFO (indx, howto->type);
erel = ((Elf_External_Rel *) rel_hdr->contents
- + output_section->reloc_count);
+ + elf_section_data (output_section)->rel_count);
elf_swap_reloc_out (output_bfd, &irel, erel);
}
else
@@ -5047,11 +5800,11 @@ elf_reloc_link_order (output_bfd, info, output_section, link_order)
irela.r_info = ELF_R_INFO (indx, howto->type);
irela.r_addend = addend;
erela = ((Elf_External_Rela *) rel_hdr->contents
- + output_section->reloc_count);
+ + elf_section_data (output_section)->rel_count);
elf_swap_reloca_out (output_bfd, &irela, erela);
}
- ++output_section->reloc_count;
+ ++elf_section_data (output_section)->rel_count;
return true;
}
@@ -5271,8 +6024,8 @@ elf_finish_pointer_linker_section (output_bfd, input_bfd, info, lsect, h, reloca
elf_swap_reloca_out (output_bfd, &outrel,
(((Elf_External_Rela *)
lsect->section->contents)
- + lsect->section->reloc_count));
- ++lsect->section->reloc_count;
+ + elf_section_data (lsect->section)->rel_count));
+ ++elf_section_data (lsect->section)->rel_count;
}
}
}
@@ -5291,3 +6044,660 @@ elf_finish_pointer_linker_section (output_bfd, input_bfd, info, lsect, h, reloca
processing. */
return relocation - linker_section_ptr->addend;
}
+
+/* Garbage collect unused sections. */
+
+static boolean elf_gc_mark
+ PARAMS ((struct bfd_link_info *info, asection *sec,
+ asection * (*gc_mark_hook)
+ PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *,
+ struct elf_link_hash_entry *, Elf_Internal_Sym *))));
+
+static boolean elf_gc_sweep
+ PARAMS ((struct bfd_link_info *info,
+ boolean (*gc_sweep_hook)
+ PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *o,
+ const Elf_Internal_Rela *relocs))));
+
+static boolean elf_gc_sweep_symbol
+ PARAMS ((struct elf_link_hash_entry *h, PTR idxptr));
+
+static boolean elf_gc_allocate_got_offsets
+ PARAMS ((struct elf_link_hash_entry *h, PTR offarg));
+
+static boolean elf_gc_propagate_vtable_entries_used
+ PARAMS ((struct elf_link_hash_entry *h, PTR dummy));
+
+static boolean elf_gc_smash_unused_vtentry_relocs
+ PARAMS ((struct elf_link_hash_entry *h, PTR dummy));
+
+/* The mark phase of garbage collection. For a given section, mark
+ it, and all the sections which define symbols to which it refers. */
+
+static boolean
+elf_gc_mark (info, sec, gc_mark_hook)
+ struct bfd_link_info *info;
+ asection *sec;
+ asection * (*gc_mark_hook)
+ PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *,
+ struct elf_link_hash_entry *, Elf_Internal_Sym *));
+{
+ boolean ret = true;
+
+ sec->gc_mark = 1;
+
+ /* Look through the section relocs. */
+
+ if ((sec->flags & SEC_RELOC) != 0 && sec->reloc_count > 0)
+ {
+ Elf_Internal_Rela *relstart, *rel, *relend;
+ Elf_Internal_Shdr *symtab_hdr;
+ struct elf_link_hash_entry **sym_hashes;
+ size_t nlocsyms;
+ size_t extsymoff;
+ Elf_External_Sym *locsyms, *freesyms = NULL;
+ bfd *input_bfd = sec->owner;
+ struct elf_backend_data *bed = get_elf_backend_data (input_bfd);
+
+ /* GCFIXME: how to arrange so that relocs and symbols are not
+ reread continually? */
+
+ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (input_bfd);
+
+ /* Read the local symbols. */
+ if (elf_bad_symtab (input_bfd))
+ {
+ nlocsyms = symtab_hdr->sh_size / sizeof (Elf_External_Sym);
+ extsymoff = 0;
+ }
+ else
+ extsymoff = nlocsyms = symtab_hdr->sh_info;
+ if (symtab_hdr->contents)
+ locsyms = (Elf_External_Sym *) symtab_hdr->contents;
+ else if (nlocsyms == 0)
+ locsyms = NULL;
+ else
+ {
+ locsyms = freesyms =
+ bfd_malloc (nlocsyms * sizeof (Elf_External_Sym));
+ if (freesyms == NULL
+ || bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0
+ || (bfd_read (locsyms, sizeof (Elf_External_Sym),
+ nlocsyms, input_bfd)
+ != nlocsyms * sizeof (Elf_External_Sym)))
+ {
+ ret = false;
+ goto out1;
+ }
+ }
+
+ /* Read the relocations. */
+ relstart = (NAME(_bfd_elf,link_read_relocs)
+ (sec->owner, sec, NULL, (Elf_Internal_Rela *) NULL,
+ info->keep_memory));
+ if (relstart == NULL)
+ {
+ ret = false;
+ goto out1;
+ }
+ relend = relstart + sec->reloc_count * bed->s->int_rels_per_ext_rel;
+
+ for (rel = relstart; rel < relend; rel++)
+ {
+ unsigned long r_symndx;
+ asection *rsec;
+ struct elf_link_hash_entry *h;
+ Elf_Internal_Sym s;
+
+ r_symndx = ELF_R_SYM (rel->r_info);
+ if (r_symndx == 0)
+ continue;
+
+ if (elf_bad_symtab (sec->owner))
+ {
+ elf_swap_symbol_in (input_bfd, &locsyms[r_symndx], &s);
+ if (ELF_ST_BIND (s.st_info) == STB_LOCAL)
+ rsec = (*gc_mark_hook)(sec->owner, info, rel, NULL, &s);
+ else
+ {
+ h = sym_hashes[r_symndx - extsymoff];
+ rsec = (*gc_mark_hook)(sec->owner, info, rel, h, NULL);
+ }
+ }
+ else if (r_symndx >= nlocsyms)
+ {
+ h = sym_hashes[r_symndx - extsymoff];
+ rsec = (*gc_mark_hook)(sec->owner, info, rel, h, NULL);
+ }
+ else
+ {
+ elf_swap_symbol_in (input_bfd, &locsyms[r_symndx], &s);
+ rsec = (*gc_mark_hook)(sec->owner, info, rel, NULL, &s);
+ }
+
+ if (rsec && !rsec->gc_mark)
+ if (!elf_gc_mark (info, rsec, gc_mark_hook))
+ {
+ ret = false;
+ goto out2;
+ }
+ }
+
+ out2:
+ if (!info->keep_memory)
+ free (relstart);
+ out1:
+ if (freesyms)
+ free (freesyms);
+ }
+
+ return ret;
+}
+
+/* The sweep phase of garbage collection. Remove all garbage sections. */
+
+static boolean
+elf_gc_sweep (info, gc_sweep_hook)
+ struct bfd_link_info *info;
+ boolean (*gc_sweep_hook)
+ PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *o,
+ const Elf_Internal_Rela *relocs));
+{
+ bfd *sub;
+
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ {
+ asection *o;
+
+ if (bfd_get_flavour (sub) != bfd_target_elf_flavour)
+ continue;
+
+ for (o = sub->sections; o != NULL; o = o->next)
+ {
+ /* Keep special sections. Keep .debug sections. */
+ if ((o->flags & SEC_LINKER_CREATED)
+ || (o->flags & SEC_DEBUGGING))
+ o->gc_mark = 1;
+
+ if (o->gc_mark)
+ continue;
+
+ /* Skip sweeping sections already excluded. */
+ if (o->flags & SEC_EXCLUDE)
+ continue;
+
+ /* Since this is early in the link process, it is simple
+ to remove a section from the output. */
+ o->flags |= SEC_EXCLUDE;
+
+ /* But we also have to update some of the relocation
+ info we collected before. */
+ if (gc_sweep_hook
+ && (o->flags & SEC_RELOC) && o->reloc_count > 0)
+ {
+ Elf_Internal_Rela *internal_relocs;
+ boolean r;
+
+ internal_relocs = (NAME(_bfd_elf,link_read_relocs)
+ (o->owner, o, NULL, NULL, info->keep_memory));
+ if (internal_relocs == NULL)
+ return false;
+
+ r = (*gc_sweep_hook)(o->owner, info, o, internal_relocs);
+
+ if (!info->keep_memory)
+ free (internal_relocs);
+
+ if (!r)
+ return false;
+ }
+ }
+ }
+
+ /* Remove the symbols that were in the swept sections from the dynamic
+ symbol table. GCFIXME: Anyone know how to get them out of the
+ static symbol table as well? */
+ {
+ int i = 0;
+
+ elf_link_hash_traverse (elf_hash_table (info),
+ elf_gc_sweep_symbol,
+ (PTR) &i);
+
+ elf_hash_table (info)->dynsymcount = i;
+ }
+
+ return true;
+}
+
+/* Sweep symbols in swept sections. Called via elf_link_hash_traverse. */
+
+static boolean
+elf_gc_sweep_symbol (h, idxptr)
+ struct elf_link_hash_entry *h;
+ PTR idxptr;
+{
+ int *idx = (int *) idxptr;
+
+ if (h->dynindx != -1
+ && ((h->root.type != bfd_link_hash_defined
+ && h->root.type != bfd_link_hash_defweak)
+ || h->root.u.def.section->gc_mark))
+ h->dynindx = (*idx)++;
+
+ return true;
+}
+
+/* Propogate collected vtable information. This is called through
+ elf_link_hash_traverse. */
+
+static boolean
+elf_gc_propagate_vtable_entries_used (h, okp)
+ struct elf_link_hash_entry *h;
+ PTR okp;
+{
+ /* Those that are not vtables. */
+ if (h->vtable_parent == NULL)
+ return true;
+
+ /* Those vtables that do not have parents, we cannot merge. */
+ if (h->vtable_parent == (struct elf_link_hash_entry *) -1)
+ return true;
+
+ /* If we've already been done, exit. */
+ if (h->vtable_entries_used && h->vtable_entries_used[-1])
+ return true;
+
+ /* Make sure the parent's table is up to date. */
+ elf_gc_propagate_vtable_entries_used (h->vtable_parent, okp);
+
+ if (h->vtable_entries_used == NULL)
+ {
+ /* None of this table's entries were referenced. Re-use the
+ parent's table. */
+ h->vtable_entries_used = h->vtable_parent->vtable_entries_used;
+ h->vtable_entries_size = h->vtable_parent->vtable_entries_size;
+ }
+ else
+ {
+ size_t n;
+ boolean *cu, *pu;
+
+ /* Or the parent's entries into ours. */
+ cu = h->vtable_entries_used;
+ cu[-1] = true;
+ pu = h->vtable_parent->vtable_entries_used;
+ if (pu != NULL)
+ {
+ n = h->vtable_parent->vtable_entries_size / FILE_ALIGN;
+ while (--n != 0)
+ {
+ if (*pu) *cu = true;
+ pu++, cu++;
+ }
+ }
+ }
+
+ return true;
+}
+
+static boolean
+elf_gc_smash_unused_vtentry_relocs (h, okp)
+ struct elf_link_hash_entry *h;
+ PTR okp;
+{
+ asection *sec;
+ bfd_vma hstart, hend;
+ Elf_Internal_Rela *relstart, *relend, *rel;
+ struct elf_backend_data *bed;
+
+ /* Take care of both those symbols that do not describe vtables as
+ well as those that are not loaded. */
+ if (h->vtable_parent == NULL)
+ return true;
+
+ BFD_ASSERT (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak);
+
+ sec = h->root.u.def.section;
+ hstart = h->root.u.def.value;
+ hend = hstart + h->size;
+
+ relstart = (NAME(_bfd_elf,link_read_relocs)
+ (sec->owner, sec, NULL, (Elf_Internal_Rela *) NULL, true));
+ if (!relstart)
+ return *(boolean *)okp = false;
+ bed = get_elf_backend_data (sec->owner);
+ relend = relstart + sec->reloc_count * bed->s->int_rels_per_ext_rel;
+
+ for (rel = relstart; rel < relend; ++rel)
+ if (rel->r_offset >= hstart && rel->r_offset < hend)
+ {
+ /* If the entry is in use, do nothing. */
+ if (h->vtable_entries_used
+ && (rel->r_offset - hstart) < h->vtable_entries_size)
+ {
+ bfd_vma entry = (rel->r_offset - hstart) / FILE_ALIGN;
+ if (h->vtable_entries_used[entry])
+ continue;
+ }
+ /* Otherwise, kill it. */
+ rel->r_offset = rel->r_info = rel->r_addend = 0;
+ }
+
+ return true;
+}
+
+/* Do mark and sweep of unused sections. */
+
+boolean
+elf_gc_sections (abfd, info)
+ bfd *abfd;
+ struct bfd_link_info *info;
+{
+ boolean ok = true;
+ bfd *sub;
+ asection * (*gc_mark_hook)
+ PARAMS ((bfd *abfd, struct bfd_link_info *, Elf_Internal_Rela *,
+ struct elf_link_hash_entry *h, Elf_Internal_Sym *));
+
+ if (!get_elf_backend_data (abfd)->can_gc_sections
+ || info->relocateable
+ || elf_hash_table (info)->dynamic_sections_created)
+ return true;
+
+ /* Apply transitive closure to the vtable entry usage info. */
+ elf_link_hash_traverse (elf_hash_table (info),
+ elf_gc_propagate_vtable_entries_used,
+ (PTR) &ok);
+ if (!ok)
+ return false;
+
+ /* Kill the vtable relocations that were not used. */
+ elf_link_hash_traverse (elf_hash_table (info),
+ elf_gc_smash_unused_vtentry_relocs,
+ (PTR) &ok);
+ if (!ok)
+ return false;
+
+ /* Grovel through relocs to find out who stays ... */
+
+ gc_mark_hook = get_elf_backend_data (abfd)->gc_mark_hook;
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ {
+ asection *o;
+
+ if (bfd_get_flavour (sub) != bfd_target_elf_flavour)
+ continue;
+
+ for (o = sub->sections; o != NULL; o = o->next)
+ {
+ if (o->flags & SEC_KEEP)
+ if (!elf_gc_mark (info, o, gc_mark_hook))
+ return false;
+ }
+ }
+
+ /* ... and mark SEC_EXCLUDE for those that go. */
+ if (!elf_gc_sweep(info, get_elf_backend_data (abfd)->gc_sweep_hook))
+ return false;
+
+ return true;
+}
+
+/* Called from check_relocs to record the existance of a VTINHERIT reloc. */
+
+boolean
+elf_gc_record_vtinherit (abfd, sec, h, offset)
+ bfd *abfd;
+ asection *sec;
+ struct elf_link_hash_entry *h;
+ bfd_vma offset;
+{
+ struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
+ struct elf_link_hash_entry **search, *child;
+ bfd_size_type extsymcount;
+
+ /* The sh_info field of the symtab header tells us where the
+ external symbols start. We don't care about the local symbols at
+ this point. */
+ extsymcount = elf_tdata (abfd)->symtab_hdr.sh_size/sizeof (Elf_External_Sym);
+ if (!elf_bad_symtab (abfd))
+ extsymcount -= elf_tdata (abfd)->symtab_hdr.sh_info;
+
+ sym_hashes = elf_sym_hashes (abfd);
+ sym_hashes_end = sym_hashes + extsymcount;
+
+ /* Hunt down the child symbol, which is in this section at the same
+ offset as the relocation. */
+ for (search = sym_hashes; search != sym_hashes_end; ++search)
+ {
+ if ((child = *search) != NULL
+ && (child->root.type == bfd_link_hash_defined
+ || child->root.type == bfd_link_hash_defweak)
+ && child->root.u.def.section == sec
+ && child->root.u.def.value == offset)
+ goto win;
+ }
+
+ (*_bfd_error_handler) ("%s: %s+%lu: No symbol found for INHERIT",
+ bfd_get_filename (abfd), sec->name,
+ (unsigned long)offset);
+ bfd_set_error (bfd_error_invalid_operation);
+ return false;
+
+win:
+ if (!h)
+ {
+ /* This *should* only be the absolute section. It could potentially
+ be that someone has defined a non-global vtable though, which
+ would be bad. It isn't worth paging in the local symbols to be
+ sure though; that case should simply be handled by the assembler. */
+
+ child->vtable_parent = (struct elf_link_hash_entry *) -1;
+ }
+ else
+ child->vtable_parent = h;
+
+ return true;
+}
+
+/* Called from check_relocs to record the existance of a VTENTRY reloc. */
+
+boolean
+elf_gc_record_vtentry (abfd, sec, h, addend)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asection *sec ATTRIBUTE_UNUSED;
+ struct elf_link_hash_entry *h;
+ bfd_vma addend;
+{
+ if (addend >= h->vtable_entries_size)
+ {
+ size_t size, bytes;
+ boolean *ptr = h->vtable_entries_used;
+
+ /* While the symbol is undefined, we have to be prepared to handle
+ a zero size. */
+ if (h->root.type == bfd_link_hash_undefined)
+ size = addend;
+ else
+ {
+ size = h->size;
+ if (size < addend)
+ {
+ /* Oops! We've got a reference past the defined end of
+ the table. This is probably a bug -- shall we warn? */
+ size = addend;
+ }
+ }
+
+ /* Allocate one extra entry for use as a "done" flag for the
+ consolidation pass. */
+ bytes = (size / FILE_ALIGN + 1) * sizeof (boolean);
+
+ if (ptr)
+ {
+ ptr = bfd_realloc (ptr - 1, bytes);
+
+ if (ptr != NULL)
+ {
+ size_t oldbytes;
+
+ oldbytes = (h->vtable_entries_size/FILE_ALIGN + 1) * sizeof (boolean);
+ memset (((char *)ptr) + oldbytes, 0, bytes - oldbytes);
+ }
+ }
+ else
+ ptr = bfd_zmalloc (bytes);
+
+ if (ptr == NULL)
+ return false;
+
+ /* And arrange for that done flag to be at index -1. */
+ h->vtable_entries_used = ptr + 1;
+ h->vtable_entries_size = size;
+ }
+
+ h->vtable_entries_used[addend / FILE_ALIGN] = true;
+
+ return true;
+}
+
+/* And an accompanying bit to work out final got entry offsets once
+ we're done. Should be called from final_link. */
+
+boolean
+elf_gc_common_finalize_got_offsets (abfd, info)
+ bfd *abfd;
+ struct bfd_link_info *info;
+{
+ bfd *i;
+ struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ bfd_vma gotoff;
+
+ /* The GOT offset is relative to the .got section, but the GOT header is
+ put into the .got.plt section, if the backend uses it. */
+ if (bed->want_got_plt)
+ gotoff = 0;
+ else
+ gotoff = bed->got_header_size;
+
+ /* Do the local .got entries first. */
+ for (i = info->input_bfds; i; i = i->link_next)
+ {
+ bfd_signed_vma *local_got;
+ bfd_size_type j, locsymcount;
+ Elf_Internal_Shdr *symtab_hdr;
+
+ if (bfd_get_flavour (i) != bfd_target_elf_flavour)
+ continue;
+
+ local_got = elf_local_got_refcounts (i);
+ if (!local_got)
+ continue;
+
+ symtab_hdr = &elf_tdata (i)->symtab_hdr;
+ if (elf_bad_symtab (i))
+ locsymcount = symtab_hdr->sh_size / sizeof (Elf_External_Sym);
+ else
+ locsymcount = symtab_hdr->sh_info;
+
+ for (j = 0; j < locsymcount; ++j)
+ {
+ if (local_got[j] > 0)
+ {
+ local_got[j] = gotoff;
+ gotoff += ARCH_SIZE / 8;
+ }
+ else
+ local_got[j] = (bfd_vma) -1;
+ }
+ }
+
+ /* Then the global .got and .plt entries. */
+ elf_link_hash_traverse (elf_hash_table (info),
+ elf_gc_allocate_got_offsets,
+ (PTR) &gotoff);
+ return true;
+}
+
+/* We need a special top-level link routine to convert got reference counts
+ to real got offsets. */
+
+static boolean
+elf_gc_allocate_got_offsets (h, offarg)
+ struct elf_link_hash_entry *h;
+ PTR offarg;
+{
+ bfd_vma *off = (bfd_vma *) offarg;
+
+ if (h->got.refcount > 0)
+ {
+ h->got.offset = off[0];
+ off[0] += ARCH_SIZE / 8;
+ }
+ else
+ h->got.offset = (bfd_vma) -1;
+
+ return true;
+}
+
+/* Many folk need no more in the way of final link than this, once
+ got entry reference counting is enabled. */
+
+boolean
+elf_gc_common_final_link (abfd, info)
+ bfd *abfd;
+ struct bfd_link_info *info;
+{
+ if (!elf_gc_common_finalize_got_offsets (abfd, info))
+ return false;
+
+ /* Invoke the regular ELF backend linker to do all the work. */
+ return elf_bfd_final_link (abfd, info);
+}
+
+/* This function will be called though elf_link_hash_traverse to store
+ all hash value of the exported symbols in an array. */
+
+static boolean
+elf_collect_hash_codes (h, data)
+ struct elf_link_hash_entry *h;
+ PTR data;
+{
+ unsigned long **valuep = (unsigned long **) data;
+ const char *name;
+ char *p;
+ unsigned long ha;
+ char *alc = NULL;
+
+ /* Ignore indirect symbols. These are added by the versioning code. */
+ if (h->dynindx == -1)
+ return true;
+
+ name = h->root.root.string;
+ p = strchr (name, ELF_VER_CHR);
+ if (p != NULL)
+ {
+ alc = bfd_malloc (p - name + 1);
+ memcpy (alc, name, p - name);
+ alc[p - name] = '\0';
+ name = alc;
+ }
+
+ /* Compute the hash value. */
+ ha = bfd_elf_hash (name);
+
+ /* Store the found hash value in the array given as the argument. */
+ *(*valuep)++ = ha;
+
+ /* And store it in the struct so that we can put it in the hash table
+ later. */
+ h->elf_hash_value = ha;
+
+ if (alc != NULL)
+ free (alc);
+
+ return true;
+}
diff --git a/contrib/binutils/bfd/elfxx-target.h b/contrib/binutils/bfd/elfxx-target.h
index e4d2b3d18334..b1f4867e5694 100644
--- a/contrib/binutils/bfd/elfxx-target.h
+++ b/contrib/binutils/bfd/elfxx-target.h
@@ -57,6 +57,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#endif
#define bfd_elfNN_sizeof_headers _bfd_elf_sizeof_headers
#define bfd_elfNN_write_object_contents _bfd_elf_write_object_contents
+#define bfd_elfNN_write_corefile_contents _bfd_elf_write_corefile_contents
#define bfd_elfNN_get_section_contents_in_window \
_bfd_generic_get_section_contents_in_window
@@ -79,6 +80,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef elf_backend_plt_alignment
#define elf_backend_plt_alignment 2
#endif
+#ifndef elf_backend_want_dynbss
+#define elf_backend_want_dynbss 1
+#endif
#define bfd_elfNN_bfd_debug_info_start bfd_void
#define bfd_elfNN_bfd_debug_info_end bfd_void
@@ -93,6 +97,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define bfd_elfNN_bfd_relax_section bfd_generic_relax_section
#endif
+#ifndef elf_backend_can_gc_sections
+#define elf_backend_can_gc_sections 0
+#endif
+#ifndef elf_backend_gc_mark_hook
+#define elf_backend_gc_mark_hook NULL
+#endif
+#ifndef elf_backend_gc_sweep_hook
+#define elf_backend_gc_sweep_hook NULL
+#endif
+#ifndef bfd_elfNN_bfd_gc_sections
+#define bfd_elfNN_bfd_gc_sections _bfd_elfNN_gc_sections
+#endif
+
#define bfd_elfNN_bfd_make_debug_symbol \
((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr)
@@ -167,6 +184,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define bfd_elfNN_mkobject bfd_elf_mkobject
#endif
+#ifndef bfd_elfNN_mkcorefile
+#define bfd_elfNN_mkcorefile bfd_elf_mkcorefile
+#endif
+
#ifndef bfd_elfNN_mkarchive
#define bfd_elfNN_mkarchive _bfd_generic_mkarchive
#endif
@@ -184,6 +205,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#endif
#ifndef ELF_MAXPAGESIZE
+ #error ELF_MAXPAGESIZE is not defined
#define ELF_MAXPAGESIZE 1
#endif
@@ -206,12 +228,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef elf_backend_symbol_table_processing
#define elf_backend_symbol_table_processing 0
#endif
+#ifndef elf_backend_get_symbol_type
+#define elf_backend_get_symbol_type 0
+#endif
#ifndef elf_backend_section_processing
#define elf_backend_section_processing 0
#endif
#ifndef elf_backend_section_from_shdr
#define elf_backend_section_from_shdr 0
#endif
+#ifndef elf_backend_section_from_phdr
+#define elf_backend_section_from_phdr 0
+#endif
#ifndef elf_backend_fake_sections
#define elf_backend_fake_sections 0
#endif
@@ -263,6 +291,50 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef elf_backend_ecoff_debug_swap
#define elf_backend_ecoff_debug_swap 0
#endif
+#ifndef elf_backend_got_header_size
+#define elf_backend_got_header_size 0
+#endif
+#ifndef elf_backend_plt_header_size
+#define elf_backend_plt_header_size 0
+#endif
+#ifndef elf_backend_post_process_headers
+#define elf_backend_post_process_headers NULL
+#endif
+#ifndef elf_backend_print_symbol_all
+#define elf_backend_print_symbol_all NULL
+#endif
+#ifndef elf_backend_output_arch_syms
+#define elf_backend_output_arch_syms NULL
+#endif
+#ifndef elf_backend_copy_indirect_symbol
+#define elf_backend_copy_indirect_symbol _bfd_elf_link_hash_copy_indirect
+#endif
+#ifndef elf_backend_hide_symbol
+#define elf_backend_hide_symbol _bfd_elf_link_hash_hide_symbol
+#endif
+
+
+/* Previously, backends could only use SHT_REL or SHT_RELA relocation
+ sections, but not both. They defined USE_REL to indicate SHT_REL
+ sections, and left it undefined to indicated SHT_RELA sections.
+ For backwards compatibility, we still support this usage. */
+#ifndef USE_REL
+#define USE_REL 0
+#else
+#undef USE_REL
+#define USE_REL 1
+#endif
+
+/* Use these in new code. */
+#ifndef elf_backend_may_use_rel_p
+#define elf_backend_may_use_rel_p USE_REL
+#endif
+#ifndef elf_backend_may_use_rela_p
+#define elf_backend_may_use_rela_p !USE_REL
+#endif
+#ifndef elf_backend_default_use_rela_p
+#define elf_backend_default_use_rela_p !USE_REL
+#endif
#ifndef ELF_MACHINE_ALT1
#define ELF_MACHINE_ALT1 0
@@ -276,28 +348,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define elf_backend_size_info _bfd_elfNN_size_info
#endif
+#ifndef elf_backend_sign_extend_vma
+#define elf_backend_sign_extend_vma 0
+#endif
+
extern const struct elf_size_info _bfd_elfNN_size_info;
static CONST struct elf_backend_data elfNN_bed =
{
-#ifdef USE_REL
- 0, /* use_rela_p */
-#else
- 1, /* use_rela_p */
-#endif
ELF_ARCH, /* arch */
ELF_MACHINE_CODE, /* elf_machine_code */
ELF_MAXPAGESIZE, /* maxpagesize */
- elf_backend_collect,
- elf_backend_type_change_ok,
elf_info_to_howto,
elf_info_to_howto_rel,
elf_backend_sym_is_global,
elf_backend_object_p,
elf_backend_symbol_processing,
elf_backend_symbol_table_processing,
+ elf_backend_get_symbol_type,
elf_backend_section_processing,
elf_backend_section_from_shdr,
+ elf_backend_section_from_phdr,
elf_backend_fake_sections,
elf_backend_section_from_bfd_section,
elf_backend_add_symbol_hook,
@@ -314,18 +385,40 @@ static CONST struct elf_backend_data elfNN_bed =
elf_backend_final_write_processing,
elf_backend_additional_program_headers,
elf_backend_modify_segment_map,
+ elf_backend_gc_mark_hook,
+ elf_backend_gc_sweep_hook,
+ elf_backend_post_process_headers,
+ elf_backend_print_symbol_all,
+ elf_backend_output_arch_syms,
+ elf_backend_copy_indirect_symbol,
+ elf_backend_hide_symbol,
elf_backend_ecoff_debug_swap,
ELF_MACHINE_ALT1,
ELF_MACHINE_ALT2,
&elf_backend_size_info,
elf_backend_got_symbol_offset,
+ elf_backend_got_header_size,
+ elf_backend_plt_header_size,
+ elf_backend_collect,
+ elf_backend_type_change_ok,
+ elf_backend_may_use_rel_p,
+ elf_backend_may_use_rela_p,
+ elf_backend_default_use_rela_p,
+ elf_backend_sign_extend_vma,
elf_backend_want_got_plt,
elf_backend_plt_readonly,
elf_backend_want_plt_sym,
elf_backend_plt_not_loaded,
- elf_backend_plt_alignment
+ elf_backend_plt_alignment,
+ elf_backend_can_gc_sections,
+ elf_backend_want_dynbss
};
+/* Forward declaration for use when initialising alternative_target field. */
+#ifdef TARGET_LITTLE_SYM
+extern const bfd_target TARGET_LITTLE_SYM;
+#endif
+
#ifdef TARGET_BIG_SYM
const bfd_target TARGET_BIG_SYM =
{
@@ -385,14 +478,14 @@ const bfd_target TARGET_BIG_SYM =
{ bfd_false,
bfd_elfNN_mkobject,
bfd_elfNN_mkarchive,
- bfd_false
+ bfd_elfNN_mkcorefile
},
/* bfd_write_contents: write cached information into a file being written */
{ bfd_false,
bfd_elfNN_write_object_contents,
bfd_elfNN_write_archive_contents,
- bfd_false
+ bfd_elfNN_write_corefile_contents,
},
BFD_JUMP_TABLE_GENERIC (bfd_elfNN),
@@ -409,8 +502,15 @@ const bfd_target TARGET_BIG_SYM =
BFD_JUMP_TABLE_LINK (bfd_elfNN),
BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN),
+ /* Alternative endian target. */
+#ifdef TARGET_LITTLE_SYM
+ & TARGET_LITTLE_SYM,
+#else
+ NULL,
+#endif
+
/* backend_data: */
- (PTR) &elfNN_bed,
+ (PTR) &elfNN_bed
};
#endif
@@ -473,14 +573,14 @@ const bfd_target TARGET_LITTLE_SYM =
{ bfd_false,
bfd_elfNN_mkobject,
bfd_elfNN_mkarchive,
- bfd_false
+ bfd_elfNN_mkcorefile
},
/* bfd_write_contents: write cached information into a file being written */
{ bfd_false,
bfd_elfNN_write_object_contents,
bfd_elfNN_write_archive_contents,
- bfd_false
+ bfd_elfNN_write_corefile_contents,
},
BFD_JUMP_TABLE_GENERIC (bfd_elfNN),
@@ -497,7 +597,14 @@ const bfd_target TARGET_LITTLE_SYM =
BFD_JUMP_TABLE_LINK (bfd_elfNN),
BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN),
+ /* Alternative endian target. */
+#ifdef TARGET_BIG_SYM
+ & TARGET_BIG_SYM,
+#else
+ NULL,
+#endif
+
/* backend_data: */
- (PTR) &elfNN_bed,
+ (PTR) &elfNN_bed
};
#endif
diff --git a/contrib/binutils/bfd/format.c b/contrib/binutils/bfd/format.c
index 7a303424df65..c9f1f9cd4be3 100644
--- a/contrib/binutils/bfd/format.c
+++ b/contrib/binutils/bfd/format.c
@@ -1,5 +1,5 @@
/* Generic BFD support for file formats.
- Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 1999 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -118,6 +118,7 @@ bfd_check_format_matches (abfd, format, matching)
bfd_format format;
char ***matching;
{
+ extern const bfd_target binary_vec;
const bfd_target * const *target, *save_targ, *right_targ;
char **matching_vector = NULL;
int match_count;
@@ -166,10 +167,32 @@ bfd_check_format_matches (abfd, format, matching)
free (matching_vector);
return true; /* File position has moved, BTW */
}
+
+ /* For a long time the code has dropped through to check all
+ targets if the specified target was wrong. I don't know why,
+ and I'm reluctant to change it. However, in the case of an
+ archive, it can cause problems. If the specified target does
+ not permit archives (e.g., the binary target), then we should
+ not allow some other target to recognize it as an archive, but
+ should instead allow the specified target to recognize it as an
+ object. When I first made this change, it broke the PE target,
+ because the specified pei-i386 target did not recognize the
+ actual pe-i386 archive. Since there may be other problems of
+ this sort, I changed this test to check only for the binary
+ target. */
+
+ if (format == bfd_archive && save_targ == &binary_vec)
+ {
+ abfd->xvec = save_targ;
+ abfd->format = bfd_unknown;
+ if (matching)
+ free (matching_vector);
+ bfd_set_error (bfd_error_file_not_recognized);
+ return false;
+ }
}
for (target = bfd_target_vector; *target != NULL; target++) {
- extern const bfd_target binary_vec;
const bfd_target *temp;
if (*target == &binary_vec)
diff --git a/contrib/binutils/bfd/freebsd.h b/contrib/binutils/bfd/freebsd.h
index 8bb19acd7d3b..e80c213b28a6 100644
--- a/contrib/binutils/bfd/freebsd.h
+++ b/contrib/binutils/bfd/freebsd.h
@@ -1,5 +1,5 @@
/* BFD back-end definitions used by all FreeBSD targets.
- Copyright (C) 1990, 1991, 1992, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1990, 1991, 1992, 1996, 2000 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -76,11 +76,7 @@ MY(write_object_contents) (abfd)
struct external_exec exec_bytes;
struct internal_exec *execp = exec_hdr (abfd);
-#if CHOOSE_RELOC_SIZE
- CHOOSE_RELOC_SIZE(abfd);
-#else
obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
-#endif
/* Magic number, maestro, please! */
switch (bfd_get_arch(abfd)) {
diff --git a/contrib/binutils/bfd/gen-aout.c b/contrib/binutils/bfd/gen-aout.c
index d2224f762d35..b5ed91a096b4 100644
--- a/contrib/binutils/bfd/gen-aout.c
+++ b/contrib/binutils/bfd/gen-aout.c
@@ -1,5 +1,5 @@
/* Generate parameters for an a.out system.
- Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92, 93, 94, 98 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -82,8 +82,8 @@ main (argc, argv)
#endif
if (arch[0] == '1')
{
- fprintf (stderr, "warning: preprocessor substituted architecture name inside string;");
- fprintf (stderr, " fix DEFAULT_ARCH in the output file yourself\n");
+ fprintf (stderr, _("warning: preprocessor substituted architecture name inside string;"));
+ fprintf (stderr, _(" fix DEFAULT_ARCH in the output file yourself\n"));
arch = "unknown";
}
printf("#define DEFAULT_ARCH bfd_arch_%s\n", arch);
diff --git a/contrib/binutils/bfd/hash.c b/contrib/binutils/bfd/hash.c
index 4c6e9877ce49..173eaf76eef6 100644
--- a/contrib/binutils/bfd/hash.c
+++ b/contrib/binutils/bfd/hash.c
@@ -1,5 +1,5 @@
/* hash.c -- hash table routines for BFD
- Copyright (C) 1993, 94, 95, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1993, 94, 95, 97, 1999 Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
This file is part of BFD, the Binary File Descriptor library.
@@ -73,7 +73,7 @@ SUBSECTION
The function <<bfd_hash_table_init>> take as an argument a
function to use to create new entries. For a basic hash
table, use the function <<bfd_hash_newfunc>>. @xref{Deriving
- a New Hash Table Type} for why you would want to use a
+ a New Hash Table Type}, for why you would want to use a
different value for this argument.
@findex bfd_hash_allocate
@@ -450,7 +450,7 @@ struct bfd_hash_entry *
bfd_hash_newfunc (entry, table, string)
struct bfd_hash_entry *entry;
struct bfd_hash_table *table;
- const char *string;
+ const char *string ATTRIBUTE_UNUSED;
{
if (entry == (struct bfd_hash_entry *) NULL)
entry = ((struct bfd_hash_entry *)
diff --git a/contrib/binutils/bfd/hosts/alphalinux.h b/contrib/binutils/bfd/hosts/alphalinux.h
index d9ba1b7ec6be..09b8d69e7882 100644
--- a/contrib/binutils/bfd/hosts/alphalinux.h
+++ b/contrib/binutils/bfd/hosts/alphalinux.h
@@ -1,6 +1,6 @@
/* Linux dumps "struct task_struct" at the end of the core-file. This
- structure is currently 920 bytes long, but we allow up to 1024
+ structure is currently 1080 bytes long, but we allow up to 4096
bytes to allow for some future growth. */
-#define TRAD_CORE_EXTRA_SIZE_ALLOWED 1024
+#define TRAD_CORE_EXTRA_SIZE_ALLOWED 4096
#define TRAD_UNIX_CORE_FILE_FAILING_SIGNAL(abfd) \
((abfd)->tdata.trad_core_data->u.signal)
diff --git a/contrib/binutils/bfd/i386linux.c b/contrib/binutils/bfd/i386linux.c
index 0f4514d60ad1..5df2a11c50f6 100644
--- a/contrib/binutils/bfd/i386linux.c
+++ b/contrib/binutils/bfd/i386linux.c
@@ -1,5 +1,6 @@
/* BFD back-end for linux flavored i386 a.out binaries.
- Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999
+ Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -297,7 +298,7 @@ new_fixup (info, h, value, builtin)
static boolean
linux_link_create_dynamic_sections (abfd, info)
bfd *abfd;
- struct bfd_link_info *info;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
{
flagword flags;
register asection *s;
@@ -446,7 +447,7 @@ linux_tally_symbols (h, data)
alloc = (char *) bfd_malloc (strlen (name) + 1);
if (p == NULL || alloc == NULL)
- (*_bfd_error_handler) ("Output file requires shared library `%s'\n",
+ (*_bfd_error_handler) (_("Output file requires shared library `%s'\n"),
name);
else
{
@@ -454,7 +455,7 @@ linux_tally_symbols (h, data)
p = strrchr (alloc, '_');
*p++ = '\0';
(*_bfd_error_handler)
- ("Output file requires shared library `%s.so.%s'\n",
+ (_("Output file requires shared library `%s.so.%s'\n"),
alloc, p);
free (alloc);
}
@@ -642,7 +643,7 @@ linux_finish_dynamic_link (output_bfd, info)
&& f->h->root.root.type != bfd_link_hash_defweak)
{
(*_bfd_error_handler)
- ("Symbol %s not defined for fixups\n",
+ (_("Symbol %s not defined for fixups\n"),
f->h->root.root.root.string);
continue;
}
@@ -692,7 +693,7 @@ linux_finish_dynamic_link (output_bfd, info)
&& f->h->root.root.type != bfd_link_hash_defweak)
{
(*_bfd_error_handler)
- ("Symbol %s not defined for fixups\n",
+ (_("Symbol %s not defined for fixups\n"),
f->h->root.root.root.string);
continue;
}
@@ -716,7 +717,7 @@ linux_finish_dynamic_link (output_bfd, info)
if (linux_hash_table (info)->fixup_count != fixups_written)
{
- (*_bfd_error_handler) ("Warning: fixup count mismatch\n");
+ (*_bfd_error_handler) (_("Warning: fixup count mismatch\n"));
while (linux_hash_table (info)->fixup_count > fixups_written)
{
bfd_put_32 (output_bfd, 0, fixup_table);
diff --git a/contrib/binutils/bfd/ieee.c b/contrib/binutils/bfd/ieee.c
index ab0914020620..71b967ac4181 100644
--- a/contrib/binutils/bfd/ieee.c
+++ b/contrib/binutils/bfd/ieee.c
@@ -1,5 +1,5 @@
/* BFD back-end for ieee-695 objects.
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support.
@@ -32,6 +32,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "ieee.h"
#include "libieee.h"
+#include <ctype.h>
+
static boolean ieee_write_byte PARAMS ((bfd *, int));
static boolean ieee_write_2bytes PARAMS ((bfd *, int));
static boolean ieee_write_int PARAMS ((bfd *, bfd_vma));
@@ -162,7 +164,7 @@ ieee_write_id (abfd, id)
else
{
(*_bfd_error_handler)
- ("%s: string too long (%d chars, max 65535)",
+ (_("%s: string too long (%d chars, max 65535)"),
bfd_get_filename (abfd), length);
bfd_set_error (bfd_error_invalid_operation);
return false;
@@ -292,7 +294,7 @@ ieee_write_expression (abfd, value, symbol, pcrel, index)
else
{
(*_bfd_error_handler)
- ("%s: unrecognized symbol `%s' flags 0x%x",
+ (_("%s: unrecognized symbol `%s' flags 0x%x"),
bfd_get_filename (abfd), bfd_asymbol_name (symbol),
symbol->flags);
bfd_set_error (bfd_error_invalid_operation);
@@ -683,7 +685,7 @@ get_symbol (abfd,
max_index,
this_type
)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
ieee_data_type *ieee;
ieee_symbol_type *last_symbol;
unsigned int *symbol_count;
@@ -788,7 +790,7 @@ ieee_slurp_external_symbols (abfd)
break;
default:
(*_bfd_error_handler)
- ("%s: unimplemented ATI record %u for symbol %u",
+ (_("%s: unimplemented ATI record %u for symbol %u"),
bfd_get_filename (abfd), symbol_attribute_def,
symbol_name_index);
bfd_set_error (bfd_error_bad_value);
@@ -803,6 +805,44 @@ ieee_slurp_external_symbols (abfd)
parse_int (&(ieee->h), &value);
parse_int (&(ieee->h), &value);
break;
+ case ieee_atn_record_enum:
+ /* We may get call optimization information here,
+ which we just ignore. The format is
+ {$F1}${CE}{index}{$00}{$3F}{$3F}{#_of_ASNs} */
+ parse_int (&ieee->h, &value);
+ parse_int (&ieee->h, &value);
+ parse_int (&ieee->h, &value);
+ if (value != 0x3f)
+ {
+ (*_bfd_error_handler)
+ (_("%s: unexpected ATN type %d in external part"),
+ bfd_get_filename (abfd), (int) value);
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ }
+ parse_int (&ieee->h, &value);
+ parse_int (&ieee->h, &value);
+ while (value > 0)
+ {
+ bfd_vma val1;
+
+ --value;
+
+ switch (read_2bytes (ieee))
+ {
+ case ieee_asn_record_enum:
+ parse_int (&ieee->h, &val1);
+ parse_int (&ieee->h, &val1);
+ break;
+
+ default:
+ (*_bfd_error_handler)
+ (_("%s: unexpected type after ATN"),
+ bfd_get_filename (abfd));
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ }
+ }
}
}
break;
@@ -823,6 +863,28 @@ ieee_slurp_external_symbols (abfd)
&extra,
&symbol->symbol.section);
+ /* Fully linked IEEE-695 files tend to give every symbol
+ an absolute value. Try to convert that back into a
+ section relative value. FIXME: This won't always to
+ the right thing. */
+ if (bfd_is_abs_section (symbol->symbol.section)
+ && (abfd->flags & HAS_RELOC) == 0)
+ {
+ bfd_vma val;
+ asection *s;
+
+ val = symbol->symbol.value;
+ for (s = abfd->sections; s != NULL; s = s->next)
+ {
+ if (val >= s->vma && val < s->vma + s->_raw_size)
+ {
+ symbol->symbol.section = s;
+ symbol->symbol.value -= s->vma;
+ break;
+ }
+ }
+ }
+
symbol->symbol.flags = BSF_GLOBAL | BSF_EXPORT;
}
@@ -947,8 +1009,17 @@ ieee_get_symtab (abfd, location)
ieee_symbol_type *symp;
static bfd dummy_bfd;
static asymbol empty_symbol =
- /* the_bfd, name, value, attr, section */
- {&dummy_bfd, " ieee empty", (symvalue) 0, BSF_DEBUGGING, bfd_abs_section_ptr};
+ {
+ &dummy_bfd,
+ " ieee empty",
+ (symvalue) 0,
+ BSF_DEBUGGING,
+ bfd_abs_section_ptr
+#ifdef __STDC__
+ /* K&R compilers can't initialise unions. */
+ , { 0 }
+#endif
+ };
if (abfd->symcount)
{
@@ -1218,6 +1289,7 @@ ieee_slurp_debug (abfd)
{
ieee_data_type *ieee = IEEE_DATA (abfd);
asection *sec;
+ file_ptr debug_end;
if (ieee->w.r.debug_information_part == 0)
return true;
@@ -1227,7 +1299,13 @@ ieee_slurp_debug (abfd)
return false;
sec->flags |= SEC_DEBUGGING | SEC_HAS_CONTENTS;
sec->filepos = ieee->w.r.debug_information_part;
- sec->_raw_size = ieee->w.r.data_part - ieee->w.r.debug_information_part;
+
+ debug_end = ieee->w.r.data_part;
+ if (debug_end == 0)
+ debug_end = ieee->w.r.trailer_part;
+ if (debug_end == 0)
+ debug_end = ieee->w.r.me_record;
+ sec->_raw_size = debug_end - ieee->w.r.debug_information_part;
return true;
}
@@ -1267,7 +1345,7 @@ ieee_archive_p (abfd)
if (this_byte (&(ieee->h)) != Module_Beginning)
{
abfd->tdata.ieee_ar_data = save;
- goto error_return;
+ goto got_wrong_format_error;
}
next_byte (&(ieee->h));
@@ -1276,7 +1354,7 @@ ieee_archive_p (abfd)
{
bfd_release (abfd, ieee);
abfd->tdata.ieee_ar_data = save;
- goto error_return;
+ goto got_wrong_format_error;
}
/* Throw away the filename */
read_id (&(ieee->h));
@@ -1379,6 +1457,8 @@ ieee_archive_p (abfd)
return abfd->xvec;
+ got_wrong_format_error:
+ bfd_set_error (bfd_error_wrong_format);
error_return:
if (elts != NULL)
free (elts);
@@ -1440,7 +1520,70 @@ ieee_object_p (abfd)
/* Determine the architecture and machine type of the object file.
*/
{
- const bfd_arch_info_type *arch = bfd_scan_arch (processor);
+ const bfd_arch_info_type *arch;
+ char family[10];
+
+ /* IEEE does not specify the format of the processor identificaton
+ string, so the compiler is free to put in it whatever it wants.
+ We try here to recognize different processors belonging to the
+ m68k family. Code for other processors can be added here. */
+ if ((processor[0] == '6') && (processor[1] == '8'))
+ {
+ if (processor[2] == '3') /* 683xx integrated processors */
+ {
+ switch (processor[3])
+ {
+ case '0': /* 68302, 68306, 68307 */
+ case '2': /* 68322, 68328 */
+ case '5': /* 68356 */
+ strcpy (family, "68000"); /* MC68000-based controllers */
+ break;
+
+ case '3': /* 68330, 68331, 68332, 68333,
+ 68334, 68335, 68336, 68338 */
+ case '6': /* 68360 */
+ case '7': /* 68376 */
+ strcpy (family, "68332"); /* CPU32 and CPU32+ */
+ break;
+
+ case '4':
+ if (processor[4] == '9') /* 68349 */
+ strcpy (family, "68030"); /* CPU030 */
+ else /* 68340, 68341 */
+ strcpy (family, "68332"); /* CPU32 and CPU32+ */
+ break;
+
+ default: /* Does not exist yet */
+ strcpy (family, "68332"); /* Guess it will be CPU32 */
+ }
+ }
+ else if (toupper (processor[3]) == 'F') /* 68F333 */
+ strcpy (family, "68332"); /* CPU32 */
+ else if ((toupper (processor[3]) == 'C') /* Embedded controllers */
+ && ((toupper (processor[2]) == 'E')
+ || (toupper (processor[2]) == 'H')
+ || (toupper (processor[2]) == 'L')))
+ {
+ strcpy (family, "68");
+ strncat (family, processor + 4, 7);
+ family[9] = '\0';
+ }
+ else /* "Regular" processors */
+ {
+ strncpy (family, processor, 9);
+ family[9] = '\0';
+ }
+ }
+ else if ((strncmp (processor, "cpu32", 5) == 0) /* CPU32 and CPU32+ */
+ || (strncmp (processor, "CPU32", 5) == 0))
+ strcpy (family, "68332");
+ else
+ {
+ strncpy (family, processor, 9);
+ family[9] = '\0';
+ }
+
+ arch = bfd_scan_arch (family);
if (arch == 0)
goto got_wrong_format;
abfd->arch_info = arch;
@@ -1527,7 +1670,7 @@ fail:
void
ieee_get_symbol_info (ignore_abfd, symbol, ret)
- bfd *ignore_abfd;
+ bfd *ignore_abfd ATTRIBUTE_UNUSED;
asymbol *symbol;
symbol_info *ret;
{
@@ -1540,7 +1683,7 @@ ieee_get_symbol_info (ignore_abfd, symbol, ret)
void
ieee_print_symbol (ignore_abfd, afile, symbol, how)
- bfd *ignore_abfd;
+ bfd *ignore_abfd ATTRIBUTE_UNUSED;
PTR afile;
asymbol *symbol;
bfd_print_symbol_type how;
@@ -3038,7 +3181,7 @@ block ()
static void
relocate_debug (output, input)
- bfd *output;
+ bfd *output ATTRIBUTE_UNUSED;
bfd *input;
{
#define IBS 400
@@ -3433,10 +3576,22 @@ ieee_write_processor (abfd)
case bfd_arch_m68k:
{
- char ab[20];
+ const char *id;
- sprintf (ab, "%lu", arch->mach);
- if (! ieee_write_id (abfd, ab))
+ switch (arch->mach)
+ {
+ default: id = "68020"; break;
+ case bfd_mach_m68000: id = "68000"; break;
+ case bfd_mach_m68008: id = "68008"; break;
+ case bfd_mach_m68010: id = "68010"; break;
+ case bfd_mach_m68020: id = "68020"; break;
+ case bfd_mach_m68030: id = "68030"; break;
+ case bfd_mach_m68040: id = "68040"; break;
+ case bfd_mach_m68060: id = "68060"; break;
+ case bfd_mach_cpu32: id = "cpu32"; break;
+ }
+
+ if (! ieee_write_id (abfd, id))
return false;
}
break;
@@ -3625,13 +3780,13 @@ ieee_find_nearest_line (abfd,
filename_ptr,
functionname_ptr,
line_ptr)
- bfd *abfd;
- asection *section;
- asymbol **symbols;
- bfd_vma offset;
- char **filename_ptr;
- char **functionname_ptr;
- int *line_ptr;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asection *section ATTRIBUTE_UNUSED;
+ asymbol **symbols ATTRIBUTE_UNUSED;
+ bfd_vma offset ATTRIBUTE_UNUSED;
+ const char **filename_ptr ATTRIBUTE_UNUSED;
+ const char **functionname_ptr ATTRIBUTE_UNUSED;
+ unsigned int *line_ptr ATTRIBUTE_UNUSED;
{
return false;
}
@@ -3670,8 +3825,8 @@ ieee_generic_stat_arch_elt (abfd, buf)
static int
ieee_sizeof_headers (abfd, x)
- bfd *abfd;
- boolean x;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ boolean x ATTRIBUTE_UNUSED;
{
return 0;
}
@@ -3773,6 +3928,7 @@ ieee_bfd_debug_info_accumulate (abfd, section)
#define ieee_bfd_get_relocated_section_contents \
bfd_generic_get_relocated_section_contents
#define ieee_bfd_relax_section bfd_generic_relax_section
+#define ieee_bfd_gc_sections bfd_generic_gc_sections
#define ieee_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
#define ieee_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define ieee_bfd_final_link _bfd_generic_final_link
@@ -3828,5 +3984,7 @@ const bfd_target ieee_vec =
BFD_JUMP_TABLE_LINK (ieee),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+ NULL,
+
(PTR) 0
};
diff --git a/contrib/binutils/bfd/ihex.c b/contrib/binutils/bfd/ihex.c
index e4b098eecd95..d00c59b5e1a1 100644
--- a/contrib/binutils/bfd/ihex.c
+++ b/contrib/binutils/bfd/ihex.c
@@ -1,5 +1,5 @@
/* BFD back-end for Intel Hex objects.
- Copyright 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
Written by Ian Lance Taylor of Cygnus Support <ian@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
@@ -146,7 +146,7 @@ static int ihex_sizeof_headers PARAMS ((bfd *, boolean));
/* The number of bytes we put on one line during output. */
-#define CHUNK (21)
+#define CHUNK 16
/* Macros for converting between hex and binary. */
@@ -256,7 +256,7 @@ ihex_bad_byte (abfd, lineno, c, error)
buf[1] = '\0';
}
(*_bfd_error_handler)
- ("%s:%d: unexpected character `%s' in Intel Hex file\n",
+ (_("%s:%d: unexpected character `%s' in Intel Hex file\n"),
bfd_get_filename (abfd), lineno, buf);
bfd_set_error (bfd_error_bad_value);
}
@@ -366,7 +366,7 @@ ihex_scan (abfd)
if (((- chksum) & 0xff) != (unsigned int) HEX2 (buf + 2 * i))
{
(*_bfd_error_handler)
- ("%s:%d: bad checksum in Intel Hex file (expected %u, found %u)",
+ (_("%s:%d: bad checksum in Intel Hex file (expected %u, found %u)"),
bfd_get_filename (abfd), lineno,
(- chksum) & 0xff, (unsigned int) HEX2 (buf + 2 * i));
bfd_set_error (bfd_error_bad_value);
@@ -418,7 +418,7 @@ ihex_scan (abfd)
if (len != 2)
{
(*_bfd_error_handler)
- ("%s:%d: bad extended address record length in Intel Hex file",
+ (_("%s:%d: bad extended address record length in Intel Hex file"),
bfd_get_filename (abfd), lineno);
bfd_set_error (bfd_error_bad_value);
goto error_return;
@@ -435,7 +435,7 @@ ihex_scan (abfd)
if (len != 4)
{
(*_bfd_error_handler)
- ("%s:%d: bad extended start address length in Intel Hex file",
+ (_("%s:%d: bad extended start address length in Intel Hex file"),
bfd_get_filename (abfd), lineno);
bfd_set_error (bfd_error_bad_value);
goto error_return;
@@ -452,7 +452,7 @@ ihex_scan (abfd)
if (len != 2)
{
(*_bfd_error_handler)
- ("%s:%d: bad extended linear address record length in Intel Hex file",
+ (_("%s:%d: bad extended linear address record length in Intel Hex file"),
bfd_get_filename (abfd), lineno);
bfd_set_error (bfd_error_bad_value);
goto error_return;
@@ -469,7 +469,7 @@ ihex_scan (abfd)
if (len != 2 && len != 4)
{
(*_bfd_error_handler)
- ("%s:%d: bad extended linear start address length in Intel Hex file",
+ (_("%s:%d: bad extended linear start address length in Intel Hex file"),
bfd_get_filename (abfd), lineno);
bfd_set_error (bfd_error_bad_value);
goto error_return;
@@ -486,7 +486,7 @@ ihex_scan (abfd)
default:
(*_bfd_error_handler)
- ("%s:%d: unrecognized ihex type %u in Intel Hex file\n",
+ (_("%s:%d: unrecognized ihex type %u in Intel Hex file\n"),
bfd_get_filename (abfd), lineno, type);
bfd_set_error (bfd_error_bad_value);
goto error_return;
@@ -606,7 +606,7 @@ ihex_read_section (abfd, section, contents)
if (type != 0)
{
(*_bfd_error_handler)
- ("%s: internal error in ihex_read_section",
+ (_("%s: internal error in ihex_read_section"),
bfd_get_filename (abfd));
bfd_set_error (bfd_error_bad_value);
goto error_return;
@@ -641,7 +641,7 @@ ihex_read_section (abfd, section, contents)
if ((bfd_size_type) (p - contents) < section->_raw_size)
{
(*_bfd_error_handler)
- ("%s: bad section length in ihex_read_section",
+ (_("%s: bad section length in ihex_read_section"),
bfd_get_filename (abfd));
bfd_set_error (bfd_error_bad_value);
goto error_return;
@@ -855,7 +855,7 @@ ihex_write_object_contents (abfd)
sprintf_vma (buf, where);
(*_bfd_error_handler)
- ("%s: address 0x%s out of range for Intex Hex file",
+ (_("%s: address 0x%s out of range for Intex Hex file"),
bfd_get_filename (abfd), buf);
bfd_set_error (bfd_error_bad_value);
return false;
@@ -947,8 +947,8 @@ ihex_set_arch_mach (abfd, arch, mach)
/*ARGSUSED*/
static int
ihex_sizeof_headers (abfd, exec)
- bfd *abfd;
- boolean exec;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ boolean exec ATTRIBUTE_UNUSED;
{
return 0;
}
@@ -982,6 +982,7 @@ ihex_sizeof_headers (abfd, exec)
#define ihex_bfd_get_relocated_section_contents \
bfd_generic_get_relocated_section_contents
#define ihex_bfd_relax_section bfd_generic_relax_section
+#define ihex_bfd_gc_sections bfd_generic_gc_sections
#define ihex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
#define ihex_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define ihex_bfd_final_link _bfd_generic_final_link
@@ -1036,5 +1037,7 @@ const bfd_target ihex_vec =
BFD_JUMP_TABLE_LINK (ihex),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+ NULL,
+
(PTR) 0
};
diff --git a/contrib/binutils/bfd/libaout.h b/contrib/binutils/bfd/libaout.h
index 3e6a56a4fd94..7001d3dc6d4a 100644
--- a/contrib/binutils/bfd/libaout.h
+++ b/contrib/binutils/bfd/libaout.h
@@ -232,6 +232,7 @@ enum machine_type {
M_PMAX_NETBSD = 139, /* NetBSD/pmax (MIPS little-endian) binary */
M_VAX_NETBSD = 140, /* NetBSD/vax binary */
M_ALPHA_NETBSD = 141, /* NetBSD/alpha binary */
+ M_ARM6_NETBSD = 143, /* NetBSD/arm32 binary */
M_SPARCLET_1 = 147, /* 0x93, reserved */
M_MIPS1 = 151, /* MIPS R2000/R3000 binary */
M_MIPS2 = 152, /* MIPS R4000/R6000 binary */
@@ -243,7 +244,8 @@ enum machine_type {
M_HPUX = (0x20c % 256), /* HP 200/300 HPUX binary */
M_SPARCLET_5 = 211, /* 0xd3, reserved */
M_SPARCLET_6 = 227, /* 0xe3, reserved */
- M_SPARCLET_7 = 243 /* 0xf3, reserved */
+ /* M_SPARCLET_7 = 243 / * 0xf3, reserved */
+ M_SPARCLITE_LE = 243
};
#define N_DYNAMIC(exec) ((exec).a_info & 0x80000000)
diff --git a/contrib/binutils/bfd/libbfd-in.h b/contrib/binutils/bfd/libbfd-in.h
index 30911b20ace9..aece1e15a51e 100644
--- a/contrib/binutils/bfd/libbfd-in.h
+++ b/contrib/binutils/bfd/libbfd-in.h
@@ -1,6 +1,7 @@
/* libbfd.h -- Declarations used by bfd library *implementation*.
(This include file is not for users of the library.)
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
+ Free Software Foundation, Inc.
Written by Cygnus Support.
** NOTE: libbfd.h is a GENERATED file. Don't change it; instead,
@@ -317,6 +318,10 @@ extern boolean _bfd_generic_set_section_contents
((boolean (*) \
PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *))) \
bfd_false)
+#define _bfd_nolink_bfd_gc_sections \
+ ((boolean (*) \
+ PARAMS ((bfd *, struct bfd_link_info *))) \
+ bfd_false)
#define _bfd_nolink_bfd_link_hash_table_create \
((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr)
#define _bfd_nolink_bfd_link_add_symbols \
@@ -352,10 +357,15 @@ extern boolean _bfd_stab_section_find_nearest_line
PARAMS ((bfd *, asymbol **, asection *, bfd_vma, boolean *, const char **,
const char **, unsigned int *, PTR *));
+/* Find the neaderst line using DWARF 1 debugging information. */
+extern boolean _bfd_dwarf1_find_nearest_line
+ PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
+ const char **, unsigned int *));
+
/* Find the nearest line using DWARF 2 debugging information. */
extern boolean _bfd_dwarf2_find_nearest_line
PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
- const char **, unsigned int *));
+ const char **, unsigned int *, unsigned int));
/* A routine to create entries for a bfd_link_hash_table. */
extern struct bfd_hash_entry *_bfd_link_hash_newfunc
@@ -469,6 +479,9 @@ extern bfd_size_type _bfd_stringtab_add
/* Write out a string table. */
extern boolean _bfd_stringtab_emit PARAMS ((bfd *, struct bfd_strtab_hash *));
+
+/* Check that endianness of input and output file match. */
+extern boolean _bfd_generic_verify_endian_match PARAMS ((bfd *, bfd *));
/* Macros to tell if bfds are read or write enabled.
@@ -490,6 +503,17 @@ void bfd_assert PARAMS ((const char*,int));
#define BFD_FAIL() \
{ bfd_assert(__FILE__,__LINE__); }
+extern void _bfd_abort PARAMS ((const char *, int, const char *))
+ ATTRIBUTE_NORETURN;
+
+/* if gcc >= 2.6, we can give a function name, too */
+#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6)
+#define __PRETTY_FUNCTION__ ((char *) NULL)
+#endif
+
+#undef abort
+#define abort() _bfd_abort (__FILE__, __LINE__, __PRETTY_FUNCTION__)
+
FILE * bfd_cache_lookup_worker PARAMS ((bfd *));
extern bfd *bfd_last_cache;
diff --git a/contrib/binutils/bfd/libbfd.c b/contrib/binutils/bfd/libbfd.c
index 042bdeeabdd1..881af73239f8 100644
--- a/contrib/binutils/bfd/libbfd.c
+++ b/contrib/binutils/bfd/libbfd.c
@@ -1,5 +1,5 @@
/* Assorted BFD support routines, only used internally.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -45,7 +45,7 @@ DESCRIPTION
/*ARGSUSED*/
boolean
bfd_false (ignore)
- bfd *ignore;
+ bfd *ignore ATTRIBUTE_UNUSED;
{
bfd_set_error (bfd_error_invalid_operation);
return false;
@@ -57,7 +57,7 @@ bfd_false (ignore)
/*ARGSUSED*/
boolean
bfd_true (ignore)
- bfd *ignore;
+ bfd *ignore ATTRIBUTE_UNUSED;
{
return true;
}
@@ -68,7 +68,7 @@ bfd_true (ignore)
/*ARGSUSED*/
PTR
bfd_nullvoidptr (ignore)
- bfd *ignore;
+ bfd *ignore ATTRIBUTE_UNUSED;
{
bfd_set_error (bfd_error_invalid_operation);
return NULL;
@@ -77,7 +77,7 @@ bfd_nullvoidptr (ignore)
/*ARGSUSED*/
int
bfd_0 (ignore)
- bfd *ignore;
+ bfd *ignore ATTRIBUTE_UNUSED;
{
return 0;
}
@@ -85,7 +85,7 @@ bfd_0 (ignore)
/*ARGSUSED*/
unsigned int
bfd_0u (ignore)
- bfd *ignore;
+ bfd *ignore ATTRIBUTE_UNUSED;
{
return 0;
}
@@ -93,7 +93,7 @@ bfd_0u (ignore)
/*ARGUSED*/
long
bfd_0l (ignore)
- bfd *ignore;
+ bfd *ignore ATTRIBUTE_UNUSED;
{
return 0;
}
@@ -104,7 +104,7 @@ bfd_0l (ignore)
/*ARGSUSED*/
long
_bfd_n1 (ignore_abfd)
- bfd *ignore_abfd;
+ bfd *ignore_abfd ATTRIBUTE_UNUSED;
{
bfd_set_error (bfd_error_invalid_operation);
return -1;
@@ -113,15 +113,15 @@ _bfd_n1 (ignore_abfd)
/*ARGSUSED*/
void
bfd_void (ignore)
- bfd *ignore;
+ bfd *ignore ATTRIBUTE_UNUSED;
{
}
/*ARGSUSED*/
boolean
_bfd_nocore_core_file_matches_executable_p (ignore_core_bfd, ignore_exec_bfd)
- bfd *ignore_core_bfd;
- bfd *ignore_exec_bfd;
+ bfd *ignore_core_bfd ATTRIBUTE_UNUSED;
+ bfd *ignore_exec_bfd ATTRIBUTE_UNUSED;
{
bfd_set_error (bfd_error_invalid_operation);
return false;
@@ -133,7 +133,7 @@ _bfd_nocore_core_file_matches_executable_p (ignore_core_bfd, ignore_exec_bfd)
/*ARGSUSED*/
char *
_bfd_nocore_core_file_failing_command (ignore_abfd)
- bfd *ignore_abfd;
+ bfd *ignore_abfd ATTRIBUTE_UNUSED;
{
bfd_set_error (bfd_error_invalid_operation);
return (char *)NULL;
@@ -145,7 +145,7 @@ _bfd_nocore_core_file_failing_command (ignore_abfd)
/*ARGSUSED*/
int
_bfd_nocore_core_file_failing_signal (ignore_abfd)
- bfd *ignore_abfd;
+ bfd *ignore_abfd ATTRIBUTE_UNUSED;
{
bfd_set_error (bfd_error_invalid_operation);
return 0;
@@ -154,7 +154,7 @@ _bfd_nocore_core_file_failing_signal (ignore_abfd)
/*ARGSUSED*/
const bfd_target *
_bfd_dummy_target (ignore_abfd)
- bfd *ignore_abfd;
+ bfd *ignore_abfd ATTRIBUTE_UNUSED;
{
bfd_set_error (bfd_error_wrong_format);
return 0;
@@ -232,7 +232,25 @@ real_read (where, a,b, file)
size_t b;
FILE *file;
{
+ /* FIXME - this looks like an optimization, but it's really to cover
+ up for a feature of some OSs (not solaris - sigh) that
+ ld/pe-dll.c takes advantage of (apparently) when it creates BFDs
+ internally and tries to link against them. BFD seems to be smart
+ enough to realize there are no symbol records in the "file" that
+ doesn't exist but attempts to read them anyway. On Solaris,
+ attempting to read zero bytes from a NULL file results in a core
+ dump, but on other platforms it just returns zero bytes read.
+ This makes it to something reasonable. - DJ */
+ if (a == 0 || b == 0)
+ return 0;
+
+#if defined (__VAX) && defined (VMS)
+ /* Apparently fread on Vax VMS does not keep the record length
+ information. */
+ return read (fileno (file), where, a * b);
+#else
return fread (where, a, b, file);
+#endif
}
/* Return value is amount read (FIXME: how are errors and end of file dealt
@@ -256,7 +274,10 @@ bfd_read (ptr, size, nitems, abfd)
get = size * nitems;
if (abfd->where + get > bim->size)
{
- get = bim->size - abfd->where;
+ if (bim->size < (bfd_size_type) abfd->where)
+ get = 0;
+ else
+ get = bim->size - abfd->where;
bfd_set_error (bfd_error_file_truncated);
}
memcpy (ptr, bim->buffer + abfd->where, get);
@@ -275,7 +296,7 @@ bfd_read (ptr, size, nitems, abfd)
A BFD backend may wish to override bfd_error_file_truncated to
provide something more useful (eg. no_symbols or wrong_format). */
- if (nread < (int)(size * nitems))
+ if (nread != (int) (size * nitems))
{
if (ferror (bfd_cache_lookup (abfd)))
bfd_set_error (bfd_error_system_call);
@@ -318,7 +339,6 @@ bfd_init_window (windowp)
#undef HAVE_MPROTECT /* code's not tested yet */
#if HAVE_MMAP || HAVE_MPROTECT || HAVE_MADVISE
-#include <sys/types.h>
#include <sys/mman.h>
#endif
@@ -461,10 +481,10 @@ bfd_get_file_window (abfd, offset, size, windowp, writable)
else if (debug_windows)
{
if (ok_to_map)
- fprintf (stderr, "not mapping: data=%lx mapped=%d\n",
+ fprintf (stderr, _("not mapping: data=%lx mapped=%d\n"),
(unsigned long) i->data, (int) i->mapped);
else
- fprintf (stderr, "not mapping: env var not set\n");
+ fprintf (stderr, _("not mapping: env var not set\n"));
}
#else
ok_to_map = 0;
@@ -523,7 +543,29 @@ bfd_write (ptr, size, nitems, abfd)
long nwrote;
if ((abfd->flags & BFD_IN_MEMORY) != 0)
- abort ();
+ {
+ struct bfd_in_memory *bim = (struct bfd_in_memory *) (abfd->iostream);
+ size *= nitems;
+ if (abfd->where + size > bim->size)
+ {
+ long newsize, oldsize = (bim->size + 127) & ~127;
+ bim->size = abfd->where + size;
+ /* Round up to cut down on memory fragmentation */
+ newsize = (bim->size + 127) & ~127;
+ if (newsize > oldsize)
+ {
+ bim->buffer = bfd_realloc (bim->buffer, newsize);
+ if (bim->buffer == 0)
+ {
+ bim->size = 0;
+ return 0;
+ }
+ }
+ }
+ memcpy (bim->buffer + abfd->where, ptr, size);
+ abfd->where += size;
+ return size;
+ }
nwrote = fwrite (ptr, 1, (size_t) (size * nitems),
bfd_cache_lookup (abfd));
@@ -638,10 +680,22 @@ bfd_seek (abfd, position, direction)
if ((abfd->flags & BFD_IN_MEMORY) != 0)
{
+ struct bfd_in_memory *bim;
+
+ bim = (struct bfd_in_memory *) abfd->iostream;
+
if (direction == SEEK_SET)
abfd->where = position;
else
abfd->where += position;
+
+ if ((bfd_size_type) abfd->where > bim->size)
+ {
+ abfd->where = bim->size;
+ bfd_set_error (bfd_error_file_truncated);
+ return -1;
+ }
+
return 0;
}
@@ -753,7 +807,7 @@ DESCRIPTION
.{* Byte swapping macros for user section data. *}
.
.#define bfd_put_8(abfd, val, ptr) \
-. (*((unsigned char *)(ptr)) = (unsigned char)(val))
+. ((void) (*((unsigned char *)(ptr)) = (unsigned char)(val)))
.#define bfd_put_signed_8 \
. bfd_put_8
.#define bfd_get_8(abfd, ptr) \
@@ -788,6 +842,20 @@ DESCRIPTION
.#define bfd_get_signed_64(abfd, ptr) \
. BFD_SEND(abfd, bfd_getx_signed_64, (ptr))
.
+.#define bfd_get(bits, abfd, ptr) \
+. ((bits) == 8 ? bfd_get_8 (abfd, ptr) \
+. : (bits) == 16 ? bfd_get_16 (abfd, ptr) \
+. : (bits) == 32 ? bfd_get_32 (abfd, ptr) \
+. : (bits) == 64 ? bfd_get_64 (abfd, ptr) \
+. : (abort (), (bfd_vma) - 1))
+.
+.#define bfd_put(bits, abfd, val, ptr) \
+. ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
+. : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
+. : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
+. : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
+. : (abort (), (void) 0))
+.
*/
/*
@@ -844,7 +912,8 @@ DESCRIPTION
/* Sign extension to bfd_signed_vma. */
#define COERCE16(x) (((bfd_signed_vma) (x) ^ 0x8000) - 0x8000)
-#define COERCE32(x) (((bfd_signed_vma) (x) ^ 0x80000000) - 0x80000000)
+#define COERCE32(x) \
+ ((bfd_signed_vma) (long) (((unsigned long) (x) ^ 0x80000000) - 0x80000000))
#define EIGHT_GAZILLION (((BFD_HOST_64_BIT)0x80000000) << 32)
#define COERCE64(x) \
(((bfd_signed_vma) (x) ^ EIGHT_GAZILLION) - EIGHT_GAZILLION)
@@ -899,37 +968,57 @@ bfd_vma
bfd_getb32 (addr)
register const bfd_byte *addr;
{
- return (((((bfd_vma)addr[0] << 8) | addr[1]) << 8)
- | addr[2]) << 8 | addr[3];
+ unsigned long v;
+
+ v = (unsigned long) addr[0] << 24;
+ v |= (unsigned long) addr[1] << 16;
+ v |= (unsigned long) addr[2] << 8;
+ v |= (unsigned long) addr[3];
+ return (bfd_vma) v;
}
bfd_vma
bfd_getl32 (addr)
register const bfd_byte *addr;
{
- return (((((bfd_vma)addr[3] << 8) | addr[2]) << 8)
- | addr[1]) << 8 | addr[0];
+ unsigned long v;
+
+ v = (unsigned long) addr[0];
+ v |= (unsigned long) addr[1] << 8;
+ v |= (unsigned long) addr[2] << 16;
+ v |= (unsigned long) addr[3] << 24;
+ return (bfd_vma) v;
}
bfd_signed_vma
bfd_getb_signed_32 (addr)
register const bfd_byte *addr;
{
- return COERCE32((((((bfd_vma)addr[0] << 8) | addr[1]) << 8)
- | addr[2]) << 8 | addr[3]);
+ unsigned long v;
+
+ v = (unsigned long) addr[0] << 24;
+ v |= (unsigned long) addr[1] << 16;
+ v |= (unsigned long) addr[2] << 8;
+ v |= (unsigned long) addr[3];
+ return COERCE32 (v);
}
bfd_signed_vma
bfd_getl_signed_32 (addr)
register const bfd_byte *addr;
{
- return COERCE32((((((bfd_vma)addr[3] << 8) | addr[2]) << 8)
- | addr[1]) << 8 | addr[0]);
+ unsigned long v;
+
+ v = (unsigned long) addr[0];
+ v |= (unsigned long) addr[1] << 8;
+ v |= (unsigned long) addr[2] << 16;
+ v |= (unsigned long) addr[3] << 24;
+ return COERCE32 (v);
}
bfd_vma
bfd_getb64 (addr)
- register const bfd_byte *addr;
+ register const bfd_byte *addr ATTRIBUTE_UNUSED;
{
#ifdef BFD64
bfd_vma low, high;
@@ -953,7 +1042,7 @@ bfd_getb64 (addr)
bfd_vma
bfd_getl64 (addr)
- register const bfd_byte *addr;
+ register const bfd_byte *addr ATTRIBUTE_UNUSED;
{
#ifdef BFD64
bfd_vma low, high;
@@ -977,7 +1066,7 @@ bfd_getl64 (addr)
bfd_signed_vma
bfd_getb_signed_64 (addr)
- register const bfd_byte *addr;
+ register const bfd_byte *addr ATTRIBUTE_UNUSED;
{
#ifdef BFD64
bfd_vma low, high;
@@ -1001,7 +1090,7 @@ bfd_getb_signed_64 (addr)
bfd_signed_vma
bfd_getl_signed_64 (addr)
- register const bfd_byte *addr;
+ register const bfd_byte *addr ATTRIBUTE_UNUSED;
{
#ifdef BFD64
bfd_vma low, high;
@@ -1046,8 +1135,8 @@ bfd_putl32 (data, addr)
void
bfd_putb64 (data, addr)
- bfd_vma data;
- register bfd_byte *addr;
+ bfd_vma data ATTRIBUTE_UNUSED;
+ register bfd_byte *addr ATTRIBUTE_UNUSED;
{
#ifdef BFD64
addr[0] = (bfd_byte)(data >> (7*8));
@@ -1065,8 +1154,8 @@ bfd_putb64 (data, addr)
void
bfd_putl64 (data, addr)
- bfd_vma data;
- register bfd_byte *addr;
+ bfd_vma data ATTRIBUTE_UNUSED;
+ register bfd_byte *addr ATTRIBUTE_UNUSED;
{
#ifdef BFD64
addr[7] = (bfd_byte)(data >> (7*8));
@@ -1092,22 +1181,29 @@ _bfd_generic_get_section_contents (abfd, section, location, offset, count)
file_ptr offset;
bfd_size_type count;
{
- if (count == 0)
- return true;
- if ((bfd_size_type)(offset+count) > section->_raw_size
- || bfd_seek(abfd, (file_ptr)(section->filepos + offset), SEEK_SET) == -1
- || bfd_read(location, (bfd_size_type)1, count, abfd) != count)
- return (false); /* on error */
- return (true);
+ if (count == 0)
+ return true;
+
+ if ((bfd_size_type) (offset + count) > section->_raw_size)
+ {
+ bfd_set_error (bfd_error_invalid_operation);
+ return false;
+ }
+
+ if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0
+ || bfd_read (location, (bfd_size_type) 1, count, abfd) != count)
+ return false;
+
+ return true;
}
boolean
_bfd_generic_get_section_contents_in_window (abfd, section, w, offset, count)
- bfd *abfd;
- sec_ptr section;
- bfd_window *w;
- file_ptr offset;
- bfd_size_type count;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ sec_ptr section ATTRIBUTE_UNUSED;
+ bfd_window *w ATTRIBUTE_UNUSED;
+ file_ptr offset ATTRIBUTE_UNUSED;
+ bfd_size_type count ATTRIBUTE_UNUSED;
{
#ifdef USE_MMAP
if (count == 0)
@@ -1180,13 +1276,14 @@ DESCRIPTION
@var{x} of 1025 returns 11.
*/
-unsigned
-bfd_log2(x)
+unsigned int
+bfd_log2 (x)
bfd_vma x;
{
- unsigned result = 0;
- while ( (bfd_vma)(1<< result) < x)
- result++;
+ unsigned int result = 0;
+
+ while ((x = (x >> 1)) != 0)
+ ++result;
return result;
}
@@ -1200,3 +1297,26 @@ bfd_generic_is_local_label_name (abfd, name)
return (name[0] == locals_prefix);
}
+/* Can be used from / for bfd_merge_private_bfd_data to check that
+ endianness matches between input and output file. Returns
+ true for a match, otherwise returns false and emits an error. */
+boolean
+_bfd_generic_verify_endian_match (ibfd, obfd)
+ bfd *ibfd;
+ bfd *obfd;
+{
+ if (ibfd->xvec->byteorder != obfd->xvec->byteorder
+ && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
+ {
+ (*_bfd_error_handler)
+ ("%s: compiled for a %s endian system and target is %s endian",
+ bfd_get_filename (ibfd),
+ bfd_big_endian (ibfd) ? "big" : "little",
+ bfd_big_endian (obfd) ? "big" : "little");
+
+ bfd_set_error (bfd_error_wrong_format);
+ return false;
+ }
+
+ return true;
+}
diff --git a/contrib/binutils/bfd/libbfd.h b/contrib/binutils/bfd/libbfd.h
index 296bf4198703..d8b5c248bf95 100644
--- a/contrib/binutils/bfd/libbfd.h
+++ b/contrib/binutils/bfd/libbfd.h
@@ -1,6 +1,7 @@
/* libbfd.h -- Declarations used by bfd library *implementation*.
(This include file is not for users of the library.)
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
+ Free Software Foundation, Inc.
Written by Cygnus Support.
** NOTE: libbfd.h is a GENERATED file. Don't change it; instead,
@@ -317,6 +318,10 @@ extern boolean _bfd_generic_set_section_contents
((boolean (*) \
PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *))) \
bfd_false)
+#define _bfd_nolink_bfd_gc_sections \
+ ((boolean (*) \
+ PARAMS ((bfd *, struct bfd_link_info *))) \
+ bfd_false)
#define _bfd_nolink_bfd_link_hash_table_create \
((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr)
#define _bfd_nolink_bfd_link_add_symbols \
@@ -352,10 +357,15 @@ extern boolean _bfd_stab_section_find_nearest_line
PARAMS ((bfd *, asymbol **, asection *, bfd_vma, boolean *, const char **,
const char **, unsigned int *, PTR *));
+/* Find the neaderst line using DWARF 1 debugging information. */
+extern boolean _bfd_dwarf1_find_nearest_line
+ PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
+ const char **, unsigned int *));
+
/* Find the nearest line using DWARF 2 debugging information. */
extern boolean _bfd_dwarf2_find_nearest_line
PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
- const char **, unsigned int *));
+ const char **, unsigned int *, unsigned int));
/* A routine to create entries for a bfd_link_hash_table. */
extern struct bfd_hash_entry *_bfd_link_hash_newfunc
@@ -469,6 +479,9 @@ extern bfd_size_type _bfd_stringtab_add
/* Write out a string table. */
extern boolean _bfd_stringtab_emit PARAMS ((bfd *, struct bfd_strtab_hash *));
+
+/* Check that endianness of input and output file match. */
+extern boolean _bfd_generic_verify_endian_match PARAMS ((bfd *, bfd *));
/* Macros to tell if bfds are read or write enabled.
@@ -490,6 +503,17 @@ void bfd_assert PARAMS ((const char*,int));
#define BFD_FAIL() \
{ bfd_assert(__FILE__,__LINE__); }
+extern void _bfd_abort PARAMS ((const char *, int, const char *))
+ ATTRIBUTE_NORETURN;
+
+/* if gcc >= 2.6, we can give a function name, too */
+#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6)
+#define __PRETTY_FUNCTION__ ((char *) NULL)
+#endif
+
+#undef abort
+#define abort() _bfd_abort (__FILE__, __LINE__, __PRETTY_FUNCTION__)
+
FILE * bfd_cache_lookup_worker PARAMS ((bfd *));
extern bfd *bfd_last_cache;
@@ -645,12 +669,20 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_SPARC_M44",
"BFD_RELOC_SPARC_L44",
"BFD_RELOC_SPARC_REGISTER",
+ "BFD_RELOC_SPARC_REV32",
"BFD_RELOC_ALPHA_GPDISP_HI16",
"BFD_RELOC_ALPHA_GPDISP_LO16",
"BFD_RELOC_ALPHA_GPDISP",
"BFD_RELOC_ALPHA_LITERAL",
"BFD_RELOC_ALPHA_ELF_LITERAL",
"BFD_RELOC_ALPHA_LITUSE",
+ "BFD_RELOC_ALPHA_USER_LITERAL",
+ "BFD_RELOC_ALPHA_USER_LITUSE_BASE",
+ "BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF",
+ "BFD_RELOC_ALPHA_USER_LITUSE_JSR",
+ "BFD_RELOC_ALPHA_USER_GPDISP",
+ "BFD_RELOC_ALPHA_USER_GPRELHIGH",
+ "BFD_RELOC_ALPHA_USER_GPRELLOW",
"BFD_RELOC_ALPHA_HINT",
"BFD_RELOC_ALPHA_LINKAGE",
"BFD_RELOC_ALPHA_CODEADDR",
@@ -669,6 +701,10 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_MIPS_GOT_LO16",
"BFD_RELOC_MIPS_CALL_HI16",
"BFD_RELOC_MIPS_CALL_LO16",
+ "BFD_RELOC_MIPS_SUB",
+ "BFD_RELOC_MIPS_GOT_PAGE",
+ "BFD_RELOC_MIPS_GOT_OFST",
+ "BFD_RELOC_MIPS_GOT_DISP",
"BFD_RELOC_386_GOT32",
"BFD_RELOC_386_PLT32",
@@ -690,6 +726,12 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_NS32K_DISP_8_PCREL",
"BFD_RELOC_NS32K_DISP_16_PCREL",
"BFD_RELOC_NS32K_DISP_32_PCREL",
+ "BFD_RELOC_PJ_CODE_HI16",
+ "BFD_RELOC_PJ_CODE_LO16",
+ "BFD_RELOC_PJ_CODE_DIR16",
+ "BFD_RELOC_PJ_CODE_DIR32",
+ "BFD_RELOC_PJ_CODE_REL16",
+ "BFD_RELOC_PJ_CODE_REL32",
"BFD_RELOC_PPC_B26",
"BFD_RELOC_PPC_BA26",
"BFD_RELOC_PPC_TOC16",
@@ -720,9 +762,11 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_PPC_EMB_RELST_HA",
"BFD_RELOC_PPC_EMB_BIT_FLD",
"BFD_RELOC_PPC_EMB_RELSDA",
+ "BFD_RELOC_I370_D12",
"BFD_RELOC_CTOR",
"BFD_RELOC_ARM_PCREL_BRANCH",
"BFD_RELOC_ARM_IMMEDIATE",
+ "BFD_RELOC_ARM_ADRL_IMMEDIATE",
"BFD_RELOC_ARM_OFFSET_IMM",
"BFD_RELOC_ARM_SHIFT_IMM",
"BFD_RELOC_ARM_SWI",
@@ -738,6 +782,15 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_ARM_THUMB_IMM",
"BFD_RELOC_ARM_THUMB_SHIFT",
"BFD_RELOC_ARM_THUMB_OFFSET",
+ "BFD_RELOC_ARM_GOT12",
+ "BFD_RELOC_ARM_GOT32",
+ "BFD_RELOC_ARM_JUMP_SLOT",
+ "BFD_RELOC_ARM_COPY",
+ "BFD_RELOC_ARM_GLOB_DAT",
+ "BFD_RELOC_ARM_PLT32",
+ "BFD_RELOC_ARM_RELATIVE",
+ "BFD_RELOC_ARM_GOTOFF",
+ "BFD_RELOC_ARM_GOTPC",
"BFD_RELOC_SH_PCDISP8BY2",
"BFD_RELOC_SH_PCDISP12BY2",
"BFD_RELOC_SH_IMM4",
@@ -765,8 +818,17 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_D10V_10_PCREL_L",
"BFD_RELOC_D10V_18",
"BFD_RELOC_D10V_18_PCREL",
-
-
+ "BFD_RELOC_D30V_6",
+ "BFD_RELOC_D30V_9_PCREL",
+ "BFD_RELOC_D30V_9_PCREL_R",
+ "BFD_RELOC_D30V_15",
+ "BFD_RELOC_D30V_15_PCREL",
+ "BFD_RELOC_D30V_15_PCREL_R",
+ "BFD_RELOC_D30V_21",
+ "BFD_RELOC_D30V_21_PCREL",
+ "BFD_RELOC_D30V_21_PCREL_R",
+ "BFD_RELOC_D30V_32",
+ "BFD_RELOC_D30V_32_PCREL",
"BFD_RELOC_M32R_24",
"BFD_RELOC_M32R_10_PCREL",
"BFD_RELOC_M32R_18_PCREL",
@@ -785,10 +847,48 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_V850_TDA_7_8_OFFSET",
"BFD_RELOC_V850_TDA_7_7_OFFSET",
"BFD_RELOC_V850_TDA_16_16_OFFSET",
+ "BFD_RELOC_V850_TDA_4_5_OFFSET",
+ "BFD_RELOC_V850_TDA_4_4_OFFSET",
+ "BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET",
+ "BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET",
+ "BFD_RELOC_V850_CALLT_6_7_OFFSET",
+ "BFD_RELOC_V850_CALLT_16_16_OFFSET",
"BFD_RELOC_MN10300_32_PCREL",
"BFD_RELOC_MN10300_16_PCREL",
"BFD_RELOC_TIC30_LDP",
+ "BFD_RELOC_FR30_48",
+ "BFD_RELOC_FR30_20",
+ "BFD_RELOC_FR30_6_IN_4",
+ "BFD_RELOC_FR30_8_IN_8",
+ "BFD_RELOC_FR30_9_IN_8",
+ "BFD_RELOC_FR30_10_IN_8",
+ "BFD_RELOC_FR30_9_PCREL",
+ "BFD_RELOC_FR30_12_PCREL",
+ "BFD_RELOC_MCORE_PCREL_IMM8BY4",
+ "BFD_RELOC_MCORE_PCREL_IMM11BY2",
+ "BFD_RELOC_MCORE_PCREL_IMM4BY2",
+ "BFD_RELOC_MCORE_PCREL_32",
+ "BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2",
+ "BFD_RELOC_MCORE_RVA",
+ "BFD_RELOC_AVR_7_PCREL",
+ "BFD_RELOC_AVR_13_PCREL",
+ "BFD_RELOC_AVR_16_PM",
+ "BFD_RELOC_AVR_LO8_LDI",
+ "BFD_RELOC_AVR_HI8_LDI",
+ "BFD_RELOC_AVR_HH8_LDI",
+ "BFD_RELOC_AVR_LO8_LDI_NEG",
+ "BFD_RELOC_AVR_HI8_LDI_NEG",
+ "BFD_RELOC_AVR_HH8_LDI_NEG",
+ "BFD_RELOC_AVR_LO8_LDI_PM",
+ "BFD_RELOC_AVR_HI8_LDI_PM",
+ "BFD_RELOC_AVR_HH8_LDI_PM",
+ "BFD_RELOC_AVR_LO8_LDI_PM_NEG",
+ "BFD_RELOC_AVR_HI8_LDI_PM_NEG",
+ "BFD_RELOC_AVR_HH8_LDI_PM_NEG",
+ "BFD_RELOC_AVR_CALL",
+ "BFD_RELOC_VTABLE_INHERIT",
+ "BFD_RELOC_VTABLE_ENTRY",
"@@overflow: BFD_RELOC_UNUSED@@",
};
#endif
@@ -804,6 +904,10 @@ bfd_generic_relax_section
struct bfd_link_info *,
boolean *));
+boolean
+bfd_generic_gc_sections
+ PARAMS ((bfd *, struct bfd_link_info *));
+
bfd_byte *
bfd_generic_get_relocated_section_contents PARAMS ((bfd *abfd,
diff --git a/contrib/binutils/bfd/libcoff-in.h b/contrib/binutils/bfd/libcoff-in.h
index 0dc2121c9813..9b1a02684870 100644
--- a/contrib/binutils/bfd/libcoff-in.h
+++ b/contrib/binutils/bfd/libcoff-in.h
@@ -1,5 +1,5 @@
/* BFD COFF object file private structure.
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -56,7 +56,7 @@ typedef struct coff_tdata
file_ptr sym_filepos;
struct coff_ptr_struct *raw_syments;
- unsigned int raw_syment_count;
+ unsigned long raw_syment_count;
/* These are only valid once writing has begun */
long int relocbase;
@@ -97,6 +97,9 @@ typedef struct coff_tdata
/* Used by coff_find_nearest_line. */
PTR line_info;
+ /* The timestamp from the COFF file header. */
+ long timestamp;
+
/* Copy of some of the f_flags bits in the COFF filehdr structure,
used by ARM code. */
flagword flags;
@@ -213,12 +216,14 @@ struct xcoff_section_tdata
#define xcoff_section_data(abfd, sec) \
((struct xcoff_section_tdata *) coff_section_data ((abfd), (sec))->tdata)
-/* Tdata for sections in PEI image files. */
+/* Tdata for sections in PE files. */
struct pei_section_tdata
{
/* The virtual size of the section. */
bfd_size_type virt_size;
+ /* The PE section flags. */
+ long pe_flags;
};
/* An accessor macro for the pei_section_tdata structure. */
@@ -249,6 +254,11 @@ struct coff_link_hash_entry
/* Pointer to array of auxiliary entries, if any. */
union internal_auxent *aux;
+
+ /* Flag word; legal values follow. */
+ unsigned short coff_link_hash_flags;
+ /* Symbol is a PE section symbol. */
+#define COFF_LINK_HASH_PE_SECTION_SYMBOL (01)
};
/* COFF linker hash table. */
@@ -462,6 +472,41 @@ struct coff_final_link_info
struct internal_reloc *internal_relocs;
};
+/* Most COFF variants have no way to record the alignment of a
+ section. This struct is used to set a specific alignment based on
+ the name of the section. */
+
+struct coff_section_alignment_entry
+{
+ /* The section name. */
+ const char *name;
+
+ /* This is either (unsigned int) -1, indicating that the section
+ name must match exactly, or it is the number of letters which
+ must match at the start of the name. */
+ unsigned int comparison_length;
+
+ /* These macros may be used to fill in the first two fields in a
+ structure initialization. */
+#define COFF_SECTION_NAME_EXACT_MATCH(name) (name), ((unsigned int) -1)
+#define COFF_SECTION_NAME_PARTIAL_MATCH(name) (name), (sizeof (name) - 1)
+
+ /* Only use this entry if the default section alignment for this
+ target is at least that much (as a power of two). If this field
+ is COFF_ALIGNMENT_FIELD_EMPTY, it should be ignored. */
+ unsigned int default_alignment_min;
+
+ /* Only use this entry if the default section alignment for this
+ target is no greater than this (as a power of two). If this
+ field is COFF_ALIGNMENT_FIELD_EMPTY, it should be ignored. */
+ unsigned int default_alignment_max;
+
+#define COFF_ALIGNMENT_FIELD_EMPTY ((unsigned int) -1)
+
+ /* The desired alignment for this section (as a power of two). */
+ unsigned int alignment_power;
+};
+
extern struct bfd_hash_entry *_bfd_coff_link_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
extern boolean _bfd_coff_link_hash_table_init
diff --git a/contrib/binutils/bfd/libcoff.h b/contrib/binutils/bfd/libcoff.h
index 4d83bd4245cc..bee4ce9e8587 100644
--- a/contrib/binutils/bfd/libcoff.h
+++ b/contrib/binutils/bfd/libcoff.h
@@ -1,5 +1,5 @@
/* BFD COFF object file private structure.
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -56,7 +56,7 @@ typedef struct coff_tdata
file_ptr sym_filepos;
struct coff_ptr_struct *raw_syments;
- unsigned int raw_syment_count;
+ unsigned long raw_syment_count;
/* These are only valid once writing has begun */
long int relocbase;
@@ -97,6 +97,9 @@ typedef struct coff_tdata
/* Used by coff_find_nearest_line. */
PTR line_info;
+ /* The timestamp from the COFF file header. */
+ long timestamp;
+
/* Copy of some of the f_flags bits in the COFF filehdr structure,
used by ARM code. */
flagword flags;
@@ -213,12 +216,14 @@ struct xcoff_section_tdata
#define xcoff_section_data(abfd, sec) \
((struct xcoff_section_tdata *) coff_section_data ((abfd), (sec))->tdata)
-/* Tdata for sections in PEI image files. */
+/* Tdata for sections in PE files. */
struct pei_section_tdata
{
/* The virtual size of the section. */
bfd_size_type virt_size;
+ /* The PE section flags. */
+ long pe_flags;
};
/* An accessor macro for the pei_section_tdata structure. */
@@ -249,6 +254,11 @@ struct coff_link_hash_entry
/* Pointer to array of auxiliary entries, if any. */
union internal_auxent *aux;
+
+ /* Flag word; legal values follow. */
+ unsigned short coff_link_hash_flags;
+ /* Symbol is a PE section symbol. */
+#define COFF_LINK_HASH_PE_SECTION_SYMBOL (01)
};
/* COFF linker hash table. */
@@ -462,6 +472,41 @@ struct coff_final_link_info
struct internal_reloc *internal_relocs;
};
+/* Most COFF variants have no way to record the alignment of a
+ section. This struct is used to set a specific alignment based on
+ the name of the section. */
+
+struct coff_section_alignment_entry
+{
+ /* The section name. */
+ const char *name;
+
+ /* This is either (unsigned int) -1, indicating that the section
+ name must match exactly, or it is the number of letters which
+ must match at the start of the name. */
+ unsigned int comparison_length;
+
+ /* These macros may be used to fill in the first two fields in a
+ structure initialization. */
+#define COFF_SECTION_NAME_EXACT_MATCH(name) (name), ((unsigned int) -1)
+#define COFF_SECTION_NAME_PARTIAL_MATCH(name) (name), (sizeof (name) - 1)
+
+ /* Only use this entry if the default section alignment for this
+ target is at least that much (as a power of two). If this field
+ is COFF_ALIGNMENT_FIELD_EMPTY, it should be ignored. */
+ unsigned int default_alignment_min;
+
+ /* Only use this entry if the default section alignment for this
+ target is no greater than this (as a power of two). If this
+ field is COFF_ALIGNMENT_FIELD_EMPTY, it should be ignored. */
+ unsigned int default_alignment_max;
+
+#define COFF_ALIGNMENT_FIELD_EMPTY ((unsigned int) -1)
+
+ /* The desired alignment for this section (as a power of two). */
+ unsigned int alignment_power;
+};
+
extern struct bfd_hash_entry *_bfd_coff_link_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
extern boolean _bfd_coff_link_hash_table_init
@@ -581,6 +626,22 @@ struct lineno_cache_entry *lineno;
/* Have the line numbers been relocated yet ? */
boolean done_lineno;
} coff_symbol_type;
+ /* COFF symbol classifications. */
+
+enum coff_symbol_classification
+{
+ /* Global symbol. */
+ COFF_SYMBOL_GLOBAL,
+ /* Common symbol. */
+ COFF_SYMBOL_COMMON,
+ /* Undefined symbol. */
+ COFF_SYMBOL_UNDEFINED,
+ /* Local symbol. */
+ COFF_SYMBOL_LOCAL,
+ /* PE section symbol. */
+ COFF_SYMBOL_PE_SECTION
+};
+
typedef struct
{
void (*_bfd_coff_swap_aux_in) PARAMS ((
@@ -648,6 +709,7 @@ typedef struct
unsigned int _bfd_auxesz;
unsigned int _bfd_relsz;
unsigned int _bfd_linesz;
+ unsigned int _bfd_filnmlen;
boolean _bfd_coff_long_filenames;
boolean _bfd_coff_long_section_names;
unsigned int _bfd_coff_default_section_alignment_power;
@@ -680,7 +742,8 @@ typedef struct
flagword (*_bfd_styp_to_sec_flags_hook) PARAMS ((
bfd *abfd,
PTR internal_scnhdr,
- const char *name));
+ const char *name,
+ asection *section));
void (*_bfd_set_alignment_hook) PARAMS ((
bfd *abfd,
asection *sec,
@@ -717,7 +780,7 @@ typedef struct
arelent *r,
unsigned int shrink,
struct bfd_link_info *link_info));
- boolean (*_bfd_coff_sym_is_global) PARAMS ((
+ enum coff_symbol_classification (*_bfd_coff_classify_symbol) PARAMS ((
bfd *abfd,
struct internal_syment *));
boolean (*_bfd_coff_compute_section_file_positions) PARAMS ((
@@ -761,7 +824,8 @@ typedef struct
struct bfd_link_hash_entry **hashp));
boolean (*_bfd_coff_link_output_has_begun) PARAMS ((
- bfd * abfd ));
+ bfd * abfd,
+ struct coff_final_link_info * pfinfo));
boolean (*_bfd_coff_final_link_postscript) PARAMS ((
bfd * abfd,
struct coff_final_link_info * pfinfo));
@@ -807,6 +871,7 @@ typedef struct
#define bfd_coff_auxesz(abfd) (coff_backend_info (abfd)->_bfd_auxesz)
#define bfd_coff_relsz(abfd) (coff_backend_info (abfd)->_bfd_relsz)
#define bfd_coff_linesz(abfd) (coff_backend_info (abfd)->_bfd_linesz)
+#define bfd_coff_filnmlen(abfd) (coff_backend_info (abfd)->_bfd_filnmlen)
#define bfd_coff_long_filenames(abfd) (coff_backend_info (abfd)->_bfd_coff_long_filenames)
#define bfd_coff_long_section_names(abfd) \
(coff_backend_info (abfd)->_bfd_coff_long_section_names)
@@ -832,8 +897,9 @@ typedef struct
#define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\
((coff_backend_info (abfd)->_bfd_coff_mkobject_hook) (abfd, filehdr, aouthdr))
-#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name)\
- ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook) (abfd, scnhdr, name))
+#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section)\
+ ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\
+ (abfd, scnhdr, name, section))
#define bfd_coff_set_alignment_hook(abfd, sec, scnhdr)\
((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr))
@@ -856,8 +922,8 @@ typedef struct
((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\
(abfd, section, reloc, shrink, link_info))
-#define bfd_coff_sym_is_global(abfd, sym)\
- ((coff_backend_info (abfd)->_bfd_coff_sym_is_global)\
+#define bfd_coff_classify_symbol(abfd, sym)\
+ ((coff_backend_info (abfd)->_bfd_coff_classify_symbol)\
(abfd, sym))
#define bfd_coff_compute_section_file_positions(abfd)\
@@ -880,8 +946,8 @@ typedef struct
((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\
(info, abfd, name, flags, section, value, string, cp, coll, hashp))
-#define bfd_coff_link_output_has_begun(a) \
- ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a))
+#define bfd_coff_link_output_has_begun(a,p) \
+ ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a,p))
#define bfd_coff_final_link_postscript(a,p) \
((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a,p))
diff --git a/contrib/binutils/bfd/libecoff.h b/contrib/binutils/bfd/libecoff.h
index ad269a52f5d7..456180544cb7 100644
--- a/contrib/binutils/bfd/libecoff.h
+++ b/contrib/binutils/bfd/libecoff.h
@@ -1,5 +1,5 @@
/* BFD ECOFF object file private structure.
- Copyright (C) 1993, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1993, 94, 95, 96, 97, 1999 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -341,7 +341,7 @@ extern PTR _bfd_ecoff_mkobject_hook PARAMS ((bfd *, PTR filehdr, PTR aouthdr));
((void (*) PARAMS ((bfd *, asection *, PTR))) bfd_void)
extern boolean _bfd_ecoff_set_arch_mach_hook PARAMS ((bfd *abfd, PTR filehdr));
extern flagword _bfd_ecoff_styp_to_sec_flags
- PARAMS ((bfd *abfd, PTR hdr, const char *name));
+ PARAMS ((bfd *abfd, PTR hdr, const char *name, asection *section));
extern boolean _bfd_ecoff_slurp_symbol_table PARAMS ((bfd *abfd));
/* ECOFF auxiliary information swapping routines. These are the same
diff --git a/contrib/binutils/bfd/linker.c b/contrib/binutils/bfd/linker.c
index 1c3c9a2592a5..6e9ee65581b1 100644
--- a/contrib/binutils/bfd/linker.c
+++ b/contrib/binutils/bfd/linker.c
@@ -1,5 +1,6 @@
/* linker.c -- BFD linker routines
- Copyright (C) 1993, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1993, 94, 95, 96, 97, 98, 1999
+ Free Software Foundation, Inc.
Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support
This file is part of BFD, the Binary File Descriptor library.
@@ -74,7 +75,7 @@ SUBSECTION
@cindex target vector (_bfd_link_hash_table_create)
The linker routines must create a hash table, which must be
derived from <<struct bfd_link_hash_table>> described in
- <<bfdlink.c>>. @xref{Hash Tables} for information on how to
+ <<bfdlink.c>>. @xref{Hash Tables}, for information on how to
create a derived hash table. This entry point is called using
the target vector of the linker output file.
@@ -693,7 +694,7 @@ static boolean
generic_link_read_symbols (abfd)
bfd *abfd;
{
- if (abfd->outsymbols == (asymbol **) NULL)
+ if (bfd_get_outsymbols (abfd) == (asymbol **) NULL)
{
long symsize;
long symcount;
@@ -701,13 +702,13 @@ generic_link_read_symbols (abfd)
symsize = bfd_get_symtab_upper_bound (abfd);
if (symsize < 0)
return false;
- abfd->outsymbols = (asymbol **) bfd_alloc (abfd, symsize);
- if (abfd->outsymbols == NULL && symsize != 0)
+ bfd_get_outsymbols (abfd) = (asymbol **) bfd_alloc (abfd, symsize);
+ if (bfd_get_outsymbols (abfd) == NULL && symsize != 0)
return false;
- symcount = bfd_canonicalize_symtab (abfd, abfd->outsymbols);
+ symcount = bfd_canonicalize_symtab (abfd, bfd_get_outsymbols (abfd));
if (symcount < 0)
return false;
- abfd->symcount = symcount;
+ bfd_get_symcount (abfd) = symcount;
}
return true;
@@ -1748,8 +1749,8 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value,
case MDEF:
/* Handle a multiple definition. */
{
- asection *msec;
- bfd_vma mval;
+ asection *msec = NULL;
+ bfd_vma mval = 0;
switch (h->type)
{
@@ -1935,8 +1936,8 @@ _bfd_generic_final_link (abfd, info)
size_t outsymalloc;
struct generic_write_global_symbol_info wginfo;
- abfd->outsymbols = (asymbol **) NULL;
- abfd->symcount = 0;
+ bfd_get_outsymbols (abfd) = (asymbol **) NULL;
+ bfd_get_symcount (abfd) = 0;
outsymalloc = 0;
/* Mark all sections which will be included in the output file. */
@@ -1958,6 +1959,12 @@ _bfd_generic_final_link (abfd, info)
_bfd_generic_link_write_global_symbol,
(PTR) &wginfo);
+ /* Make sure we have a trailing NULL pointer on OUTSYMBOLS. We
+ shouldn't really need one, since we have SYMCOUNT, but some old
+ code still expects one. */
+ if (! generic_add_output_symbol (abfd, &outsymalloc, NULL))
+ return false;
+
if (info->relocateable)
{
/* Allocate space for the output relocs for each section. */
@@ -2047,7 +2054,7 @@ _bfd_generic_final_link (abfd, info)
}
}
}
-
+
return true;
}
@@ -2059,7 +2066,7 @@ generic_add_output_symbol (output_bfd, psymalloc, sym)
size_t *psymalloc;
asymbol *sym;
{
- if (output_bfd->symcount >= *psymalloc)
+ if (bfd_get_symcount (output_bfd) >= *psymalloc)
{
asymbol **newsyms;
@@ -2067,15 +2074,16 @@ generic_add_output_symbol (output_bfd, psymalloc, sym)
*psymalloc = 124;
else
*psymalloc *= 2;
- newsyms = (asymbol **) bfd_realloc (output_bfd->outsymbols,
+ newsyms = (asymbol **) bfd_realloc (bfd_get_outsymbols (output_bfd),
*psymalloc * sizeof (asymbol *));
if (newsyms == (asymbol **) NULL)
return false;
- output_bfd->outsymbols = newsyms;
+ bfd_get_outsymbols (output_bfd) = newsyms;
}
- output_bfd->outsymbols[output_bfd->symcount] = sym;
- ++output_bfd->symcount;
+ bfd_get_outsymbols (output_bfd) [bfd_get_symcount (output_bfd)] = sym;
+ if (sym != NULL)
+ ++ bfd_get_symcount (output_bfd);
return true;
}
@@ -2516,7 +2524,9 @@ _bfd_generic_reloc_link_order (abfd, info, sec, link_order)
break;
}
ok = bfd_set_section_contents (abfd, sec, (PTR) buf,
- (file_ptr) link_order->offset, size);
+ (file_ptr)
+ (link_order->offset *
+ bfd_octets_per_byte (abfd)), size);
free (buf);
if (! ok)
return false;
@@ -2584,7 +2594,9 @@ _bfd_default_link_order (abfd, info, sec, link_order)
case bfd_data_link_order:
return bfd_set_section_contents (abfd, sec,
(PTR) link_order->u.data.contents,
- (file_ptr) link_order->offset,
+ (file_ptr)
+ (link_order->offset *
+ bfd_octets_per_byte (abfd)),
link_order->size);
}
}
@@ -2595,7 +2607,7 @@ _bfd_default_link_order (abfd, info, sec, link_order)
static boolean
default_fill_link_order (abfd, info, sec, link_order)
bfd *abfd;
- struct bfd_link_info *info;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
asection *sec;
struct bfd_link_order *link_order;
{
@@ -2618,7 +2630,9 @@ default_fill_link_order (abfd, info, sec, link_order)
for (i = 1; i < size; i += 2)
space[i] = fill;
result = bfd_set_section_contents (abfd, sec, space,
- (file_ptr) link_order->offset,
+ (file_ptr)
+ (link_order->offset *
+ bfd_octets_per_byte (abfd)),
link_order->size);
free (space);
return result;
@@ -2662,7 +2676,7 @@ default_indirect_link_order (output_bfd, info, output_section, link_order,
types of object files. Handling this case correctly is
difficult, and sometimes impossible. */
(*_bfd_error_handler)
- ("Attempt to do relocateable link with %s input and %s output",
+ (_("Attempt to do relocateable link with %s input and %s output"),
bfd_get_target (input_bfd), bfd_get_target (output_bfd));
bfd_set_error (bfd_error_wrong_format);
return false;
@@ -2735,7 +2749,10 @@ default_indirect_link_order (output_bfd, info, output_section, link_order,
/* Output the section contents. */
if (! bfd_set_section_contents (output_bfd, output_section,
(PTR) new_contents,
- link_order->offset, link_order->size))
+ (file_ptr)
+ (link_order->offset *
+ bfd_octets_per_byte (output_bfd)),
+ link_order->size))
goto error_return;
if (contents != NULL)
@@ -2790,8 +2807,8 @@ DESCRIPTION
boolean
_bfd_generic_link_split_section (abfd, sec)
- bfd *abfd;
- asection *sec;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asection *sec ATTRIBUTE_UNUSED;
{
return false;
}
diff --git a/contrib/binutils/bfd/mipsbsd.c b/contrib/binutils/bfd/mipsbsd.c
index c5ec9e14a5b5..7a680fb38949 100644
--- a/contrib/binutils/bfd/mipsbsd.c
+++ b/contrib/binutils/bfd/mipsbsd.c
@@ -1,5 +1,5 @@
/* BFD backend for MIPS BSD (a.out) binaries.
- Copyright (C) 1993, 94, 95, 97, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1993, 94, 95, 97, 98, 1999 Free Software Foundation, Inc.
Written by Ralph Campbell.
This file is part of BFD, the Binary File Descriptor library.
@@ -45,7 +45,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define SET_ARCH_MACH(ABFD, EXEC) \
MY(set_arch_mach)(ABFD, N_MACHTYPE (EXEC)); \
MY(choose_reloc_size)(ABFD);
-void MY(set_arch_mach) PARAMS ((bfd *abfd, int machtype));
+static void MY(set_arch_mach) PARAMS ((bfd *abfd, int machtype));
static void MY(choose_reloc_size) PARAMS ((bfd *abfd));
#define MY_write_object_contents MY(write_object_contents)
@@ -66,7 +66,7 @@ static boolean MY(write_object_contents) PARAMS ((bfd *abfd));
#include "aout-target.h"
-void
+static void
MY(set_arch_mach) (abfd, machtype)
bfd *abfd;
int machtype;
@@ -187,10 +187,10 @@ MY(write_object_contents) (abfd)
*/
static bfd_reloc_status_type
mips_fix_jmp_addr (abfd,reloc_entry,symbol,data,input_section,output_bfd)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
arelent *reloc_entry;
struct symbol_cache_entry *symbol;
- PTR data;
+ PTR data ATTRIBUTE_UNUSED;
asection *input_section;
bfd *output_bfd;
{
@@ -240,13 +240,13 @@ mips_fix_hi16_s PARAMS ((bfd *, arelent *, asymbol *, PTR,
static bfd_reloc_status_type
mips_fix_hi16_s (abfd, reloc_entry, symbol, data, input_section,
output_bfd, error_message)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
arelent *reloc_entry;
asymbol *symbol;
- PTR data;
- asection *input_section;
+ PTR data ATTRIBUTE_UNUSED;
+ asection *input_section ATTRIBUTE_UNUSED;
bfd *output_bfd;
- char **error_message;
+ char **error_message ATTRIBUTE_UNUSED;
{
bfd_vma relocation;
@@ -389,6 +389,8 @@ static CONST struct aout_backend_data MY(backend_data) = {
0 /* finish_dynamic_link */
};
+extern const bfd_target aout_mips_big_vec;
+
const bfd_target aout_mips_little_vec =
{
"a.out-mips-little", /* name */
@@ -425,7 +427,9 @@ const bfd_target aout_mips_little_vec =
BFD_JUMP_TABLE_LINK (MY),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
- (PTR) MY_backend_data,
+ & aout_mips_big_vec,
+
+ (PTR) MY_backend_data
};
const bfd_target aout_mips_big_vec =
@@ -464,5 +468,7 @@ const bfd_target aout_mips_big_vec =
BFD_JUMP_TABLE_LINK (MY),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
- (PTR) MY_backend_data,
+ & aout_mips_little_vec,
+
+ (PTR) MY_backend_data
};
diff --git a/contrib/binutils/bfd/netbsd-core.c b/contrib/binutils/bfd/netbsd-core.c
index 41fab991b544..828c2a1ceb13 100644
--- a/contrib/binutils/bfd/netbsd-core.c
+++ b/contrib/binutils/bfd/netbsd-core.c
@@ -23,13 +23,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "libbfd.h"
#include "libaout.h" /* BFD a.out internal data structures */
-#include <stdio.h>
-#include <sys/types.h>
#include <sys/param.h>
#include <sys/dir.h>
#include <signal.h>
#include <sys/core.h>
-#include <errno.h>
/*
* FIXME: On NetBSD/sparc CORE_FPU_OFFSET should be (sizeof(struct trapframe))
@@ -250,5 +247,7 @@ const bfd_target netbsd_core_vec =
BFD_JUMP_TABLE_LINK (_bfd_nolink),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+ NULL,
+
(PTR) 0 /* backend_data */
};
diff --git a/contrib/binutils/bfd/netbsd.h b/contrib/binutils/bfd/netbsd.h
index ba0ce5a9d556..760ed9508e85 100644
--- a/contrib/binutils/bfd/netbsd.h
+++ b/contrib/binutils/bfd/netbsd.h
@@ -1,5 +1,5 @@
/* BFD back-end definitions used by all NetBSD targets.
- Copyright (C) 1990, 91, 92, 94, 95, 96, 97 1998
+ Copyright (C) 1990, 91, 92, 94, 95, 96, 97, 98, 2000
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -91,11 +91,7 @@ MY(write_object_contents) (abfd)
NAME(aout,adjust_sizes_and_vmas) (abfd, &text_size, &text_end);
}
-#if CHOOSE_RELOC_SIZE
- CHOOSE_RELOC_SIZE(abfd);
-#else
obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
-#endif
/* Magic number, maestro, please! */
switch (bfd_get_arch(abfd)) {
diff --git a/contrib/binutils/bfd/opncls.c b/contrib/binutils/bfd/opncls.c
index c58173c11a9b..8f10135d267b 100644
--- a/contrib/binutils/bfd/opncls.c
+++ b/contrib/binutils/bfd/opncls.c
@@ -531,6 +531,109 @@ bfd_create (filename, templ)
}
/*
+FUNCTION
+ bfd_make_writable
+
+SYNOPSIS
+ boolean bfd_make_writable(bfd *abfd);
+
+DESCRIPTION
+ Takes a BFD as created by <<bfd_create>> and converts it
+ into one like as returned by <<bfd_openw>>. It does this
+ by converting the BFD to BFD_IN_MEMORY. It's assumed that
+ you will call <<bfd_make_readable>> on this bfd later.
+
+RETURNS
+ <<true>> is returned if all is ok, otherwise <<false>>.
+*/
+
+boolean
+bfd_make_writable(abfd)
+ bfd *abfd;
+{
+ struct bfd_in_memory *bim;
+
+ if (abfd->direction != no_direction)
+ {
+ bfd_set_error (bfd_error_invalid_operation);
+ return false;
+ }
+
+ bim = (struct bfd_in_memory *) bfd_malloc (sizeof (struct bfd_in_memory));
+ abfd->iostream = (PTR) bim;
+ /* bfd_write will grow these as needed */
+ bim->size = 0;
+ bim->buffer = 0;
+
+ abfd->flags |= BFD_IN_MEMORY;
+ abfd->direction = write_direction;
+ abfd->where = 0;
+
+ return true;
+}
+
+/*
+FUNCTION
+ bfd_make_readable
+
+SYNOPSIS
+ boolean bfd_make_readable(bfd *abfd);
+
+DESCRIPTION
+ Takes a BFD as created by <<bfd_create>> and
+ <<bfd_make_writable>> and converts it into one like as
+ returned by <<bfd_openr>>. It does this by writing the
+ contents out to the memory buffer, then reversing the
+ direction.
+
+RETURNS
+ <<true>> is returned if all is ok, otherwise <<false>>. */
+
+boolean
+bfd_make_readable(abfd)
+ bfd *abfd;
+{
+ if (abfd->direction != write_direction || !(abfd->flags & BFD_IN_MEMORY))
+ {
+ bfd_set_error (bfd_error_invalid_operation);
+ return false;
+ }
+
+ if (! BFD_SEND_FMT (abfd, _bfd_write_contents, (abfd)))
+ return false;
+
+ if (! BFD_SEND (abfd, _close_and_cleanup, (abfd)))
+ return false;
+
+
+ abfd->arch_info = &bfd_default_arch_struct;
+
+ abfd->where = 0;
+ abfd->sections = (asection *) NULL;
+ abfd->format = bfd_unknown;
+ abfd->my_archive = (bfd *) NULL;
+ abfd->origin = 0;
+ abfd->opened_once = false;
+ abfd->output_has_begun = false;
+ abfd->section_count = 0;
+ abfd->usrdata = (PTR) NULL;
+ abfd->cacheable = false;
+ abfd->flags = BFD_IN_MEMORY;
+ abfd->mtime_set = false;
+
+ abfd->target_defaulted = true;
+ abfd->direction = read_direction;
+ abfd->sections = 0;
+ abfd->symcount = 0;
+ abfd->outsymbols = 0;
+ abfd->tdata.any = 0;
+
+ bfd_check_format(abfd, bfd_object);
+
+ return true;
+}
+
+/*
INTERNAL_FUNCTION
bfd_alloc
diff --git a/contrib/binutils/bfd/osf-core.c b/contrib/binutils/bfd/osf-core.c
index ea158d24e0d7..4f4fc12dc727 100644
--- a/contrib/binutils/bfd/osf-core.c
+++ b/contrib/binutils/bfd/osf-core.c
@@ -1,5 +1,5 @@
/* BFD back-end for OSF/1 core files.
- Copyright 1993, 94, 95, 1997 Free Software Foundation, Inc.
+ Copyright 1993, 94, 95, 97, 1998 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -24,8 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysdep.h"
#include "libbfd.h"
-#include <stdio.h>
-#include <string.h>
#include <sys/user.h>
#include <sys/core.h>
@@ -145,7 +143,7 @@ osf_core_core_file_p (abfd)
flags = SEC_HAS_CONTENTS;
break;
default:
- (*_bfd_error_handler) ("Unhandled OSF/1 core file section type %d\n",
+ (*_bfd_error_handler) (_("Unhandled OSF/1 core file section type %d\n"),
core_scnhdr.scntype);
continue;
}
@@ -252,5 +250,7 @@ const bfd_target osf_core_vec =
BFD_JUMP_TABLE_LINK (_bfd_nolink),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+ NULL,
+
(PTR) 0 /* backend_data */
};
diff --git a/contrib/binutils/bfd/pe-arm.c b/contrib/binutils/bfd/pe-arm.c
new file mode 100644
index 000000000000..6c6b65980071
--- /dev/null
+++ b/contrib/binutils/bfd/pe-arm.c
@@ -0,0 +1,47 @@
+/* BFD back-end for ARM PECOFF files.
+ Copyright 1995, 1999 Free Software Foundation, Inc.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+
+#ifndef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM armpe_little_vec
+#define TARGET_LITTLE_NAME "pe-arm-little"
+#define TARGET_BIG_SYM armpe_big_vec
+#define TARGET_BIG_NAME "pe-arm-big"
+#endif
+
+#define COFF_WITH_PE
+#define PCRELOFFSET true
+#define COFF_LONG_SECTION_NAMES
+
+#ifndef bfd_arm_allocate_interworking_sections
+#define bfd_arm_allocate_interworking_sections \
+ bfd_arm_pe_allocate_interworking_sections
+#define bfd_arm_get_bfd_for_interworking \
+ bfd_arm_pe_get_bfd_for_interworking
+#define bfd_arm_process_before_allocation \
+ bfd_arm_pe_process_before_allocation
+#endif
+
+#ifdef ARM_WINCE
+#define TARGET_UNDERSCORE 0
+#endif
+
+#include "coff-arm.c"
diff --git a/contrib/binutils/bfd/pe-i386.c b/contrib/binutils/bfd/pe-i386.c
index bcdbe444994e..a2eb78477c2f 100644
--- a/contrib/binutils/bfd/pe-i386.c
+++ b/contrib/binutils/bfd/pe-i386.c
@@ -1,5 +1,5 @@
/* BFD back-end for Intel 386 PECOFF files.
- Copyright 1995 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1999 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -27,5 +27,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define PCRELOFFSET true
#define TARGET_UNDERSCORE '_'
#define COFF_LONG_SECTION_NAMES
+#define COFF_LONG_FILENAMES
+
+#define COFF_SECTION_ALIGNMENT_ENTRIES \
+{ COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
+{ COFF_SECTION_NAME_EXACT_MATCH (".pdata"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }
#include "coff-i386.c"
diff --git a/contrib/binutils/bfd/pe-mips.c b/contrib/binutils/bfd/pe-mips.c
new file mode 100644
index 000000000000..9b89369b37b6
--- /dev/null
+++ b/contrib/binutils/bfd/pe-mips.c
@@ -0,0 +1,998 @@
+/* BFD back-end for MIPS PE COFF files.
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
+ Modified from coff-i386.c by DJ Delorie, dj@cygnus.com
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#define COFF_WITH_PE
+#define COFF_LONG_SECTION_NAMES
+#define PCRELOFFSET true
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+
+#include "coff/mipspe.h"
+
+#include "coff/internal.h"
+
+#include "coff/pe.h"
+
+#include "libcoff.h"
+
+static bfd_reloc_status_type coff_mips_reloc
+ PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+static reloc_howto_type *coff_mips_rtype_to_howto
+ PARAMS ((bfd *, asection *, struct internal_reloc *,
+ struct coff_link_hash_entry *, struct internal_syment *,
+
+ bfd_vma *));
+#if 0
+static void mips_ecoff_swap_reloc_in PARAMS ((bfd *, PTR,
+ struct internal_reloc *));
+static void mips_ecoff_swap_reloc_out PARAMS ((bfd *,
+ const struct internal_reloc *,
+ PTR));
+static void mips_adjust_reloc_in PARAMS ((bfd *,
+ const struct internal_reloc *,
+ arelent *));
+static void mips_adjust_reloc_out PARAMS ((bfd *, const arelent *,
+ struct internal_reloc *));
+#endif
+#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2)
+/* The page size is a guess based on ELF. */
+
+#define COFF_PAGE_SIZE 0x1000
+
+/* For some reason when using mips COFF the value stored in the .text
+ section for a reference to a common symbol is the value itself plus
+ any desired offset. Ian Taylor, Cygnus Support. */
+
+/* If we are producing relocateable output, we need to do some
+ adjustments to the object file that are not done by the
+ bfd_perform_relocation function. This function is called by every
+ reloc type to make any required adjustments. */
+
+static bfd_reloc_status_type
+coff_mips_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
+ error_message)
+ bfd *abfd;
+ arelent *reloc_entry;
+ asymbol *symbol;
+ PTR data;
+ asection *input_section ATTRIBUTE_UNUSED;
+ bfd *output_bfd;
+ char **error_message ATTRIBUTE_UNUSED;
+{
+ symvalue diff;
+
+ if (output_bfd == (bfd *) NULL)
+ return bfd_reloc_continue;
+
+ if (bfd_is_com_section (symbol->section))
+ {
+#ifndef COFF_WITH_PE
+ /* We are relocating a common symbol. The current value in the
+ object file is ORIG + OFFSET, where ORIG is the value of the
+ common symbol as seen by the object file when it was compiled
+ (this may be zero if the symbol was undefined) and OFFSET is
+ the offset into the common symbol (normally zero, but may be
+ non-zero when referring to a field in a common structure).
+ ORIG is the negative of reloc_entry->addend, which is set by
+ the CALC_ADDEND macro below. We want to replace the value in
+ the object file with NEW + OFFSET, where NEW is the value of
+ the common symbol which we are going to put in the final
+ object file. NEW is symbol->value. */
+ diff = symbol->value + reloc_entry->addend;
+#else
+ /* In PE mode, we do not offset the common symbol. */
+ diff = reloc_entry->addend;
+#endif
+ }
+ else
+ {
+ /* For some reason bfd_perform_relocation always effectively
+ ignores the addend for a COFF target when producing
+ relocateable output. This seems to be always wrong for 386
+ COFF, so we handle the addend here instead. */
+ diff = reloc_entry->addend;
+ }
+
+#ifdef COFF_WITH_PE
+#if 0
+ /* dj - handle it like any other reloc? */
+ /* FIXME: How should this case be handled? */
+ if (reloc_entry->howto->type == MIPS_R_RVA && diff != 0)
+ abort ();
+#endif
+#endif
+
+#define DOIT(x) \
+ x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + (diff >> howto->rightshift)) & howto->dst_mask))
+
+ if (diff != 0)
+ {
+ reloc_howto_type *howto = reloc_entry->howto;
+ unsigned char *addr = (unsigned char *) data + reloc_entry->address;
+
+ switch (howto->size)
+ {
+ case 0:
+ {
+ char x = bfd_get_8 (abfd, addr);
+ DOIT (x);
+ bfd_put_8 (abfd, x, addr);
+ }
+ break;
+
+ case 1:
+ {
+ short x = bfd_get_16 (abfd, addr);
+ DOIT (x);
+ bfd_put_16 (abfd, x, addr);
+ }
+ break;
+
+ case 2:
+ {
+ long x = bfd_get_32 (abfd, addr);
+ DOIT (x);
+ bfd_put_32 (abfd, x, addr);
+ }
+ break;
+
+ default:
+ abort ();
+ }
+ }
+
+ /* Now let bfd_perform_relocation finish everything up. */
+ return bfd_reloc_continue;
+}
+
+#ifdef COFF_WITH_PE
+/* Return true if this relocation should
+ appear in the output .reloc section. */
+
+static boolean in_reloc_p(abfd, howto)
+ bfd * abfd ATTRIBUTE_UNUSED;
+ reloc_howto_type *howto;
+{
+ return ! howto->pc_relative && howto->type != MIPS_R_RVA;
+}
+#endif
+
+#ifndef PCRELOFFSET
+#define PCRELOFFSET false
+#endif
+
+static reloc_howto_type howto_table[] =
+{
+ /* Reloc type 0 is ignored. The reloc reading code ensures that
+ this is a reference to the .abs section, which will cause
+ bfd_perform_relocation to do nothing. */
+ HOWTO (MIPS_R_ABSOLUTE, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ 0, /* special_function */
+ "IGNORE", /* name */
+ false, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 16 bit reference to a symbol, normally from a data section. */
+ HOWTO (MIPS_R_REFHALF, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ coff_mips_reloc, /* special_function */
+ "REFHALF", /* name */
+ true, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 32 bit reference to a symbol, normally from a data section. */
+ HOWTO (MIPS_R_REFWORD, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ coff_mips_reloc, /* special_function */
+ "REFWORD", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A 26 bit absolute jump address. */
+ HOWTO (MIPS_R_JMPADDR, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ /* This needs complex overflow
+ detection, because the upper four
+ bits must match the PC. */
+ coff_mips_reloc, /* special_function */
+ "JMPADDR", /* name */
+ true, /* partial_inplace */
+ 0x3ffffff, /* src_mask */
+ 0x3ffffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* The high 16 bits of a symbol value. Handled by the function
+ mips_refhi_reloc. */
+ HOWTO (MIPS_R_REFHI, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ coff_mips_reloc, /* special_function */
+ "REFHI", /* name */
+ true, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* The low 16 bits of a symbol value. */
+ HOWTO (MIPS_R_REFLO, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ coff_mips_reloc, /* special_function */
+ "REFLO", /* name */
+ true, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A reference to an offset from the gp register. Handled by the
+ function mips_gprel_reloc. */
+ HOWTO (MIPS_R_GPREL, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ coff_mips_reloc, /* special_function */
+ "GPREL", /* name */
+ true, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* A reference to a literal using an offset from the gp register.
+ Handled by the function mips_gprel_reloc. */
+ HOWTO (MIPS_R_LITERAL, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ coff_mips_reloc, /* special_function */
+ "LITERAL", /* name */
+ true, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ false), /* pcrel_offset */
+
+ EMPTY_HOWTO (8),
+ EMPTY_HOWTO (9),
+ EMPTY_HOWTO (10),
+ EMPTY_HOWTO (11),
+ EMPTY_HOWTO (12),
+ EMPTY_HOWTO (13),
+ EMPTY_HOWTO (14),
+ EMPTY_HOWTO (15),
+ EMPTY_HOWTO (16),
+ EMPTY_HOWTO (17),
+ EMPTY_HOWTO (18),
+ EMPTY_HOWTO (19),
+ EMPTY_HOWTO (20),
+ EMPTY_HOWTO (21),
+ EMPTY_HOWTO (22),
+ EMPTY_HOWTO (23),
+ EMPTY_HOWTO (24),
+ EMPTY_HOWTO (25),
+ EMPTY_HOWTO (26),
+ EMPTY_HOWTO (27),
+ EMPTY_HOWTO (28),
+ EMPTY_HOWTO (29),
+ EMPTY_HOWTO (30),
+ EMPTY_HOWTO (31),
+ EMPTY_HOWTO (32),
+ EMPTY_HOWTO (33),
+ HOWTO (MIPS_R_RVA, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ coff_mips_reloc, /* special_function */
+ "rva32", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+ EMPTY_HOWTO (35),
+ EMPTY_HOWTO (36),
+ HOWTO (MIPS_R_PAIR, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ coff_mips_reloc, /* special_function */
+ "PAIR", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false), /* pcrel_offset */
+};
+
+/* Turn a howto into a reloc nunmber */
+
+#define SELECT_RELOC(x,howto) { x.r_type = howto->type; }
+#define BADMAG(x) MIPSBADMAG(x)
+#define MIPS 1 /* Customize coffcode.h */
+
+#define RTYPE2HOWTO(cache_ptr, dst) \
+ (cache_ptr)->howto = howto_table + (dst)->r_type;
+
+/* Compute the addend of a reloc. If the reloc is to a common symbol,
+ the object file contains the value of the common symbol. By the
+ time this is called, the linker may be using a different symbol
+ from a different object file with a different value. Therefore, we
+ hack wildly to locate the original symbol from this file so that we
+ can make the correct adjustment. This macro sets coffsym to the
+ symbol from the original file, and uses it to set the addend value
+ correctly. If this is not a common symbol, the usual addend
+ calculation is done, except that an additional tweak is needed for
+ PC relative relocs.
+ FIXME: This macro refers to symbols and asect; these are from the
+ calling function, not the macro arguments. */
+
+#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) \
+ { \
+ coff_symbol_type *coffsym = (coff_symbol_type *) NULL; \
+ if (ptr && bfd_asymbol_bfd (ptr) != abfd) \
+ coffsym = (obj_symbols (abfd) \
+ + (cache_ptr->sym_ptr_ptr - symbols)); \
+ else if (ptr) \
+ coffsym = coff_symbol_from (abfd, ptr); \
+ if (coffsym != (coff_symbol_type *) NULL \
+ && coffsym->native->u.syment.n_scnum == 0) \
+ cache_ptr->addend = - coffsym->native->u.syment.n_value; \
+ else if (ptr && bfd_asymbol_bfd (ptr) == abfd \
+ && ptr->section != (asection *) NULL) \
+ cache_ptr->addend = - (ptr->section->vma + ptr->value); \
+ else \
+ cache_ptr->addend = 0; \
+ if (ptr && howto_table[reloc.r_type].pc_relative) \
+ cache_ptr->addend += asect->vma; \
+ }
+
+
+/* Convert an rtype to howto for the COFF backend linker. */
+
+static reloc_howto_type *
+coff_mips_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asection *sec;
+ struct internal_reloc *rel;
+ struct coff_link_hash_entry *h;
+ struct internal_syment *sym;
+ bfd_vma *addendp;
+{
+
+ reloc_howto_type *howto;
+
+ howto = howto_table + rel->r_type;
+
+#ifdef COFF_WITH_PE
+ *addendp = 0;
+#endif
+
+ if (howto->pc_relative)
+ *addendp += sec->vma;
+
+ if (sym != NULL && sym->n_scnum == 0 && sym->n_value != 0)
+ {
+ /* This is a common symbol. The section contents include the
+ size (sym->n_value) as an addend. The relocate_section
+ function will be adding in the final value of the symbol. We
+ need to subtract out the current size in order to get the
+ correct result. */
+
+ BFD_ASSERT (h != NULL);
+
+#ifndef COFF_WITH_PE
+ /* I think we *do* want to bypass this. If we don't, I have
+ seen some data parameters get the wrong relocation address.
+ If I link two versions with and without this section bypassed
+ and then do a binary comparison, the addresses which are
+ different can be looked up in the map. The case in which
+ this section has been bypassed has addresses which correspond
+ to values I can find in the map. */
+ *addendp -= sym->n_value;
+#endif
+ }
+
+#ifndef COFF_WITH_PE
+ /* If the output symbol is common (in which case this must be a
+ relocateable link), we need to add in the final size of the
+ common symbol. */
+ if (h != NULL && h->root.type == bfd_link_hash_common)
+ *addendp += h->root.u.c.size;
+#endif
+
+#ifdef COFF_WITH_PE
+ if (howto->pc_relative)
+ {
+ *addendp -= 4;
+
+ /* If the symbol is defined, then the generic code is going to
+ add back the symbol value in order to cancel out an
+ adjustment it made to the addend. However, we set the addend
+ to 0 at the start of this function. We need to adjust here,
+ to avoid the adjustment the generic code will make. FIXME:
+ This is getting a bit hackish. */
+ if (sym != NULL && sym->n_scnum != 0)
+ *addendp -= sym->n_value;
+ }
+
+ if (rel->r_type == MIPS_R_RVA)
+ {
+ *addendp -= pe_data(sec->output_section->owner)->pe_opthdr.ImageBase;
+ }
+#endif
+
+ return howto;
+}
+
+#define coff_rtype_to_howto coff_mips_rtype_to_howto
+
+
+#define coff_bfd_reloc_type_lookup coff_mips_reloc_type_lookup
+
+
+
+/* Get the howto structure for a generic reloc type. */
+
+static reloc_howto_type *
+coff_mips_reloc_type_lookup (abfd, code)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ bfd_reloc_code_real_type code;
+{
+ int mips_type;
+
+ switch (code)
+ {
+ case BFD_RELOC_16:
+ mips_type = MIPS_R_REFHALF;
+ break;
+ case BFD_RELOC_32:
+ case BFD_RELOC_CTOR:
+ mips_type = MIPS_R_REFWORD;
+ break;
+ case BFD_RELOC_MIPS_JMP:
+ mips_type = MIPS_R_JMPADDR;
+ break;
+ case BFD_RELOC_HI16_S:
+ mips_type = MIPS_R_REFHI;
+ break;
+ case BFD_RELOC_LO16:
+ mips_type = MIPS_R_REFLO;
+ break;
+ case BFD_RELOC_MIPS_GPREL:
+ mips_type = MIPS_R_GPREL;
+ break;
+ case BFD_RELOC_MIPS_LITERAL:
+ mips_type = MIPS_R_LITERAL;
+ break;
+/* FIXME?
+ case BFD_RELOC_16_PCREL_S2:
+ mips_type = MIPS_R_PCREL16;
+ break;
+ case BFD_RELOC_PCREL_HI16_S:
+ mips_type = MIPS_R_RELHI;
+ break;
+ case BFD_RELOC_PCREL_LO16:
+ mips_type = MIPS_R_RELLO;
+ break;
+ case BFD_RELOC_GPREL32:
+ mips_type = MIPS_R_SWITCH;
+ break;
+*/
+ case BFD_RELOC_RVA:
+ mips_type = MIPS_R_RVA;
+ break;
+ default:
+ return (reloc_howto_type *) NULL;
+ }
+
+ return &howto_table[mips_type];
+}
+
+static void
+mips_swap_reloc_in (abfd, src, dst)
+ bfd *abfd;
+ PTR src;
+ PTR dst;
+{
+ static struct internal_reloc pair_prev;
+ RELOC *reloc_src = (RELOC *) src;
+ struct internal_reloc *reloc_dst = (struct internal_reloc *) dst;
+
+ reloc_dst->r_vaddr = bfd_h_get_32(abfd, (bfd_byte *)reloc_src->r_vaddr);
+ reloc_dst->r_symndx =
+ bfd_h_get_signed_32(abfd, (bfd_byte *) reloc_src->r_symndx);
+ reloc_dst->r_type = bfd_h_get_16(abfd, (bfd_byte *) reloc_src->r_type);
+ reloc_dst->r_size = 0;
+ reloc_dst->r_extern = 0;
+ reloc_dst->r_offset = 0;
+
+ switch (reloc_dst->r_type)
+ {
+ case MIPS_R_REFHI:
+ pair_prev = *reloc_dst;
+ break;
+ case MIPS_R_PAIR:
+ reloc_dst->r_offset = reloc_dst->r_symndx;
+ if (reloc_dst->r_offset & 0x8000)
+ reloc_dst->r_offset -= 0x10000;
+ /*printf("dj: pair offset is %08x\n", reloc_dst->r_offset);*/
+ reloc_dst->r_symndx = pair_prev.r_symndx;
+ break;
+ }
+}
+
+static unsigned int
+mips_swap_reloc_out (abfd, src, dst)
+ bfd *abfd;
+ PTR src;
+ PTR dst;
+{
+ static int prev_offset = 1;
+ static bfd_vma prev_addr = 0;
+ struct internal_reloc *reloc_src = (struct internal_reloc *)src;
+ struct external_reloc *reloc_dst = (struct external_reloc *)dst;
+
+ switch (reloc_src->r_type)
+ {
+ case MIPS_R_REFHI:
+ prev_addr = reloc_src->r_vaddr;
+ prev_offset = reloc_src->r_offset;
+ break;
+ case MIPS_R_REFLO:
+ if (reloc_src->r_vaddr == prev_addr)
+ {
+ /* FIXME: only slightly hackish. If we see a REFLO pointing to
+ the same address as a REFHI, we assume this is the matching
+ PAIR reloc and output it accordingly. The symndx is really
+ the low 16 bits of the addend */
+ bfd_h_put_32 (abfd, reloc_src->r_vaddr,
+ (bfd_byte *) reloc_dst->r_vaddr);
+ bfd_h_put_32 (abfd, reloc_src->r_symndx,
+ (bfd_byte *) reloc_dst->r_symndx);
+
+ bfd_h_put_16(abfd, MIPS_R_PAIR, (bfd_byte *)
+ reloc_dst->r_type);
+ return RELSZ;
+ }
+ break;
+ }
+
+ bfd_h_put_32(abfd, reloc_src->r_vaddr, (bfd_byte *) reloc_dst->r_vaddr);
+ bfd_h_put_32(abfd, reloc_src->r_symndx, (bfd_byte *) reloc_dst->r_symndx);
+
+ bfd_h_put_16(abfd, reloc_src->r_type, (bfd_byte *)
+ reloc_dst->r_type);
+ return RELSZ;
+}
+
+#define coff_swap_reloc_in mips_swap_reloc_in
+#define coff_swap_reloc_out mips_swap_reloc_out
+#define NO_COFF_RELOCS
+
+static boolean
+coff_pe_mips_relocate_section (output_bfd, info, input_bfd,
+ input_section, contents, relocs, syms,
+ sections)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+ bfd *input_bfd;
+ asection *input_section;
+ bfd_byte *contents;
+ struct internal_reloc *relocs;
+ struct internal_syment *syms;
+ asection **sections;
+{
+ bfd_vma gp;
+ boolean gp_undefined;
+ size_t adjust;
+ struct internal_reloc *rel;
+ struct internal_reloc *rel_end;
+ unsigned int i;
+ boolean got_lo;
+
+ if (info->relocateable)
+ {
+ (*_bfd_error_handler)(_("\
+%s: `ld -r' not supported with PE MIPS objects\n"),
+ bfd_get_filename (input_bfd));
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ }
+
+ BFD_ASSERT (input_bfd->xvec->byteorder
+ == output_bfd->xvec->byteorder);
+
+#if 0
+ printf("dj: relocate %s(%s) %08x\n",
+ input_bfd->filename, input_section->name,
+ input_section->output_section->vma + input_section->output_offset);
+#endif
+
+ gp = _bfd_get_gp_value (output_bfd);
+ if (gp == 0)
+ gp_undefined = true;
+ else
+ gp_undefined = false;
+
+ got_lo = false;
+
+ adjust = 0;
+
+ rel = relocs;
+ rel_end = rel + input_section->reloc_count;
+ for (i = 0; rel < rel_end; rel++, i++)
+ {
+ long symndx;
+ struct coff_link_hash_entry *h;
+ struct internal_syment *sym;
+ bfd_vma addend = 0;
+ bfd_vma val, tmp, targ, src, low;
+ reloc_howto_type *howto;
+ unsigned char *mem = contents + rel->r_vaddr;
+
+ symndx = rel->r_symndx;
+
+ if (symndx == -1)
+ {
+ h = NULL;
+ sym = NULL;
+ }
+ else
+ {
+ h = obj_coff_sym_hashes (input_bfd)[symndx];
+ sym = syms + symndx;
+ }
+
+ /* COFF treats common symbols in one of two ways. Either the
+ size of the symbol is included in the section contents, or it
+ is not. We assume that the size is not included, and force
+ the rtype_to_howto function to adjust the addend as needed. */
+
+ if (sym != NULL && sym->n_scnum != 0)
+ addend = - sym->n_value;
+ else
+ addend = 0;
+
+
+ howto = bfd_coff_rtype_to_howto (input_bfd, input_section, rel, h,
+ sym, &addend);
+ if (howto == NULL)
+ return false;
+
+ /* If we are doing a relocateable link, then we can just ignore
+ a PC relative reloc that is pcrel_offset. It will already
+ have the correct value. If this is not a relocateable link,
+ then we should ignore the symbol value. */
+ if (howto->pc_relative && howto->pcrel_offset)
+ {
+ if (info->relocateable)
+ continue;
+ if (sym != NULL && sym->n_scnum != 0)
+ addend += sym->n_value;
+ }
+
+ val = 0;
+
+ if (h == NULL)
+ {
+ asection *sec;
+
+ if (symndx == -1)
+ {
+ sec = bfd_abs_section_ptr;
+ val = 0;
+ }
+ else
+ {
+ sec = sections[symndx];
+ val = (sec->output_section->vma
+ + sec->output_offset
+ + sym->n_value);
+ if (! obj_pe (input_bfd))
+ val -= sec->vma;
+ }
+ }
+ else
+ {
+ if (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ {
+ asection *sec;
+
+ sec = h->root.u.def.section;
+ val = (h->root.u.def.value
+ + sec->output_section->vma
+ + sec->output_offset);
+ }
+
+ else if (! info->relocateable)
+ {
+ if (! ((*info->callbacks->undefined_symbol)
+ (info, h->root.root.string, input_bfd, input_section,
+ rel->r_vaddr - input_section->vma, true)))
+ return false;
+ }
+ }
+
+ src = rel->r_vaddr + input_section->output_section->vma
+ + input_section->output_offset;
+#if 0
+ printf("dj: reloc %02x %-8s a=%08x/%08x(%08x) v=%08x+%08x %s\n",
+ rel->r_type, howto_table[rel->r_type].name,
+ src, rel->r_vaddr, *(unsigned long *)mem, val, rel->r_offset,
+ h?h->root.root.string:"(none)");
+#endif
+
+ /* OK, at this point the following variables are set up:
+ src = VMA of the memory we're fixing up
+ mem = pointer to memory we're fixing up
+ val = VMA of what we need to refer to
+ */
+
+#define UI(x) (*_bfd_error_handler)(_("%s: unimplemented %s\n"), \
+ bfd_get_filename (input_bfd), x); \
+ bfd_set_error (bfd_error_bad_value);
+
+ switch (rel->r_type)
+ {
+ case MIPS_R_ABSOLUTE:
+ /* ignore these */
+ break;
+
+ case MIPS_R_REFHALF:
+ UI("refhalf");
+ break;
+
+ case MIPS_R_REFWORD:
+ tmp = bfd_get_32(input_bfd, mem);
+ /* printf("refword: src=%08x targ=%08x+%08x\n", src, tmp, val); */
+ tmp += val;
+ bfd_put_32(input_bfd, tmp, mem);
+ break;
+
+ case MIPS_R_JMPADDR:
+ tmp = bfd_get_32(input_bfd, mem);
+ targ = val + (tmp&0x03ffffff)*4;
+ if ((src & 0xf0000000) != (targ & 0xf0000000))
+ {
+ (*_bfd_error_handler)(_("%s: jump too far away\n"),
+ bfd_get_filename (input_bfd));
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ }
+ tmp &= 0xfc000000;
+ tmp |= (targ/4) & 0x3ffffff;
+ bfd_put_32(input_bfd, tmp, mem);
+ break;
+
+ case MIPS_R_REFHI:
+ tmp = bfd_get_32(input_bfd, mem);
+ switch (rel[1].r_type)
+ {
+ case MIPS_R_PAIR:
+ /* MS PE object */
+ targ = val + rel[1].r_offset + ((tmp & 0xffff) << 16);
+ break;
+ case MIPS_R_REFLO:
+ /* GNU COFF object */
+ low = bfd_get_32(input_bfd, contents + rel[1].r_vaddr);
+ low &= 0xffff;
+ if (low & 0x8000)
+ low -= 0x10000;
+ targ = val + low + ((tmp & 0xffff) << 16);
+ break;
+ default:
+ (*_bfd_error_handler)(_("%s: bad pair/reflo after refhi\n"),
+ bfd_get_filename (input_bfd));
+ bfd_set_error (bfd_error_bad_value);
+ return false;
+ }
+ tmp &= 0xffff0000;
+ tmp |= (targ >> 16) & 0xffff;
+ bfd_put_32(input_bfd, tmp, mem);
+ break;
+
+ case MIPS_R_REFLO:
+ tmp = bfd_get_32(input_bfd, mem);
+ targ = val + (tmp & 0xffff);
+ /* printf("refword: src=%08x targ=%08x\n", src, targ); */
+ tmp &= 0xffff0000;
+ tmp |= targ & 0xffff;
+ bfd_put_32(input_bfd, tmp, mem);
+ break;
+
+ case MIPS_R_GPREL:
+ case MIPS_R_LITERAL:
+ UI("gprel");
+ break;
+
+ case MIPS_R_SECTION:
+ UI("section");
+ break;
+
+ case MIPS_R_SECREL:
+ UI("secrel");
+ break;
+
+ case MIPS_R_SECRELLO:
+ UI("secrello");
+ break;
+
+ case MIPS_R_SECRELHI:
+ UI("secrelhi");
+ break;
+
+ case MIPS_R_RVA:
+ tmp = bfd_get_32 (input_bfd, mem);
+ /* printf("rva: src=%08x targ=%08x+%08x\n", src, tmp, val); */
+ tmp += val
+ - pe_data (input_section->output_section->owner)->pe_opthdr.ImageBase;
+ bfd_put_32 (input_bfd, tmp, mem);
+ break;
+
+ case MIPS_R_PAIR:
+ /* ignore these */
+ break;
+ }
+ }
+
+ return true;
+}
+
+#define coff_relocate_section coff_pe_mips_relocate_section
+
+#ifdef TARGET_UNDERSCORE
+
+/* If mips gcc uses underscores for symbol names, then it does not use
+ a leading dot for local labels, so if TARGET_UNDERSCORE is defined
+ we treat all symbols starting with L as local. */
+
+static boolean coff_mips_is_local_label_name PARAMS ((bfd *, const char *));
+
+static boolean
+coff_mips_is_local_label_name (abfd, name)
+ bfd *abfd;
+ const char *name;
+{
+ if (name[0] == 'L')
+ return true;
+
+ return _bfd_coff_is_local_label_name (abfd, name);
+}
+
+#define coff_bfd_is_local_label_name coff_mips_is_local_label_name
+
+#endif /* TARGET_UNDERSCORE */
+
+#define COFF_NO_HACK_SCNHDR_SIZE
+
+#include "coffcode.h"
+
+const bfd_target
+#ifdef TARGET_SYM
+ TARGET_SYM =
+#else
+ mipslpe_vec =
+#endif
+{
+#ifdef TARGET_NAME
+ TARGET_NAME,
+#else
+ "pe-mips", /* name */
+#endif
+ bfd_target_coff_flavour,
+ BFD_ENDIAN_LITTLE, /* data byte order is little */
+ BFD_ENDIAN_LITTLE, /* header byte order is little */
+
+ (HAS_RELOC | EXEC_P | /* object flags */
+ HAS_LINENO | HAS_DEBUG |
+ HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
+
+#ifndef COFF_WITH_PE
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */
+ | SEC_CODE | SEC_DATA),
+#else
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */
+ | SEC_CODE | SEC_DATA
+ | SEC_LINK_ONCE | SEC_LINK_DUPLICATES),
+#endif
+
+#ifdef TARGET_UNDERSCORE
+ TARGET_UNDERSCORE, /* leading underscore */
+#else
+ 0, /* leading underscore */
+#endif
+ '/', /* ar_pad_char */
+ 15, /* ar_max_namelen */
+
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
+
+/* Note that we allow an object file to be treated as a core file as well. */
+ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
+ bfd_generic_archive_p, coff_object_p},
+ {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
+ bfd_false},
+ {bfd_false, coff_write_object_contents, /* bfd_write_contents */
+ _bfd_write_archive_contents, bfd_false},
+
+ BFD_JUMP_TABLE_GENERIC (coff),
+ BFD_JUMP_TABLE_COPY (coff),
+ BFD_JUMP_TABLE_CORE (_bfd_nocore),
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
+ BFD_JUMP_TABLE_SYMBOLS (coff),
+ BFD_JUMP_TABLE_RELOCS (coff),
+ BFD_JUMP_TABLE_WRITE (coff),
+ BFD_JUMP_TABLE_LINK (coff),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+
+ NULL,
+
+ COFF_SWAP_TABLE
+};
diff --git a/contrib/binutils/bfd/pe-ppc.c b/contrib/binutils/bfd/pe-ppc.c
new file mode 100644
index 000000000000..7d4a54716237
--- /dev/null
+++ b/contrib/binutils/bfd/pe-ppc.c
@@ -0,0 +1,44 @@
+/* BFD back-end for PowerPC PECOFF files.
+ Copyright 1995 Free Software Foundation, Inc.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+
+
+#define E_FILENMLEN 18
+
+#define PPC_PE
+
+#define TARGET_LITTLE_SYM bfd_powerpcle_pe_vec
+#define TARGET_LITTLE_NAME "pe-powerpcle"
+
+#define TARGET_BIG_SYM bfd_powerpc_pe_vec
+#define TARGET_BIG_NAME "pe-powerpc"
+
+#define COFF_WITH_PE
+
+#define COFF_LONG_SECTION_NAMES
+
+/* FIXME: verify PCRELOFFSET is always false */
+
+/* FIXME: This target no longer works. Search for POWERPC_LE_PE in
+ coff-ppc.c and peigen.c. */
+
+#include "coff-ppc.c"
diff --git a/contrib/binutils/bfd/po/Make-in b/contrib/binutils/bfd/po/Make-in
new file mode 100644
index 000000000000..0552db1feef3
--- /dev/null
+++ b/contrib/binutils/bfd/po/Make-in
@@ -0,0 +1,251 @@
+# Makefile for program source directory in GNU NLS utilities package.
+# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+#
+# This file file be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+SHELL = /bin/sh
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datadir = $(prefix)/@DATADIRNAME@
+localedir = $(datadir)/locale
+gnulocaledir = $(prefix)/share/locale
+gettextsrcdir = $(prefix)/share/gettext/po
+subdir = po
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+
+CC = @CC@
+GENCAT = @GENCAT@
+GMSGFMT = PATH=../src:$$PATH @GMSGFMT@
+MSGFMT = @MSGFMT@
+XGETTEXT = PATH=../src:$$PATH @XGETTEXT@
+MSGMERGE = PATH=../src:$$PATH msgmerge
+
+DEFS = @DEFS@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+
+INCLUDES = -I.. -I$(top_srcdir)/intl
+
+COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
+
+SOURCES = cat-id-tbl.c
+POFILES = @POFILES@
+GMOFILES = @GMOFILES@
+DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
+stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
+
+POTFILES = \
+
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
+INSTOBJEXT = @INSTOBJEXT@
+
+.SUFFIXES:
+.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
+
+.c.o:
+ $(COMPILE) $<
+
+.po.pox:
+ $(MAKE) $(PACKAGE).pot
+ $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
+
+.po.mo:
+ $(MSGFMT) -o $@ $<
+
+.po.gmo:
+ file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
+ && rm -f $$file && $(GMSGFMT) -o $$file $<
+
+.po.cat:
+ sed -f ../intl/po2msg.sed < $< > $*.msg \
+ && rm -f $@ && $(GENCAT) $@ $*.msg
+
+
+all: all-@USE_NLS@
+
+all-yes: $(CATALOGS) @MAINT@ $(PACKAGE).pot
+all-no:
+
+$(srcdir)/$(PACKAGE).pot: $(POTFILES)
+ $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
+ --add-comments --keyword=_ --keyword=N_ \
+ --files-from=$(srcdir)/POTFILES.in
+ rm -f $(srcdir)/$(PACKAGE).pot
+ mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
+
+$(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
+$(srcdir)/stamp-cat-id: $(PACKAGE).pot
+ rm -f cat-id-tbl.tmp
+ sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
+ | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
+ if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \
+ rm cat-id-tbl.tmp; \
+ else \
+ echo cat-id-tbl.c changed; \
+ rm -f $(srcdir)/cat-id-tbl.c; \
+ mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \
+ fi
+ cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
+
+
+install: install-exec install-data
+install-exec:
+install-info:
+install-data: install-data-@USE_NLS@
+install-data-no: all
+install-data-yes: all
+ if test -r $(MKINSTALLDIRS); then \
+ $(MKINSTALLDIRS) $(datadir); \
+ else \
+ $(top_srcdir)/mkinstalldirs $(datadir); \
+ fi
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ case "$$cat" in \
+ *.gmo) destdir=$(gnulocaledir);; \
+ *) destdir=$(localedir);; \
+ esac; \
+ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+ dir=$$destdir/$$lang/LC_MESSAGES; \
+ if test -r $(MKINSTALLDIRS); then \
+ $(MKINSTALLDIRS) $$dir; \
+ else \
+ $(top_srcdir)/mkinstalldirs $$dir; \
+ fi; \
+ if test -r $$cat; then \
+ $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
+ echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
+ else \
+ $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
+ echo "installing $(srcdir)/$$cat as" \
+ "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
+ fi; \
+ if test -r $$cat.m; then \
+ $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
+ echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
+ else \
+ if test -r $(srcdir)/$$cat.m ; then \
+ $(INSTALL_DATA) $(srcdir)/$$cat.m \
+ $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
+ echo "installing $(srcdir)/$$cat as" \
+ "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
+ else \
+ true; \
+ fi; \
+ fi; \
+ done
+ if test "$(PACKAGE)" = "gettext"; then \
+ if test -r $(MKINSTALLDIRS); then \
+ $(MKINSTALLDIRS) $(gettextsrcdir); \
+ else \
+ $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
+ fi; \
+ $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
+ $(gettextsrcdir)/Makefile.in.in; \
+ else \
+ : ; \
+ fi
+
+# Define this as empty until I found a useful application.
+installcheck:
+
+uninstall:
+ catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+ rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
+ rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
+ rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
+ rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
+ done
+ rm -f $(gettextsrcdir)/po-Makefile.in.in
+
+check: all
+
+cat-id-tbl.o: ../intl/libgettext.h
+
+dvi info tags TAGS ID:
+
+mostlyclean:
+ rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp
+ rm -fr *.o
+
+clean: mostlyclean
+
+distclean: clean
+ rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
+
+maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ rm -f $(GMOFILES)
+
+distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir: update-po $(DISTFILES)
+ dists="$(DISTFILES)"; \
+ for file in $$dists; do \
+ ln $(srcdir)/$$file $(distdir) 2> /dev/null \
+ || cp -p $(srcdir)/$$file $(distdir); \
+ done
+
+update-po: Makefile
+ $(MAKE) $(PACKAGE).pot
+ PATH=`pwd`/../src:$$PATH; \
+ cd $(srcdir); \
+ catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+ mv $$lang.po $$lang.old.po; \
+ echo "$$lang:"; \
+ if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
+ rm -f $$lang.old.po; \
+ else \
+ echo "msgmerge for $$cat failed!"; \
+ rm -f $$lang.po; \
+ mv $$lang.old.po $$lang.po; \
+ fi; \
+ done
+
+POTFILES: POTFILES.in
+ ( if test 'x$(srcdir)' != 'x.'; then \
+ posrcprefix='$(top_srcdir)/'; \
+ else \
+ posrcprefix="../"; \
+ fi; \
+ rm -f $@-t $@ \
+ && (sed -e '/^#/d' -e '/^[ ]*$$/d' \
+ -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
+ | sed -e '$$s/\\$$//') > $@-t \
+ && chmod a-w $@-t \
+ && mv $@-t $@ )
+
+POTFILES.in: @MAINT@ ../Makefile
+ cd .. && $(MAKE) po/POTFILES.in
+
+Makefile: Make-in ../config.status POTFILES
+ cd .. \
+ && CONFIG_FILES=$(subdir)/Makefile.in:$(subdir)/Make-in \
+ CONFIG_HEADERS= $(SHELL) ./config.status
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/contrib/binutils/bfd/po/POTFILES.in b/contrib/binutils/bfd/po/POTFILES.in
new file mode 100644
index 000000000000..409bf1d7c9cf
--- /dev/null
+++ b/contrib/binutils/bfd/po/POTFILES.in
@@ -0,0 +1,234 @@
+aix386-core.c
+aout0.c
+aout32.c
+aout64.c
+aout-adobe.c
+aout-arm.c
+aoutf1.h
+aout-ns32k.c
+aout-sparcle.c
+aout-target.h
+aout-tic30.c
+aoutx.h
+archive.c
+archures.c
+armnetbsd.c
+bfd.c
+binary.c
+bout.c
+cache.c
+cf-i386lynx.c
+cf-m68klynx.c
+cf-sparclynx.c
+cisco-core.c
+coff-a29k.c
+coff-alpha.c
+coff-apollo.c
+coff-arm.c
+coff-aux.c
+coffcode.h
+coffgen.c
+coff-go32.c
+coff-h8300.c
+coff-h8500.c
+coff-i386.c
+coff-i860.c
+coff-i960.c
+cofflink.c
+coff-m68k.c
+coff-m88k.c
+coff-mips.c
+coff-pmac.c
+coff-rs6000.c
+coff-sh.c
+coff-sparc.c
+coff-stgo32.c
+coff-svm68k.c
+coffswap.h
+coff-tic30.c
+coff-tic80.c
+coff-u68k.c
+coff-w65.c
+coff-we32k.c
+coff-z8k.c
+corefile.c
+cpu-a29k.c
+cpu-alpha.c
+cpu-arc.c
+cpu-arm.c
+cpu-avr.c
+cpu-d10v.c
+cpu-d30v.c
+cpu-fr30.c
+cpu-h8300.c
+cpu-h8500.c
+cpu-hppa.c
+cpu-i370.c
+cpu-i386.c
+cpu-i860.c
+cpu-i960.c
+cpu-m10200.c
+cpu-m10300.c
+cpu-m32r.c
+cpu-m68k.c
+cpu-m88k.c
+cpu-mcore.c
+cpu-mips.c
+cpu-ns32k.c
+cpu-pj.c
+cpu-powerpc.c
+cpu-rs6000.c
+cpu-sh.c
+cpu-sparc.c
+cpu-tic30.c
+cpu-tic80.c
+cpu-v850.c
+cpu-vax.c
+cpu-w65.c
+cpu-we32k.c
+cpu-z8k.c
+demo64.c
+dwarf1.c
+dwarf2.c
+ecoff.c
+ecofflink.c
+ecoffswap.h
+elf32-arc.c
+elf32-arm.h
+elf32-avr.c
+elf32.c
+elf32-d10v.c
+elf32-d30v.c
+elf32-fr30.c
+elf32-gen.c
+elf32-i370.c
+elf32-i386.c
+elf32-i860.c
+elf32-i960.c
+elf32-m32r.c
+elf32-m68k.c
+elf32-m88k.c
+elf32-mcore.c
+elf32-mips.c
+elf32-pj.c
+elf32-ppc.c
+elf32-sh.c
+elf32-sparc.c
+elf32-v850.c
+elf64-alpha.c
+elf64.c
+elf64-gen.c
+elf64-mips.c
+elf64-sparc.c
+elfarm-nabi.c
+elfarm-oabi.c
+elf-bfd.h
+elf.c
+elfcode.h
+elfcore.h
+elflink.c
+elflink.h
+elf-m10200.c
+elf-m10300.c
+epoc-pe-arm.c
+epoc-pei-arm.c
+format.c
+freebsd.h
+genlink.h
+go32stub.h
+hash.c
+hp300bsd.c
+hp300hpux.c
+hpux-core.c
+i386aout.c
+i386bsd.c
+i386dynix.c
+i386freebsd.c
+i386linux.c
+i386lynx.c
+i386mach3.c
+i386msdos.c
+i386netbsd.c
+i386os9k.c
+ieee.c
+ihex.c
+init.c
+irix-core.c
+libaout.h
+libbfd.c
+libbfd.h
+libcoff.h
+libecoff.h
+libhppa.h
+libieee.h
+libnlm.h
+liboasys.h
+libpei.h
+linker.c
+lynx-core.c
+m68k4knetbsd.c
+m68klinux.c
+m68klynx.c
+m68knetbsd.c
+m88kmach3.c
+mipsbsd.c
+netbsd.h
+newsos3.c
+nlm32-alpha.c
+nlm32.c
+nlm32-i386.c
+nlm32-ppc.c
+nlm32-sparc.c
+nlm64.c
+nlm.c
+nlmcode.h
+nlmswap.h
+nlm-target.h
+ns32k.h
+ns32knetbsd.c
+oasys.c
+opncls.c
+osf-core.c
+pc532-mach.c
+pe-arm.c
+pe-i386.c
+pei-arm.c
+peicode.h
+peigen.c
+pei-i386.c
+pei-mcore.c
+pei-mips.c
+pei-ppc.c
+pei-sh.c
+pe-mcore.c
+pe-mips.c
+pe-ppc.c
+pe-sh.c
+ppcboot.c
+reloc16.c
+reloc.c
+riscix.c
+sco5-core.c
+section.c
+som.c
+som.h
+sparclinux.c
+sparclynx.c
+sparcnetbsd.c
+srec.c
+stabs.c
+stab-syms.c
+sunos.c
+syms.c
+targets.c
+tekhex.c
+trad-core.c
+vaxnetbsd.c
+versados.c
+vms.c
+vms-gsd.c
+vms.h
+vms-hdr.c
+vms-misc.c
+vms-tir.c
+xcofflink.c
diff --git a/contrib/binutils/bfd/po/bfd.pot b/contrib/binutils/bfd/po/bfd.pot
new file mode 100644
index 000000000000..b08ec3649c97
--- /dev/null
+++ b/contrib/binutils/bfd/po/bfd.pot
@@ -0,0 +1,2051 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2000-04-04 22:10+0930\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: ENCODING\n"
+
+#: aout-adobe.c:183
+#, c-format
+msgid "%s: Unknown section type in a.out.adobe file: %x\n"
+msgstr ""
+
+#: aoutx.h:1244 aoutx.h:1658
+#, c-format
+msgid "%s: can not represent section `%s' in a.out object file format"
+msgstr ""
+
+#: aoutx.h:1628
+#, c-format
+msgid ""
+"%s: can not represent section for symbol `%s' in a.out object file format"
+msgstr ""
+
+#: aoutx.h:1630
+msgid "*unknown*"
+msgstr ""
+
+#: aoutx.h:3674
+#, c-format
+msgid "%s: relocateable link from %s to %s not supported"
+msgstr ""
+
+#: archive.c:1724
+msgid "Warning: writing archive was slow: rewriting timestamp\n"
+msgstr ""
+
+#: archive.c:1990
+msgid "Reading archive file mod timestamp"
+msgstr ""
+
+#. FIXME: bfd can't call perror.
+#: archive.c:2014
+msgid "Writing updated armap timestamp"
+msgstr ""
+
+#: bfd.c:274
+msgid "No error"
+msgstr ""
+
+#: bfd.c:275
+msgid "System call error"
+msgstr ""
+
+#: bfd.c:276
+msgid "Invalid bfd target"
+msgstr ""
+
+#: bfd.c:277
+msgid "File in wrong format"
+msgstr ""
+
+#: bfd.c:278
+msgid "Invalid operation"
+msgstr ""
+
+#: bfd.c:279
+msgid "Memory exhausted"
+msgstr ""
+
+#: bfd.c:280
+msgid "No symbols"
+msgstr ""
+
+#: bfd.c:281
+msgid "Archive has no index; run ranlib to add one"
+msgstr ""
+
+#: bfd.c:282
+msgid "No more archived files"
+msgstr ""
+
+#: bfd.c:283
+msgid "Malformed archive"
+msgstr ""
+
+#: bfd.c:284
+msgid "File format not recognized"
+msgstr ""
+
+#: bfd.c:285
+msgid "File format is ambiguous"
+msgstr ""
+
+#: bfd.c:286
+msgid "Section has no contents"
+msgstr ""
+
+#: bfd.c:287
+msgid "Nonrepresentable section on output"
+msgstr ""
+
+#: bfd.c:288
+msgid "Symbol needs debug section which does not exist"
+msgstr ""
+
+#: bfd.c:289
+msgid "Bad value"
+msgstr ""
+
+#: bfd.c:290
+msgid "File truncated"
+msgstr ""
+
+#: bfd.c:291
+msgid "File too big"
+msgstr ""
+
+#: bfd.c:292
+msgid "#<Invalid error code>"
+msgstr ""
+
+#: bfd.c:679
+#, c-format
+msgid "bfd assertion fail %s:%d"
+msgstr ""
+
+#: bfd.c:697
+#, c-format
+msgid "BFD internal error, aborting at %s line %d in %s\n"
+msgstr ""
+
+#: bfd.c:701
+#, c-format
+msgid "BFD internal error, aborting at %s line %d\n"
+msgstr ""
+
+#: bfd.c:703
+msgid "Please report this bug.\n"
+msgstr ""
+
+#: binary.c:298
+#, c-format
+msgid "Warning: Writing section `%s' to huge (ie negative) file offset 0x%lx."
+msgstr ""
+
+#: coff-a29k.c:122
+msgid "Missing IHCONST"
+msgstr ""
+
+#: coff-a29k.c:182
+msgid "Missing IHIHALF"
+msgstr ""
+
+#: coff-a29k.c:214
+msgid "Unrecognized reloc"
+msgstr ""
+
+#: coff-a29k.c:427
+msgid "missing IHCONST reloc"
+msgstr ""
+
+#: coff-a29k.c:518
+msgid "missing IHIHALF reloc"
+msgstr ""
+
+#: coff-alpha.c:880 coff-alpha.c:917
+msgid "GP relative relocation used when GP not defined"
+msgstr ""
+
+#: coff-alpha.c:1486 elf64-alpha.c:3990
+msgid "using multiple gp values"
+msgstr ""
+
+#: coff-alpha.c:1992 coff-mips.c:1435
+msgid "GP relative relocation when GP not defined"
+msgstr ""
+
+#: coff-arm.c:1020 elf32-arm.h:258
+#, c-format
+msgid "%s: unable to find THUMB glue '%s' for `%s'"
+msgstr ""
+
+#: coff-arm.c:1049 elf32-arm.h:291
+#, c-format
+msgid "%s: unable to find ARM glue '%s' for `%s'"
+msgstr ""
+
+#: coff-arm.c:1331 coff-arm.c:1426 elf32-arm.h:857 elf32-arm.h:955
+#, c-format
+msgid "%s(%s): warning: interworking not enabled."
+msgstr ""
+
+#: coff-arm.c:1335 elf32-arm.h:958
+#, c-format
+msgid " first occurrence: %s: arm call to thumb"
+msgstr ""
+
+#: coff-arm.c:1430 elf32-arm.h:860
+#, c-format
+msgid " first occurrence: %s: thumb call to arm"
+msgstr ""
+
+#: coff-arm.c:1433
+msgid " consider relinking with --support-old-code enabled"
+msgstr ""
+
+#: coff-arm.c:1722 coff-tic80.c:682 cofflink.c:2980
+#, c-format
+msgid "%s: bad reloc address 0x%lx in section `%s'"
+msgstr ""
+
+#: coff-arm.c:2060
+#, c-format
+msgid "%s: illegal symbol index in reloc: %d"
+msgstr ""
+
+#: coff-arm.c:2189
+#, c-format
+msgid "%s: ERROR: compiled for APCS-%d whereas target %s uses APCS-%d"
+msgstr ""
+
+#: coff-arm.c:2204
+#, c-format
+msgid ""
+"%s: ERROR: passes floats in float registers whereas target %s uses integer "
+"registers"
+msgstr ""
+
+#: coff-arm.c:2207
+#, c-format
+msgid ""
+"%s: ERROR: passes floats in integer registers whereas target %s uses float "
+"registers"
+msgstr ""
+
+#: coff-arm.c:2222
+#, c-format
+msgid ""
+"%s: ERROR: compiled as position independent code, whereas target %s is "
+"absolute position"
+msgstr ""
+
+#: coff-arm.c:2225
+#, c-format
+msgid ""
+"%s: ERROR: compiled as absolute position code, whereas target %s is position "
+"independent"
+msgstr ""
+
+#: coff-arm.c:2254
+#, c-format
+msgid "Warning: input file %s supports interworking, whereas %s does not."
+msgstr ""
+
+#: coff-arm.c:2257
+#, c-format
+msgid "Warning: input file %s does not support interworking, whereas %s does."
+msgstr ""
+
+#: coff-arm.c:2285
+#, c-format
+msgid "private flags = %x:"
+msgstr ""
+
+#: coff-arm.c:2293 elf32-arm.h:2089
+msgid " [floats passed in float registers]"
+msgstr ""
+
+#: coff-arm.c:2295 elf32-arm.h:2091
+msgid " [floats passed in integer registers]"
+msgstr ""
+
+#: coff-arm.c:2298 elf32-arm.h:2094
+msgid " [position independent]"
+msgstr ""
+
+#: coff-arm.c:2300 elf32-arm.h:2096
+msgid " [absolute position]"
+msgstr ""
+
+#: coff-arm.c:2304
+msgid " [interworking flag not initialised]"
+msgstr ""
+
+#: coff-arm.c:2306
+msgid " [interworking supported]"
+msgstr ""
+
+#: coff-arm.c:2308
+msgid " [interworking not supported]"
+msgstr ""
+
+#: coff-arm.c:2357
+#, c-format
+msgid ""
+"Warning: Not setting interworking flag of %s, since it has already been "
+"specified as non-interworking"
+msgstr ""
+
+#: coff-arm.c:2361
+#, c-format
+msgid "Warning: Clearing the interworking flag of %s due to outside request"
+msgstr ""
+
+#: coffcode.h:3965
+#, c-format
+msgid "%s: warning: illegal symbol index %ld in line numbers"
+msgstr ""
+
+#: coffcode.h:3979
+#, c-format
+msgid "%s: warning: duplicate line number information for `%s'"
+msgstr ""
+
+#: coffcode.h:4334
+#, c-format
+msgid "%s: Unrecognized storage class %d for %s symbol `%s'"
+msgstr ""
+
+#: coffcode.h:4465
+#, c-format
+msgid "warning: %s: local symbol `%s' has no section"
+msgstr ""
+
+#: coffcode.h:4578
+#, c-format
+msgid "%s: warning: illegal symbol index %ld in relocs"
+msgstr ""
+
+#: coffcode.h:4616
+#, c-format
+msgid "%s: illegal relocation type %d at address 0x%lx"
+msgstr ""
+
+#: coffgen.c:1613
+#, c-format
+msgid "%s: bad string table size %lu"
+msgstr ""
+
+#: coffgen.c:2076
+#, c-format
+msgid "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld"
+msgstr ""
+
+#: coff-i960.c:136 coff-i960.c:485
+msgid "uncertain calling convention for non-COFF symbol"
+msgstr ""
+
+#: cofflink.c:518 elflink.h:1568
+#, c-format
+msgid "Warning: type of symbol `%s' changed from %d to %d in %s"
+msgstr ""
+
+#: cofflink.c:2285
+#, c-format
+msgid "%s: relocs in section `%s', but it has no contents"
+msgstr ""
+
+#: cofflink.c:2619 coffswap.h:904
+#, c-format
+msgid "%s: %s: reloc overflow: 0x%lx > 0xffff"
+msgstr ""
+
+#: cofflink.c:2628 coffswap.h:891
+#, c-format
+msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff"
+msgstr ""
+
+#: coff-mips.c:875 elf32-mips.c:1406
+msgid "GP relative relocation when _gp not defined"
+msgstr ""
+
+#: coff-mips.c:2433
+msgid "unsupported reloc type"
+msgstr ""
+
+#. No other sections should appear in -membedded-pic
+#. code.
+#: coff-mips.c:2470
+msgid "reloc against unsupported section"
+msgstr ""
+
+#: coff-mips.c:2478
+msgid "reloc not properly aligned"
+msgstr ""
+
+#: coff-tic80.c:445
+#, c-format
+msgid "Unrecognized reloc type 0x%x"
+msgstr ""
+
+#: coff-w65.c:383
+#, c-format
+msgid "ignoring reloc %s\n"
+msgstr ""
+
+#: dwarf2.c:429
+msgid "Dwarf Error: Can't find .debug_abbrev section."
+msgstr ""
+
+#: dwarf2.c:447
+#, c-format
+msgid "Dwarf Error: Abbrev offset (%u) bigger than abbrev size (%u)."
+msgstr ""
+
+#: dwarf2.c:627
+#, c-format
+msgid "Dwarf Error: Invalid or unhandled FORM value: %d."
+msgstr ""
+
+#: dwarf2.c:700
+msgid "Dwarf Error: mangled line number section (bad file number)."
+msgstr ""
+
+#: dwarf2.c:791
+msgid "Dwarf Error: Can't find .debug_line section."
+msgstr ""
+
+#: dwarf2.c:963
+msgid "Dwarf Error: mangled line number section."
+msgstr ""
+
+#: dwarf2.c:1151 dwarf2.c:1307
+#, c-format
+msgid "Dwarf Error: Could not find abbrev number %d."
+msgstr ""
+
+#: dwarf2.c:1268
+#, c-format
+msgid ""
+"Dwarf Error: found dwarf version '%hu', this reader only handles version 2 "
+"information."
+msgstr ""
+
+#: dwarf2.c:1275
+#, c-format
+msgid ""
+"Dwarf Error: found address size '%u', this reader can not handle sizes "
+"greater than '%u'."
+msgstr ""
+
+#: dwarf2.c:1298
+#, c-format
+msgid "Dwarf Error: Bad abbrev number: %d."
+msgstr ""
+
+#: ecoff.c:1325
+#, c-format
+msgid "Unknown basic type %d"
+msgstr ""
+
+#: ecoff.c:1597
+#, c-format
+msgid ""
+"\n"
+" End+1 symbol: %ld"
+msgstr ""
+
+#: ecoff.c:1604 ecoff.c:1607
+#, c-format
+msgid ""
+"\n"
+" First symbol: %ld"
+msgstr ""
+
+#: ecoff.c:1619
+#, c-format
+msgid ""
+"\n"
+" End+1 symbol: %-7ld Type: %s"
+msgstr ""
+
+#: ecoff.c:1626
+#, c-format
+msgid ""
+"\n"
+" Local symbol: %ld"
+msgstr ""
+
+#: ecoff.c:1634
+#, c-format
+msgid ""
+"\n"
+" struct; End+1 symbol: %ld"
+msgstr ""
+
+#: ecoff.c:1639
+#, c-format
+msgid ""
+"\n"
+" union; End+1 symbol: %ld"
+msgstr ""
+
+#: ecoff.c:1644
+#, c-format
+msgid ""
+"\n"
+" enum; End+1 symbol: %ld"
+msgstr ""
+
+#: ecoff.c:1650
+#, c-format
+msgid ""
+"\n"
+" Type: %s"
+msgstr ""
+
+#: elf32-arm.h:1787 elf32-i386.c:1304 elf32-ppc.c:3092
+#, c-format
+msgid ""
+"%s: warning: unresolvable relocation against symbol `%s' from %s section"
+msgstr ""
+
+#: elf-m10200.c:455 elf-m10300.c:670 elf32-arm.h:1853 elf32-avr.c:844
+#: elf32-d10v.c:493 elf32-fr30.c:651 elf32-m32r.c:1265 elf32-v850.c:1677
+msgid "internal error: out of range error"
+msgstr ""
+
+#: elf-m10200.c:459 elf-m10300.c:674 elf32-arm.h:1857 elf32-avr.c:848
+#: elf32-d10v.c:497 elf32-fr30.c:655 elf32-m32r.c:1269 elf32-v850.c:1681
+msgid "internal error: unsupported relocation error"
+msgstr ""
+
+#: elf-m10200.c:463 elf-m10300.c:678 elf32-arm.h:1861 elf32-d10v.c:501
+#: elf32-m32r.c:1273
+msgid "internal error: dangerous error"
+msgstr ""
+
+#: elf-m10200.c:467 elf-m10300.c:682 elf32-arm.h:1865 elf32-avr.c:856
+#: elf32-d10v.c:505 elf32-fr30.c:663 elf32-m32r.c:1277 elf32-v850.c:1701
+msgid "internal error: unknown error"
+msgstr ""
+
+#: elf32-arm.h:1891
+#, c-format
+msgid ""
+"Warning: Not setting interwork flag of %s since it has already been "
+"specified as non-interworking"
+msgstr ""
+
+#: elf32-arm.h:1895
+#, c-format
+msgid "Warning: Clearing the interwork flag of %s due to outside request"
+msgstr ""
+
+#: elf32-arm.h:1943
+#, c-format
+msgid ""
+"Warning: Clearing the interwork flag in %s because non-interworking code in "
+"%s has been linked with it"
+msgstr ""
+
+#: elf32-arm.h:1977
+#, c-format
+msgid "%s: compiled for a %s endian system and target is %s endian"
+msgstr ""
+
+#: elf32-arm.h:2023
+#, c-format
+msgid "Error: %s compiled for APCS-%d, whereas %s is compiled for APCS-%d"
+msgstr ""
+
+#: elf32-arm.h:2031
+#, c-format
+msgid ""
+"Error: %s passes floats in %s registers, whereas %s passes them in %s "
+"registers"
+msgstr ""
+
+#: elf32-arm.h:2034 elf32-arm.h:2036
+msgid "float"
+msgstr ""
+
+#: elf32-arm.h:2034 elf32-arm.h:2036
+msgid "integer"
+msgstr ""
+
+#: elf32-arm.h:2039
+#, c-format
+msgid "Error: %s is compiled as position %s code, whereas %s is not"
+msgstr ""
+
+#: elf32-arm.h:2042
+msgid "independent"
+msgstr ""
+
+#: elf32-arm.h:2042
+msgid "dependent"
+msgstr ""
+
+#: elf32-arm.h:2048
+#, c-format
+msgid "Warning: %s %s interworking, whereas %s %s"
+msgstr ""
+
+#: elf32-arm.h:2051
+msgid "supports"
+msgstr ""
+
+#: elf32-arm.h:2051
+msgid "does not support"
+msgstr ""
+
+#: elf32-arm.h:2053
+msgid "does not"
+msgstr ""
+
+#: elf32-arm.h:2053
+msgid "does"
+msgstr ""
+
+#. Ignore init flag - it may not be set, despite the flags field containing valid data.
+#: elf32-arm.h:2076 elf32-m68k.c:430 elf32-mips.c:2634
+#, c-format
+msgid "private flags = %lx:"
+msgstr ""
+
+#: elf32-arm.h:2079
+msgid " [interworking enabled]"
+msgstr ""
+
+#: elf32-arm.h:2081
+msgid " [interworking not enabled]"
+msgstr ""
+
+#: elf32-arm.h:2084
+msgid " [APCS-26]"
+msgstr ""
+
+#: elf32-arm.h:2086
+msgid " [APCS-32]"
+msgstr ""
+
+#: elf32-avr.c:852 elf32-fr30.c:659 elf32-v850.c:1685
+msgid "internal error: dangerous relocation"
+msgstr ""
+
+#: elf32-i386.c:239
+#, c-format
+msgid "%s: invalid relocation type %d"
+msgstr ""
+
+#: elf32-m32r.c:916
+msgid "SDA relocation when _SDA_BASE_ not defined"
+msgstr ""
+
+#: elf32-m32r.c:1000 elf32-ppc.c:2963
+#, c-format
+msgid "%s: unknown relocation type %d"
+msgstr ""
+
+#: elf32-m32r.c:1208
+#, c-format
+msgid "%s: The target (%s) of an %s relocation is in the wrong section (%s)"
+msgstr ""
+
+#: elf32-m32r.c:2010
+#, c-format
+msgid "%s: Instruction set mismatch with previous modules"
+msgstr ""
+
+#: elf32-m32r.c:2033
+#, c-format
+msgid "private flags = %lx"
+msgstr ""
+
+#: elf32-m32r.c:2038
+msgid ": m32r instructions"
+msgstr ""
+
+#: elf32-m32r.c:2039
+msgid ": m32rx instructions"
+msgstr ""
+
+#: elf32-m68k.c:433
+msgid " [cpu32]"
+msgstr ""
+
+#: elf32-mcore.c:329
+#, c-format
+msgid "%s: compiled for a %s endian system and target is %s endian.\n"
+msgstr ""
+
+#: elf32-mcore.c:377 elf32-mcore.c:504
+#, c-format
+msgid "%s: Relocation %s (%d) is not currently supported.\n"
+msgstr ""
+
+#: elf32-mcore.c:463
+#, c-format
+msgid "%s: Unknown relocation type %d\n"
+msgstr ""
+
+#: elf32-mips.c:1565
+msgid "32bits gp relative relocation occurs for an external symbol"
+msgstr ""
+
+#: elf32-mips.c:1714
+#, c-format
+msgid "Linking mips16 objects into %s format is not supported"
+msgstr ""
+
+#: elf32-mips.c:2469 elf32-ppc.c:1408
+#, c-format
+msgid "%s: compiled for a big endian system and target is little endian"
+msgstr ""
+
+#: elf32-mips.c:2471 elf32-ppc.c:1410
+#, c-format
+msgid "%s: compiled for a little endian system and target is big endian"
+msgstr ""
+
+#: elf32-mips.c:2520
+#, c-format
+msgid "%s: linking PIC files with non-PIC files"
+msgstr ""
+
+#: elf32-mips.c:2530
+#, c-format
+msgid "%s: linking abicalls files with non-abicalls files"
+msgstr ""
+
+#: elf32-mips.c:2560
+#, c-format
+msgid "%s: ISA mismatch (-mips%d) with previous modules (-mips%d)"
+msgstr ""
+
+#: elf32-mips.c:2569
+#, c-format
+msgid "%s: ISA mismatch (%d) with previous modules (%d)"
+msgstr ""
+
+#: elf32-mips.c:2592
+#, c-format
+msgid "%s: ABI mismatch: linking %s module with previous %s modules"
+msgstr ""
+
+#: elf32-mips.c:2606 elf32-ppc.c:1477 elf64-sparc.c:2844
+#, c-format
+msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"
+msgstr ""
+
+#: elf32-mips.c:2637
+msgid " [abi=O32]"
+msgstr ""
+
+#: elf32-mips.c:2639
+msgid " [abi=O64]"
+msgstr ""
+
+#: elf32-mips.c:2641
+msgid " [abi=EABI32]"
+msgstr ""
+
+#: elf32-mips.c:2643
+msgid " [abi=EABI64]"
+msgstr ""
+
+#: elf32-mips.c:2645
+msgid " [abi unknown]"
+msgstr ""
+
+#: elf32-mips.c:2647
+msgid " [abi=N32]"
+msgstr ""
+
+#: elf32-mips.c:2649
+msgid " [abi=64]"
+msgstr ""
+
+#: elf32-mips.c:2651
+msgid " [no abi set]"
+msgstr ""
+
+#: elf32-mips.c:2654
+msgid " [mips1]"
+msgstr ""
+
+#: elf32-mips.c:2656
+msgid " [mips2]"
+msgstr ""
+
+#: elf32-mips.c:2658
+msgid " [mips3]"
+msgstr ""
+
+#: elf32-mips.c:2660
+msgid " [mips4]"
+msgstr ""
+
+#: elf32-mips.c:2662
+msgid " [unknown ISA]"
+msgstr ""
+
+#: elf32-mips.c:2665
+msgid " [32bitmode]"
+msgstr ""
+
+#: elf32-mips.c:2667
+msgid " [not 32bitmode]"
+msgstr ""
+
+#: elf32-mips.c:4270
+msgid "static procedure (no name)"
+msgstr ""
+
+#: elf32-mips.c:4887 elf64-alpha.c:4364
+#, c-format
+msgid "%s: illegal section name `%s'"
+msgstr ""
+
+#: elf32-mips.c:5414
+msgid "not enough GOT space for local GOT entries"
+msgstr ""
+
+#: elf32-mips.c:6493
+#, c-format
+msgid "%s: %s+0x%lx: jump to stub routine which is not jal"
+msgstr ""
+
+#: elf32-mips.c:7521
+#, c-format
+msgid "%s: CALL16 reloc at 0x%lx not against global symbol"
+msgstr ""
+
+#: elf32-ppc.c:1443
+#, c-format
+msgid ""
+"%s: compiled with -mrelocatable and linked with modules compiled normally"
+msgstr ""
+
+#: elf32-ppc.c:1451
+#, c-format
+msgid ""
+"%s: compiled normally and linked with modules compiled with -mrelocatable"
+msgstr ""
+
+#: elf32-ppc.c:1578
+#, c-format
+msgid "%s: Unknown special linker type %d"
+msgstr ""
+
+#: elf32-ppc.c:2251 elf32-ppc.c:2285 elf32-ppc.c:2320
+#, c-format
+msgid "%s: relocation %s cannot be used when making a shared object"
+msgstr ""
+
+#: elf32-ppc.c:3123
+#, c-format
+msgid "%s: unknown relocation type %d for symbol %s"
+msgstr ""
+
+#: elf32-ppc.c:3491 elf32-ppc.c:3513 elf32-ppc.c:3562
+#, c-format
+msgid ""
+"%s: The target (%s) of a %s relocation is in the wrong output section (%s)"
+msgstr ""
+
+#: elf32-ppc.c:3628
+#, c-format
+msgid "%s: Relocation %s is not yet supported for symbol %s."
+msgstr ""
+
+#: elf32-sh.c:681
+#, c-format
+msgid "%s: 0x%lx: warning: bad R_SH_USES offset"
+msgstr ""
+
+#: elf32-sh.c:693
+#, c-format
+msgid "%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x"
+msgstr ""
+
+#: elf32-sh.c:710
+#, c-format
+msgid "%s: 0x%lx: warning: bad R_SH_USES load offset"
+msgstr ""
+
+#: elf32-sh.c:725
+#, c-format
+msgid "%s: 0x%lx: warning: could not find expected reloc"
+msgstr ""
+
+#: elf32-sh.c:762
+#, c-format
+msgid "%s: 0x%lx: warning: symbol in unexpected section"
+msgstr ""
+
+#: elf32-sh.c:884
+#, c-format
+msgid "%s: 0x%lx: warning: could not find expected COUNT reloc"
+msgstr ""
+
+#: elf32-sh.c:893
+#, c-format
+msgid "%s: 0x%lx: warning: bad count"
+msgstr ""
+
+#: elf32-sh.c:1279 elf32-sh.c:1666
+#, c-format
+msgid "%s: 0x%lx: fatal: reloc overflow while relaxing"
+msgstr ""
+
+#: elf32-sparc.c:1486 elf64-sparc.c:2242
+#, c-format
+msgid "%s: probably compiled without -fPIC?"
+msgstr ""
+
+#: elf32-sparc.c:1856
+#, c-format
+msgid "%s: compiled for a v8plus system and target is v8"
+msgstr ""
+
+#: elf32-sparc.c:1865
+#, c-format
+msgid "%s: compiled for a v8plusa system and target is v8plus"
+msgstr ""
+
+#: elf32-sparc.c:1873
+#, c-format
+msgid "%s: compiled for a 64 bit system and target is 32 bit"
+msgstr ""
+
+#: elf32-sparc.c:1888
+#, c-format
+msgid "%s: linking little endian files with big endian files"
+msgstr ""
+
+#: elf32-v850.c:680
+#, c-format
+msgid "Variable `%s' cannot occupy in multiple small data regions"
+msgstr ""
+
+#: elf32-v850.c:683
+#, c-format
+msgid ""
+"Variable `%s' can only be in one of the small, zero, and tiny data regions"
+msgstr ""
+
+#: elf32-v850.c:686
+#, c-format
+msgid ""
+"Variable `%s' cannot be in both small and zero data regions simultaneously"
+msgstr ""
+
+#: elf32-v850.c:689
+#, c-format
+msgid ""
+"Variable `%s' cannot be in both small and tiny data regions simultaneously"
+msgstr ""
+
+#: elf32-v850.c:692
+#, c-format
+msgid ""
+"Variable `%s' cannot be in both zero and tiny data regions simultaneously"
+msgstr ""
+
+#: elf32-v850.c:1070
+msgid "FAILED to find previous HI16 reloc\n"
+msgstr ""
+
+#: elf32-v850.c:1689
+msgid "could not locate special linker symbol __gp"
+msgstr ""
+
+#: elf32-v850.c:1693
+msgid "could not locate special linker symbol __ep"
+msgstr ""
+
+#: elf32-v850.c:1697
+msgid "could not locate special linker symbol __ctbp"
+msgstr ""
+
+#: elf32-v850.c:1886
+#, c-format
+msgid "%s: Architecture mismatch with previous modules"
+msgstr ""
+
+#: elf32-v850.c:1905
+#, c-format
+msgid "private flags = %lx: "
+msgstr ""
+
+#: elf32-v850.c:1910
+msgid "v850 architecture"
+msgstr ""
+
+#: elf32-v850.c:1911
+msgid "v850e architecture"
+msgstr ""
+
+#: elf32-v850.c:1912
+msgid "v850ea architecture"
+msgstr ""
+
+#: elf64-alpha.c:951
+msgid "GPDISP relocation did not find ldah and lda instructions"
+msgstr ""
+
+#: elf64-alpha.c:3004
+#, c-format
+msgid "%s: .got subsegment exceeds 64K (size %d)"
+msgstr ""
+
+#: elf64-sparc.c:1249
+#, c-format
+msgid "%s: check_relocs: unhandled reloc type %d"
+msgstr ""
+
+#: elf64-sparc.c:1286
+msgid "%s: Only registers %%g[2367] can be declared using STT_REGISTER"
+msgstr ""
+
+#: elf64-sparc.c:1306
+msgid ""
+"Register %%g%d used incompatibly: previously declared in %s to %s, in %s "
+"redefined to %s"
+msgstr ""
+
+#: elf64-sparc.c:1329
+#, c-format
+msgid "Symbol `%s' has differing types: previously %s, REGISTER in %s"
+msgstr ""
+
+#: elf64-sparc.c:1375
+#, c-format
+msgid "Symbol `%s' has differing types: REGISTER in %s, %s in %s"
+msgstr ""
+
+#: elf64-sparc.c:2825
+#, c-format
+msgid "%s: linking UltraSPARC specific with HAL specific code"
+msgstr ""
+
+#: elf.c:323
+#, c-format
+msgid "%s: invalid string offset %u >= %lu for section `%s'"
+msgstr ""
+
+#: elf.c:546
+msgid ""
+"\n"
+"Program Header:\n"
+msgstr ""
+
+#: elf.c:594
+msgid ""
+"\n"
+"Dynamic Section:\n"
+msgstr ""
+
+#: elf.c:696
+msgid ""
+"\n"
+"Version definitions:\n"
+msgstr ""
+
+#: elf.c:719
+msgid ""
+"\n"
+"Version References:\n"
+msgstr ""
+
+#: elf.c:724
+#, c-format
+msgid " required from %s:\n"
+msgstr ""
+
+#: elf.c:1286
+#, c-format
+msgid "%s: invalid link %lu for reloc section %s (index %u)"
+msgstr ""
+
+#: elf.c:2045
+#, c-format
+msgid ""
+"creating section symbol, name = %s, value = 0x%.8lx, index = %d, section = "
+"0x%.8lx\n"
+msgstr ""
+
+#: elf.c:2648
+#, c-format
+msgid "%s: Not enough room for program headers (allocated %u, need %u)"
+msgstr ""
+
+#: elf.c:2747
+#, c-format
+msgid "%s: Not enough room for program headers, try linking with -N"
+msgstr ""
+
+#: elf.c:2873
+#, c-format
+msgid "Error: First section in segment (%s) starts at 0x%x"
+msgstr ""
+
+#: elf.c:2876
+#, c-format
+msgid " whereas segment starts at 0x%x"
+msgstr ""
+
+#: elf.c:3146
+#, c-format
+msgid "%s: warning: allocated section `%s' not in segment"
+msgstr ""
+
+#: elf.c:3528
+#, c-format
+msgid "%s: symbol `%s' required but not present"
+msgstr ""
+
+#: elf.c:3537
+#, c-format
+msgid ""
+"elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = "
+"0x%.8lx%s\n"
+msgstr ""
+
+#: elf.c:3679
+#, c-format
+msgid "%s: warning: Empty loadable segment detected\n"
+msgstr ""
+
+#: elf.c:4956
+#, c-format
+msgid "%s: unsupported relocation type %s"
+msgstr ""
+
+#: elfcode.h:1061
+#, c-format
+msgid "%s: version count (%ld) does not match symbol count (%ld)"
+msgstr ""
+
+#: elflink.c:423
+#, c-format
+msgid "%s: Section %s is already to large to put hole of %ld bytes in"
+msgstr ""
+
+#: elflink.h:1388
+#, c-format
+msgid "%s: %s: invalid version %u (max %d)"
+msgstr ""
+
+#: elflink.h:1429
+#, c-format
+msgid "%s: %s: invalid needed version %d"
+msgstr ""
+
+#: elflink.h:1546
+#, c-format
+msgid "Warning: size of symbol `%s' changed from %lu to %lu in %s"
+msgstr ""
+
+#: elflink.h:1790
+#, c-format
+msgid "%s: warning: unexpected redefinition of `%s'"
+msgstr ""
+
+#: elflink.h:3480
+#, c-format
+msgid "warning: type and size of dynamic symbol `%s' are not defined"
+msgstr ""
+
+#: elflink.h:3752
+#, c-format
+msgid "%s: undefined versioned symbol name %s"
+msgstr ""
+
+#: elflink.h:4983
+#, c-format
+msgid "%s: could not find output section %s for input section %s"
+msgstr ""
+
+#: i386linux.c:450 m68klinux.c:454 sparclinux.c:452
+#, c-format
+msgid "Output file requires shared library `%s'\n"
+msgstr ""
+
+#: i386linux.c:458 m68klinux.c:462 sparclinux.c:460
+#, c-format
+msgid "Output file requires shared library `%s.so.%s'\n"
+msgstr ""
+
+#: i386linux.c:646 i386linux.c:696 m68klinux.c:653 m68klinux.c:701
+#: sparclinux.c:649 sparclinux.c:699
+#, c-format
+msgid "Symbol %s not defined for fixups\n"
+msgstr ""
+
+#: i386linux.c:720 m68klinux.c:725 sparclinux.c:723
+msgid "Warning: fixup count mismatch\n"
+msgstr ""
+
+#: ieee.c:167
+#, c-format
+msgid "%s: string too long (%d chars, max 65535)"
+msgstr ""
+
+#: ieee.c:297
+#, c-format
+msgid "%s: unrecognized symbol `%s' flags 0x%x"
+msgstr ""
+
+#: ieee.c:793
+#, c-format
+msgid "%s: unimplemented ATI record %u for symbol %u"
+msgstr ""
+
+#: ieee.c:818
+#, c-format
+msgid "%s: unexpected ATN type %d in external part"
+msgstr ""
+
+#: ieee.c:840
+#, c-format
+msgid "%s: unexpected type after ATN"
+msgstr ""
+
+#: ihex.c:259
+#, c-format
+msgid "%s:%d: unexpected character `%s' in Intel Hex file\n"
+msgstr ""
+
+#: ihex.c:369
+#, c-format
+msgid "%s:%d: bad checksum in Intel Hex file (expected %u, found %u)"
+msgstr ""
+
+#: ihex.c:421
+#, c-format
+msgid "%s:%d: bad extended address record length in Intel Hex file"
+msgstr ""
+
+#: ihex.c:438
+#, c-format
+msgid "%s:%d: bad extended start address length in Intel Hex file"
+msgstr ""
+
+#: ihex.c:455
+#, c-format
+msgid "%s:%d: bad extended linear address record length in Intel Hex file"
+msgstr ""
+
+#: ihex.c:472
+#, c-format
+msgid "%s:%d: bad extended linear start address length in Intel Hex file"
+msgstr ""
+
+#: ihex.c:489
+#, c-format
+msgid "%s:%d: unrecognized ihex type %u in Intel Hex file\n"
+msgstr ""
+
+#: ihex.c:609
+#, c-format
+msgid "%s: internal error in ihex_read_section"
+msgstr ""
+
+#: ihex.c:644
+#, c-format
+msgid "%s: bad section length in ihex_read_section"
+msgstr ""
+
+#: ihex.c:858
+#, c-format
+msgid "%s: address 0x%s out of range for Intex Hex file"
+msgstr ""
+
+#: libbfd.c:484
+#, c-format
+msgid "not mapping: data=%lx mapped=%d\n"
+msgstr ""
+
+#: libbfd.c:487
+msgid "not mapping: env var not set\n"
+msgstr ""
+
+#: linker.c:2679
+#, c-format
+msgid "Attempt to do relocateable link with %s input and %s output"
+msgstr ""
+
+#: oasys.c:1016
+#, c-format
+msgid "%s: can not represent section `%s' in oasys"
+msgstr ""
+
+#: osf-core.c:146
+#, c-format
+msgid "Unhandled OSF/1 core file section type %d\n"
+msgstr ""
+
+#. XXX code yet to be written.
+#: peicode.h:806
+#, c-format
+msgid "%s: Unhandled import type; %x"
+msgstr ""
+
+#: peicode.h:811
+#, c-format
+msgid "%s: Unrecognised import type; %x"
+msgstr ""
+
+#: peicode.h:825
+#, c-format
+msgid "%s: Unrecognised import name type; %x"
+msgstr ""
+
+#: peicode.h:1182
+#, c-format
+msgid "%s: Unrecognised machine type (0x%x) in Import Library Format archive"
+msgstr ""
+
+#: peicode.h:1194
+#, c-format
+msgid ""
+"%s: Recognised but unhandled machine type (0x%x) in Import Library Format "
+"archive"
+msgstr ""
+
+#: peicode.h:1211
+#, c-format
+msgid "%s: size field is zero in Import Library Format header"
+msgstr ""
+
+#: peicode.h:1239
+#, c-format
+msgid "%s: string not null terminated in ILF object file."
+msgstr ""
+
+#: peigen.c:938
+#, c-format
+msgid "%s: line number overflow: 0x%lx > 0xffff"
+msgstr ""
+
+#: peigen.c:950
+#, c-format
+msgid "%s: reloc overflow: 0x%lx > 0xffff"
+msgstr ""
+
+#: peigen.c:963
+msgid "Export Directory [.edata (or where ever we found it)]"
+msgstr ""
+
+#: peigen.c:964
+msgid "Import Directory [parts of .idata]"
+msgstr ""
+
+#: peigen.c:965
+msgid "Resource Directory [.rsrc]"
+msgstr ""
+
+#: peigen.c:966
+msgid "Exception Directory [.pdata]"
+msgstr ""
+
+#: peigen.c:967
+msgid "Security Directory"
+msgstr ""
+
+#: peigen.c:968
+msgid "Base Relocation Directory [.reloc]"
+msgstr ""
+
+#: peigen.c:969
+msgid "Debug Directory"
+msgstr ""
+
+#: peigen.c:970
+msgid "Description Directory"
+msgstr ""
+
+#: peigen.c:971
+msgid "Special Directory"
+msgstr ""
+
+#: peigen.c:972
+msgid "Thread Storage Directory [.tls]"
+msgstr ""
+
+#: peigen.c:973
+msgid "Load Configuration Directory"
+msgstr ""
+
+#: peigen.c:974
+msgid "Bound Import Directory"
+msgstr ""
+
+#: peigen.c:975
+msgid "Import Address Table Directory"
+msgstr ""
+
+#: peigen.c:976 peigen.c:977 peigen.c:978
+msgid "Reserved"
+msgstr ""
+
+#: peigen.c:1022
+msgid ""
+"\n"
+"The import table is the .idata section\n"
+msgstr ""
+
+#: peigen.c:1044
+msgid ""
+"\n"
+"There is an import table, but the section containing it could not be found\n"
+msgstr ""
+
+#: peigen.c:1048
+#, c-format
+msgid ""
+"\n"
+"There is an import table in %s at 0x%lx\n"
+msgstr ""
+
+#: peigen.c:1089
+#, c-format
+msgid ""
+"\n"
+"Function descriptor located at the start address: %04lx\n"
+msgstr ""
+
+#: peigen.c:1092
+#, c-format
+msgid "\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n"
+msgstr ""
+
+#: peigen.c:1098
+msgid ""
+"\n"
+"No reldata section! Function descriptor not decoded.\n"
+msgstr ""
+
+#: peigen.c:1103
+msgid ""
+"\n"
+"The Import Tables (interpreted .idata section contents)\n"
+msgstr ""
+
+#: peigen.c:1105
+msgid " vma: Hint Time Forward DLL First\n"
+msgstr ""
+
+#: peigen.c:1107
+msgid " Table Stamp Chain Name Thunk\n"
+msgstr ""
+
+#: peigen.c:1157
+#, c-format
+msgid ""
+"\n"
+"\tDLL Name: %s\n"
+msgstr ""
+
+#: peigen.c:1161 peigen.c:1224
+msgid "\tvma: Hint/Ord Member-Name\n"
+msgstr ""
+
+#: peigen.c:1223
+msgid "\tThe Import Address Table (difference found)\n"
+msgstr ""
+
+#: peigen.c:1230
+msgid "\t>>> Ran out of IAT members!\n"
+msgstr ""
+
+#: peigen.c:1248
+msgid "\tThe Import Address Table is identical\n"
+msgstr ""
+
+#: peigen.c:1297
+msgid ""
+"\n"
+"The export table is the .edata section\n"
+msgstr ""
+
+#: peigen.c:1319
+msgid ""
+"\n"
+"There is an export table, but the section containing it could not be found\n"
+msgstr ""
+
+#: peigen.c:1323
+#, c-format
+msgid ""
+"\n"
+"There is an export table in %s at 0x%lx\n"
+msgstr ""
+
+#: peigen.c:1355
+msgid ""
+"\n"
+"The Export Tables (interpreted .edata section contents)\n"
+"\n"
+msgstr ""
+
+#: peigen.c:1358
+#, c-format
+msgid "Export Flags \t\t\t%lx\n"
+msgstr ""
+
+#: peigen.c:1361
+#, c-format
+msgid "Time/Date stamp \t\t%lx\n"
+msgstr ""
+
+#: peigen.c:1364
+#, c-format
+msgid "Major/Minor \t\t\t%d/%d\n"
+msgstr ""
+
+#: peigen.c:1367
+msgid "Name \t\t\t\t"
+msgstr ""
+
+#: peigen.c:1373
+#, c-format
+msgid "Ordinal Base \t\t\t%ld\n"
+msgstr ""
+
+#: peigen.c:1376
+msgid "Number in:\n"
+msgstr ""
+
+#: peigen.c:1379
+#, c-format
+msgid "\tExport Address Table \t\t%lx\n"
+msgstr ""
+
+#: peigen.c:1383
+#, c-format
+msgid "\t[Name Pointer/Ordinal] Table\t%lu\n"
+msgstr ""
+
+#: peigen.c:1386
+msgid "Table Addresses\n"
+msgstr ""
+
+#: peigen.c:1389
+msgid "\tExport Address Table \t\t"
+msgstr ""
+
+#: peigen.c:1394
+msgid "\tName Pointer Table \t\t"
+msgstr ""
+
+#: peigen.c:1399
+msgid "\tOrdinal Table \t\t\t"
+msgstr ""
+
+#: peigen.c:1415
+#, c-format
+msgid ""
+"\n"
+"Export Address Table -- Ordinal Base %ld\n"
+msgstr ""
+
+#: peigen.c:1436
+msgid "Forwarder RVA"
+msgstr ""
+
+#: peigen.c:1444
+msgid "Export RVA"
+msgstr ""
+
+#: peigen.c:1451
+msgid ""
+"\n"
+"[Ordinal/Name Pointer] Table\n"
+msgstr ""
+
+#: peigen.c:1496
+#, c-format
+msgid "Warning, .pdata section size (%ld) is not a multiple of %d\n"
+msgstr ""
+
+#: peigen.c:1500
+msgid ""
+"\n"
+"The Function Table (interpreted .pdata section contents)\n"
+msgstr ""
+
+#: peigen.c:1502
+msgid " vma:\t\tBegin End EH EH PrologEnd Exception\n"
+msgstr ""
+
+#: peigen.c:1504
+msgid " \t\tAddress Address Handler Data Address Mask\n"
+msgstr ""
+
+#: peigen.c:1576
+msgid " Register save millicode"
+msgstr ""
+
+#: peigen.c:1579
+msgid " Register restore millicode"
+msgstr ""
+
+#: peigen.c:1582
+msgid " Glue code sequence"
+msgstr ""
+
+#: peigen.c:1628
+msgid ""
+"\n"
+"\n"
+"PE File Base Relocations (interpreted .reloc section contents)\n"
+msgstr ""
+
+#: peigen.c:1663
+#, c-format
+msgid ""
+"\n"
+"Virtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n"
+msgstr ""
+
+#: peigen.c:1676
+#, c-format
+msgid "\treloc %4d offset %4x [%4lx] %s"
+msgstr ""
+
+#. The MS dumpbin program reportedly ands with 0xff0f before
+#. printing the characteristics field. Not sure why. No reason to
+#. emulate it here.
+#: peigen.c:1714
+#, c-format
+msgid ""
+"\n"
+"Characteristics 0x%x\n"
+msgstr ""
+
+#: pe-mips.c:657
+#, c-format
+msgid "%s: `ld -r' not supported with PE MIPS objects\n"
+msgstr ""
+
+#: pe-mips.c:820
+#, c-format
+msgid "%s: jump too far away\n"
+msgstr ""
+
+#: pe-mips.c:847
+#, c-format
+msgid "%s: bad pair/reflo after refhi\n"
+msgstr ""
+
+#: ppcboot.c:418
+msgid ""
+"\n"
+"ppcboot header:\n"
+msgstr ""
+
+#: ppcboot.c:419
+#, c-format
+msgid "Entry offset = 0x%.8lx (%ld)\n"
+msgstr ""
+
+#: ppcboot.c:420
+#, c-format
+msgid "Length = 0x%.8lx (%ld)\n"
+msgstr ""
+
+#: ppcboot.c:423
+#, c-format
+msgid "Flag field = 0x%.2x\n"
+msgstr ""
+
+#: ppcboot.c:429
+#, c-format
+msgid "Partition name = \"%s\"\n"
+msgstr ""
+
+#: ppcboot.c:448
+#, c-format
+msgid ""
+"\n"
+"Partition[%d] start = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n"
+msgstr ""
+
+#: ppcboot.c:454
+#, c-format
+msgid "Partition[%d] end = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n"
+msgstr ""
+
+#: ppcboot.c:460
+#, c-format
+msgid "Partition[%d] sector = 0x%.8lx (%ld)\n"
+msgstr ""
+
+#: ppcboot.c:461
+#, c-format
+msgid "Partition[%d] length = 0x%.8lx (%ld)\n"
+msgstr ""
+
+#: som.c:5335
+msgid "som_sizeof_headers unimplemented"
+msgstr ""
+
+#: srec.c:290
+#, c-format
+msgid "%s:%d: Unexpected character `%s' in S-record file\n"
+msgstr ""
+
+#: syms.c:974
+msgid "Unsupported .stab relocation"
+msgstr ""
+
+#: vms-gsd.c:357
+#, c-format
+msgid "bfd_make_section (%s) failed"
+msgstr ""
+
+#: vms-gsd.c:371
+#, c-format
+msgid "bfd_set_section_flags (%s, %x) failed"
+msgstr ""
+
+#: vms-gsd.c:407
+#, c-format
+msgid "Size mismatch section %s=%lx, %s=%lx"
+msgstr ""
+
+#: vms-gsd.c:702
+#, c-format
+msgid "unknown gsd/egsd subtype %d"
+msgstr ""
+
+#: vms-hdr.c:405
+msgid "Object module NOT error-free !\n"
+msgstr ""
+
+#: vms-misc.c:541
+#, c-format
+msgid "Stack overflow (%d) in _bfd_vms_push"
+msgstr ""
+
+#: vms-misc.c:560
+msgid "Stack underflow in _bfd_vms_pop"
+msgstr ""
+
+#: vms-misc.c:931
+msgid "_bfd_vms_output_counted called with zero bytes"
+msgstr ""
+
+#: vms-misc.c:936
+msgid "_bfd_vms_output_counted called with too many bytes"
+msgstr ""
+
+#: vms-misc.c:1069
+#, c-format
+msgid "Symbol %s replaced by %s\n"
+msgstr ""
+
+#: vms-misc.c:1133
+#, c-format
+msgid "failed to enter %s"
+msgstr ""
+
+#: vms-tir.c:69
+msgid "No Mem !"
+msgstr ""
+
+#: vms-tir.c:309
+msgid "Bad section index in ETIR_S_C_STA_PQ"
+msgstr ""
+
+#: vms-tir.c:324
+#, c-format
+msgid "Unsupported STA cmd %d"
+msgstr ""
+
+#: vms-tir.c:329 vms-tir.c:1287
+#, c-format
+msgid "Reserved STA cmd %d"
+msgstr ""
+
+#: vms-tir.c:436
+#, c-format
+msgid "ETIR_S_C_STO_GBL: no symbol \"%s\""
+msgstr ""
+
+#: vms-tir.c:457
+#, c-format
+msgid "ETIR_S_C_STO_CA: no symbol \"%s\""
+msgstr ""
+
+#: vms-tir.c:470
+msgid "ETIR_S_C_STO_RB/AB: Not supported"
+msgstr ""
+
+#: vms-tir.c:528
+msgid "ETIR_S_C_STO_LP_PSB: Not supported"
+msgstr ""
+
+#: vms-tir.c:534
+msgid "ETIR_S_C_STO_HINT_GBL: not implemented"
+msgstr ""
+
+#: vms-tir.c:540
+msgid "ETIR_S_C_STO_HINT_PS: not implemented"
+msgstr ""
+
+#: vms-tir.c:544 vms-tir.c:1460
+#, c-format
+msgid "Reserved STO cmd %d"
+msgstr ""
+
+#: vms-tir.c:657
+msgid "ETIR_S_C_OPR_INSV: Not supported"
+msgstr ""
+
+#: vms-tir.c:675
+msgid "ETIR_S_C_OPR_USH: Not supported"
+msgstr ""
+
+#: vms-tir.c:681
+msgid "ETIR_S_C_OPR_ROT: Not supported"
+msgstr ""
+
+#: vms-tir.c:700
+msgid "ETIR_S_C_OPR_REDEF: Not supported"
+msgstr ""
+
+#: vms-tir.c:706
+msgid "ETIR_S_C_OPR_DFLIT: Not supported"
+msgstr ""
+
+#: vms-tir.c:710 vms-tir.c:1656
+#, c-format
+msgid "Reserved OPR cmd %d"
+msgstr ""
+
+#: vms-tir.c:779 vms-tir.c:1726
+#, c-format
+msgid "Reserved CTL cmd %d"
+msgstr ""
+
+#: vms-tir.c:808
+msgid "ETIR_S_C_STC_LP: not supported"
+msgstr ""
+
+#: vms-tir.c:826
+msgid "ETIR_S_C_STC_GBL: not supported"
+msgstr ""
+
+#: vms-tir.c:834
+msgid "ETIR_S_C_STC_GCA: not supported"
+msgstr ""
+
+#: vms-tir.c:843
+msgid "ETIR_S_C_STC_PS: not supported"
+msgstr ""
+
+#.
+#. * stack byte from image
+#. * arg: -
+#. *
+#.
+#: vms-tir.c:1187
+msgid "Stack-from-image not implemented"
+msgstr ""
+
+#: vms-tir.c:1207
+msgid "Stack-entry-mask not fully implemented"
+msgstr ""
+
+#.
+#. * compare procedure argument
+#. * arg: cs symbol name
+#. * by argument index
+#. * da argument descriptor
+#. *
+#. * compare argument descriptor with symbol argument (ARG$V_PASSMECH)
+#. * and stack TRUE (args match) or FALSE (args dont match) value
+#.
+#: vms-tir.c:1223
+msgid "PASSMECH not fully implemented"
+msgstr ""
+
+#: vms-tir.c:1243
+msgid "Stack-local-symbol not fully implemented"
+msgstr ""
+
+#: vms-tir.c:1258
+msgid "Stack-literal not fully implemented"
+msgstr ""
+
+#: vms-tir.c:1280
+msgid "Stack-local-symbol-entry-point-mask not fully implemented"
+msgstr ""
+
+#: vms-tir.c:1456
+#, c-format
+msgid "Unimplemented STO cmd %d"
+msgstr ""
+
+#: vms-tir.c:1596
+msgid "TIR_S_C_OPR_ASH incomplete"
+msgstr ""
+
+#: vms-tir.c:1610
+msgid "TIR_S_C_OPR_USH incomplete"
+msgstr ""
+
+#: vms-tir.c:1624
+msgid "TIR_S_C_OPR_ROT incomplete"
+msgstr ""
+
+#.
+#. * redefine symbol to current location
+#.
+#: vms-tir.c:1645
+msgid "TIR_S_C_OPR_REDEF not supported"
+msgstr ""
+
+#.
+#. * define a literal
+#.
+#: vms-tir.c:1652
+msgid "TIR_S_C_OPR_DFLIT not supported"
+msgstr ""
+
+#: vms-tir.c:1707
+msgid "TIR_S_C_CTL_DFLOC not fully implemented"
+msgstr ""
+
+#: vms-tir.c:1715
+msgid "TIR_S_C_CTL_STLOC not fully implemented"
+msgstr ""
+
+#: vms-tir.c:1723
+msgid "TIR_S_C_CTL_STKDL not fully implemented"
+msgstr ""
+
+#: vms-tir.c:1778
+#, c-format
+msgid "Obj code %d not found"
+msgstr ""
+
+#: vms-tir.c:2127
+#, c-format
+msgid "SEC_RELOC with no relocs in section %s"
+msgstr ""
+
+#: vms-tir.c:2401
+#, c-format
+msgid "Unhandled relocation %s"
+msgstr ""
+
+#: xcofflink.c:1661
+#, c-format
+msgid "%s: `%s' has line numbers but no enclosing section"
+msgstr ""
+
+#: xcofflink.c:1713
+#, c-format
+msgid "%s: class %d symbol `%s' has no aux entries"
+msgstr ""
+
+#: xcofflink.c:1736
+#, c-format
+msgid "%s: symbol `%s' has unrecognized csect type %d"
+msgstr ""
+
+#: xcofflink.c:1748
+#, c-format
+msgid "%s: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d"
+msgstr ""
+
+#: xcofflink.c:1787
+#, c-format
+msgid "%s: XMC_TC0 symbol `%s' is class %d scnlen %d"
+msgstr ""
+
+#: xcofflink.c:1911
+#, c-format
+msgid "%s: symbol `%s' has unrecognized smclas %d"
+msgstr ""
+
+#: xcofflink.c:1930
+#, c-format
+msgid "%s: csect `%s' not in enclosing section"
+msgstr ""
+
+#: xcofflink.c:2034
+#, c-format
+msgid "%s: misplaced XTY_LD `%s'"
+msgstr ""
+
+#: xcofflink.c:2345
+#, c-format
+msgid "%s: reloc %s:%d not in csect"
+msgstr ""
+
+#: xcofflink.c:2480
+#, c-format
+msgid "%s: XCOFF shared object when not producing XCOFF output"
+msgstr ""
+
+#: xcofflink.c:2501
+#, c-format
+msgid "%s: dynamic object with no .loader section"
+msgstr ""
+
+#: xcofflink.c:3141
+#, c-format
+msgid "%s: no such symbol"
+msgstr ""
+
+#: xcofflink.c:3733
+#, c-format
+msgid "warning: attempt to export undefined symbol `%s'"
+msgstr ""
+
+#: xcofflink.c:4709
+#, c-format
+msgid "TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling"
+msgstr ""
+
+#: xcofflink.c:5534 xcofflink.c:5890 xcofflink.c:5927 xcofflink.c:6244
+#, c-format
+msgid "%s: loader reloc in unrecognized section `%s'"
+msgstr ""
+
+#: xcofflink.c:5556 xcofflink.c:6255
+#, c-format
+msgid "%s: `%s' in loader reloc but not loader sym"
+msgstr ""
+
+#: xcofflink.c:5571
+#, c-format
+msgid "%s: loader reloc in read-only section %s"
+msgstr ""
+
+#: xcofflink.c:6451
+#, c-format
+msgid "%s: unsupported relocation type 0x%02x"
+msgstr ""
+
+#: xcofflink.c:6497
+#, c-format
+msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry"
+msgstr ""
diff --git a/contrib/binutils/bfd/ppcboot.c b/contrib/binutils/bfd/ppcboot.c
new file mode 100644
index 000000000000..d9db8268d478
--- /dev/null
+++ b/contrib/binutils/bfd/ppcboot.c
@@ -0,0 +1,537 @@
+/* BFD back-end for PPCbug boot records.
+ Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Written by Michael Meissner, Cygnus Support, <meissner@cygnus.com>
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* This is a BFD backend which may be used to write PowerPCBug boot objects.
+ It may only be used for output, not input. The intention is that this may
+ be used as an output format for objcopy in order to generate raw binary
+ data.
+
+ This is very simple. The only complication is that the real data
+ will start at some address X, and in some cases we will not want to
+ include X zeroes just to get to that point. Since the start
+ address is not meaningful for this object file format, we use it
+ instead to indicate the number of zeroes to skip at the start of
+ the file. objcopy cooperates by specially setting the start
+ address to zero by default. */
+
+#include <ctype.h>
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+
+/* PPCbug location structure */
+typedef struct ppcboot_location {
+ bfd_byte ind;
+ bfd_byte head;
+ bfd_byte sector;
+ bfd_byte cylinder;
+} ppcboot_location_t;
+
+/* PPCbug partition table layout */
+typedef struct ppcboot_partition {
+ ppcboot_location_t partition_begin; /* partition begin */
+ ppcboot_location_t partition_end; /* partition end */
+ bfd_byte sector_begin[4]; /* 32-bit start RBA (zero-based), little endian */
+ bfd_byte sector_length[4]; /* 32-bit RBA count (one-based), little endian */
+} ppcboot_partition_t;
+
+/* PPCbug boot layout. */
+typedef struct ppcboot_hdr {
+ bfd_byte pc_compatibility[446]; /* x86 instruction field */
+ ppcboot_partition_t partition[4]; /* partition information */
+ bfd_byte signature[2]; /* 0x55 and 0xaa */
+ bfd_byte entry_offset[4]; /* entry point offset, little endian */
+ bfd_byte length[4]; /* load image length, little endian */
+ bfd_byte flags; /* flag field */
+ bfd_byte os_id; /* OS_ID */
+ char partition_name[32]; /* partition name */
+ bfd_byte reserved1[470]; /* reserved */
+} ppcboot_hdr_t;
+
+/* Signature bytes for last 2 bytes of the 512 byte record */
+#define SIGNATURE0 0x55
+#define SIGNATURE1 0xaa
+
+/* PowerPC boot type */
+#define PPC_IND 0x41
+
+/* Information needed for ppcboot header */
+typedef struct ppcboot_data {
+ ppcboot_hdr_t header; /* raw header */
+ asection *sec; /* single section */
+} ppcboot_data_t;
+
+/* Any bfd we create by reading a ppcboot file has three symbols:
+ a start symbol, an end symbol, and an absolute length symbol. */
+#define PPCBOOT_SYMS 3
+
+static boolean ppcboot_mkobject PARAMS ((bfd *));
+static const bfd_target *ppcboot_object_p PARAMS ((bfd *));
+static boolean ppcboot_set_arch_mach
+ PARAMS ((bfd *, enum bfd_architecture, unsigned long));
+static boolean ppcboot_get_section_contents
+ PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
+static long ppcboot_get_symtab_upper_bound PARAMS ((bfd *));
+static char *mangle_name PARAMS ((bfd *, char *));
+static long ppcboot_get_symtab PARAMS ((bfd *, asymbol **));
+static asymbol *ppcboot_make_empty_symbol PARAMS ((bfd *));
+static void ppcboot_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *));
+static boolean ppcboot_set_section_contents
+ PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
+static int ppcboot_sizeof_headers PARAMS ((bfd *, boolean));
+static boolean ppcboot_bfd_print_private_bfd_data PARAMS ((bfd *, PTR));
+
+#define ppcboot_set_tdata(abfd, ptr) ((abfd)->tdata.any = (PTR) (ptr))
+#define ppcboot_get_tdata(abfd) ((ppcboot_data_t *) ((abfd)->tdata.any))
+
+/* Create a ppcboot object. Invoked via bfd_set_format. */
+
+static boolean
+ppcboot_mkobject (abfd)
+ bfd *abfd;
+{
+ if (!ppcboot_get_tdata (abfd))
+ ppcboot_set_tdata (abfd, bfd_zalloc (abfd, sizeof (ppcboot_data_t)));
+
+ return true;
+}
+
+
+/* Set the architecture to PowerPC */
+static boolean
+ppcboot_set_arch_mach (abfd, arch, machine)
+ bfd *abfd;
+ enum bfd_architecture arch;
+ unsigned long machine;
+{
+ if (arch == bfd_arch_unknown)
+ arch = bfd_arch_powerpc;
+
+ else if (arch != bfd_arch_powerpc)
+ return false;
+
+ return bfd_default_set_arch_mach (abfd, arch, machine);
+}
+
+
+/* Any file may be considered to be a ppcboot file, provided the target
+ was not defaulted. That is, it must be explicitly specified as
+ being ppcboot. */
+
+static const bfd_target *
+ppcboot_object_p (abfd)
+ bfd *abfd;
+{
+ struct stat statbuf;
+ asection *sec;
+ ppcboot_hdr_t hdr;
+ size_t i;
+ ppcboot_data_t *tdata;
+
+ BFD_ASSERT (sizeof (ppcboot_hdr_t) == 1024);
+
+ if (abfd->target_defaulted)
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+
+ /* Find the file size. */
+ if (bfd_stat (abfd, &statbuf) < 0)
+ {
+ bfd_set_error (bfd_error_system_call);
+ return NULL;
+ }
+
+ if ((size_t) statbuf.st_size < sizeof (ppcboot_hdr_t))
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+
+ if (bfd_read ((PTR) &hdr, sizeof (hdr), 1, abfd) != sizeof (hdr))
+ {
+ if (bfd_get_error () != bfd_error_system_call)
+ bfd_set_error (bfd_error_wrong_format);
+
+ return NULL;
+ }
+
+ /* Now do some basic checks. */
+ for (i = 0; i < sizeof (hdr.pc_compatibility); i++)
+ if (hdr.pc_compatibility[i])
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+
+ if (hdr.signature[0] != SIGNATURE0 || hdr.signature[1] != SIGNATURE1)
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+
+ if (hdr.partition[0].partition_end.ind != PPC_IND)
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+
+ abfd->symcount = PPCBOOT_SYMS;
+
+ /* One data section. */
+ sec = bfd_make_section (abfd, ".data");
+ if (sec == NULL)
+ return NULL;
+ sec->flags = SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_CODE | SEC_HAS_CONTENTS;
+ sec->vma = 0;
+ sec->_raw_size = statbuf.st_size - sizeof (ppcboot_hdr_t);
+ sec->filepos = sizeof (ppcboot_hdr_t);
+
+ ppcboot_mkobject (abfd);
+ tdata = ppcboot_get_tdata (abfd);
+ tdata->sec = sec;
+ memcpy ((PTR) &tdata->header, (PTR) &hdr, sizeof (ppcboot_hdr_t));
+
+ ppcboot_set_arch_mach (abfd, bfd_arch_powerpc, 0);
+ return abfd->xvec;
+}
+
+#define ppcboot_close_and_cleanup _bfd_generic_close_and_cleanup
+#define ppcboot_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
+#define ppcboot_new_section_hook _bfd_generic_new_section_hook
+
+
+/* Get contents of the only section. */
+
+static boolean
+ppcboot_get_section_contents (abfd, section, location, offset, count)
+ bfd *abfd;
+ asection *section ATTRIBUTE_UNUSED;
+ PTR location;
+ file_ptr offset;
+ bfd_size_type count;
+{
+ if (bfd_seek (abfd, offset + sizeof(ppcboot_hdr_t), SEEK_SET) != 0
+ || bfd_read (location, 1, count, abfd) != count)
+ return false;
+ return true;
+}
+
+
+/* Return the amount of memory needed to read the symbol table. */
+
+static long
+ppcboot_get_symtab_upper_bound (abfd)
+ bfd *abfd ATTRIBUTE_UNUSED;
+{
+ return (PPCBOOT_SYMS + 1) * sizeof (asymbol *);
+}
+
+
+/* Create a symbol name based on the bfd's filename. */
+
+static char *
+mangle_name (abfd, suffix)
+ bfd *abfd;
+ char *suffix;
+{
+ int size;
+ char *buf;
+ char *p;
+
+ size = (strlen (bfd_get_filename (abfd))
+ + strlen (suffix)
+ + sizeof "_ppcboot__");
+
+ buf = (char *) bfd_alloc (abfd, size);
+ if (buf == NULL)
+ return "";
+
+ sprintf (buf, "_ppcboot_%s_%s", bfd_get_filename (abfd), suffix);
+
+ /* Change any non-alphanumeric characters to underscores. */
+ for (p = buf; *p; p++)
+ if (! isalnum ((unsigned char) *p))
+ *p = '_';
+
+ return buf;
+}
+
+
+/* Return the symbol table. */
+
+static long
+ppcboot_get_symtab (abfd, alocation)
+ bfd *abfd;
+ asymbol **alocation;
+{
+ asection *sec = ppcboot_get_tdata (abfd)->sec;
+ asymbol *syms;
+ unsigned int i;
+
+ syms = (asymbol *) bfd_alloc (abfd, PPCBOOT_SYMS * sizeof (asymbol));
+ if (syms == NULL)
+ return false;
+
+ /* Start symbol. */
+ syms[0].the_bfd = abfd;
+ syms[0].name = mangle_name (abfd, "start");
+ syms[0].value = 0;
+ syms[0].flags = BSF_GLOBAL;
+ syms[0].section = sec;
+ syms[0].udata.p = NULL;
+
+ /* End symbol. */
+ syms[1].the_bfd = abfd;
+ syms[1].name = mangle_name (abfd, "end");
+ syms[1].value = sec->_raw_size;
+ syms[1].flags = BSF_GLOBAL;
+ syms[1].section = sec;
+ syms[1].udata.p = NULL;
+
+ /* Size symbol. */
+ syms[2].the_bfd = abfd;
+ syms[2].name = mangle_name (abfd, "size");
+ syms[2].value = sec->_raw_size;
+ syms[2].flags = BSF_GLOBAL;
+ syms[2].section = bfd_abs_section_ptr;
+ syms[2].udata.p = NULL;
+
+ for (i = 0; i < PPCBOOT_SYMS; i++)
+ *alocation++ = syms++;
+ *alocation = NULL;
+
+ return PPCBOOT_SYMS;
+}
+
+
+/* Make an empty symbol. */
+
+static asymbol *
+ppcboot_make_empty_symbol (abfd)
+ bfd *abfd;
+{
+ return (asymbol *) bfd_alloc (abfd, sizeof (asymbol));
+}
+
+
+#define ppcboot_print_symbol _bfd_nosymbols_print_symbol
+
+/* Get information about a symbol. */
+
+static void
+ppcboot_get_symbol_info (ignore_abfd, symbol, ret)
+ bfd *ignore_abfd ATTRIBUTE_UNUSED;
+ asymbol *symbol;
+ symbol_info *ret;
+{
+ bfd_symbol_info (symbol, ret);
+}
+
+#define ppcboot_bfd_is_local_label_name bfd_generic_is_local_label_name
+#define ppcboot_get_lineno _bfd_nosymbols_get_lineno
+#define ppcboot_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define ppcboot_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define ppcboot_read_minisymbols _bfd_generic_read_minisymbols
+#define ppcboot_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
+
+#define ppcboot_get_reloc_upper_bound \
+ ((long (*) PARAMS ((bfd *, asection *))) bfd_0l)
+#define ppcboot_canonicalize_reloc \
+ ((long (*) PARAMS ((bfd *, asection *, arelent **, asymbol **))) bfd_0l)
+#define ppcboot_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
+
+/* Write section contents of a ppcboot file. */
+
+static boolean
+ppcboot_set_section_contents (abfd, sec, data, offset, size)
+ bfd *abfd;
+ asection *sec;
+ PTR data;
+ file_ptr offset;
+ bfd_size_type size;
+{
+ if (! abfd->output_has_begun)
+ {
+ bfd_vma low;
+ asection *s;
+
+ /* The lowest section VMA sets the virtual address of the start
+ of the file. We use the set the file position of all the
+ sections. */
+ low = abfd->sections->vma;
+ for (s = abfd->sections->next; s != NULL; s = s->next)
+ if (s->vma < low)
+ low = s->vma;
+
+ for (s = abfd->sections; s != NULL; s = s->next)
+ s->filepos = s->vma - low;
+
+ abfd->output_has_begun = true;
+ }
+
+ return _bfd_generic_set_section_contents (abfd, sec, data, offset, size);
+}
+
+
+static int
+ppcboot_sizeof_headers (abfd, exec)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ boolean exec ATTRIBUTE_UNUSED;
+{
+ return sizeof (ppcboot_hdr_t);
+}
+
+
+/* Print out the program headers. */
+
+static boolean
+ppcboot_bfd_print_private_bfd_data (abfd, farg)
+ bfd *abfd;
+ PTR farg;
+{
+ FILE *f = (FILE *)farg;
+ ppcboot_data_t *tdata = ppcboot_get_tdata (abfd);
+ long entry_offset = bfd_getl_signed_32 ((PTR) tdata->header.entry_offset);
+ long length = bfd_getl_signed_32 ((PTR) tdata->header.length);
+ int i;
+
+ fprintf (f, _("\nppcboot header:\n"));
+ fprintf (f, _("Entry offset = 0x%.8lx (%ld)\n"), entry_offset, entry_offset);
+ fprintf (f, _("Length = 0x%.8lx (%ld)\n"), length, length);
+
+ if (tdata->header.flags)
+ fprintf (f, _("Flag field = 0x%.2x\n"), tdata->header.flags);
+
+ if (tdata->header.os_id)
+ fprintf (f, "OS_ID = 0x%.2x\n", tdata->header.os_id);
+
+ if (tdata->header.partition_name)
+ fprintf (f, _("Partition name = \"%s\"\n"), tdata->header.partition_name);
+
+ for (i = 0; i < 4; i++)
+ {
+ long sector_begin = bfd_getl_signed_32 ((PTR) tdata->header.partition[i].sector_begin);
+ long sector_length = bfd_getl_signed_32 ((PTR) tdata->header.partition[i].sector_length);
+
+ /* Skip all 0 entries */
+ if (!tdata->header.partition[i].partition_begin.ind
+ && !tdata->header.partition[i].partition_begin.head
+ && !tdata->header.partition[i].partition_begin.sector
+ && !tdata->header.partition[i].partition_begin.cylinder
+ && !tdata->header.partition[i].partition_end.ind
+ && !tdata->header.partition[i].partition_end.head
+ && !tdata->header.partition[i].partition_end.sector
+ && !tdata->header.partition[i].partition_end.cylinder
+ && !sector_begin && !sector_length)
+ continue;
+
+ fprintf (f, _("\nPartition[%d] start = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n"), i,
+ tdata->header.partition[i].partition_begin.ind,
+ tdata->header.partition[i].partition_begin.head,
+ tdata->header.partition[i].partition_begin.sector,
+ tdata->header.partition[i].partition_begin.cylinder);
+
+ fprintf (f, _("Partition[%d] end = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n"), i,
+ tdata->header.partition[i].partition_end.ind,
+ tdata->header.partition[i].partition_end.head,
+ tdata->header.partition[i].partition_end.sector,
+ tdata->header.partition[i].partition_end.cylinder);
+
+ fprintf (f, _("Partition[%d] sector = 0x%.8lx (%ld)\n"), i, sector_begin, sector_begin);
+ fprintf (f, _("Partition[%d] length = 0x%.8lx (%ld)\n"), i, sector_length, sector_length);
+ }
+
+ fprintf (f, "\n");
+ return true;
+}
+
+
+#define ppcboot_bfd_get_relocated_section_contents \
+ bfd_generic_get_relocated_section_contents
+#define ppcboot_bfd_relax_section bfd_generic_relax_section
+#define ppcboot_bfd_gc_sections bfd_generic_gc_sections
+#define ppcboot_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
+#define ppcboot_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#define ppcboot_bfd_final_link _bfd_generic_final_link
+#define ppcboot_bfd_link_split_section _bfd_generic_link_split_section
+#define ppcboot_get_section_contents_in_window \
+ _bfd_generic_get_section_contents_in_window
+
+#define ppcboot_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
+#define ppcboot_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
+#define ppcboot_bfd_copy_private_section_data _bfd_generic_bfd_copy_private_section_data
+#define ppcboot_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data
+#define ppcboot_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
+#define ppcboot_bfd_print_private_bfd_dat ppcboot_bfd_print_private_bfd_data
+
+const bfd_target ppcboot_vec =
+{
+ "ppcboot", /* name */
+ bfd_target_unknown_flavour, /* flavour */
+ BFD_ENDIAN_BIG, /* byteorder is big endian for code */
+ BFD_ENDIAN_LITTLE, /* header_byteorder */
+ EXEC_P, /* object_flags */
+ (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE | SEC_DATA
+ | SEC_ROM | SEC_HAS_CONTENTS), /* section_flags */
+ 0, /* symbol_leading_char */
+ ' ', /* ar_pad_char */
+ 16, /* ar_max_namelen */
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
+ { /* bfd_check_format */
+ _bfd_dummy_target,
+ ppcboot_object_p, /* bfd_check_format */
+ _bfd_dummy_target,
+ _bfd_dummy_target,
+ },
+ { /* bfd_set_format */
+ bfd_false,
+ ppcboot_mkobject,
+ bfd_false,
+ bfd_false,
+ },
+ { /* bfd_write_contents */
+ bfd_false,
+ bfd_true,
+ bfd_false,
+ bfd_false,
+ },
+
+ BFD_JUMP_TABLE_GENERIC (ppcboot),
+ BFD_JUMP_TABLE_COPY (ppcboot),
+ BFD_JUMP_TABLE_CORE (_bfd_nocore),
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
+ BFD_JUMP_TABLE_SYMBOLS (ppcboot),
+ BFD_JUMP_TABLE_RELOCS (ppcboot),
+ BFD_JUMP_TABLE_WRITE (ppcboot),
+ BFD_JUMP_TABLE_LINK (ppcboot),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+
+ NULL,
+
+ NULL
+};
diff --git a/contrib/binutils/bfd/ptrace-core.c b/contrib/binutils/bfd/ptrace-core.c
index 97007353ff7e..0969dce4c054 100644
--- a/contrib/binutils/bfd/ptrace-core.c
+++ b/contrib/binutils/bfd/ptrace-core.c
@@ -1,5 +1,5 @@
/* BFD backend for core files which use the ptrace_user structure
- Copyright 1993, 1994 Free Software Foundation, Inc.
+ Copyright 1993, 94, 95, 96, 1998 Free Software Foundation, Inc.
The structure of this file is based on trad-core.c written by John Gilmore
of Cygnus Support.
Modified to work with the ptrace_user structure by Kevin A. Buettner.
@@ -27,13 +27,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysdep.h"
#include "libbfd.h"
-#include <stdio.h>
-#include <sys/types.h>
#include <sys/param.h>
#include <sys/dir.h>
#include <signal.h>
-#include <errno.h>
-#include <unistd.h>
#include <sys/ptrace.h>
@@ -228,6 +224,8 @@ const bfd_target ptrace_core_vec =
BFD_JUMP_TABLE_LINK (_bfd_nolink),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+ NULL,
+
(PTR) 0 /* backend_data */
};
diff --git a/contrib/binutils/bfd/reloc.c b/contrib/binutils/bfd/reloc.c
index dda7624c585f..ef2375a0d790 100644
--- a/contrib/binutils/bfd/reloc.c
+++ b/contrib/binutils/bfd/reloc.c
@@ -1,5 +1,5 @@
/* BFD support for handling relocation entries.
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -25,7 +25,7 @@ SECTION
BFD maintains relocations in much the same way it maintains
symbols: they are left alone until required, then read in
- en-mass and translated into an internal form. A common
+ en-masse and translated into an internal form. A common
routine <<bfd_perform_relocation>> acts upon the
canonical form to do the fixup.
@@ -340,13 +340,26 @@ CODE_FRAGMENT
. {* The textual name of the relocation type. *}
. char *name;
.
-. {* When performing a partial link, some formats must modify the
-. relocations rather than the data - this flag signals this.*}
+. {* Some formats record a relocation addend in the section contents
+. rather than with the relocation. For ELF formats this is the
+. distinction between USE_REL and USE_RELA (though the code checks
+. for USE_REL == 1/0). The value of this field is TRUE if the
+. addend is recorded with the section contents; when performing a
+. partial link (ld -r) the section contents (the data) will be
+. modified. The value of this field is FALSE if addends are
+. recorded with the relocation (in arelent.addend); when performing
+. a partial link the relocation will be modified.
+. All relocations for all ELF USE_RELA targets should set this field
+. to FALSE (values of TRUE should be looked on with suspicion).
+. However, the converse is not true: not all relocations of all ELF
+. USE_REL targets set this field to TRUE. Why this is so is peculiar
+. to each particular target. For relocs that aren't used in partial
+. links (e.g. GOT stuff) it doesn't matter what this is set to. *}
. boolean partial_inplace;
.
. {* The src_mask selects which parts of the read in data
. are to be used in the relocation sum. E.g., if this was an 8 bit
-. bit of data which we read and relocated, this would be
+. byte of data which we read and relocated, this would be
. 0x000000ff. When we have relocs which have an addend, such as
. sun4 extended relocs, the value in the offset part of a
. relocating field is garbage so we never use it. In this case
@@ -389,6 +402,14 @@ DESCRIPTION
.#define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN)
.
+
+DESCRIPTION
+ This is used to fill in an empty howto entry in an array.
+
+.#define EMPTY_HOWTO(C) \
+. HOWTO((C),0,0,0,false,0,complain_overflow_dont,NULL,NULL,false,0,0,false)
+.
+
DESCRIPTION
Helper routine to turn a symbol into a relocation value.
@@ -450,6 +471,8 @@ DESCRIPTION
*/
+/* N_ONES produces N one bits, without overflowing machine arithmetic. */
+#define N_ONES(n) (((((bfd_vma) 1 << ((n) - 1)) - 1) << 1) | 1)
/*
FUNCTION
@@ -461,28 +484,37 @@ SYNOPSIS
(enum complain_overflow how,
unsigned int bitsize,
unsigned int rightshift,
+ unsigned int addrsize,
bfd_vma relocation);
DESCRIPTION
- Perform overflow checking on @var{relocation} which has @var{bitsize}
- significant bits and will be shifted right by @var{rightshift} bits.
- The result is either of @code{bfd_reloc_ok} or
- @code{bfd_reloc_overflow}.
+ Perform overflow checking on @var{relocation} which has
+ @var{bitsize} significant bits and will be shifted right by
+ @var{rightshift} bits, on a machine with addresses containing
+ @var{addrsize} significant bits. The result is either of
+ @code{bfd_reloc_ok} or @code{bfd_reloc_overflow}.
*/
bfd_reloc_status_type
-bfd_check_overflow (how, bitsize, rightshift, relocation)
+bfd_check_overflow (how, bitsize, rightshift, addrsize, relocation)
enum complain_overflow how;
- unsigned int bitsize, rightshift;
+ unsigned int bitsize;
+ unsigned int rightshift;
+ unsigned int addrsize;
bfd_vma relocation;
{
- bfd_vma check;
+ bfd_vma fieldmask, addrmask, signmask, ss, a;
bfd_reloc_status_type flag = bfd_reloc_ok;
- /* Get the value that will be used for the relocation, but
- starting at bit position zero. */
- check = relocation >> rightshift;
+ a = relocation;
+
+ /* Note: BITSIZE should always be <= ADDRSIZE, but in case it's not,
+ we'll be permissive: extra bits in the field mask will
+ automatically extend the address mask for purposes of the
+ overflow check. */
+ fieldmask = N_ONES (bitsize);
+ addrmask = N_ONES (addrsize) | fieldmask;
switch (how)
{
@@ -490,62 +522,32 @@ bfd_check_overflow (how, bitsize, rightshift, relocation)
break;
case complain_overflow_signed:
- {
- /* Assumes two's complement. */
- bfd_signed_vma reloc_signed_max = (1 << (bitsize - 1)) - 1;
- bfd_signed_vma reloc_signed_min = ~reloc_signed_max;
-
- /* The above right shift is incorrect for a signed value.
- Fix it up by forcing on the upper bits. */
- if (rightshift > 0
- && (bfd_signed_vma) relocation < 0)
- check |= ((bfd_vma) - 1
- & ~((bfd_vma) - 1
- >> rightshift));
- if ((bfd_signed_vma) check > reloc_signed_max
- || (bfd_signed_vma) check < reloc_signed_min)
- flag = bfd_reloc_overflow;
- }
+ /* If any sign bits are set, all sign bits must be set. That
+ is, A must be a valid negative address after shifting. */
+ a = (a & addrmask) >> rightshift;
+ signmask = ~ (fieldmask >> 1);
+ ss = a & signmask;
+ if (ss != 0 && ss != ((addrmask >> rightshift) & signmask))
+ flag = bfd_reloc_overflow;
break;
case complain_overflow_unsigned:
- {
- /* Assumes two's complement. This expression avoids
- overflow if `bitsize' is the number of bits in
- bfd_vma. */
- bfd_vma reloc_unsigned_max = (((1 << (bitsize - 1)) - 1) << 1) | 1;
-
- if ((bfd_vma) check > reloc_unsigned_max)
- flag = bfd_reloc_overflow;
- }
+ /* We have an overflow if the address does not fit in the field. */
+ a = (a & addrmask) >> rightshift;
+ if ((a & ~ fieldmask) != 0)
+ flag = bfd_reloc_overflow;
break;
case complain_overflow_bitfield:
- {
- /* Assumes two's complement. This expression avoids
- overflow if `bitsize' is the number of bits in
- bfd_vma. */
- bfd_vma reloc_bits = (((1 << (bitsize - 1)) - 1) << 1) | 1;
-
- if (((bfd_vma) check & ~reloc_bits) != 0
- && ((bfd_vma) check & ~reloc_bits) != (-1 & ~reloc_bits))
- {
- /* The above right shift is incorrect for a signed
- value. See if turning on the upper bits fixes the
- overflow. */
- if (rightshift > 0
- && (bfd_signed_vma) relocation < 0)
- {
- check |= ((bfd_vma) - 1
- & ~((bfd_vma) - 1
- >> rightshift));
- if (((bfd_vma) check & ~reloc_bits) != (-1 & ~reloc_bits))
- flag = bfd_reloc_overflow;
- }
- else
- flag = bfd_reloc_overflow;
- }
- }
+ /* Bitfields are sometimes signed, sometimes unsigned. We
+ explicitly allow an address wrap too, which means a bitfield
+ of n bits is allowed to store -2**n to 2**n-1. Thus overflow
+ if the value has some, but not all, bits set outside the
+ field. */
+ a >>= rightshift;
+ ss = a & ~ fieldmask;
+ if (ss != 0 && ss != (((bfd_vma) -1 >> rightshift) & ~ fieldmask))
+ flag = bfd_reloc_overflow;
break;
default:
@@ -555,7 +557,6 @@ bfd_check_overflow (how, bitsize, rightshift, relocation)
return flag;
}
-
/*
FUNCTION
bfd_perform_relocation
@@ -601,7 +602,7 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd,
{
bfd_vma relocation;
bfd_reloc_status_type flag = bfd_reloc_ok;
- bfd_size_type addr = reloc_entry->address;
+ bfd_size_type octets = reloc_entry->address * bfd_octets_per_byte (abfd);
bfd_vma output_base = 0;
reloc_howto_type *howto = reloc_entry->howto;
asection *reloc_target_output_section;
@@ -637,7 +638,8 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd,
}
/* Is the address of the relocation really within the section? */
- if (reloc_entry->address > input_section->_cooked_size)
+ if (reloc_entry->address > input_section->_cooked_size /
+ bfd_octets_per_byte (abfd))
return bfd_reloc_outofrange;
/* Work out which section the relocation is targetted at and the
@@ -825,8 +827,11 @@ space consuming. For each target:
adding in the value contained in the object file. */
if (howto->complain_on_overflow != complain_overflow_dont
&& flag == bfd_reloc_ok)
- flag = bfd_check_overflow (howto->complain_on_overflow, howto->bitsize,
- howto->rightshift, relocation);
+ flag = bfd_check_overflow (howto->complain_on_overflow,
+ howto->bitsize,
+ howto->rightshift,
+ bfd_arch_bits_per_address (abfd),
+ relocation);
/*
Either we are relocating all the way, or we don't want to apply
@@ -877,23 +882,23 @@ space consuming. For each target:
R result
Do this:
- i i i i i o o o o o from bfd_get<size>
- and S S S S S to get the size offset we want
- + r r r r r r r r r r to get the final value to place
+ (( i i i i i o o o o o from bfd_get<size>
+ and S S S S S) to get the size offset we want
+ + r r r r r r r r r r) to get the final value to place
and D D D D D to chop to right size
-----------------------
- A A A A A
+ = A A A A A
And this:
- ... i i i i i o o o o o from bfd_get<size>
- and N N N N N get instruction
+ ( i i i i i o o o o o from bfd_get<size>
+ and N N N N N ) get instruction
-----------------------
- ... B B B B B
+ = B B B B B
And then:
- B B B B B
- or A A A A A
+ ( B B B B B
+ or A A A A A)
-----------------------
- R R R R R R R R R R put into bfd_put<size>
+ = R R R R R R R R R R put into bfd_put<size>
*/
#define DOIT(x) \
@@ -903,41 +908,41 @@ space consuming. For each target:
{
case 0:
{
- char x = bfd_get_8 (abfd, (char *) data + addr);
+ char x = bfd_get_8 (abfd, (char *) data + octets);
DOIT (x);
- bfd_put_8 (abfd, x, (unsigned char *) data + addr);
+ bfd_put_8 (abfd, x, (unsigned char *) data + octets);
}
break;
case 1:
{
- short x = bfd_get_16 (abfd, (bfd_byte *) data + addr);
+ short x = bfd_get_16 (abfd, (bfd_byte *) data + octets);
DOIT (x);
- bfd_put_16 (abfd, x, (unsigned char *) data + addr);
+ bfd_put_16 (abfd, x, (unsigned char *) data + octets);
}
break;
case 2:
{
- long x = bfd_get_32 (abfd, (bfd_byte *) data + addr);
+ long x = bfd_get_32 (abfd, (bfd_byte *) data + octets);
DOIT (x);
- bfd_put_32 (abfd, x, (bfd_byte *) data + addr);
+ bfd_put_32 (abfd, x, (bfd_byte *) data + octets);
}
break;
case -2:
{
- long x = bfd_get_32 (abfd, (bfd_byte *) data + addr);
+ long x = bfd_get_32 (abfd, (bfd_byte *) data + octets);
relocation = -relocation;
DOIT (x);
- bfd_put_32 (abfd, x, (bfd_byte *) data + addr);
+ bfd_put_32 (abfd, x, (bfd_byte *) data + octets);
}
break;
case -1:
{
- long x = bfd_get_16 (abfd, (bfd_byte *) data + addr);
+ long x = bfd_get_16 (abfd, (bfd_byte *) data + octets);
relocation = -relocation;
DOIT (x);
- bfd_put_16 (abfd, x, (bfd_byte *) data + addr);
+ bfd_put_16 (abfd, x, (bfd_byte *) data + octets);
}
break;
@@ -948,9 +953,9 @@ space consuming. For each target:
case 4:
#ifdef BFD64
{
- bfd_vma x = bfd_get_64 (abfd, (bfd_byte *) data + addr);
+ bfd_vma x = bfd_get_64 (abfd, (bfd_byte *) data + octets);
DOIT (x);
- bfd_put_64 (abfd, x, (bfd_byte *) data + addr);
+ bfd_put_64 (abfd, x, (bfd_byte *) data + octets);
}
#else
abort ();
@@ -1000,7 +1005,7 @@ bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset,
{
bfd_vma relocation;
bfd_reloc_status_type flag = bfd_reloc_ok;
- bfd_size_type addr = reloc_entry->address;
+ bfd_size_type octets = reloc_entry->address * bfd_octets_per_byte (abfd);
bfd_vma output_base = 0;
reloc_howto_type *howto = reloc_entry->howto;
asection *reloc_target_output_section;
@@ -1020,7 +1025,7 @@ bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset,
if (howto->special_function)
{
bfd_reloc_status_type cont;
-
+
/* XXX - The special_function calls haven't been fixed up to deal
with creating new relocations and section contents. */
cont = howto->special_function (abfd, reloc_entry, symbol,
@@ -1212,8 +1217,11 @@ space consuming. For each target:
FIXME: We should also do overflow checking on the result after
adding in the value contained in the object file. */
if (howto->complain_on_overflow != complain_overflow_dont)
- flag = bfd_check_overflow (howto->complain_on_overflow, howto->bitsize,
- howto->rightshift, relocation);
+ flag = bfd_check_overflow (howto->complain_on_overflow,
+ howto->bitsize,
+ howto->rightshift,
+ bfd_arch_bits_per_address (abfd),
+ relocation);
/*
Either we are relocating all the way, or we don't want to apply
@@ -1264,29 +1272,29 @@ space consuming. For each target:
R result
Do this:
- i i i i i o o o o o from bfd_get<size>
- and S S S S S to get the size offset we want
- + r r r r r r r r r r to get the final value to place
+ (( i i i i i o o o o o from bfd_get<size>
+ and S S S S S) to get the size offset we want
+ + r r r r r r r r r r) to get the final value to place
and D D D D D to chop to right size
-----------------------
- A A A A A
+ = A A A A A
And this:
- ... i i i i i o o o o o from bfd_get<size>
- and N N N N N get instruction
+ ( i i i i i o o o o o from bfd_get<size>
+ and N N N N N ) get instruction
-----------------------
- ... B B B B B
+ = B B B B B
And then:
- B B B B B
- or A A A A A
+ ( B B B B B
+ or A A A A A)
-----------------------
- R R R R R R R R R R put into bfd_put<size>
+ = R R R R R R R R R R put into bfd_put<size>
*/
#define DOIT(x) \
x = ( (x & ~howto->dst_mask) | (((x & howto->src_mask) + relocation) & howto->dst_mask))
- data = (bfd_byte *) data_start + (addr - data_start_offset);
+ data = (bfd_byte *) data_start + (octets - data_start_offset);
switch (howto->size)
{
@@ -1416,8 +1424,10 @@ _bfd_relocate_contents (howto, input_bfd, relocation, location)
bfd_byte *location;
{
int size;
- bfd_vma x;
- boolean overflow;
+ bfd_vma x = 0;
+ bfd_reloc_status_type flag;
+ unsigned int rightshift = howto->rightshift;
+ unsigned int bitpos = howto->bitpos;
/* If the size is negative, negate RELOCATION. This isn't very
general. */
@@ -1453,117 +1463,124 @@ _bfd_relocate_contents (howto, input_bfd, relocation, location)
which we don't check for. We must either check at every single
operation, which would be tedious, or we must do the computations
in a type larger than bfd_vma, which would be inefficient. */
- overflow = false;
+ flag = bfd_reloc_ok;
if (howto->complain_on_overflow != complain_overflow_dont)
{
- bfd_vma check;
- bfd_signed_vma signed_check;
- bfd_vma add;
- bfd_signed_vma signed_add;
-
- if (howto->rightshift == 0)
- {
- check = relocation;
- signed_check = (bfd_signed_vma) relocation;
- }
- else
- {
- /* Drop unwanted bits from the value we are relocating to. */
- check = relocation >> howto->rightshift;
-
- /* If this is a signed value, the rightshift just dropped
- leading 1 bits (assuming twos complement). */
- if ((bfd_signed_vma) relocation >= 0)
- signed_check = check;
- else
- signed_check = (check
- | ((bfd_vma) - 1
- & ~((bfd_vma) - 1 >> howto->rightshift)));
- }
-
- /* Get the value from the object file. */
- add = x & howto->src_mask;
-
- /* Get the value from the object file with an appropriate sign.
- The expression involving howto->src_mask isolates the upper
- bit of src_mask. If that bit is set in the value we are
- adding, it is negative, and we subtract out that number times
- two. If src_mask includes the highest possible bit, then we
- can not get the upper bit, but that does not matter since
- signed_add needs no adjustment to become negative in that
- case. */
- signed_add = add;
- if ((add & (((~howto->src_mask) >> 1) & howto->src_mask)) != 0)
- signed_add -= (((~howto->src_mask) >> 1) & howto->src_mask) << 1;
-
- /* Add the value from the object file, shifted so that it is a
- straight number. */
- if (howto->bitpos == 0)
- {
- check += add;
- signed_check += signed_add;
- }
- else
- {
- check += add >> howto->bitpos;
-
- /* For the signed case we use ADD, rather than SIGNED_ADD,
- to avoid warnings from SVR4 cc. This is OK since we
- explictly handle the sign bits. */
- if (signed_add >= 0)
- signed_check += add >> howto->bitpos;
- else
- signed_check += ((add >> howto->bitpos)
- | ((bfd_vma) - 1
- & ~((bfd_vma) - 1 >> howto->bitpos)));
- }
+ bfd_vma addrmask, fieldmask, signmask, ss;
+ bfd_vma a, b, sum;
+
+ /* Get the values to be added together. For signed and unsigned
+ relocations, we assume that all values should be truncated to
+ the size of an address. For bitfields, all the bits matter.
+ See also bfd_check_overflow. */
+ fieldmask = N_ONES (howto->bitsize);
+ addrmask = N_ONES (bfd_arch_bits_per_address (input_bfd)) | fieldmask;
+ a = relocation;
+ b = x & howto->src_mask;
switch (howto->complain_on_overflow)
{
case complain_overflow_signed:
- {
- /* Assumes two's complement. */
- bfd_signed_vma reloc_signed_max = (1 << (howto->bitsize - 1)) - 1;
- bfd_signed_vma reloc_signed_min = ~reloc_signed_max;
-
- if (signed_check > reloc_signed_max
- || signed_check < reloc_signed_min)
- overflow = true;
- }
+ a = (a & addrmask) >> rightshift;
+
+ /* If any sign bits are set, all sign bits must be set.
+ That is, A must be a valid negative address after
+ shifting. */
+ signmask = ~ (fieldmask >> 1);
+ ss = a & signmask;
+ if (ss != 0 && ss != ((addrmask >> rightshift) & signmask))
+ flag = bfd_reloc_overflow;
+
+ /* We only need this next bit of code if the sign bit of B
+ is below the sign bit of A. This would only happen if
+ SRC_MASK had fewer bits than BITSIZE. Note that if
+ SRC_MASK has more bits than BITSIZE, we can get into
+ trouble; we would need to verify that B is in range, as
+ we do for A above. */
+ signmask = ((~ howto->src_mask) >> 1) & howto->src_mask;
+
+ /* Set all the bits above the sign bit. */
+ b = (b ^ signmask) - signmask;
+
+ b = (b & addrmask) >> bitpos;
+
+ /* Now we can do the addition. */
+ sum = a + b;
+
+ /* See if the result has the correct sign. Bits above the
+ sign bit are junk now; ignore them. If the sum is
+ positive, make sure we did not have all negative inputs;
+ if the sum is negative, make sure we did not have all
+ positive inputs. The test below looks only at the sign
+ bits, and it really just
+ SIGN (A) == SIGN (B) && SIGN (A) != SIGN (SUM)
+ */
+ signmask = (fieldmask >> 1) + 1;
+ if (((~ (a ^ b)) & (a ^ sum)) & signmask)
+ flag = bfd_reloc_overflow;
+
break;
+
case complain_overflow_unsigned:
- {
- /* Assumes two's complement. This expression avoids
- overflow if howto->bitsize is the number of bits in
- bfd_vma. */
- bfd_vma reloc_unsigned_max =
- (((1 << (howto->bitsize - 1)) - 1) << 1) | 1;
-
- if (check > reloc_unsigned_max)
- overflow = true;
- }
+ /* Checking for an unsigned overflow is relatively easy:
+ trim the addresses and add, and trim the result as well.
+ Overflow is normally indicated when the result does not
+ fit in the field. However, we also need to consider the
+ case when, e.g., fieldmask is 0x7fffffff or smaller, an
+ input is 0x80000000, and bfd_vma is only 32 bits; then we
+ will get sum == 0, but there is an overflow, since the
+ inputs did not fit in the field. Instead of doing a
+ separate test, we can check for this by or-ing in the
+ operands when testing for the sum overflowing its final
+ field. */
+ a = (a & addrmask) >> rightshift;
+ b = (b & addrmask) >> bitpos;
+ sum = (a + b) & addrmask;
+ if ((a | b | sum) & ~ fieldmask)
+ flag = bfd_reloc_overflow;
+
break;
+
case complain_overflow_bitfield:
- {
- /* Assumes two's complement. This expression avoids
- overflow if howto->bitsize is the number of bits in
- bfd_vma. */
- bfd_vma reloc_bits = (((1 << (howto->bitsize - 1)) - 1) << 1) | 1;
-
- if ((check & ~reloc_bits) != 0
- && (((bfd_vma) signed_check & ~reloc_bits)
- != (-1 & ~reloc_bits)))
- overflow = true;
- }
+ /* Much like the signed check, but for a field one bit
+ wider, and no trimming inputs with addrmask. We allow a
+ bitfield to represent numbers in the range -2**n to
+ 2**n-1, where n is the number of bits in the field.
+ Note that when bfd_vma is 32 bits, a 32-bit reloc can't
+ overflow, which is exactly what we want. */
+ a >>= rightshift;
+
+ signmask = ~ fieldmask;
+ ss = a & signmask;
+ if (ss != 0 && ss != (((bfd_vma) -1 >> rightshift) & signmask))
+ flag = bfd_reloc_overflow;
+
+ signmask = ((~ howto->src_mask) >> 1) & howto->src_mask;
+ b = (b ^ signmask) - signmask;
+
+ b >>= bitpos;
+
+ sum = a + b;
+
+ /* We mask with addrmask here to explicitly allow an address
+ wrap-around. The Linux kernel relies on it, and it is
+ the only way to write assembler code which can run when
+ loaded at a location 0x80000000 away from the location at
+ which it is linked. */
+ signmask = fieldmask + 1;
+ if (((~ (a ^ b)) & (a ^ sum)) & signmask & addrmask)
+ flag = bfd_reloc_overflow;
+
break;
+
default:
abort ();
}
}
/* Put RELOCATION in the right bits. */
- relocation >>= (bfd_vma) howto->rightshift;
- relocation <<= (bfd_vma) howto->bitpos;
+ relocation >>= (bfd_vma) rightshift;
+ relocation <<= (bfd_vma) bitpos;
/* Add RELOCATION to the right bits of X. */
x = ((x & ~howto->dst_mask)
@@ -1593,7 +1610,7 @@ _bfd_relocate_contents (howto, input_bfd, relocation, location)
break;
}
- return overflow ? bfd_reloc_overflow : bfd_reloc_ok;
+ return flag;
}
/*
@@ -1866,6 +1883,11 @@ ENUMDOC
SPARC64 relocations
ENUM
+ BFD_RELOC_SPARC_REV32
+ENUMDOC
+ SPARC little endian relocation
+
+ENUM
BFD_RELOC_ALPHA_GPDISP_HI16
ENUMDOC
Alpha ECOFF and ELF relocations. Some of these treat the symbol or
@@ -1923,6 +1945,25 @@ ENUMDOC
The GNU linker currently doesn't do any of this optimizing.
ENUM
+ BFD_RELOC_ALPHA_USER_LITERAL
+ENUMX
+ BFD_RELOC_ALPHA_USER_LITUSE_BASE
+ENUMX
+ BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF
+ENUMX
+ BFD_RELOC_ALPHA_USER_LITUSE_JSR
+ENUMX
+ BFD_RELOC_ALPHA_USER_GPDISP
+ENUMX
+ BFD_RELOC_ALPHA_USER_GPRELHIGH
+ENUMX
+ BFD_RELOC_ALPHA_USER_GPRELLOW
+ENUMDOC
+ The BFD_RELOC_ALPHA_USER_* relocations are used by the assembler to
+ process the explicit !<reloc>!sequence relocations, and are mapped
+ into the normal relocations at the end of processing.
+
+ENUM
BFD_RELOC_ALPHA_HINT
ENUMDOC
The HINT relocation indicates a value that should be filled into the
@@ -2007,6 +2048,14 @@ ENUMX
BFD_RELOC_MIPS_CALL_HI16
ENUMX
BFD_RELOC_MIPS_CALL_LO16
+ENUMX
+ BFD_RELOC_MIPS_SUB
+ENUMX
+ BFD_RELOC_MIPS_GOT_PAGE
+ENUMX
+ BFD_RELOC_MIPS_GOT_OFST
+ENUMX
+ BFD_RELOC_MIPS_GOT_DISP
COMMENT
ENUMDOC
MIPS ELF relocations.
@@ -2060,6 +2109,21 @@ ENUMDOC
ns32k relocations
ENUM
+ BFD_RELOC_PJ_CODE_HI16
+ENUMX
+ BFD_RELOC_PJ_CODE_LO16
+ENUMX
+ BFD_RELOC_PJ_CODE_DIR16
+ENUMX
+ BFD_RELOC_PJ_CODE_DIR32
+ENUMX
+ BFD_RELOC_PJ_CODE_REL16
+ENUMX
+ BFD_RELOC_PJ_CODE_REL32
+ENUMDOC
+ Picojava relocs. Not all of these appear in object files.
+
+ENUM
BFD_RELOC_PPC_B26
ENUMX
BFD_RELOC_PPC_BA26
@@ -2123,6 +2187,11 @@ ENUMDOC
Power(rs6000) and PowerPC relocations.
ENUM
+ BFD_RELOC_I370_D12
+ENUMDOC
+ IBM 370/390 relocations
+
+ENUM
BFD_RELOC_CTOR
ENUMDOC
The type of reloc used to build a contructor table - at the moment
@@ -2137,6 +2206,8 @@ ENUMDOC
ENUM
BFD_RELOC_ARM_IMMEDIATE
ENUMX
+ BFD_RELOC_ARM_ADRL_IMMEDIATE
+ENUMX
BFD_RELOC_ARM_OFFSET_IMM
ENUMX
BFD_RELOC_ARM_SHIFT_IMM
@@ -2166,6 +2237,24 @@ ENUMX
BFD_RELOC_ARM_THUMB_SHIFT
ENUMX
BFD_RELOC_ARM_THUMB_OFFSET
+ENUMX
+ BFD_RELOC_ARM_GOT12
+ENUMX
+ BFD_RELOC_ARM_GOT32
+ENUMX
+ BFD_RELOC_ARM_JUMP_SLOT
+ENUMX
+ BFD_RELOC_ARM_COPY
+ENUMX
+ BFD_RELOC_ARM_GLOB_DAT
+ENUMX
+ BFD_RELOC_ARM_PLT32
+ENUMX
+ BFD_RELOC_ARM_RELATIVE
+ENUMX
+ BFD_RELOC_ARM_GOTOFF
+ENUMX
+ BFD_RELOC_ARM_GOTPC
ENUMDOC
These relocs are only used within the ARM assembler. They are not
(at present) written to any object files.
@@ -2233,7 +2322,6 @@ ENUMDOC
stored in the instruction. The high 24 bits are installed in bits 23
through 0.
-COMMENT
ENUM
BFD_RELOC_D10V_10_PCREL_R
ENUMDOC
@@ -2258,9 +2346,66 @@ ENUM
ENUMDOC
This is an 18-bit reloc with the right 2 bits
assumed to be 0.
-COMMENT
-COMMENT
+ENUM
+ BFD_RELOC_D30V_6
+ENUMDOC
+ Mitsubishi D30V relocs.
+ This is a 6-bit absolute reloc.
+ENUM
+ BFD_RELOC_D30V_9_PCREL
+ENUMDOC
+ This is a 6-bit pc-relative reloc with
+ the right 3 bits assumed to be 0.
+ENUM
+ BFD_RELOC_D30V_9_PCREL_R
+ENUMDOC
+ This is a 6-bit pc-relative reloc with
+ the right 3 bits assumed to be 0. Same
+ as the previous reloc but on the right side
+ of the container.
+ENUM
+ BFD_RELOC_D30V_15
+ENUMDOC
+ This is a 12-bit absolute reloc with the
+ right 3 bitsassumed to be 0.
+ENUM
+ BFD_RELOC_D30V_15_PCREL
+ENUMDOC
+ This is a 12-bit pc-relative reloc with
+ the right 3 bits assumed to be 0.
+ENUM
+ BFD_RELOC_D30V_15_PCREL_R
+ENUMDOC
+ This is a 12-bit pc-relative reloc with
+ the right 3 bits assumed to be 0. Same
+ as the previous reloc but on the right side
+ of the container.
+ENUM
+ BFD_RELOC_D30V_21
+ENUMDOC
+ This is an 18-bit absolute reloc with
+ the right 3 bits assumed to be 0.
+ENUM
+ BFD_RELOC_D30V_21_PCREL
+ENUMDOC
+ This is an 18-bit pc-relative reloc with
+ the right 3 bits assumed to be 0.
+ENUM
+ BFD_RELOC_D30V_21_PCREL_R
+ENUMDOC
+ This is an 18-bit pc-relative reloc with
+ the right 3 bits assumed to be 0. Same
+ as the previous reloc but on the right side
+ of the container.
+ENUM
+ BFD_RELOC_D30V_32
+ENUMDOC
+ This is a 32-bit absolute reloc.
+ENUM
+ BFD_RELOC_D30V_32_PCREL
+ENUMDOC
+ This is a 32-bit pc-relative reloc.
ENUM
BFD_RELOC_M32R_24
@@ -2345,6 +2490,34 @@ ENUM
ENUMDOC
This is a 16 bit offset from the tiny data area pointer.
COMMENT
+ENUM
+ BFD_RELOC_V850_TDA_4_5_OFFSET
+ENUMDOC
+ This is a 5 bit offset (of which only 4 bits are used) from the tiny
+ data area pointer.
+ENUM
+ BFD_RELOC_V850_TDA_4_4_OFFSET
+ENUMDOC
+ This is a 4 bit offset from the tiny data area pointer.
+ENUM
+ BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET
+ENUMDOC
+ This is a 16 bit offset from the short data area pointer, with the
+ bits placed non-contigously in the instruction.
+ENUM
+ BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET
+ENUMDOC
+ This is a 16 bit offset from the zero data area pointer, with the
+ bits placed non-contigously in the instruction.
+ENUM
+ BFD_RELOC_V850_CALLT_6_7_OFFSET
+ENUMDOC
+ This is a 6 bit offset from the call table base pointer.
+ENUM
+ BFD_RELOC_V850_CALLT_16_16_OFFSET
+ENUMDOC
+ This is a 16 bit offset from the call table base pointer.
+COMMENT
ENUM
BFD_RELOC_MN10300_32_PCREL
@@ -2364,6 +2537,169 @@ ENUMDOC
significant 8 bits of a 24 bit word are placed into the least
significant 8 bits of the opcode.
+ENUM
+ BFD_RELOC_FR30_48
+ENUMDOC
+ This is a 48 bit reloc for the FR30 that stores 32 bits.
+ENUM
+ BFD_RELOC_FR30_20
+ENUMDOC
+ This is a 32 bit reloc for the FR30 that stores 20 bits split up into
+ two sections.
+ENUM
+ BFD_RELOC_FR30_6_IN_4
+ENUMDOC
+ This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
+ 4 bits.
+ENUM
+ BFD_RELOC_FR30_8_IN_8
+ENUMDOC
+ This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
+ into 8 bits.
+ENUM
+ BFD_RELOC_FR30_9_IN_8
+ENUMDOC
+ This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
+ into 8 bits.
+ENUM
+ BFD_RELOC_FR30_10_IN_8
+ENUMDOC
+ This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
+ into 8 bits.
+ENUM
+ BFD_RELOC_FR30_9_PCREL
+ENUMDOC
+ This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
+ short offset into 8 bits.
+ENUM
+ BFD_RELOC_FR30_12_PCREL
+ENUMDOC
+ This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
+ short offset into 11 bits.
+
+ENUM
+ BFD_RELOC_MCORE_PCREL_IMM8BY4
+ENUMX
+ BFD_RELOC_MCORE_PCREL_IMM11BY2
+ENUMX
+ BFD_RELOC_MCORE_PCREL_IMM4BY2
+ENUMX
+ BFD_RELOC_MCORE_PCREL_32
+ENUMX
+ BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2
+ENUMX
+ BFD_RELOC_MCORE_RVA
+ENUMDOC
+ Motorola Mcore relocations.
+
+ENUM
+ BFD_RELOC_AVR_7_PCREL
+ENUMDOC
+ This is a 16 bit reloc for the AVR that stores 8 bit pc relative
+ short offset into 7 bits.
+ENUM
+ BFD_RELOC_AVR_13_PCREL
+ENUMDOC
+ This is a 16 bit reloc for the AVR that stores 13 bit pc relative
+ short offset into 12 bits.
+ENUM
+ BFD_RELOC_AVR_16_PM
+ENUMDOC
+ This is a 16 bit reloc for the AVR that stores 17 bit value (usually
+ program memory address) into 16 bits.
+ENUM
+ BFD_RELOC_AVR_LO8_LDI
+ENUMDOC
+ This is a 16 bit reloc for the AVR that stores 8 bit value (usually
+ data memory address) into 8 bit immediate value of LDI insn.
+ENUM
+ BFD_RELOC_AVR_HI8_LDI
+ENUMDOC
+ This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
+ of data memory address) into 8 bit immediate value of LDI insn.
+ENUM
+ BFD_RELOC_AVR_HH8_LDI
+ENUMDOC
+ This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
+ of program memory address) into 8 bit immediate value of LDI insn.
+ENUM
+ BFD_RELOC_AVR_LO8_LDI_NEG
+ENUMDOC
+ This is a 16 bit reloc for the AVR that stores negated 8 bit value
+ (usually data memory address) into 8 bit immediate value of SUBI insn.
+ENUM
+ BFD_RELOC_AVR_HI8_LDI_NEG
+ENUMDOC
+ This is a 16 bit reloc for the AVR that stores negated 8 bit value
+ (high 8 bit of data memory address) into 8 bit immediate value of
+ SUBI insn.
+ENUM
+ BFD_RELOC_AVR_HH8_LDI_NEG
+ENUMDOC
+ This is a 16 bit reloc for the AVR that stores negated 8 bit value
+ (most high 8 bit of program memory address) into 8 bit immediate value
+ of LDI or SUBI insn.
+ENUM
+ BFD_RELOC_AVR_LO8_LDI_PM
+ENUMDOC
+ This is a 16 bit reloc for the AVR that stores 8 bit value (usually
+ command address) into 8 bit immediate value of LDI insn.
+ENUM
+ BFD_RELOC_AVR_HI8_LDI_PM
+ENUMDOC
+ This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
+ of command address) into 8 bit immediate value of LDI insn.
+ENUM
+ BFD_RELOC_AVR_HH8_LDI_PM
+ENUMDOC
+ This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
+ of command address) into 8 bit immediate value of LDI insn.
+ENUM
+ BFD_RELOC_AVR_LO8_LDI_PM_NEG
+ENUMDOC
+ This is a 16 bit reloc for the AVR that stores negated 8 bit value
+ (usually command address) into 8 bit immediate value of SUBI insn.
+ENUM
+ BFD_RELOC_AVR_HI8_LDI_PM_NEG
+ENUMDOC
+ This is a 16 bit reloc for the AVR that stores negated 8 bit value
+ (high 8 bit of 16 bit command address) into 8 bit immediate value
+ of SUBI insn.
+ENUM
+ BFD_RELOC_AVR_HH8_LDI_PM_NEG
+ENUMDOC
+ This is a 16 bit reloc for the AVR that stores negated 8 bit value
+ (high 6 bit of 22 bit command address) into 8 bit immediate
+ value of SUBI insn.
+ENUM
+ BFD_RELOC_AVR_CALL
+ENUMDOC
+ This is a 32 bit reloc for the AVR that stores 23 bit value
+ into 22 bits.
+
+ENUM
+ BFD_RELOC_VTABLE_INHERIT
+ENUMX
+ BFD_RELOC_VTABLE_ENTRY
+ENUMDOC
+ These two relocations are used by the linker to determine which of
+ the entries in a C++ virtual function table are actually used. When
+ the --gc-sections option is given, the linker will zero out the entries
+ that are not used, so that the code for those functions need not be
+ included in the output.
+
+ VTABLE_INHERIT is a zero-space relocation used to describe to the
+ linker the inheritence tree of a C++ virtual function table. The
+ relocation's symbol should be the parent class' vtable, and the
+ relocation should be located at the child vtable.
+
+ VTABLE_ENTRY is a zero-space relocation that describes the use of a
+ virtual function table entry. The reloc's symbol should refer to the
+ table of the class mentioned in the code. Off of that base, an offset
+ describes the entry that is being used. For Rela hosts, this offset
+ is stored in the reloc's addend. For Rel hosts, we are forced to put
+ this offset in the reloc's section offset.
+
ENDSENUM
BFD_RELOC_UNUSED
CODE_FRAGMENT
@@ -2481,9 +2817,9 @@ DESCRIPTION
/*ARGSUSED*/
boolean
bfd_generic_relax_section (abfd, section, link_info, again)
- bfd *abfd;
- asection *section;
- struct bfd_link_info *link_info;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ asection *section ATTRIBUTE_UNUSED;
+ struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
boolean *again;
{
*again = false;
@@ -2492,6 +2828,28 @@ bfd_generic_relax_section (abfd, section, link_info, again)
/*
INTERNAL_FUNCTION
+ bfd_generic_gc_sections
+
+SYNOPSIS
+ boolean bfd_generic_gc_sections
+ (bfd *, struct bfd_link_info *);
+
+DESCRIPTION
+ Provides default handling for relaxing for back ends which
+ don't do section gc -- i.e., does nothing.
+*/
+
+/*ARGSUSED*/
+boolean
+bfd_generic_gc_sections (abfd, link_info)
+ bfd *abfd ATTRIBUTE_UNUSED;
+ struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
+{
+ return true;
+}
+
+/*
+INTERNAL_FUNCTION
bfd_generic_get_relocated_section_contents
SYNOPSIS
@@ -2584,7 +2942,8 @@ bfd_generic_get_relocated_section_contents (abfd, link_info, link_order, data,
case bfd_reloc_undefined:
if (!((*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
- input_bfd, input_section, (*parent)->address)))
+ input_bfd, input_section, (*parent)->address,
+ true)))
goto error_return;
break;
case bfd_reloc_dangerous:
diff --git a/contrib/binutils/bfd/reloc16.c b/contrib/binutils/bfd/reloc16.c
index 7e7952ed5064..0e7c18abfd97 100644
--- a/contrib/binutils/bfd/reloc16.c
+++ b/contrib/binutils/bfd/reloc16.c
@@ -81,7 +81,8 @@ bfd_coff_reloc16_get_value (reloc, link_info, input_section)
{
if (! ((*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (symbol),
- input_section->owner, input_section, reloc->address)))
+ input_section->owner, input_section, reloc->address,
+ true)))
abort ();
value = 0;
}
@@ -194,9 +195,10 @@ bfd_coff_reloc16_relax_section (abfd, i, link_info, again)
{
int another_pass = 0;
- /* Allocate and initialize the shrinks array for this section. */
- shrinks = (int *) bfd_malloc (reloc_count * sizeof (int));
- memset (shrinks, 0, reloc_count * sizeof (int));
+ /* Allocate and initialize the shrinks array for this section.
+ The last element is used as an accumlator of shrinks. */
+ shrinks = (int *) bfd_malloc ((reloc_count + 1) * sizeof (int));
+ memset (shrinks, 0, (reloc_count + 1) * sizeof (int));
/* Loop until nothing changes in this section. */
do {
@@ -218,13 +220,14 @@ bfd_coff_reloc16_relax_section (abfd, i, link_info, again)
if (shrink != shrinks[i])
{
another_pass = 1;
- for (j = i + 1; j < reloc_count; j++)
+ for (j = i + 1; j <= reloc_count; j++)
shrinks[j] += shrink - shrinks[i];
}
}
} while (another_pass);
+ shrink = shrinks[reloc_count];
free((char *)shrinks);
}
diff --git a/contrib/binutils/bfd/sco5-core.c b/contrib/binutils/bfd/sco5-core.c
new file mode 100644
index 000000000000..46c97d25889f
--- /dev/null
+++ b/contrib/binutils/bfd/sco5-core.c
@@ -0,0 +1,431 @@
+/* BFD back end for SCO5 core files (U-area and raw sections)
+ Copyright 1998 Free Software Foundation, Inc.
+ Written by Jouke Numan <jnuman@hiscom.nl>
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "libaout.h" /* BFD a.out internal data structures */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/dir.h>
+#include <signal.h>
+
+#include <sys/user.h> /* After a.out.h */
+#include <sys/paccess.h>
+#include <sys/region.h>
+
+struct sco5_core_struct
+{
+ struct user u;
+};
+
+/* forward declarations */
+
+static asection *
+make_bfd_asection PARAMS ((bfd *, const char *, flagword, bfd_size_type,
+ bfd_vma, file_ptr));
+static asymbol *sco5_core_make_empty_symbol PARAMS ((bfd *));
+static struct user *read_uarea PARAMS ((bfd *, int));
+const bfd_target *sco5_core_file_p PARAMS ((bfd *abfd));
+char *sco5_core_file_failing_command PARAMS ((bfd *abfd));
+int sco5_core_file_failing_signal PARAMS ((bfd *abfd));
+boolean sco5_core_file_matches_executable_p PARAMS ((bfd *core_bfd,
+ bfd *exec_bfd));
+static void swap_abort PARAMS ((void));
+
+static asection *
+make_bfd_asection (abfd, name, flags, _raw_size, vma, filepos)
+ bfd *abfd;
+ const char *name;
+ flagword flags;
+ bfd_size_type _raw_size;
+ bfd_vma vma;
+ file_ptr filepos;
+{
+ asection *asect;
+
+ asect = bfd_make_section_anyway (abfd, name);
+ if (!asect)
+ return NULL;
+ asect->flags = flags;
+ asect->_raw_size = _raw_size;
+ asect->vma = vma;
+ asect->filepos = filepos;
+ asect->alignment_power = 2;
+
+ return asect;
+}
+
+static asymbol *
+sco5_core_make_empty_symbol (abfd)
+ bfd *abfd;
+{
+ asymbol *new = (asymbol *) bfd_zalloc (abfd, sizeof (asymbol));
+ if (new)
+ new->the_bfd = abfd;
+ return new;
+}
+
+static struct user *
+read_uarea(abfd, filepos)
+ bfd *abfd;
+ int filepos;
+
+{
+ struct sco5_core_struct *rawptr;
+
+ rawptr = ((struct sco5_core_struct *)
+ bfd_zmalloc (sizeof (struct sco5_core_struct)));
+ if (rawptr == NULL)
+ return NULL;
+
+ abfd->tdata.sco5_core_data = rawptr;
+
+ if ((bfd_seek (abfd, filepos, SEEK_SET) != 0)
+ || (bfd_read ((void *)&rawptr->u, 1, sizeof rawptr->u, abfd)
+ != sizeof rawptr->u))
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+
+ /* Sanity check perhaps??? */
+ if (rawptr->u.u_dsize > 0x1000000) /* Remember, it's in pages... */
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+ if (rawptr->u.u_ssize > 0x1000000)
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+ return &rawptr->u;
+}
+
+/* ARGSUSED */
+const bfd_target *
+sco5_core_file_p (abfd)
+ bfd *abfd;
+{
+ int coffset_siz, val, nsecs, cheadoffs;
+ int coresize;
+ struct user *u;
+ struct coreoffsets coffsets;
+ struct coresecthead chead;
+ char *secname;
+ flagword flags;
+
+ /* Read coreoffsets region at end of core (see core(FP)) */
+
+ {
+ FILE *stream = bfd_cache_lookup (abfd);
+ struct stat statbuf;
+ if (stream == NULL)
+ return NULL;
+ if (fstat (fileno (stream), &statbuf) < 0)
+ {
+ bfd_set_error (bfd_error_system_call);
+ return NULL;
+ }
+ coresize = statbuf.st_size;
+ }
+ /* Last long in core is sizeof struct coreoffsets, read it */
+ if ((bfd_seek (abfd, coresize-sizeof coffset_siz, SEEK_SET) != 0)
+ || (bfd_read ((void *)&coffset_siz, 1, sizeof coffset_siz, abfd)
+ != sizeof coffset_siz) )
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+
+ /* Use it to seek start of coreoffsets region, read it and determine
+ validity */
+ if ((bfd_seek (abfd, coresize-coffset_siz, SEEK_SET) != 0)
+ || (bfd_read ((void *)&coffsets, 1, sizeof coffsets, abfd)
+ != sizeof coffsets)
+ || ((coffsets.u_info != 1) && (coffsets.u_info != C_VERSION)))
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+
+
+ if (coffsets.u_info == 1)
+ {
+ /* Old version, no section heads, read info from user struct */
+
+ u = read_uarea(abfd, coffsets.u_user);
+ if (! u)
+ return NULL;
+
+ if (!make_bfd_asection (abfd, ".reg", SEC_HAS_CONTENTS,
+ (bfd_size_type) coffsets.u_usize,
+ 0 - (bfd_vma) u->u_ar0,
+ (file_ptr) coffsets.u_user))
+ return NULL;
+
+ if (!make_bfd_asection (abfd, ".data",
+ SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS,
+ ((bfd_size_type) u->u_exdata.ux_dsize
+ + u->u_exdata.ux_bsize),
+ (bfd_vma) u->u_exdata.ux_datorg,
+ (file_ptr) coffsets.u_data))
+ return NULL;
+
+ if (!make_bfd_asection (abfd, ".stack",
+ SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS,
+ (bfd_size_type) u->u_ssize * NBPC,
+ (bfd_vma) u->u_sub,
+ (file_ptr) coffsets.u_stack))
+ return NULL;
+
+ return abfd->xvec; /* Done for version 1 */
+ }
+
+ /* Immediately before coreoffsets region is a long with offset in core
+ to first coresecthead (CORES_OFFSETS), the long before this is the
+ number of section heads in the list. Read both longs and read the
+ coresecthead and check its validity */
+
+ if ((bfd_seek (abfd,
+ coresize - coffset_siz - 2 * sizeof coffset_siz,
+ SEEK_SET) != 0)
+ || (bfd_read ((void *)&nsecs, 1, sizeof nsecs, abfd) != sizeof nsecs)
+ || (bfd_read ((void *)&cheadoffs, 1, sizeof cheadoffs, abfd)
+ != sizeof cheadoffs)
+ || (bfd_seek (abfd, cheadoffs, SEEK_SET) != 0)
+ || (bfd_read ((void *)&chead, 1, sizeof chead, abfd) != sizeof chead)
+ || (chead.cs_stype != CORES_OFFSETS)
+ || (chead.cs_x.csx_magic != COREMAGIC_NUMBER))
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+
+ /* OK, we believe you. You're a core file (sure, sure). */
+
+ /* Now loop over all regions and map them */
+ nsecs--; /* We've seen CORES_OFFSETS already */
+ for (; nsecs; nsecs--)
+ {
+ if ((bfd_seek (abfd, chead.cs_hseek, SEEK_SET) != 0)
+ || bfd_read ((void *)&chead, 1, sizeof chead, abfd) != sizeof chead)
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+
+ switch (chead.cs_stype)
+ {
+ case CORES_MAGIC: /* Core header, check magic */
+ if (chead.cs_x.csx_magic != COREMAGIC_NUMBER)
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+ secname = NULL;
+ nsecs++; /* MAGIC not in section cnt!*/
+ break;
+ case CORES_UAREA: /* U-area, read in tdata */
+ u = read_uarea(abfd, chead.cs_sseek);
+ if (! u)
+ return NULL;
+
+ /* This is tricky. As the "register section", we give them
+ the entire upage and stack. u.u_ar0 points to where
+ "register 0" is stored. There are two tricks with this,
+ though. One is that the rest of the registers might be
+ at positive or negative (or both) displacements from
+ *u_ar0. The other is that u_ar0 is sometimes an absolute
+ address in kernel memory, and on other systems it is an
+ offset from the beginning of the `struct user'.
+
+ As a practical matter, we don't know where the registers
+ actually are, so we have to pass the whole area to GDB.
+ We encode the value of u_ar0 by setting the .regs section
+ up so that its virtual memory address 0 is at the place
+ pointed to by u_ar0 (by setting the vma of the start of
+ the section to -u_ar0). GDB uses this info to locate the
+ regs, using minor trickery to get around the
+ offset-or-absolute-addr problem. */
+
+ chead.cs_vaddr = 0 - (bfd_vma) u->u_ar0;
+
+
+ secname = ".reg";
+ flags = SEC_HAS_CONTENTS;
+
+ break;
+ case CORES_PREGION: /* A program region, map it */
+ switch (chead.cs_x.csx_preg.csxp_rtyp)
+ {
+ case PT_DATA:
+ secname = ".data"; /* Data region. */
+ break;
+ case PT_STACK:
+ secname = ".stack"; /* Stack region. */
+ break;
+ case PT_SHMEM:
+ secname = ".shmem"; /* Shared memory */
+ break;
+ case PT_LIBDAT:
+ secname = ".libdat"; /* Shared library data */
+ break;
+ case PT_V86:
+ secname = ".virt86"; /* Virtual 8086 mode */
+ break;
+ case PT_SHFIL:
+ secname = ".mmfile"; /* Memory mapped file */
+ break;
+ case PT_XDATA0:
+ secname = ".Xdat0"; /* XENIX data region, virtual 0 */
+ break;
+ default:
+ secname = "";
+ }
+ flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS;
+ break;
+ case CORES_PROC: /* struct proc */
+ case CORES_ITIMER: /* interval timers */
+ case CORES_SCOUTSNAME: /* struct scoutsname */
+ secname = NULL; /* Ignore these */
+ break;
+ default:
+ (*_bfd_error_handler) ("Unhandled SCO core file section type %d\n",
+ chead.cs_stype);
+ continue;
+ }
+
+ if (secname
+ && !make_bfd_asection (abfd, secname, flags,
+ (bfd_size_type) chead.cs_vsize,
+ (bfd_vma) chead.cs_vaddr,
+ (file_ptr) chead.cs_sseek))
+ return NULL;
+
+ }
+
+ return abfd->xvec;
+
+}
+
+char *
+sco5_core_file_failing_command (abfd)
+ bfd *abfd;
+{
+ char *com = abfd->tdata.sco5_core_data->u.u_comm;
+ if (*com)
+ return com;
+ else
+ return NULL;
+}
+
+/* ARGSUSED */
+int
+sco5_core_file_failing_signal (ignore_abfd)
+ bfd *ignore_abfd;
+{
+ return ((ignore_abfd->tdata.sco5_core_data->u.u_sysabort != 0)
+ ? ignore_abfd->tdata.sco5_core_data->u.u_sysabort
+ : -1);
+}
+
+/* ARGSUSED */
+boolean
+sco5_core_file_matches_executable_p (core_bfd, exec_bfd)
+ bfd *core_bfd, *exec_bfd;
+{
+ return true; /* FIXME, We have no way of telling at this point */
+}
+
+#define sco5_core_get_symtab_upper_bound _bfd_nosymbols_get_symtab_upper_bound
+#define sco5_core_get_symtab _bfd_nosymbols_get_symtab
+#define sco5_core_print_symbol _bfd_nosymbols_print_symbol
+#define sco5_core_get_symbol_info _bfd_nosymbols_get_symbol_info
+#define sco5_core_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
+#define sco5_core_get_lineno _bfd_nosymbols_get_lineno
+#define sco5_core_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define sco5_core_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define sco5_core_read_minisymbols _bfd_nosymbols_read_minisymbols
+#define sco5_core_minisymbol_to_symbol _bfd_nosymbols_minisymbol_to_symbol
+
+/* If somebody calls any byte-swapping routines, shoot them. */
+static void
+swap_abort()
+{
+ abort(); /* This way doesn't require any declaration for ANSI to fuck up */
+}
+#define NO_GET ((bfd_vma (*) PARAMS (( const bfd_byte *))) swap_abort )
+#define NO_PUT ((void (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort )
+#define NO_SIGNED_GET \
+ ((bfd_signed_vma (*) PARAMS ((const bfd_byte *))) swap_abort )
+
+const bfd_target sco5_core_vec =
+ {
+ "sco5-core",
+ bfd_target_unknown_flavour,
+ BFD_ENDIAN_LITTLE, /* target byte order */
+ BFD_ENDIAN_LITTLE, /* target headers byte order */
+ (HAS_RELOC | EXEC_P | /* object flags */
+ HAS_LINENO | HAS_DEBUG |
+ HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
+ 0, /* symbol prefix */
+ ' ', /* ar_pad_char */
+ 16, /* ar_max_namelen */
+ NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit data */
+ NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit data */
+ NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit data */
+ NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit hdrs */
+ NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit hdrs */
+ NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit hdrs */
+
+ { /* bfd_check_format */
+ _bfd_dummy_target, /* unknown format */
+ _bfd_dummy_target, /* object file */
+ _bfd_dummy_target, /* archive */
+ sco5_core_file_p /* a core file */
+ },
+ { /* bfd_set_format */
+ bfd_false, bfd_false,
+ bfd_false, bfd_false
+ },
+ { /* bfd_write_contents */
+ bfd_false, bfd_false,
+ bfd_false, bfd_false
+ },
+
+ BFD_JUMP_TABLE_GENERIC (_bfd_generic),
+ BFD_JUMP_TABLE_COPY (_bfd_generic),
+ BFD_JUMP_TABLE_CORE (sco5),
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
+ BFD_JUMP_TABLE_SYMBOLS (sco5_core),
+ BFD_JUMP_TABLE_RELOCS (_bfd_norelocs),
+ BFD_JUMP_TABLE_WRITE (_bfd_generic),
+ BFD_JUMP_TABLE_LINK (_bfd_nolink),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+
+ NULL,
+
+ (PTR) 0 /* backend_data */
+};
diff --git a/contrib/binutils/bfd/section.c b/contrib/binutils/bfd/section.c
index 787855ca4e94..b3b760802d3e 100644
--- a/contrib/binutils/bfd/section.c
+++ b/contrib/binutils/bfd/section.c
@@ -1,5 +1,5 @@
/* Object file "section" support for the BFD library.
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -137,7 +137,7 @@ SUBSECTION
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
-
+#include "bfdlink.h"
/*
DOCDD
@@ -150,6 +150,27 @@ SUBSECTION
CODE_FRAGMENT
.
+. {* This structure is used for a comdat section, as in PE. A comdat
+. section is associated with a particular symbol. When the linker
+. sees a comdat section, it keeps only one of the sections with a
+. given name and associated with a given symbol. *}
+.
+.struct bfd_comdat_info
+.{
+. {* The name of the symbol associated with a comdat section. *}
+. const char *name;
+.
+. {* The local symbol table index of the symbol associated with a
+. comdat section. This is only meaningful to the object file format
+. specific code; it is not an index into the list returned by
+. bfd_canonicalize_symtab. *}
+. long symbol;
+.
+. {* If this section is being discarded, the linker uses this field
+. to point to the input section which is being kept. *}
+. struct sec *sec;
+.};
+.
.typedef struct sec
.{
. {* The name of the section; the name isn't a copy, the pointer is
@@ -215,7 +236,7 @@ CODE_FRAGMENT
. standard data. *}
.#define SEC_CONSTRUCTOR 0x100
.
-. {* The section is a constuctor, and should be placed at the
+. {* The section is a constructor, and should be placed at the
. end of the text, data, or bss section(?). *}
.#define SEC_CONSTRUCTOR_TEXT 0x1100
.#define SEC_CONSTRUCTOR_DATA 0x2100
@@ -304,6 +325,17 @@ CODE_FRAGMENT
. else up the line will take care of it later. *}
.#define SEC_LINKER_CREATED 0x800000
.
+. {* This section should not be subject to garbage collection. *}
+.#define SEC_KEEP 0x1000000
+.
+. {* This section contains "short" data, and should be placed
+. "near" the GP. *}
+.#define SEC_SMALL_DATA 0x2000000
+.
+. {* This section contains data which may be shared with other
+. executables or shared objects. *}
+.#define SEC_SHARED 0x4000000
+.
. {* End of section flags. *}
.
. {* Some internal packed boolean fields. *}
@@ -317,6 +349,9 @@ CODE_FRAGMENT
. {* A mark flag used by some of the linker backends. *}
. unsigned int linker_mark : 1;
.
+. {* A mark flag used by some linker backends for garbage collection. *}
+. unsigned int gc_mark : 1;
+.
. {* End of internal packed boolean fields. *}
.
. {* The virtual memory address of the section - where it will be
@@ -334,22 +369,25 @@ CODE_FRAGMENT
.
. bfd_vma lma;
.
-. {* The size of the section in bytes, as it will be output.
-. contains a value even if the section has no contents (e.g., the
-. size of <<.bss>>). This will be filled in after relocation *}
+. {* The size of the section in octets, as it will be output.
+. Contains a value even if the section has no contents (e.g., the
+. size of <<.bss>>). This will be filled in after relocation. *}
.
. bfd_size_type _cooked_size;
.
-. {* The original size on disk of the section, in bytes. Normally this
+. {* The original size on disk of the section, in octets. Normally this
. value is the same as the size, but if some relaxing has
. been done, then this value will be bigger. *}
.
. bfd_size_type _raw_size;
.
. {* If this section is going to be output, then this value is the
-. offset into the output section of the first byte in the input
-. section. E.g., if this was going to start at the 100th byte in
-. the output section, this value would be 100. *}
+. offset in *bytes* into the output section of the first byte in the
+. input section (byte ==> smallest addressable unit on the
+. target). In most cases, if this was going to start at the
+. 100th octet (8-bit quantity) in the output section, this value
+. would be 100. However, if the target byte size is 16 bits
+. (bfd_octets_per_byte is "2"), this value would be 50. *}
.
. bfd_vma output_offset;
.
@@ -407,6 +445,10 @@ CODE_FRAGMENT
.
. unsigned int lineno_count;
.
+. {* Optional information about a COMDAT entry; NULL if not COMDAT *}
+.
+. struct bfd_comdat_info *comdat;
+.
. {* When a section is being output, this value changes as more
. linenumbers are written out *}
.
@@ -466,28 +508,60 @@ CODE_FRAGMENT
.extern const struct symbol_cache_entry * const bfd_und_symbol;
.extern const struct symbol_cache_entry * const bfd_ind_symbol;
.#define bfd_get_section_size_before_reloc(section) \
-. (section->reloc_done ? (abort(),1): (section)->_raw_size)
+. ((section)->reloc_done ? (abort (), (bfd_size_type) 1) \
+. : (section)->_raw_size)
.#define bfd_get_section_size_after_reloc(section) \
-. ((section->reloc_done) ? (section)->_cooked_size: (abort(),1))
+. ((section)->reloc_done ? (section)->_cooked_size \
+. : (abort (), (bfd_size_type) 1))
*/
+/* We use a macro to initialize the static asymbol structures because
+ traditional C does not permit us to initialize a union member while
+ gcc warns if we don't initialize it. */
+ /* the_bfd, name, value, attr, section [, udata] */
+#ifdef __STDC__
+#define GLOBAL_SYM_INIT(NAME, SECTION) \
+ { 0, NAME, 0, BSF_SECTION_SYM, (asection *) SECTION, { 0 }}
+#else
+#define GLOBAL_SYM_INIT(NAME, SECTION) \
+ { 0, NAME, 0, BSF_SECTION_SYM, (asection *) SECTION }
+#endif
+
/* These symbols are global, not specific to any BFD. Therefore, anything
that tries to change them is broken, and should be repaired. */
+
static const asymbol global_syms[] =
{
- /* the_bfd, name, value, attr, section [, udata] */
- {0, BFD_COM_SECTION_NAME, 0, BSF_SECTION_SYM, (asection *) &bfd_com_section},
- {0, BFD_UND_SECTION_NAME, 0, BSF_SECTION_SYM, (asection *) &bfd_und_section},
- {0, BFD_ABS_SECTION_NAME, 0, BSF_SECTION_SYM, (asection *) &bfd_abs_section},
- {0, BFD_IND_SECTION_NAME, 0, BSF_SECTION_SYM, (asection *) &bfd_ind_section},
+ GLOBAL_SYM_INIT (BFD_COM_SECTION_NAME, &bfd_com_section),
+ GLOBAL_SYM_INIT (BFD_UND_SECTION_NAME, &bfd_und_section),
+ GLOBAL_SYM_INIT (BFD_ABS_SECTION_NAME, &bfd_abs_section),
+ GLOBAL_SYM_INIT (BFD_IND_SECTION_NAME, &bfd_ind_section)
};
#define STD_SECTION(SEC, FLAGS, SYM, NAME, IDX) \
const asymbol * const SYM = (asymbol *) &global_syms[IDX]; \
const asection SEC = \
- { NAME, 0, 0, FLAGS, 0, 0, 0, 0, 0, 0, 0, 0, (asection *) &SEC, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
- (asymbol *) &global_syms[IDX], (asymbol **) &SYM, 0, 0 }
+ /* name, index, next, flags, set_vma, reloc_done, linker_mark, gc_mark */ \
+ { NAME, 0, 0, FLAGS, 0, 0, 0, 0, \
+ \
+ /* vma, lma, _cooked_size, _raw_size, output_offset, output_section, */ \
+ 0, 0, 0, 0, 0, (struct sec *) &SEC, \
+ \
+ /* alig..., reloc..., orel..., reloc_count, filepos, rel_..., line_... */ \
+ 0, 0, 0, 0, 0, 0, 0, \
+ \
+ /* userdata, contents, lineno, lineno_count */ \
+ 0, 0, 0, 0, \
+ \
+ /* comdat_info, moving_line_filepos, target_index, used_by_bfd, */ \
+ NULL, 0, 0, 0, \
+ \
+ /* cons..., owner, symbol */ \
+ 0, 0, (struct symbol_cache_entry *) &global_syms[IDX], \
+ \
+ /* symbol_ptr_ptr, link_order_head, ..._tail */ \
+ (struct symbol_cache_entry **) &SYM, 0, 0 \
+ }
STD_SECTION (bfd_com_section, SEC_IS_COMMON, bfd_com_symbol,
BFD_COM_SECTION_NAME, 0);
@@ -630,6 +704,7 @@ bfd_make_section_anyway (abfd, name)
newsect->reloc_count = 0;
newsect->line_filepos = 0;
newsect->owner = abfd;
+ newsect->comdat = NULL;
/* Create a symbol whos only job is to point to this section. This is
useful for things like relocs which are relative to the base of a
@@ -727,7 +802,7 @@ DESCRIPTION
/*ARGSUSED*/
boolean
bfd_set_section_flags (abfd, section, flags)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
sec_ptr section;
flagword flags;
{
@@ -850,7 +925,7 @@ DESCRIPTION
Sets the contents of the section @var{section} in BFD
@var{abfd} to the data starting in memory at @var{data}. The
data is written to the output section starting at offset
- @var{offset} for @var{count} bytes.
+ @var{offset} for @var{count} octets.
@@ -1020,3 +1095,80 @@ DESCRIPTION
. BFD_SEND (obfd, _bfd_copy_private_section_data, \
. (ibfd, isection, obfd, osection))
*/
+
+/*
+FUNCTION
+ _bfd_strip_section_from_output
+
+SYNOPSIS
+ void _bfd_strip_section_from_output
+ (struct bfd_link_info *info, asection *section);
+
+DESCRIPTION
+ Remove @var{section} from the output. If the output section
+ becomes empty, remove it from the output bfd. @var{info} may
+ be NULL; if it is not, it is used to decide whether the output
+ section is empty.
+*/
+void
+_bfd_strip_section_from_output (info, s)
+ struct bfd_link_info *info;
+ asection *s;
+{
+ asection **spp, *os;
+ struct bfd_link_order *p, *pp;
+ boolean keep_os;
+
+ /* Excise the input section from the link order.
+
+ FIXME: For all calls that I can see to this function, the link
+ orders have not yet been set up. So why are we checking them? --
+ Ian */
+ os = s->output_section;
+ for (p = os->link_order_head, pp = NULL; p != NULL; pp = p, p = p->next)
+ if (p->type == bfd_indirect_link_order
+ && p->u.indirect.section == s)
+ {
+ if (pp)
+ pp->next = p->next;
+ else
+ os->link_order_head = p->next;
+ if (!p->next)
+ os->link_order_tail = pp;
+ break;
+ }
+
+ keep_os = os->link_order_head != NULL;
+
+ if (! keep_os && info != NULL)
+ {
+ bfd *abfd;
+ for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link_next)
+ {
+ asection *is;
+ for (is = abfd->sections; is != NULL; is = is->next)
+ {
+ if (is != s && is->output_section == os)
+ break;
+ }
+ if (is != NULL)
+ break;
+ }
+ if (abfd != NULL)
+ keep_os = true;
+ }
+
+ /* If the output section is empty, remove it too. Careful about sections
+ that have been discarded in the link script -- they are mapped to
+ bfd_abs_section, which has no owner. */
+ if (!keep_os && os->owner != NULL)
+ {
+ for (spp = &os->owner->sections; *spp; spp = &(*spp)->next)
+ if (*spp == os)
+ {
+ *spp = os->next;
+ os->owner->section_count--;
+ break;
+ }
+ }
+}
diff --git a/contrib/binutils/bfd/sparclinux.c b/contrib/binutils/bfd/sparclinux.c
new file mode 100644
index 000000000000..73a29b39b262
--- /dev/null
+++ b/contrib/binutils/bfd/sparclinux.c
@@ -0,0 +1,771 @@
+/* BFD back-end for linux flavored sparc a.out binaries.
+ Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999
+ Free Software Foundation, Inc.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+USA. */
+
+#define TARGET_PAGE_SIZE 4096
+#define ZMAGIC_DISK_BLOCK_SIZE 1024
+#define SEGMENT_SIZE TARGET_PAGE_SIZE
+#define TEXT_START_ADDR 0x0
+#define N_SHARED_LIB(x) 0
+#define BYTES_IN_WORD 4
+
+#define MACHTYPE_OK(mtype) ((mtype) == M_SPARC || (mtype) == M_UNKNOWN)
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "aout/aout64.h"
+#include "aout/stab_gnu.h"
+#include "aout/ar.h"
+#include "libaout.h" /* BFD a.out internal data structures */
+
+#define DEFAULT_ARCH bfd_arch_sparc
+#define MY(OP) CAT(sparclinux_,OP)
+#define TARGETNAME "a.out-sparc-linux"
+
+extern const bfd_target MY(vec);
+
+/* We always generate QMAGIC files in preference to ZMAGIC files. It
+ would be possible to make this a linker option, if that ever
+ becomes important. */
+
+static void MY_final_link_callback
+ PARAMS ((bfd *, file_ptr *, file_ptr *, file_ptr *));
+
+static boolean sparclinux_bfd_final_link
+ PARAMS ((bfd *abfd, struct bfd_link_info *info));
+
+static boolean
+sparclinux_bfd_final_link (abfd, info)
+ bfd *abfd;
+ struct bfd_link_info *info;
+{
+ obj_aout_subformat (abfd) = q_magic_format;
+ return NAME(aout,final_link) (abfd, info, MY_final_link_callback);
+}
+
+#define MY_bfd_final_link sparclinux_bfd_final_link
+
+/* Set the machine type correctly. */
+
+static boolean sparclinux_write_object_contents PARAMS ((bfd *abfd));
+
+static boolean
+sparclinux_write_object_contents (abfd)
+ bfd *abfd;
+{
+ struct external_exec exec_bytes;
+ struct internal_exec *execp = exec_hdr (abfd);
+
+ N_SET_MACHTYPE (*execp, M_SPARC);
+
+ obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
+
+ WRITE_HEADERS(abfd, execp);
+
+ return true;
+}
+
+#define MY_write_object_contents sparclinux_write_object_contents
+/* Code to link against Linux a.out shared libraries. */
+
+/* See if a symbol name is a reference to the global offset table. */
+
+#ifndef GOT_REF_PREFIX
+#define GOT_REF_PREFIX "__GOT_"
+#endif
+
+#define IS_GOT_SYM(name) \
+ (strncmp (name, GOT_REF_PREFIX, sizeof GOT_REF_PREFIX - 1) == 0)
+
+/* See if a symbol name is a reference to the procedure linkage table. */
+
+#ifndef PLT_REF_PREFIX
+#define PLT_REF_PREFIX "__PLT_"
+#endif
+
+#define IS_PLT_SYM(name) \
+ (strncmp (name, PLT_REF_PREFIX, sizeof PLT_REF_PREFIX - 1) == 0)
+
+/* This string is used to generate specialized error messages. */
+
+#ifndef NEEDS_SHRLIB
+#define NEEDS_SHRLIB "__NEEDS_SHRLIB_"
+#endif
+
+/* This special symbol is a set vector that contains a list of
+ pointers to fixup tables. It will be present in any dynamicly
+ linked file. The linker generated fixup table should also be added
+ to the list, and it should always appear in the second slot (the
+ first one is a dummy with a magic number that is defined in
+ crt0.o). */
+
+#ifndef SHARABLE_CONFLICTS
+#define SHARABLE_CONFLICTS "__SHARABLE_CONFLICTS__"
+#endif
+
+/* We keep a list of fixups. The terminology is a bit strange, but
+ each fixup contains two 32 bit numbers. A regular fixup contains
+ an address and a pointer, and at runtime we should store the
+ address at the location pointed to by the pointer. A builtin fixup
+ contains two pointers, and we should read the address using one
+ pointer and store it at the location pointed to by the other
+ pointer. Builtin fixups come into play when we have duplicate
+ __GOT__ symbols for the same variable. The builtin fixup will copy
+ the GOT pointer from one over into the other. */
+
+struct fixup
+{
+ struct fixup *next;
+ struct linux_link_hash_entry *h;
+ bfd_vma value;
+
+ /* Nonzero if this is a jump instruction that needs to be fixed,
+ zero if this is just a pointer */
+ char jump;
+
+ char builtin;
+};
+
+/* We don't need a special hash table entry structure, but we do need
+ to keep some information between linker passes, so we use a special
+ hash table. */
+
+struct linux_link_hash_entry
+{
+ struct aout_link_hash_entry root;
+};
+
+struct linux_link_hash_table
+{
+ struct aout_link_hash_table root;
+
+ /* First dynamic object found in link. */
+ bfd *dynobj;
+
+ /* Number of fixups. */
+ size_t fixup_count;
+
+ /* Number of builtin fixups. */
+ size_t local_builtins;
+
+ /* List of fixups. */
+ struct fixup *fixup_list;
+};
+
+static struct bfd_hash_entry *linux_link_hash_newfunc
+ PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
+static struct bfd_link_hash_table *linux_link_hash_table_create
+ PARAMS ((bfd *));
+static struct fixup *new_fixup
+ PARAMS ((struct bfd_link_info *, struct linux_link_hash_entry *,
+ bfd_vma, int));
+static boolean linux_link_create_dynamic_sections
+ PARAMS ((bfd *, struct bfd_link_info *));
+static boolean linux_add_one_symbol
+ PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, asection *,
+ bfd_vma, const char *, boolean, boolean,
+ struct bfd_link_hash_entry **));
+static boolean linux_tally_symbols
+ PARAMS ((struct linux_link_hash_entry *, PTR));
+static boolean linux_finish_dynamic_link
+ PARAMS ((bfd *, struct bfd_link_info *));
+
+/* Routine to create an entry in an Linux link hash table. */
+
+static struct bfd_hash_entry *
+linux_link_hash_newfunc (entry, table, string)
+ struct bfd_hash_entry *entry;
+ struct bfd_hash_table *table;
+ const char *string;
+{
+ struct linux_link_hash_entry *ret = (struct linux_link_hash_entry *) entry;
+
+ /* Allocate the structure if it has not already been allocated by a
+ subclass. */
+ if (ret == (struct linux_link_hash_entry *) NULL)
+ ret = ((struct linux_link_hash_entry *)
+ bfd_hash_allocate (table, sizeof (struct linux_link_hash_entry)));
+ if (ret == NULL)
+ return (struct bfd_hash_entry *) ret;
+
+ /* Call the allocation method of the superclass. */
+ ret = ((struct linux_link_hash_entry *)
+ NAME(aout,link_hash_newfunc) ((struct bfd_hash_entry *) ret,
+ table, string));
+ if (ret != NULL)
+ {
+ /* Set local fields; there aren't any. */
+ }
+
+ return (struct bfd_hash_entry *) ret;
+}
+
+/* Create a Linux link hash table. */
+
+static struct bfd_link_hash_table *
+linux_link_hash_table_create (abfd)
+ bfd *abfd;
+{
+ struct linux_link_hash_table *ret;
+
+ ret = ((struct linux_link_hash_table *)
+ bfd_alloc (abfd, sizeof (struct linux_link_hash_table)));
+ if (ret == (struct linux_link_hash_table *) NULL)
+ return (struct bfd_link_hash_table *) NULL;
+ if (! NAME(aout,link_hash_table_init) (&ret->root, abfd,
+ linux_link_hash_newfunc))
+ {
+ free (ret);
+ return (struct bfd_link_hash_table *) NULL;
+ }
+
+ ret->dynobj = NULL;
+ ret->fixup_count = 0;
+ ret->local_builtins = 0;
+ ret->fixup_list = NULL;
+
+ return &ret->root.root;
+}
+
+/* Look up an entry in a Linux link hash table. */
+
+#define linux_link_hash_lookup(table, string, create, copy, follow) \
+ ((struct linux_link_hash_entry *) \
+ aout_link_hash_lookup (&(table)->root, (string), (create), (copy),\
+ (follow)))
+
+/* Traverse a Linux link hash table. */
+
+#define linux_link_hash_traverse(table, func, info) \
+ (aout_link_hash_traverse \
+ (&(table)->root, \
+ (boolean (*) PARAMS ((struct aout_link_hash_entry *, PTR))) (func), \
+ (info)))
+
+/* Get the Linux link hash table from the info structure. This is
+ just a cast. */
+
+#define linux_hash_table(p) ((struct linux_link_hash_table *) ((p)->hash))
+
+/* Store the information for a new fixup. */
+
+static struct fixup *
+new_fixup (info, h, value, builtin)
+ struct bfd_link_info *info;
+ struct linux_link_hash_entry *h;
+ bfd_vma value;
+ int builtin;
+{
+ struct fixup *f;
+
+ f = (struct fixup *) bfd_hash_allocate (&info->hash->table,
+ sizeof (struct fixup));
+ if (f == NULL)
+ return f;
+ f->next = linux_hash_table (info)->fixup_list;
+ linux_hash_table (info)->fixup_list = f;
+ f->h = h;
+ f->value = value;
+ f->builtin = builtin;
+ f->jump = 0;
+ ++linux_hash_table (info)->fixup_count;
+ return f;
+}
+
+/* We come here once we realize that we are going to link to a shared
+ library. We need to create a special section that contains the
+ fixup table, and we ultimately need to add a pointer to this into
+ the set vector for SHARABLE_CONFLICTS. At this point we do not
+ know the size of the section, but that's OK - we just need to
+ create it for now. */
+
+static boolean
+linux_link_create_dynamic_sections (abfd, info)
+ bfd *abfd;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
+{
+ flagword flags;
+ register asection *s;
+
+ /* Note that we set the SEC_IN_MEMORY flag. */
+ flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY;
+
+ /* We choose to use the name ".linux-dynamic" for the fixup table.
+ Why not? */
+ s = bfd_make_section (abfd, ".linux-dynamic");
+ if (s == NULL
+ || ! bfd_set_section_flags (abfd, s, flags)
+ || ! bfd_set_section_alignment (abfd, s, 2))
+ return false;
+ s->_raw_size = 0;
+ s->contents = 0;
+
+ return true;
+}
+
+/* Function to add a single symbol to the linker hash table. This is
+ a wrapper around _bfd_generic_link_add_one_symbol which handles the
+ tweaking needed for dynamic linking support. */
+
+static boolean
+linux_add_one_symbol (info, abfd, name, flags, section, value, string,
+ copy, collect, hashp)
+ struct bfd_link_info *info;
+ bfd *abfd;
+ const char *name;
+ flagword flags;
+ asection *section;
+ bfd_vma value;
+ const char *string;
+ boolean copy;
+ boolean collect;
+ struct bfd_link_hash_entry **hashp;
+{
+ struct linux_link_hash_entry *h;
+ boolean insert;
+
+ /* Look up and see if we already have this symbol in the hash table.
+ If we do, and the defining entry is from a shared library, we
+ need to create the dynamic sections.
+
+ FIXME: What if abfd->xvec != info->hash->creator? We may want to
+ be able to link Linux a.out and ELF objects together, but serious
+ confusion is possible. */
+
+ insert = false;
+
+ if (! info->relocateable
+ && linux_hash_table (info)->dynobj == NULL
+ && strcmp (name, SHARABLE_CONFLICTS) == 0
+ && (flags & BSF_CONSTRUCTOR) != 0
+ && abfd->xvec == info->hash->creator)
+ {
+ if (! linux_link_create_dynamic_sections (abfd, info))
+ return false;
+ linux_hash_table (info)->dynobj = abfd;
+ insert = true;
+ }
+
+ if (bfd_is_abs_section (section)
+ && abfd->xvec == info->hash->creator)
+ {
+ h = linux_link_hash_lookup (linux_hash_table (info), name, false,
+ false, false);
+ if (h != NULL
+ && (h->root.root.type == bfd_link_hash_defined
+ || h->root.root.type == bfd_link_hash_defweak))
+ {
+ struct fixup *f;
+
+ if (hashp != NULL)
+ *hashp = (struct bfd_link_hash_entry *) h;
+
+ f = new_fixup (info, h, value, ! IS_PLT_SYM (name));
+ if (f == NULL)
+ return false;
+ f->jump = IS_PLT_SYM (name);
+
+ return true;
+ }
+ }
+
+ /* Do the usual procedure for adding a symbol. */
+ if (! _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section,
+ value, string, copy, collect,
+ hashp))
+ return false;
+
+ /* Insert a pointer to our table in the set vector. The dynamic
+ linker requires this information */
+ if (insert)
+ {
+ asection *s;
+
+ /* Here we do our special thing to add the pointer to the
+ dynamic section in the SHARABLE_CONFLICTS set vector. */
+ s = bfd_get_section_by_name (linux_hash_table (info)->dynobj,
+ ".linux-dynamic");
+ BFD_ASSERT (s != NULL);
+
+ if (! (_bfd_generic_link_add_one_symbol
+ (info, linux_hash_table (info)->dynobj, SHARABLE_CONFLICTS,
+ BSF_GLOBAL | BSF_CONSTRUCTOR, s, 0, NULL, false, false, NULL)))
+ return false;
+ }
+
+ return true;
+}
+
+/* We will crawl the hash table and come here for every global symbol.
+ We will examine each entry and see if there are indications that we
+ need to add a fixup. There are two possible cases - one is where
+ you have duplicate definitions of PLT or GOT symbols - these will
+ have already been caught and added as "builtin" fixups. If we find
+ that the corresponding non PLT/GOT symbol is also present, we
+ convert it to a regular fixup instead.
+
+ This function is called via linux_link_hash_traverse. */
+
+static boolean
+linux_tally_symbols (h, data)
+ struct linux_link_hash_entry *h;
+ PTR data;
+{
+ struct bfd_link_info *info = (struct bfd_link_info *) data;
+ struct fixup *f, *f1;
+ int is_plt;
+ struct linux_link_hash_entry *h1, *h2;
+ boolean exists;
+
+ if (h->root.root.type == bfd_link_hash_undefined
+ && strncmp (h->root.root.root.string, NEEDS_SHRLIB,
+ sizeof NEEDS_SHRLIB - 1) == 0)
+ {
+ const char *name;
+ char *p;
+ char *alloc = NULL;
+
+ name = h->root.root.root.string + sizeof NEEDS_SHRLIB - 1;
+ p = strrchr (name, '_');
+ if (p != NULL)
+ alloc = (char *) bfd_malloc (strlen (name) + 1);
+
+ if (p == NULL || alloc == NULL)
+ (*_bfd_error_handler) (_("Output file requires shared library `%s'\n"),
+ name);
+ else
+ {
+ strcpy (alloc, name);
+ p = strrchr (alloc, '_');
+ *p++ = '\0';
+ (*_bfd_error_handler)
+ (_("Output file requires shared library `%s.so.%s'\n"),
+ alloc, p);
+ free (alloc);
+ }
+
+ abort ();
+ }
+
+ /* If this symbol is not a PLT/GOT, we do not even need to look at
+ it. */
+ is_plt = IS_PLT_SYM (h->root.root.root.string);
+
+ if (is_plt || IS_GOT_SYM (h->root.root.root.string))
+ {
+ /* Look up this symbol twice. Once just as a regular lookup,
+ and then again following all of the indirect links until we
+ reach a real symbol. */
+ h1 = linux_link_hash_lookup (linux_hash_table (info),
+ (h->root.root.root.string
+ + sizeof PLT_REF_PREFIX - 1),
+ false, false, true);
+ /* h2 does not follow indirect symbols. */
+ h2 = linux_link_hash_lookup (linux_hash_table (info),
+ (h->root.root.root.string
+ + sizeof PLT_REF_PREFIX - 1),
+ false, false, false);
+
+ /* The real symbol must exist but if it is also an ABS symbol,
+ there is no need to have a fixup. This is because they both
+ came from the same library. If on the other hand, we had to
+ use an indirect symbol to get to the real symbol, we add the
+ fixup anyway, since there are cases where these symbols come
+ from different shared libraries */
+ if (h1 != NULL
+ && (((h1->root.root.type == bfd_link_hash_defined
+ || h1->root.root.type == bfd_link_hash_defweak)
+ && ! bfd_is_abs_section (h1->root.root.u.def.section))
+ || h2->root.root.type == bfd_link_hash_indirect))
+ {
+ /* See if there is a "builtin" fixup already present
+ involving this symbol. If so, convert it to a regular
+ fixup. In the end, this relaxes some of the requirements
+ about the order of performing fixups. */
+ exists = false;
+ for (f1 = linux_hash_table (info)->fixup_list;
+ f1 != NULL;
+ f1 = f1->next)
+ {
+ if ((f1->h != h && f1->h != h1)
+ || (! f1->builtin && ! f1->jump))
+ continue;
+ if (f1->h == h1)
+ exists = true;
+ if (! exists
+ && bfd_is_abs_section (h->root.root.u.def.section))
+ {
+ f = new_fixup (info, h1, f1->h->root.root.u.def.value, 0);
+ f->jump = is_plt;
+ }
+ f1->h = h1;
+ f1->jump = is_plt;
+ f1->builtin = 0;
+ exists = true;
+ }
+ if (! exists
+ && bfd_is_abs_section (h->root.root.u.def.section))
+ {
+ f = new_fixup (info, h1, h->root.root.u.def.value, 0);
+ if (f == NULL)
+ {
+ /* FIXME: No way to return error. */
+ abort ();
+ }
+ f->jump = is_plt;
+ }
+ }
+
+ /* Quick and dirty way of stripping these symbols from the
+ symtab. */
+ if (bfd_is_abs_section (h->root.root.u.def.section))
+ h->root.written = true;
+ }
+
+ return true;
+}
+
+/* This is called to set the size of the .linux-dynamic section is.
+ It is called by the Linux linker emulation before_allocation
+ routine. We have finished reading all of the input files, and now
+ we just scan the hash tables to find out how many additional fixups
+ are required. */
+
+boolean
+bfd_sparclinux_size_dynamic_sections (output_bfd, info)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+{
+ struct fixup *f;
+ asection *s;
+
+ if (output_bfd->xvec != &MY(vec))
+ return true;
+
+ /* First find the fixups... */
+ linux_link_hash_traverse (linux_hash_table (info),
+ linux_tally_symbols,
+ (PTR) info);
+
+ /* If there are builtin fixups, leave room for a marker. This is
+ used by the dynamic linker so that it knows that all that follow
+ are builtin fixups instead of regular fixups. */
+ for (f = linux_hash_table (info)->fixup_list; f != NULL; f = f->next)
+ {
+ if (f->builtin)
+ {
+ ++linux_hash_table (info)->fixup_count;
+ ++linux_hash_table (info)->local_builtins;
+ break;
+ }
+ }
+
+ if (linux_hash_table (info)->dynobj == NULL)
+ {
+ if (linux_hash_table (info)->fixup_count > 0)
+ abort ();
+ return true;
+ }
+
+ /* Allocate memory for our fixup table. We will fill it in later. */
+ s = bfd_get_section_by_name (linux_hash_table (info)->dynobj,
+ ".linux-dynamic");
+ if (s != NULL)
+ {
+ s->_raw_size = 8 + linux_hash_table (info)->fixup_count * 8;
+ s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size);
+ if (s->contents == NULL)
+ return false;
+ memset (s->contents, 0, (size_t) s->_raw_size);
+ }
+
+ return true;
+}
+
+/* We come here once we are ready to actually write the fixup table to
+ the output file. Scan the fixup tables and so forth and generate
+ the stuff we need. */
+
+static boolean
+linux_finish_dynamic_link (output_bfd, info)
+ bfd *output_bfd;
+ struct bfd_link_info *info;
+{
+ asection *s, *os, *is;
+ bfd_byte *fixup_table;
+ struct linux_link_hash_entry *h;
+ struct fixup *f;
+ unsigned int new_addr;
+ int section_offset;
+ unsigned int fixups_written;
+
+ if (linux_hash_table (info)->dynobj == NULL)
+ return true;
+
+ s = bfd_get_section_by_name (linux_hash_table (info)->dynobj,
+ ".linux-dynamic");
+ BFD_ASSERT (s != NULL);
+ os = s->output_section;
+ fixups_written = 0;
+
+#ifdef LINUX_LINK_DEBUG
+ printf ("Fixup table file offset: %x VMA: %x\n",
+ os->filepos + s->output_offset,
+ os->vma + s->output_offset);
+#endif
+
+ fixup_table = s->contents;
+ bfd_put_32 (output_bfd, linux_hash_table (info)->fixup_count, fixup_table);
+ fixup_table += 4;
+
+ /* Fill in fixup table. */
+ for (f = linux_hash_table (info)->fixup_list; f != NULL; f = f->next)
+ {
+ if (f->builtin)
+ continue;
+
+ if (f->h->root.root.type != bfd_link_hash_defined
+ && f->h->root.root.type != bfd_link_hash_defweak)
+ {
+ (*_bfd_error_handler)
+ (_("Symbol %s not defined for fixups\n"),
+ f->h->root.root.root.string);
+ continue;
+ }
+
+ is = f->h->root.root.u.def.section;
+ section_offset = is->output_section->vma + is->output_offset;
+ new_addr = f->h->root.root.u.def.value + section_offset;
+
+#ifdef LINUX_LINK_DEBUG
+ printf ("Fixup(%d) %s: %x %x\n",f->jump, f->h->root.root.string,
+ new_addr, f->value);
+#endif
+
+ if (f->jump)
+ {
+ /* Relative address */
+ new_addr = new_addr - (f->value + 5);
+ bfd_put_32 (output_bfd, new_addr, fixup_table);
+ fixup_table += 4;
+ bfd_put_32 (output_bfd, f->value + 1, fixup_table);
+ fixup_table += 4;
+ }
+ else
+ {
+ bfd_put_32 (output_bfd, new_addr, fixup_table);
+ fixup_table += 4;
+ bfd_put_32 (output_bfd, f->value, fixup_table);
+ fixup_table += 4;
+ }
+ ++fixups_written;
+ }
+
+ if (linux_hash_table (info)->local_builtins != 0)
+ {
+ /* Special marker so we know to switch to the other type of fixup */
+ bfd_put_32 (output_bfd, 0, fixup_table);
+ fixup_table += 4;
+ bfd_put_32 (output_bfd, 0, fixup_table);
+ fixup_table += 4;
+ ++fixups_written;
+ for (f = linux_hash_table (info)->fixup_list; f != NULL; f = f->next)
+ {
+ if (! f->builtin)
+ continue;
+
+ if (f->h->root.root.type != bfd_link_hash_defined
+ && f->h->root.root.type != bfd_link_hash_defweak)
+ {
+ (*_bfd_error_handler)
+ (_("Symbol %s not defined for fixups\n"),
+ f->h->root.root.root.string);
+ continue;
+ }
+
+ is = f->h->root.root.u.def.section;
+ section_offset = is->output_section->vma + is->output_offset;
+ new_addr = f->h->root.root.u.def.value + section_offset;
+
+#ifdef LINUX_LINK_DEBUG
+ printf ("Fixup(B) %s: %x %x\n", f->h->root.root.string,
+ new_addr, f->value);
+#endif
+
+ bfd_put_32 (output_bfd, new_addr, fixup_table);
+ fixup_table += 4;
+ bfd_put_32 (output_bfd, f->value, fixup_table);
+ fixup_table += 4;
+ ++fixups_written;
+ }
+ }
+
+ if (linux_hash_table (info)->fixup_count != fixups_written)
+ {
+ (*_bfd_error_handler) (_("Warning: fixup count mismatch\n"));
+ while (linux_hash_table (info)->fixup_count > fixups_written)
+ {
+ bfd_put_32 (output_bfd, 0, fixup_table);
+ fixup_table += 4;
+ bfd_put_32 (output_bfd, 0, fixup_table);
+ fixup_table += 4;
+ ++fixups_written;
+ }
+ }
+
+ h = linux_link_hash_lookup (linux_hash_table (info),
+ "__BUILTIN_FIXUPS__",
+ false, false, false);
+
+ if (h != NULL
+ && (h->root.root.type == bfd_link_hash_defined
+ || h->root.root.type == bfd_link_hash_defweak))
+ {
+ is = h->root.root.u.def.section;
+ section_offset = is->output_section->vma + is->output_offset;
+ new_addr = h->root.root.u.def.value + section_offset;
+
+#ifdef LINUX_LINK_DEBUG
+ printf ("Builtin fixup table at %x\n", new_addr);
+#endif
+
+ bfd_put_32 (output_bfd, new_addr, fixup_table);
+ }
+ else
+ bfd_put_32 (output_bfd, 0, fixup_table);
+
+ if (bfd_seek (output_bfd, os->filepos + s->output_offset, SEEK_SET) != 0)
+ return false;
+
+ if (bfd_write ((PTR) s->contents, 1, s->_raw_size, output_bfd)
+ != s->_raw_size)
+ return false;
+
+ return true;
+}
+
+#define MY_bfd_link_hash_table_create linux_link_hash_table_create
+#define MY_add_one_symbol linux_add_one_symbol
+#define MY_finish_dynamic_link linux_finish_dynamic_link
+
+#define MY_zmagic_contiguous 1
+
+#include "aout-target.h"
diff --git a/contrib/binutils/bfd/sparcnetbsd.c b/contrib/binutils/bfd/sparcnetbsd.c
new file mode 100644
index 000000000000..4277bb8914d4
--- /dev/null
+++ b/contrib/binutils/bfd/sparcnetbsd.c
@@ -0,0 +1,34 @@
+/* BFD back-end for NetBSD/sparc a.out-ish binaries.
+ Copyright (C) 1990, 91, 92, 94, 95, 97, 1998 Free Software Foundation, Inc.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#define BYTES_IN_WORD 4
+#define TARGET_IS_BIG_ENDIAN_P
+
+/* SPARC chips use either 4K or 8K pages, but object files always
+ assume 8K page alignment so they will work on either one. */
+#define TARGET_PAGE_SIZE 0x2000
+
+#define DEFAULT_ARCH bfd_arch_sparc
+#define DEFAULT_MID M_SPARC_NETBSD
+
+#define MY(OP) CAT(sparcnetbsd_,OP)
+/* This needs to start with a.out so GDB knows it is an a.out variant. */
+#define TARGETNAME "a.out-sparc-netbsd"
+
+#include "netbsd.h"
diff --git a/contrib/binutils/bfd/srec.c b/contrib/binutils/bfd/srec.c
index 1386ebd1db26..31f69b04cf0c 100644
--- a/contrib/binutils/bfd/srec.c
+++ b/contrib/binutils/bfd/srec.c
@@ -1,5 +1,5 @@
/* BFD back-end for s-record objects.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
@@ -171,7 +171,7 @@ srec_init ()
/* The maximum number of bytes on a line is FF */
#define MAXCHUNK 0xff
/* The number of bytes we fit onto a line on output */
-#define CHUNK 21
+#define CHUNK 16
/* When writing an S-record file, the S-records can not be output as
they are seen. This structure is used to hold them in memory. */
@@ -287,7 +287,7 @@ srec_bad_byte (abfd, lineno, c, error)
buf[1] = '\0';
}
(*_bfd_error_handler)
- ("%s:%d: Unexpected character `%s' in S-record file\n",
+ (_("%s:%d: Unexpected character `%s' in S-record file\n"),
bfd_get_filename (abfd), lineno, buf);
bfd_set_error (bfd_error_bad_value);
}
@@ -387,7 +387,7 @@ srec_scan (abfd)
&& (c == ' ' || c == '\t'))
;
- if (c == '\n')
+ if (c == '\n' || c == '\r')
break;
if (c == EOF)
@@ -469,14 +469,14 @@ srec_scan (abfd)
}
while (c == ' ' || c == '\t');
- if (c != '\n')
+ if (c == '\n')
+ ++lineno;
+ else if (c != '\r')
{
srec_bad_byte (abfd, lineno, c, error);
goto error_return;
}
- ++lineno;
-
break;
case 'S':
@@ -643,6 +643,9 @@ srec_object_p (abfd)
|| ! srec_scan (abfd))
return NULL;
+ if (abfd->symcount > 0)
+ abfd->flags |= HAS_SYMS;
+
return abfd->xvec;
}
@@ -670,6 +673,9 @@ symbolsrec_object_p (abfd)
|| ! srec_scan (abfd))
return NULL;
+ if (abfd->symcount > 0)
+ abfd->flags |= HAS_SYMS;
+
return abfd->xvec;
}
@@ -865,7 +871,7 @@ srec_set_section_contents (abfd, section, location, offset, bytes_to_do)
}
else if ((section->lma + offset + bytes_to_do - 1) <= 0xffffff
- && tdata->type < 2)
+ && tdata->type <= 2)
{
tdata->type = 2;
}
@@ -994,31 +1000,28 @@ srec_write_section (abfd, tdata, list)
tdata_type *tdata;
srec_data_list_type *list;
{
- unsigned int bytes_written = 0;
+ unsigned int octets_written = 0;
bfd_byte *location = list->data;
- while (bytes_written < list->size)
+ while (octets_written < list->size)
{
bfd_vma address;
+ unsigned int octets_this_chunk = list->size - octets_written;
- unsigned int bytes_this_chunk = list->size - bytes_written;
+ if (octets_this_chunk > CHUNK)
+ octets_this_chunk = CHUNK;
- if (bytes_this_chunk > CHUNK)
- {
- bytes_this_chunk = CHUNK;
- }
-
- address = list->where + bytes_written;
+ address = list->where + octets_written / bfd_octets_per_byte (abfd);
if (! srec_write_record (abfd,
tdata->type,
address,
location,
- location + bytes_this_chunk))
+ location + octets_this_chunk))
return false;
- bytes_written += bytes_this_chunk;
- location += bytes_this_chunk;
+ octets_written += octets_this_chunk;
+ location += octets_this_chunk;
}
return true;
@@ -1059,26 +1062,8 @@ srec_write_symbols (abfd)
for (i = 0; i < count; i++)
{
asymbol *s = table[i];
-#if 0
- int len = strlen (s->name);
-
- /* If this symbol has a .[ocs] in it, it's probably a file name
- and we'll output that as the module name */
-
- if (len > 3 && s->name[len - 2] == '.')
- {
- int l;
- sprintf (buffer, "$$ %s\r\n", s->name);
- l = strlen (buffer);
- if (bfd_write (buffer, l, 1, abfd) != l)
- return false;
- }
- else
-#endif
- if (s->flags & (BSF_GLOBAL | BSF_LOCAL)
- && (s->flags & BSF_DEBUGGING) == 0
- && s->name[0] != '.'
- && s->name[0] != 't')
+ if (! bfd_is_local_label (abfd, s)
+ && (s->flags & BSF_DEBUGGING) == 0)
{
/* Just dump out non debug symbols */
bfd_size_type l;
@@ -1151,8 +1136,8 @@ symbolsrec_write_object_contents (abfd)
/*ARGSUSED*/
static int
srec_sizeof_headers (abfd, exec)
- bfd *abfd;
- boolean exec;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ boolean exec ATTRIBUTE_UNUSED;
{
return 0;
}
@@ -1221,7 +1206,7 @@ srec_get_symtab (abfd, alocation)
/*ARGSUSED*/
static void
srec_get_symbol_info (ignore_abfd, symbol, ret)
- bfd *ignore_abfd;
+ bfd *ignore_abfd ATTRIBUTE_UNUSED;
asymbol *symbol;
symbol_info *ret;
{
@@ -1231,7 +1216,7 @@ srec_get_symbol_info (ignore_abfd, symbol, ret)
/*ARGSUSED*/
static void
srec_print_symbol (ignore_abfd, afile, symbol, how)
- bfd *ignore_abfd;
+ bfd *ignore_abfd ATTRIBUTE_UNUSED;
PTR afile;
asymbol *symbol;
bfd_print_symbol_type how;
@@ -1274,6 +1259,7 @@ srec_print_symbol (ignore_abfd, afile, symbol, how)
#define srec_bfd_get_relocated_section_contents \
bfd_generic_get_relocated_section_contents
#define srec_bfd_relax_section bfd_generic_relax_section
+#define srec_bfd_gc_sections bfd_generic_gc_sections
#define srec_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
#define srec_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define srec_bfd_final_link _bfd_generic_final_link
@@ -1329,6 +1315,8 @@ const bfd_target srec_vec =
BFD_JUMP_TABLE_LINK (srec),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+ NULL,
+
(PTR) 0
};
@@ -1384,5 +1372,7 @@ const bfd_target symbolsrec_vec =
BFD_JUMP_TABLE_LINK (srec),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+ NULL,
+
(PTR) 0
};
diff --git a/contrib/binutils/bfd/stabs.c b/contrib/binutils/bfd/stabs.c
index 77c735238519..e9ac167628d2 100644
--- a/contrib/binutils/bfd/stabs.c
+++ b/contrib/binutils/bfd/stabs.c
@@ -1,5 +1,5 @@
/* Stabs in sections linking support.
- Copyright 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -230,6 +230,8 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo)
sinfo->strings = _bfd_stringtab_init ();
if (sinfo->strings == NULL)
goto error_return;
+ /* Make sure the first byte is zero. */
+ (void) _bfd_stringtab_add (sinfo->strings, "", true, true);
if (! bfd_hash_table_init_n (&sinfo->includes.root,
stab_link_includes_newfunc,
251))
@@ -587,6 +589,12 @@ _bfd_write_stab_strings (output_bfd, psinfo)
if (sinfo == NULL)
return true;
+ if (bfd_is_abs_section (sinfo->stabstr->output_section))
+ {
+ /* The section was discarded from the link. */
+ return true;
+ }
+
BFD_ASSERT ((sinfo->stabstr->output_offset
+ _bfd_stringtab_size (sinfo->strings))
<= sinfo->stabstr->output_section->_raw_size);
@@ -613,8 +621,8 @@ _bfd_write_stab_strings (output_bfd, psinfo)
bfd_vma
_bfd_stab_section_offset (output_bfd, psinfo, stabsec, psecinfo, offset)
- bfd *output_bfd;
- PTR *psinfo;
+ bfd *output_bfd ATTRIBUTE_UNUSED;
+ PTR *psinfo ATTRIBUTE_UNUSED;
asection *stabsec;
PTR *psecinfo;
bfd_vma offset;
diff --git a/contrib/binutils/bfd/syms.c b/contrib/binutils/bfd/syms.c
index d39e7d875cb0..6546f585054a 100644
--- a/contrib/binutils/bfd/syms.c
+++ b/contrib/binutils/bfd/syms.c
@@ -1,5 +1,5 @@
/* Generic symbol-table support for the BFD library.
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -227,7 +227,7 @@ CODE_FRAGMENT
. <<BSF_GLOBAL>> *}
.
. {* The symbol is a debugging record. The value has an arbitary
-. meaning. *}
+. meaning, unless BSF_DEBUGGING_RELOC is also set. *}
.#define BSF_DEBUGGING 0x08
.
. {* The symbol denotes a function entry point. Used in ELF,
@@ -285,6 +285,11 @@ CODE_FRAGMENT
. others someday. *}
.#define BSF_OBJECT 0x10000
.
+. {* This symbol is a debugging symbol. The value is the offset
+. into the section of the data. BSF_DEBUGGING should be set
+. as well. *}
+.#define BSF_DEBUGGING_RELOC 0x20000
+.
. flagword flags;
.
. {* A pointer to the section to which this symbol is
@@ -523,6 +528,11 @@ static CONST struct section_to_type stt[] =
{".sdata", 'g'}, /* Small initialized data. */
{".text", 't'},
{"code", 't'}, /* MRI .text */
+ {".drectve", 'i'}, /* MSVC's .drective section */
+ {".idata", 'i'}, /* MSVC's .idata (import) section */
+ {".edata", 'e'}, /* MSVC's .edata (export) section */
+ {".pdata", 'p'}, /* MSVC's .pdata (stack unwind) section */
+ {".debug", 'N'}, /* MSVC's .debug (non-standard debug syms) */
{0, 0}
};
@@ -572,11 +582,30 @@ bfd_decode_symclass (symbol)
if (bfd_is_com_section (symbol->section))
return 'C';
if (bfd_is_und_section (symbol->section))
- return 'U';
+ {
+ if (symbol->flags & BSF_WEAK)
+ {
+ /* If weak, determine if it's specifically an object
+ or non-object weak. */
+ if (symbol->flags & BSF_OBJECT)
+ return 'v';
+ else
+ return 'w';
+ }
+ else
+ return 'U';
+ }
if (bfd_is_ind_section (symbol->section))
return 'I';
if (symbol->flags & BSF_WEAK)
- return 'W';
+ {
+ /* If weak, determine if it's specifically an object
+ or non-object weak. */
+ if (symbol->flags & BSF_OBJECT)
+ return 'V';
+ else
+ return 'W';
+ }
if (!(symbol->flags & (BSF_GLOBAL | BSF_LOCAL)))
return '?';
@@ -602,6 +631,26 @@ bfd_decode_symclass (symbol)
/*
FUNCTION
+ bfd_is_undefined_symclass
+
+DESCRIPTION
+ Returns non-zero if the class symbol returned by
+ bfd_decode_symclass represents an undefined symbol.
+ Returns zero otherwise.
+
+SYNOPSIS
+ boolean bfd_is_undefined_symclass (int symclass);
+*/
+
+boolean
+bfd_is_undefined_symclass (symclass)
+ int symclass;
+{
+ return symclass == 'U' || symclass == 'w' || symclass == 'v';
+}
+
+/*
+FUNCTION
bfd_symbol_info
DESCRIPTION
@@ -619,10 +668,12 @@ bfd_symbol_info (symbol, ret)
symbol_info *ret;
{
ret->type = bfd_decode_symclass (symbol);
- if (ret->type != 'U')
- ret->value = symbol->value + symbol->section->vma;
- else
+
+ if (bfd_is_undefined_symclass (ret->type))
ret->value = 0;
+ else
+ ret->value = symbol->value + symbol->section->vma;
+
ret->name = symbol->name;
}
@@ -698,10 +749,10 @@ _bfd_generic_read_minisymbols (abfd, dynamic, minisymsp, sizep)
/*ARGSUSED*/
asymbol *
_bfd_generic_minisymbol_to_symbol (abfd, dynamic, minisym, sym)
- bfd *abfd;
- boolean dynamic;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ boolean dynamic ATTRIBUTE_UNUSED;
const PTR minisym;
- asymbol *sym;
+ asymbol *sym ATTRIBUTE_UNUSED;
{
return *(asymbol **) minisym;
}
@@ -797,9 +848,11 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
struct stab_find_info *info;
bfd_size_type stabsize, strsize;
bfd_byte *stab, *str;
+ bfd_byte *last_stab = NULL;
bfd_size_type stroff;
struct indexentry *indexentry;
char *directory_name, *file_name;
+ int saw_fun;
*pfound = false;
*pfilename = bfd_get_filename (abfd);
@@ -842,7 +895,6 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
{
long reloc_size, reloc_count;
arelent **reloc_vector;
- bfd_vma val;
int i;
char *name;
char *file_name;
@@ -919,7 +971,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
|| r->howto->dst_mask != 0xffffffff)
{
(*_bfd_error_handler)
- ("Unsupported .stab relocation");
+ (_("Unsupported .stab relocation"));
bfd_set_error (bfd_error_invalid_operation);
if (reloc_vector != NULL)
free (reloc_vector);
@@ -944,12 +996,38 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
table. */
info->indextablesize = 0;
+ saw_fun = 1;
for (stab = info->stabs; stab < info->stabs + stabsize; stab += STABSIZE)
{
- if (stab[TYPEOFF] == N_FUN)
- ++info->indextablesize;
+ if (stab[TYPEOFF] == N_SO)
+ {
+ /* N_SO with null name indicates EOF */
+ if (bfd_get_32 (abfd, stab + STRDXOFF) == 0)
+ continue;
+
+ /* if we did not see a function def, leave space for one. */
+ if (saw_fun == 0)
+ ++info->indextablesize;
+
+ saw_fun = 0;
+
+ /* two N_SO's in a row is a filename and directory. Skip */
+ if (stab + STABSIZE < info->stabs + stabsize
+ && *(stab + STABSIZE + TYPEOFF) == N_SO)
+ {
+ stab += STABSIZE;
+ }
+ }
+ else if (stab[TYPEOFF] == N_FUN)
+ {
+ saw_fun = 1;
+ ++info->indextablesize;
+ }
}
+ if (saw_fun == 0)
+ ++info->indextablesize;
+
if (info->indextablesize == 0)
return true;
++info->indextablesize;
@@ -963,6 +1041,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
file_name = NULL;
directory_name = NULL;
+ saw_fun = 1;
for (i = 0, stroff = 0, stab = info->stabs, str = info->strs;
i < info->indextablesize && stab < info->stabs + stabsize;
@@ -981,26 +1060,47 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
case N_SO:
/* The main file name. */
+ /* The following code creates a new indextable entry with
+ a NULL function name if there were no N_FUNs in a file.
+ Note that a N_SO without a file name is an EOF and
+ there could be 2 N_SO following it with the new filename
+ and directory. */
+ if (saw_fun == 0)
+ {
+ info->indextable[i].val = bfd_get_32 (abfd, last_stab + VALOFF);
+ info->indextable[i].stab = last_stab;
+ info->indextable[i].str = str;
+ info->indextable[i].directory_name = directory_name;
+ info->indextable[i].file_name = file_name;
+ info->indextable[i].function_name = NULL;
+ ++i;
+ }
+ saw_fun = 0;
+
file_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
-
if (*file_name == '\0')
{
directory_name = NULL;
file_name = NULL;
- }
- else if (stab + STABSIZE >= info->stabs + stabsize
- || *(stab + STABSIZE + TYPEOFF) != N_SO)
- {
- directory_name = NULL;
+ saw_fun = 1;
}
else
{
- /* Two consecutive N_SOs are a directory and a file
- name. */
- stab += STABSIZE;
- directory_name = file_name;
- file_name = ((char *) str
- + bfd_get_32 (abfd, stab + STRDXOFF));
+ last_stab = stab;
+ if (stab + STABSIZE >= info->stabs + stabsize
+ || *(stab + STABSIZE + TYPEOFF) != N_SO)
+ {
+ directory_name = NULL;
+ }
+ else
+ {
+ /* Two consecutive N_SOs are a directory and a
+ file name. */
+ stab += STABSIZE;
+ directory_name = file_name;
+ file_name = ((char *) str
+ + bfd_get_32 (abfd, stab + STRDXOFF));
+ }
}
break;
@@ -1011,7 +1111,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
case N_FUN:
/* A function name. */
-
+ saw_fun = 1;
name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
if (*name == '\0')
@@ -1022,20 +1122,28 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
if (name == NULL)
continue;
- val = bfd_get_32 (abfd, stab + VALOFF);
-
- info->indextable[i].val = val;
+ info->indextable[i].val = bfd_get_32 (abfd, stab + VALOFF);
info->indextable[i].stab = stab;
info->indextable[i].str = str;
info->indextable[i].directory_name = directory_name;
info->indextable[i].file_name = file_name;
info->indextable[i].function_name = function_name;
-
++i;
break;
}
}
+ if (saw_fun == 0)
+ {
+ info->indextable[i].val = bfd_get_32 (abfd, last_stab + VALOFF);
+ info->indextable[i].stab = last_stab;
+ info->indextable[i].str = str;
+ info->indextable[i].directory_name = directory_name;
+ info->indextable[i].file_name = file_name;
+ info->indextable[i].function_name = NULL;
+ ++i;
+ }
+
info->indextable[i].val = (bfd_vma) -1;
info->indextable[i].stab = info->stabs + stabsize;
info->indextable[i].str = str;
@@ -1045,7 +1153,6 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
++i;
info->indextablesize = i;
-
qsort (info->indextable, i, sizeof (struct indexentry), cmpindexentry);
*pinfo = (PTR) info;
diff --git a/contrib/binutils/bfd/sysdep.h b/contrib/binutils/bfd/sysdep.h
index e559aa69a130..0a58983fa2d5 100644
--- a/contrib/binutils/bfd/sysdep.h
+++ b/contrib/binutils/bfd/sysdep.h
@@ -1,5 +1,5 @@
/* sysdep.h -- handle host dependencies for the BFD library
- Copyright 1995, 1996 Free Software Foundation, Inc.
+ Copyright 1995, 96, 97, 98, 1999 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -122,4 +122,23 @@ extern void free ();
extern char *getenv ();
#endif
+#ifdef ENABLE_NLS
+#include <libintl.h>
+#define _(String) dgettext (PACKAGE, String)
+#ifdef gettext_noop
+#define N_(String) gettext_noop (String)
+#else
+#define N_(String) (String)
+#endif
+#else
+/* Stubs that do something close enough. */
+#define textdomain(String) (String)
+#define gettext(String) (String)
+#define dgettext(Domain,Message) (Message)
+#define dcgettext(Domain,Message,Type) (Message)
+#define bindtextdomain(Domain,Directory) (Domain)
+#define _(String) (String)
+#define N_(String) (String)
+#endif
+
#endif /* ! defined (BFD_SYSDEP_H) */
diff --git a/contrib/binutils/bfd/targets.c b/contrib/binutils/bfd/targets.c
index a6c61bb121ec..1f2217b9fdaa 100644
--- a/contrib/binutils/bfd/targets.c
+++ b/contrib/binutils/bfd/targets.c
@@ -1,5 +1,5 @@
/* Generic target-file-type support for the BFD library.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -152,6 +152,7 @@ DESCRIPTION
. bfd_target_os9k_flavour,
. bfd_target_versados_flavour,
. bfd_target_msdos_flavour,
+. bfd_target_ovax_flavour,
. bfd_target_evax_flavour
.};
.
@@ -244,7 +245,8 @@ Write cached information into a file being written, at <<bfd_close>>.
. boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *));
-The general target vector.
+The general target vector. These vectors are initialized using the
+BFD_JUMP_TABLE macros.
.
. {* Generic entry points. *}
@@ -413,7 +415,8 @@ The general target vector.
.CAT(NAME,_bfd_link_hash_table_create),\
.CAT(NAME,_bfd_link_add_symbols),\
.CAT(NAME,_bfd_final_link),\
-.CAT(NAME,_bfd_link_split_section)
+.CAT(NAME,_bfd_link_split_section),\
+.CAT(NAME,_bfd_gc_sections)
. int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean));
. bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *,
. struct bfd_link_info *, struct bfd_link_order *,
@@ -437,7 +440,10 @@ The general target vector.
. {* Should this section be split up into smaller pieces during linking. *}
. boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *));
.
-. {* Routines to handle dynamic symbols and relocs. *}
+. {* Remove sections that are not referenced from the output. *}
+. boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *));
+.
+. {* Routines to handle dynamic symbols and relocs. *}
.#define BFD_JUMP_TABLE_DYNAMIC(NAME)\
.CAT(NAME,_get_dynamic_symtab_upper_bound),\
.CAT(NAME,_canonicalize_dynamic_symtab),\
@@ -455,10 +461,21 @@ The general target vector.
. PARAMS ((bfd *, arelent **, struct symbol_cache_entry **));
.
+A pointer to an alternative bfd_target in case the current one is not
+satisfactory. This can happen when the target cpu supports both big
+and little endian code, and target chosen by the linker has the wrong
+endianness. The function open_output() in ld/ldlang.c uses this field
+to find an alternative output format that is suitable.
+
+. {* Opposite endian version of this target. *}
+. const struct bfd_target * alternative_target;
+.
+
Data for use by back-end routines, which isn't generic enough to belong
in this structure.
. PTR backend_data;
+.
.} bfd_target;
*/
@@ -477,22 +494,35 @@ extern const bfd_target aout0_big_vec;
extern const bfd_target apollocoff_vec;
extern const bfd_target armcoff_little_vec;
extern const bfd_target armcoff_big_vec;
+extern const bfd_target armnetbsd_vec;
extern const bfd_target armpe_little_vec;
extern const bfd_target armpe_big_vec;
extern const bfd_target armpei_little_vec;
extern const bfd_target armpei_big_vec;
+extern const bfd_target arm_epoc_pe_little_vec;
+extern const bfd_target arm_epoc_pe_big_vec;
+extern const bfd_target arm_epoc_pei_little_vec;
+extern const bfd_target arm_epoc_pei_big_vec;
extern const bfd_target b_out_vec_big_host;
extern const bfd_target b_out_vec_little_host;
extern const bfd_target bfd_elf64_alpha_vec;
+extern const bfd_target bfd_elf32_avr_vec;
extern const bfd_target bfd_elf32_bigarc_vec;
+extern const bfd_target bfd_elf32_bigarm_vec;
+extern const bfd_target bfd_elf32_bigarm_oabi_vec;
extern const bfd_target bfd_elf32_littlearc_vec;
+extern const bfd_target bfd_elf32_littlearm_vec;
+extern const bfd_target bfd_elf32_littlearm_oabi_vec;
extern const bfd_target bfd_elf32_big_generic_vec;
extern const bfd_target bfd_elf32_bigmips_vec;
extern const bfd_target bfd_elf64_bigmips_vec;
extern const bfd_target bfd_elf32_d10v_vec;
+extern const bfd_target bfd_elf32_d30v_vec;
extern const bfd_target bfd_elf32_hppa_vec;
+extern const bfd_target bfd_elf32_i370_vec;
extern const bfd_target bfd_elf32_i386_vec;
extern const bfd_target bfd_elf32_i860_vec;
+extern const bfd_target bfd_elf32_i960_vec;
extern const bfd_target bfd_elf32_little_generic_vec;
extern const bfd_target bfd_elf32_littlemips_vec;
extern const bfd_target bfd_elf64_littlemips_vec;
@@ -501,12 +531,17 @@ extern const bfd_target bfd_elf32_m68k_vec;
extern const bfd_target bfd_elf32_m88k_vec;
extern const bfd_target bfd_elf32_mn10200_vec;
extern const bfd_target bfd_elf32_mn10300_vec;
+extern const bfd_target bfd_elf32_pj_vec;
+extern const bfd_target bfd_elf32_pjl_vec;
extern const bfd_target bfd_elf32_powerpc_vec;
extern const bfd_target bfd_elf32_powerpcle_vec;
extern const bfd_target bfd_elf32_sh_vec;
extern const bfd_target bfd_elf32_shl_vec;
extern const bfd_target bfd_elf32_sparc_vec;
extern const bfd_target bfd_elf32_v850_vec;
+extern const bfd_target bfd_elf32_fr30_vec;
+extern const bfd_target bfd_elf32_mcore_big_vec;
+extern const bfd_target bfd_elf32_mcore_little_vec;
extern const bfd_target bfd_elf64_big_generic_vec;
extern const bfd_target bfd_elf64_little_generic_vec;
extern const bfd_target bfd_elf64_sparc_vec;
@@ -515,7 +550,6 @@ extern const bfd_target ecoff_big_vec;
extern const bfd_target ecoff_little_vec;
extern const bfd_target ecoff_biglittle_vec;
extern const bfd_target ecoffalpha_little_vec;
-extern const bfd_target evax_alpha_vec;
extern const bfd_target h8300coff_vec;
extern const bfd_target h8500coff_vec;
extern const bfd_target host_aout_vec;
@@ -557,6 +591,12 @@ extern const bfd_target m68ksysvcoff_vec;
extern const bfd_target m68k4knetbsd_vec;
extern const bfd_target m88kbcs_vec;
extern const bfd_target m88kmach3_vec;
+extern const bfd_target mipslpe_vec;
+extern const bfd_target mipslpei_vec;
+extern const bfd_target mcore_pe_big_vec;
+extern const bfd_target mcore_pe_little_vec;
+extern const bfd_target mcore_pei_big_vec;
+extern const bfd_target mcore_pei_little_vec;
extern const bfd_target newsos3_vec;
extern const bfd_target nlm32_i386_vec;
extern const bfd_target nlm32_sparc_vec;
@@ -573,6 +613,8 @@ extern const bfd_target shcoff_vec;
extern const bfd_target shlcoff_vec;
extern const bfd_target shcoff_small_vec;
extern const bfd_target shlcoff_small_vec;
+extern const bfd_target shlpe_vec;
+extern const bfd_target shlpei_vec;
extern const bfd_target sparcle_aout_vec;
extern const bfd_target sparclinux_vec;
extern const bfd_target sparclynx_aout_vec;
@@ -583,8 +625,11 @@ extern const bfd_target sunos_big_vec;
extern const bfd_target tekhex_vec;
extern const bfd_target tic30_aout_vec;
extern const bfd_target tic30_coff_vec;
+extern const bfd_target tic80coff_vec;
extern const bfd_target vaxnetbsd_vec;
extern const bfd_target versados_vec;
+extern const bfd_target vms_alpha_vec;
+extern const bfd_target vms_vax_vec;
extern const bfd_target we32kcoff_vec;
extern const bfd_target w65_vec;
extern const bfd_target z8kcoff_vec;
@@ -601,13 +646,14 @@ extern const bfd_target ihex_vec;
/* All of the xvecs for core files. */
extern const bfd_target aix386_core_vec;
-extern const bfd_target cisco_core_vec;
+extern const bfd_target cisco_core_big_vec;
+extern const bfd_target cisco_core_little_vec;
extern const bfd_target hpux_core_vec;
extern const bfd_target hppabsd_core_vec;
extern const bfd_target irix_core_vec;
extern const bfd_target netbsd_core_vec;
extern const bfd_target osf_core_vec;
-extern const bfd_target sco_core_vec;
+extern const bfd_target sco5_core_vec;
extern const bfd_target trad_core_vec;
extern const bfd_target ptrace_core_vec;
@@ -645,17 +691,27 @@ const bfd_target * const bfd_target_vector[] = {
#ifdef BFD64
&bfd_elf64_alpha_vec,
#endif
+ &bfd_elf32_avr_vec,
&bfd_elf32_bigarc_vec,
+ &bfd_elf32_bigarm_vec,
+ &bfd_elf32_bigarm_oabi_vec,
&bfd_elf32_bigmips_vec,
#ifdef BFD64
&bfd_elf64_bigmips_vec,
#endif
&bfd_elf32_d10v_vec,
+ &bfd_elf32_d30v_vec,
+#if 0
&bfd_elf32_hppa_vec,
+#endif
+ &bfd_elf32_i370_vec,
&bfd_elf32_i386_vec,
&bfd_elf32_i860_vec,
+ &bfd_elf32_i960_vec,
&bfd_elf32_little_generic_vec,
&bfd_elf32_littlearc_vec,
+ &bfd_elf32_littlearm_vec,
+ &bfd_elf32_littlearm_oabi_vec,
&bfd_elf32_littlemips_vec,
#ifdef BFD64
&bfd_elf64_littlemips_vec,
@@ -666,9 +722,14 @@ const bfd_target * const bfd_target_vector[] = {
&bfd_elf32_m68k_vec,
&bfd_elf32_m88k_vec,
&bfd_elf32_sparc_vec,
+ &bfd_elf32_pj_vec,
+ &bfd_elf32_pjl_vec,
&bfd_elf32_powerpc_vec,
&bfd_elf32_powerpcle_vec,
&bfd_elf32_v850_vec,
+ &bfd_elf32_fr30_vec,
+ &bfd_elf32_mcore_big_vec,
+ &bfd_elf32_mcore_little_vec,
#ifdef BFD64 /* No one seems to use this. */
&bfd_elf64_big_generic_vec,
&bfd_elf64_little_generic_vec,
@@ -676,7 +737,7 @@ const bfd_target * const bfd_target_vector[] = {
#if 0
&bfd_elf64_sparc_vec,
#endif
- /* We don't include cisco_core_vec. Although it has a magic number,
+ /* We don't include cisco_core_*_vec. Although it has a magic number,
the magic number isn't at the beginning of the file, and thus
might spuriously match other kinds of files. */
#ifdef BFD64
@@ -687,7 +748,6 @@ const bfd_target * const bfd_target_vector[] = {
&ecoff_biglittle_vec,
#ifdef BFD64
&ecoffalpha_little_vec,
- &evax_alpha_vec,
#endif
&h8300coff_vec,
&h8500coff_vec,
@@ -732,10 +792,15 @@ const bfd_target * const bfd_target_vector[] = {
&i386pei_vec,
&armcoff_little_vec,
&armcoff_big_vec,
+ &armnetbsd_vec,
&armpe_little_vec,
&armpe_big_vec,
&armpei_little_vec,
&armpei_big_vec,
+ &arm_epoc_pe_little_vec,
+ &arm_epoc_pe_big_vec,
+ &arm_epoc_pei_little_vec,
+ &arm_epoc_pei_big_vec,
&icoff_big_vec,
&icoff_little_vec,
&ieee_vec,
@@ -752,6 +817,10 @@ const bfd_target * const bfd_target_vector[] = {
&m68ksysvcoff_vec,
&m88kbcs_vec,
&m88kmach3_vec,
+ &mcore_pe_big_vec,
+ &mcore_pe_little_vec,
+ &mcore_pei_big_vec,
+ &mcore_pei_little_vec,
&newsos3_vec,
&nlm32_i386_vec,
&nlm32_sparc_vec,
@@ -791,11 +860,15 @@ const bfd_target * const bfd_target_vector[] = {
&sparcnetbsd_vec,
&sunos_big_vec,
&aout0_big_vec,
- &tekhex_vec,
&tic30_aout_vec,
&tic30_coff_vec,
+ &tic80coff_vec,
&vaxnetbsd_vec,
&versados_vec,
+#ifdef BFD64
+ &vms_alpha_vec,
+#endif
+ &vms_vax_vec,
&we32kcoff_vec,
&z8kcoff_vec,
@@ -831,6 +904,9 @@ const bfd_target * const bfd_target_vector[] = {
#ifdef OSF_CORE
&osf_core_vec,
#endif
+#ifdef SCO5_CORE
+ &sco5_core_vec,
+#endif
#ifdef TRAD_CORE
&trad_core_vec,
#endif
@@ -1032,3 +1108,32 @@ bfd_target_list ()
return name_list;
}
+
+/*
+FUNCTION
+ bfd_seach_for_target
+
+SYNOPSIS
+ const bfd_target * bfd_search_for_target (int (* search_func)(const bfd_target *, void *), void *);
+
+DESCRIPTION
+ Return a pointer to the first transfer vector in the list of
+ transfer vectors maintained by BFD that produces a non-zero
+ result when passed to the function @var{search_func}. The
+ parameter @var{data} is passed, unexamined, to the search
+ function.
+*/
+
+const bfd_target *
+bfd_search_for_target (search_func, data)
+ int (* search_func) PARAMS ((const bfd_target * target, void * data));
+ void * data;
+{
+ const bfd_target * const * target;
+
+ for (target = bfd_target_vector; * target != NULL; target ++)
+ if (search_func (* target, data))
+ return * target;
+
+ return NULL;
+}
diff --git a/contrib/binutils/bfd/tekhex.c b/contrib/binutils/bfd/tekhex.c
index 76f49d9c808a..b1ffe75e0731 100644
--- a/contrib/binutils/bfd/tekhex.c
+++ b/contrib/binutils/bfd/tekhex.c
@@ -1,5 +1,6 @@
/* BFD backend for Extended Tektronix Hex Format objects.
- Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999
+ Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library.
@@ -599,7 +600,7 @@ move_section_contents (abfd, section, locationp, offset, count, get)
bfd *abfd;
asection *section;
PTR locationp;
- file_ptr offset;
+ file_ptr offset ATTRIBUTE_UNUSED;
bfd_size_type count;
boolean get;
{
@@ -928,8 +929,8 @@ tekhex_write_object_contents (abfd)
static int
tekhex_sizeof_headers (abfd, exec)
- bfd *abfd;
- boolean exec;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ boolean exec ATTRIBUTE_UNUSED;
{
return 0;
@@ -951,7 +952,7 @@ tekhex_make_empty_symbol (abfd)
static void
tekhex_get_symbol_info (ignore_abfd, symbol, ret)
- bfd *ignore_abfd;
+ bfd *ignore_abfd ATTRIBUTE_UNUSED;
asymbol *symbol;
symbol_info *ret;
{
@@ -960,7 +961,7 @@ tekhex_get_symbol_info (ignore_abfd, symbol, ret)
static void
tekhex_print_symbol (ignore_abfd, filep, symbol, how)
- bfd *ignore_abfd;
+ bfd *ignore_abfd ATTRIBUTE_UNUSED;
PTR filep;
asymbol *symbol;
bfd_print_symbol_type how;
@@ -1002,6 +1003,7 @@ tekhex_print_symbol (ignore_abfd, filep, symbol, how)
#define tekhex_bfd_get_relocated_section_contents \
bfd_generic_get_relocated_section_contents
#define tekhex_bfd_relax_section bfd_generic_relax_section
+#define tekhex_bfd_gc_sections bfd_generic_gc_sections
#define tekhex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
#define tekhex_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define tekhex_bfd_final_link _bfd_generic_final_link
@@ -1060,5 +1062,7 @@ const bfd_target tekhex_vec =
BFD_JUMP_TABLE_LINK (tekhex),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+ NULL,
+
(PTR) 0
};
diff --git a/contrib/binutils/bfd/trad-core.c b/contrib/binutils/bfd/trad-core.c
index 02d6a254c334..aea6366795b4 100644
--- a/contrib/binutils/bfd/trad-core.c
+++ b/contrib/binutils/bfd/trad-core.c
@@ -1,5 +1,6 @@
/* BFD back end for traditional Unix core files (U-area and raw sections)
- Copyright 1988, 1989, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
+ Copyright 1988, 89, 91, 92, 93, 94, 95, 96, 98, 99, 2000
+ Free Software Foundation, Inc.
Written by John Gilmore of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -23,8 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "libbfd.h"
#include "libaout.h" /* BFD a.out internal data structures */
-#include <stdio.h>
-#include <sys/types.h>
#include <sys/param.h>
#include <sys/dir.h>
#include <signal.h>
@@ -106,22 +105,24 @@ trad_unix_core_file_p (abfd)
bfd_set_error (bfd_error_system_call);
return 0;
}
- if (NBPG * (UPAGES + u.u_dsize
+ if ((unsigned long) (NBPG * (UPAGES + u.u_dsize
#ifdef TRAD_CORE_DSIZE_INCLUDES_TSIZE
- - u.u_tsize
+ - u.u_tsize
#endif
- + u.u_ssize) > statbuf.st_size)
+ + u.u_ssize))
+ > (unsigned long) statbuf.st_size)
{
- bfd_set_error (bfd_error_file_truncated);
+ bfd_set_error (bfd_error_wrong_format);
return 0;
}
#ifndef TRAD_CORE_ALLOW_ANY_EXTRA_SIZE
- if (NBPG * (UPAGES + u.u_dsize + u.u_ssize)
+ if ((unsigned long) (NBPG * (UPAGES + u.u_dsize + u.u_ssize)
#ifdef TRAD_CORE_EXTRA_SIZE_ALLOWED
/* Some systems write the file too big. */
- + TRAD_CORE_EXTRA_SIZE_ALLOWED
+ + TRAD_CORE_EXTRA_SIZE_ALLOWED
#endif
- < statbuf.st_size)
+ )
+ < (unsigned long) statbuf.st_size)
{
/* The file is too big. Maybe it's not a core file
or we otherwise have bad values for u_dsize and u_ssize). */
@@ -201,7 +202,7 @@ trad_unix_core_file_p (abfd)
0 is at the place pointed to by u_ar0 (by setting the vma of the start
of the section to -u_ar0). GDB uses this info to locate the regs,
using minor trickery to get around the offset-or-absolute-addr problem. */
- core_regsec (abfd)->vma = 0 - (bfd_vma) u.u_ar0;
+ core_regsec (abfd)->vma = - (bfd_vma) u.u_ar0;
core_datasec (abfd)->filepos = NBPG * UPAGES;
core_stacksec (abfd)->filepos = (NBPG * UPAGES) + NBPG * u.u_dsize
@@ -240,7 +241,7 @@ trad_unix_core_file_failing_command (abfd)
/* ARGSUSED */
int
trad_unix_core_file_failing_signal (ignore_abfd)
- bfd *ignore_abfd;
+ bfd *ignore_abfd ATTRIBUTE_UNUSED;
{
#ifdef TRAD_UNIX_CORE_FILE_FAILING_SIGNAL
return TRAD_UNIX_CORE_FILE_FAILING_SIGNAL(ignore_abfd);
@@ -252,7 +253,8 @@ trad_unix_core_file_failing_signal (ignore_abfd)
/* ARGSUSED */
boolean
trad_unix_core_file_matches_executable_p (core_bfd, exec_bfd)
- bfd *core_bfd, *exec_bfd;
+ bfd *core_bfd ATTRIBUTE_UNUSED;
+ bfd *exec_bfd ATTRIBUTE_UNUSED;
{
return true; /* FIXME, We have no way of telling at this point */
}
@@ -313,5 +315,7 @@ const bfd_target trad_core_vec =
BFD_JUMP_TABLE_LINK (_bfd_nolink),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+ NULL,
+
(PTR) 0 /* backend_data */
};