diff -upr --new-file binutils-2.9.5.0.29/ChangeLog binutils-2.9.5.0.31/ChangeLog --- binutils-2.9.5.0.29/ChangeLog Tue Feb 29 10:59:49 2000 +++ binutils-2.9.5.0.31/ChangeLog Sun Mar 12 09:31:32 2000 @@ -1,3 +1,19 @@ +2000-03-10 H.J. Lu + + * Makefile.in (all-gcc): Backed out the last change. + +2000-03-10 H.J. Lu + + * Makefile.in (all-gcc): Run ld/ld-new if necessary. + +Fri Mar 3 18:44:08 2000 Andrew Cagney + + * Makefile.in (taz): Set PACKAGE to TOOL when not defined. + (do-tar-bz2): Replace TOOL with PACKAGE. + (gdb.tar.bz2): Remove GDBTK from GDB package. + (gdb+dejagnu.tar.bz2, insight.tar.bz2, insight+dejagnu.tar.bz2, + dejagnu.tar.bz2): New packages. + 2000-02-27 Andreas Jaeger * configure.in: Add entry for mips*-*-linux*, move catch all diff -upr --new-file binutils-2.9.5.0.29/Makefile.in binutils-2.9.5.0.31/Makefile.in --- binutils-2.9.5.0.29/Makefile.in Sat Feb 19 11:21:13 2000 +++ binutils-2.9.5.0.31/Makefile.in Sun Mar 12 09:31:32 2000 @@ -1747,14 +1747,19 @@ taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) te else \ ver=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \ fi; \ - $(MAKE) -f Makefile.in do-tar-bz2 TOOL=$(TOOL) VER=$$ver + if test x"$(PACKAGE)" = x; then \ + package="$(TOOL)"; \ + else \ + package="$(PACKAGE)"; \ + fi; \ + $(MAKE) -f Makefile.in do-tar-bz2 TOOL=$(TOOL) VER=$$ver PACKAGE=$$package do-tar-bz2: - echo "==> Making $(TOOL)-$(VER).tar.bz2" - -rm -f $(TOOL)-$(VER) - ln -s proto-toplev $(TOOL)-$(VER) - tar cfh $(TOOL)-$(VER).tar $(TOOL)-$(VER) - $(BZIPPROG) -v -9 $(TOOL)-$(VER).tar + echo "==> Making $(PACKAGE)-$(VER).tar.bz2" + -rm -f $(PACKAGE)-$(VER) + ln -s proto-toplev $(PACKAGE)-$(VER) + tar cfh $(PACKAGE)-$(VER).tar $(PACKAGE)-$(VER) + $(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar TEXINFO_SUPPORT= texinfo/texinfo.tex DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT) @@ -1791,10 +1796,33 @@ gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_S .PHONY: gdb.tar.bz2 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils intl -GDBTK_SUPPORT_DIRS= `if [ -d tcl -a -d tk ] ; then echo tcl tk itcl tix libgui; fi` gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb $(MAKE) -f Makefile.in taz TOOL=gdb \ - SUPPORT_FILES="$(GDB_SUPPORT_DIRS) $(GDBTK_SUPPORT_DIRS)" + SUPPORT_FILES="$(GDB_SUPPORT_DIRS)" + +.PHONY: dejagnu.tar.bz2 +DEJAGNU_SUPPORT_DIRS= tcl expect libiberty +dejagnu.tar.bz2: $(DIST_SUPPORT) $(DEJAGNU_SUPPORT_DIRS) dejagnu + $(MAKE) -f Makefile.in taz TOOL=dejagnu \ + SUPPORT_FILES="$(DEJAGNU_SUPPORT_DIRS)" + +.PHONY: gdb+dejagnu.tar.bz2 +GDBD_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl expect dejagnu +gdb+dejagnu.tar.bz2: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb + $(MAKE) -f Makefile.in taz TOOL=gdb PACKAGE=gdb+dejagnu \ + SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)" + +.PHONY: insight.tar.bz2 +INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl tix libgui +insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb + $(MAKE) -f Makefile.in taz TOOL=gdb PACKAGE=insight \ + SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)" + +.PHONY: insight+dejagnu.tar.bz2 +INSIGHTD_SUPPORT_DIRS= $(INSIGHT_SUPPORT_DIRS) expect dejagnu +insight+dejagnu.tar.bz2: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb + $(MAKE) -f Makefile.in taz TOOL=gdb PACKAGE="insight+dejagnu" \ + SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)" .PHONY: newlib.tar.bz2 NEWLIB_SUPPORT_DIRS=libgloss diff -upr --new-file binutils-2.9.5.0.29/bfd/ChangeLog binutils-2.9.5.0.31/bfd/ChangeLog --- binutils-2.9.5.0.29/bfd/ChangeLog Tue Feb 29 11:00:00 2000 +++ binutils-2.9.5.0.31/bfd/ChangeLog Sun Mar 19 11:54:20 2000 @@ -1,3 +1,204 @@ +2000-03-17 Alan Modra + + * 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". + +2000-03-14 Doug Evans + + * elf32-m32r.c (m32r_elf_lo16_reloc): Rewrite. + +2000-03-14 Kazu Hirata + + * reloc16.c (bfd_coff_reloc16_relax_section): Count the total number + of shrinks properly, including the last reloc. + +2000-03-13 Kazu Hirata + + * coff-h8300.c (h8300_reloc16_extra_cases): Fix the sanity + check for R_MOVL2. + +2000-03-11 Alan Modra + + * 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 + + * 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 + + * 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 + + * 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 + + * reloc.c (reloc_howto_struct): Fix partial_inplace comment. + * bfd-in2.h: Rebuild. + +2000-03-06 Nick Clifton + + * 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. + +2000-03-06 Catherine Moore + + * elf.c (swap_out_syms): Check for null type_ptr. + +2000-03-01 Hans-Peter Nilsson + + * 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. + +2000-02-29 H.J. Lu + + * peicode.h (jtab): Make it static. + + * 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. + +2000-03-01 Nick Clifton + + * coff-arm.c (bfd_arm_process_before_allocation): Make + 'symndx' signed to prevent compile time warning. + + * coff-mcore.c: Remove unused prototype for pe_object_p. + + * 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. + + * coffcode.h (styp_to_sec_flags): Initialise 'target_name'. + + * elf-m10300.c (mn10300_elf_relax_section): Initialise + 'sym_sec'. + + * elf32-i370.c: Add ATTRIBUTE_UNUSED to unused function + parameters. + Remove unusued variables and code. + (elf_backend_add_symbol_hook): Fix prototype. + + * elf32-m68k.c (elf_m68k_gc_sweep_hook): Initialise 'sgot' and + 'srelgot'. + + * elf32-mcore.c (mcore_elf_relocate_section): Initialise + 'oldinst'. + + * elf32-mips.c: Add ATTRIBUTE_UNUSED to unused function + parameters. + Remove unusued variables and code. + (elf_backend_add_symbol_hook): Fix prototype. + + * elf32-sh.c (sh_elf_set_mach_from_flags): Use 'flags'. + + * 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. + + * peicode.h (pe_ILF_build_a_bfd): Initialise id6. + +2000-03-01 H.J. Lu + + * 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. + 2000-02-28 Nick Clifton * Makefile.am: Add rules to build pe[i]-{sh|mips}.lo objects. diff -upr --new-file binutils-2.9.5.0.29/bfd/ChangeLog.linux binutils-2.9.5.0.31/bfd/ChangeLog.linux --- binutils-2.9.5.0.29/bfd/ChangeLog.linux Wed Mar 1 10:00:35 2000 +++ binutils-2.9.5.0.31/bfd/ChangeLog.linux Sun Mar 19 11:52:01 2000 @@ -1,59 +1,8 @@ -2000-03-01 H.J. Lu +2000-03-10 Ken Block USG - * 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. - -2000-02-29 H.J. Lu - - * peicode.h (jtab): Make it static. - - * 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. + * elf64-alpha.c (elf64_alpha_check_relocs): Don't count the + RELATIVE relocation for an non-loaded section + (elf64_alpha_relocate_section): Likewise. Thu Jan 13 13:29:40 2000 H.J. Lu diff -upr --new-file binutils-2.9.5.0.29/bfd/aout-target.h binutils-2.9.5.0.31/bfd/aout-target.h --- binutils-2.9.5.0.29/bfd/aout-target.h Mon Jul 19 09:13:12 1999 +++ binutils-2.9.5.0.31/bfd/aout-target.h Sun Mar 12 09:31:45 2000 @@ -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, 97, 98, 1999 + 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. @@ -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); diff -upr --new-file binutils-2.9.5.0.29/bfd/aout-tic30.c binutils-2.9.5.0.31/bfd/aout-tic30.c --- binutils-2.9.5.0.29/bfd/aout-tic30.c Mon Jul 19 09:13:12 1999 +++ binutils-2.9.5.0.31/bfd/aout-tic30.c Sun Mar 12 09:31:46 2000 @@ -1,5 +1,5 @@ /* BFD back-end for TMS320C30 a.out binaries. - Copyright (C) 1998, 1999 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. @@ -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; diff -upr --new-file binutils-2.9.5.0.29/bfd/bfd-in.h binutils-2.9.5.0.31/bfd/bfd-in.h --- binutils-2.9.5.0.29/bfd/bfd-in.h Fri Feb 25 13:39:22 2000 +++ binutils-2.9.5.0.31/bfd/bfd-in.h Sun Mar 12 09:40:13 2000 @@ -728,6 +728,16 @@ extern boolean bfd_arm_process_before_al 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 *)); diff -upr --new-file binutils-2.9.5.0.29/bfd/bfd-in2.h binutils-2.9.5.0.31/bfd/bfd-in2.h --- binutils-2.9.5.0.29/bfd/bfd-in2.h Fri Feb 25 13:39:22 2000 +++ binutils-2.9.5.0.31/bfd/bfd-in2.h Sun Mar 19 12:07:54 2000 @@ -728,6 +728,16 @@ extern boolean bfd_arm_process_before_al 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 *)); @@ -1595,13 +1605,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 @@ -2100,39 +2123,39 @@ assumed to be 0. */ This is a 6-bit absolute reloc. */ BFD_RELOC_D30V_6, -/* This is a 6-bit pc-relative reloc with +/* 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 +/* 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 +/* 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 +/* 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 +/* 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 +/* 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 +/* 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 +/* 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. */ @@ -2280,7 +2303,7 @@ short offset into 11 bits. */ BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2, BFD_RELOC_MCORE_RVA, -/* These two relocations are used by the linker to determine which of +/* 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 @@ -2294,7 +2317,7 @@ relocation should be located at the chil 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 +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, diff -upr --new-file binutils-2.9.5.0.29/bfd/coff-arm.c binutils-2.9.5.0.31/bfd/coff-arm.c --- binutils-2.9.5.0.29/bfd/coff-arm.c Wed Mar 1 10:00:35 2000 +++ binutils-2.9.5.0.31/bfd/coff-arm.c Sun Mar 12 09:40:13 2000 @@ -2045,7 +2045,7 @@ bfd_arm_process_before_allocation (abfd, for (rel = i; rel < i + sec->reloc_count; ++rel) { unsigned short r_type = rel->r_type; - unsigned long symndx; + long symndx; struct coff_link_hash_entry * h; symndx = rel->r_symndx; diff -upr --new-file binutils-2.9.5.0.29/bfd/coff-h8300.c binutils-2.9.5.0.31/bfd/coff-h8300.c --- binutils-2.9.5.0.29/bfd/coff-h8300.c Mon Jul 19 09:13:13 1999 +++ binutils-2.9.5.0.31/bfd/coff-h8300.c Sun Mar 19 11:54:26 2000 @@ -796,7 +796,7 @@ h8300_reloc16_extra_cases (abfd, link_in value = bfd_coff_reloc16_get_value (reloc, link_info, input_section); /* Sanity check. */ - if (value < 0x8000 || value > 0xff8000) + if (value <= 0x7fff || value >= 0xff8000) { /* Insert the 16bit value into the proper location. */ bfd_put_16 (abfd, value, data + dst_address); diff -upr --new-file binutils-2.9.5.0.29/bfd/coff-mcore.c binutils-2.9.5.0.31/bfd/coff-mcore.c --- binutils-2.9.5.0.29/bfd/coff-mcore.c Wed Mar 1 10:00:35 2000 +++ binutils-2.9.5.0.31/bfd/coff-mcore.c Sun Mar 12 09:40:13 2000 @@ -52,10 +52,6 @@ static reloc_howto_type * mcor static reloc_howto_type * coff_mcore_rtype_to_howto PARAMS ((bfd *, asection *, struct internal_reloc *, struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *)); -static const bfd_target * pe_object_p - PARAMS ((bfd *)); - - /* 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 diff -upr --new-file binutils-2.9.5.0.29/bfd/coff-sh.c binutils-2.9.5.0.31/bfd/coff-sh.c --- binutils-2.9.5.0.29/bfd/coff-sh.c Wed Mar 1 10:00:35 2000 +++ binutils-2.9.5.0.31/bfd/coff-sh.c Sun Mar 12 09:40:13 2000 @@ -50,7 +50,9 @@ static boolean sh_relax_section PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); static boolean sh_relax_delete_bytes PARAMS ((bfd *, asection *, bfd_vma, int)); +#ifndef COFF_IMAGE_WITH_PE static const struct sh_opcode *sh_insn_info PARAMS ((unsigned int)); +#endif static boolean sh_align_loads PARAMS ((bfd *, asection *, struct internal_reloc *, bfd_byte *, boolean *)); static boolean sh_swap_insns @@ -411,7 +413,7 @@ get_symbol_value (symbol) static reloc_howto_type * coff_sh_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; @@ -1556,7 +1558,7 @@ struct sh_opcode mask value in the sh_major_opcode structure. */ unsigned short opcode; /* Flags for this instruction. */ - unsigned short flags; + unsigned long flags; }; /* Flag which appear in the sh_opcode structure. */ @@ -1629,6 +1631,7 @@ struct sh_opcode #define SETSAS (0x40000) #define SETSAS_REG(x) USESAS_REG (x) +#ifndef COFF_IMAGE_WITH_PE static boolean sh_insn_uses_reg PARAMS ((unsigned int, const struct sh_opcode *, unsigned int)); static boolean sh_insn_sets_reg @@ -1647,7 +1650,7 @@ static boolean sh_insns_conflict static boolean sh_load_use PARAMS ((unsigned int, const struct sh_opcode *, unsigned int, const struct sh_opcode *)); - +#endif /* The opcode maps. */ #define MAP(a) a, sizeof a / sizeof a[0] @@ -2110,6 +2113,7 @@ static const struct sh_minor_opcode sh_d { MAP (sh_dsp_opcodef0), 0xfc0d } }; +#ifndef COFF_IMAGE_WITH_PE /* Given an instruction, return a pointer to the corresponding sh_opcode structure. Return NULL if the instruction is not recognized. */ @@ -2393,7 +2397,6 @@ sh_load_use (i1, op1, i2, op2) return false; } -#ifndef COFF_IMAGE_WITH_PE /* Try to align loads and stores within a span of memory. This is called by both the ELF and the COFF sh targets. ABFD and SEC are the BFD and section we are examining. CONTENTS is the contents of @@ -2616,7 +2619,7 @@ _bfd_sh_align_load_span (abfd, sec, cont return true; } -#endif +#endif /* not COFF_IMAGE_WITH_PE */ /* Look for loads and stores which we can align to four byte boundaries. See the longer comment above sh_relax_section for why @@ -3124,9 +3127,10 @@ CREATE_BIG_COFF_TARGET_VEC (shcoff_vec, CREATE_LITTLE_COFF_TARGET_VEC (TARGET_SYM, TARGET_SHL_NAME, BFD_IS_RELAXABLE, SEC_CODE | SEC_DATA, '_', NULL); #else -CREATE_LITTLE_COFF_TARGET_VEC (TARGET_SYM, TARGET_SHL_NAME, BFD_IS_RELAXABLE, 0, '_', NULL) +CREATE_LITTLE_COFF_TARGET_VEC (TARGET_SYM, TARGET_SHL_NAME, BFD_IS_RELAXABLE, + 0, '_', NULL) #endif - + #ifndef TARGET_SHL_SYM /* Some people want versions of the SH COFF target which do not align to 16 byte boundaries. We implement that by adding a couple of new diff -upr --new-file binutils-2.9.5.0.29/bfd/coffcode.h binutils-2.9.5.0.31/bfd/coffcode.h --- binutils-2.9.5.0.29/bfd/coffcode.h Tue Feb 29 11:00:07 2000 +++ binutils-2.9.5.0.31/bfd/coffcode.h Sun Mar 12 09:31:54 2000 @@ -760,7 +760,7 @@ styp_to_sec_flags (abfd, hdr, name, sect { bfd_byte *esymstart, *esym, *esymend; int seen_state = 0; - char *target_name; + char *target_name = NULL; esymstart = esym = (bfd_byte *) obj_coff_external_syms (abfd); esymend = esym + obj_raw_syment_count (abfd) * bfd_coff_symesz (abfd); diff -upr --new-file binutils-2.9.5.0.29/bfd/configure binutils-2.9.5.0.31/bfd/configure --- binutils-2.9.5.0.29/bfd/configure Tue Feb 29 11:15:14 2000 +++ binutils-2.9.5.0.31/bfd/configure Sun Mar 19 12:07:25 2000 @@ -1061,7 +1061,7 @@ fi PACKAGE=bfd -VERSION=2.9.5.0.29 +VERSION=2.9.5.0.31 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; } diff -upr --new-file binutils-2.9.5.0.29/bfd/configure.in binutils-2.9.5.0.31/bfd/configure.in --- binutils-2.9.5.0.29/bfd/configure.in Tue Feb 29 11:15:14 2000 +++ binutils-2.9.5.0.31/bfd/configure.in Sun Mar 19 12:07:25 2000 @@ -7,7 +7,7 @@ AC_INIT(libbfd.c) AC_CANONICAL_SYSTEM AC_ISC_POSIX -AM_INIT_AUTOMAKE(bfd, 2.9.5.0.29) +AM_INIT_AUTOMAKE(bfd, 2.9.5.0.31) dnl These must be called before AM_PROG_LIBTOOL, because it may want dnl to call AC_CHECK_PROG. diff -upr --new-file binutils-2.9.5.0.29/bfd/elf-m10300.c binutils-2.9.5.0.31/bfd/elf-m10300.c --- binutils-2.9.5.0.29/bfd/elf-m10300.c Wed Mar 1 10:00:35 2000 +++ binutils-2.9.5.0.31/bfd/elf-m10300.c Sun Mar 12 09:40:13 2000 @@ -849,7 +849,7 @@ mn10300_elf_relax_section (abfd, sec, li { struct elf32_mn10300_link_hash_entry *hash; Elf_Internal_Sym *sym; - asection *sym_sec; + asection *sym_sec = NULL; const char *sym_name; char *new_name; @@ -930,7 +930,7 @@ mn10300_elf_relax_section (abfd, sec, li sym_sec = bfd_abs_section_ptr; else if (isym.st_shndx == SHN_COMMON) sym_sec = bfd_com_section_ptr; - + sym_name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, isym.st_name); @@ -1193,7 +1193,7 @@ mn10300_elf_relax_section (abfd, sec, li { Elf_Internal_Sym isym; struct elf32_mn10300_link_hash_entry *sym_hash; - asection *sym_sec; + asection *sym_sec = NULL; const char *sym_name; char *new_name; @@ -1211,7 +1211,9 @@ mn10300_elf_relax_section (abfd, sec, li sym_sec = bfd_abs_section_ptr; else if (isym.st_shndx == SHN_COMMON) sym_sec = bfd_com_section_ptr; - + else + abort (); + sym_name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, isym.st_name); @@ -1461,7 +1463,7 @@ mn10300_elf_relax_section (abfd, sec, li if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) { Elf_Internal_Sym isym; - asection *sym_sec; + asection *sym_sec = NULL; const char *sym_name; char *new_name; @@ -1478,7 +1480,9 @@ mn10300_elf_relax_section (abfd, sec, li sym_sec = bfd_abs_section_ptr; else if (isym.st_shndx == SHN_COMMON) sym_sec = bfd_com_section_ptr; - + else + abort (); + symval = (isym.st_value + sym_sec->output_section->vma + sym_sec->output_offset); diff -upr --new-file binutils-2.9.5.0.29/bfd/elf.c binutils-2.9.5.0.31/bfd/elf.c --- binutils-2.9.5.0.29/bfd/elf.c Fri Feb 25 13:39:22 2000 +++ binutils-2.9.5.0.31/bfd/elf.c Sun Mar 12 09:40:13 2000 @@ -4224,7 +4224,8 @@ swap_out_syms (abfd, sttp, relocatable_p type = STT_NOTYPE; /* Processor-specific types */ - if (bed->elf_backend_get_symbol_type) + 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) diff -upr --new-file binutils-2.9.5.0.29/bfd/elf32-arm.h binutils-2.9.5.0.31/bfd/elf32-arm.h --- binutils-2.9.5.0.29/bfd/elf32-arm.h Wed Mar 1 10:00:36 2000 +++ binutils-2.9.5.0.31/bfd/elf32-arm.h Sun Mar 12 09:40:13 2000 @@ -1807,7 +1807,7 @@ elf32_arm_relocate_section (output_bfd, if (!((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, rel->r_offset, - !info->shared || info->no_undefined))) + (!info->shared || info->no_undefined)))) return false; relocation = 0; } diff -upr --new-file binutils-2.9.5.0.29/bfd/elf32-i370.c binutils-2.9.5.0.31/bfd/elf32-i370.c --- binutils-2.9.5.0.29/bfd/elf32-i370.c Wed Mar 1 10:00:36 2000 +++ binutils-2.9.5.0.31/bfd/elf32-i370.c Sun Mar 12 09:40:13 2000 @@ -280,7 +280,7 @@ i370_elf_howto_init () static reloc_howto_type * i370_elf_reloc_type_lookup (abfd, code) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; bfd_reloc_code_real_type code; { enum i370_reloc_type i370_reloc = R_I370_NONE; @@ -325,12 +325,12 @@ static boolean i370_elf_section_from_shd static boolean i370_elf_fake_sections PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *)); - +#if 0 static elf_linker_section_t *i370_elf_create_linker_section PARAMS ((bfd *abfd, struct bfd_link_info *info, enum elf_linker_section_enum)); - +#endif static boolean i370_elf_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, @@ -355,7 +355,7 @@ static boolean i370_elf_finish_dynamic_s static void i370_elf_info_to_howto (abfd, cache_ptr, dst) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; arelent *cache_ptr; Elf32_Internal_Rela *dst; { @@ -482,7 +482,7 @@ i370_elf_section_from_shdr (abfd, hdr, n static boolean i370_elf_fake_sections (abfd, shdr, asect) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; Elf32_Internal_Shdr *shdr; asection *asect; { @@ -496,6 +496,7 @@ i370_elf_fake_sections (abfd, shdr, asec } +#if 0 /* Create a special linker section */ /* XXX hack alert bogus This routine is mostly all junk and almost * certainly does the wrong thing. Its here simply because it does @@ -571,7 +572,7 @@ i370_elf_create_linker_section (abfd, in return lsect; } - +#endif /* 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 @@ -636,7 +637,6 @@ i370_elf_adjust_dynamic_symbol (info, h) bfd *dynobj = elf_hash_table (info)->dynobj; asection *s; unsigned int power_of_two; - bfd_vma plt_offset; #ifdef DEBUG fprintf (stderr, "i370_elf_adjust_dynamic_symbol called for %s\n", @@ -1024,11 +1024,7 @@ i370_elf_check_relocs (abfd, info, sec, const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; bfd_vma *local_got_offsets; - elf_linker_section_t *sdata; - elf_linker_section_t *sdata2; asection *sreloc; - asection *sgot; - asection *srelgot = NULL; if (info->relocateable) return true; @@ -1732,8 +1728,8 @@ int i370_noop() #define elf_backend_add_symbol_hook \ (boolean (*) PARAMS ((bfd *, struct bfd_link_info *, \ - const char *, Elf_Internal_Sym *, \ - asection *))) i370_noop + const Elf_Internal_Sym *, const char **, flagword *, \ + asection **, bfd_vma *))) i370_noop #define elf_backend_finish_dynamic_symbol \ (boolean (*) PARAMS ((bfd *, struct bfd_link_info *, \ struct elf_link_hash_entry *, \ diff -upr --new-file binutils-2.9.5.0.29/bfd/elf32-i386.c binutils-2.9.5.0.31/bfd/elf32-i386.c --- binutils-2.9.5.0.29/bfd/elf32-i386.c Wed Mar 1 10:00:36 2000 +++ binutils-2.9.5.0.31/bfd/elf32-i386.c Sun Mar 12 09:40:13 2000 @@ -1320,7 +1320,7 @@ elf_i386_relocate_section (output_bfd, i if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, rel->r_offset, - !info->shared || info->no_undefined))) + (!info->shared || info->no_undefined)))) return false; relocation = 0; } diff -upr --new-file binutils-2.9.5.0.29/bfd/elf32-m32r.c binutils-2.9.5.0.31/bfd/elf32-m32r.c --- binutils-2.9.5.0.29/bfd/elf32-m32r.c Wed Mar 1 10:00:36 2000 +++ binutils-2.9.5.0.31/bfd/elf32-m32r.c Sun Mar 19 12:07:54 2000 @@ -498,9 +498,9 @@ m32r_elf_relocate_hi16 (input_bfd, type, R_M32R_HI16_[SU]LO relocation described above. */ bfd_reloc_status_type -m32r_elf_lo16_reloc (abfd, reloc_entry, symbol, data, +m32r_elf_lo16_reloc (input_bfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) - bfd *abfd; + bfd *input_bfd; arelent *reloc_entry; asymbol *symbol; PTR data; @@ -508,6 +508,21 @@ m32r_elf_lo16_reloc (abfd, reloc_entry, bfd *output_bfd; char **error_message; { + bfd_reloc_status_type ret; + bfd_vma relocation; + unsigned long insn; + + /* This part is from bfd_elf_generic_reloc. + If we're relocating, and this an external symbol, we don't want + to change anything. */ + if (output_bfd != (bfd *) NULL + && (symbol->flags & BSF_SECTION_SYM) == 0 + && reloc_entry->addend == 0) + { + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; + } + if (m32r_hi16_list != NULL) { struct m32r_hi16 *l; @@ -523,8 +538,8 @@ m32r_elf_lo16_reloc (abfd, reloc_entry, /* Do the HI16 relocation. Note that we actually don't need to know anything about the LO16 itself, except where to find the low 16 bits of the addend needed by the LO16. */ - insn = bfd_get_32 (abfd, l->addr); - vallo = ((bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address) + insn = bfd_get_32 (input_bfd, l->addr); + vallo = ((bfd_get_32 (input_bfd, (bfd_byte *) data + reloc_entry->address) & 0xffff) ^ 0x8000) - 0x8000; val = ((insn & 0xffff) << 16) + vallo; val += l->addend; @@ -534,7 +549,7 @@ m32r_elf_lo16_reloc (abfd, reloc_entry, val += 0x10000; insn = (insn &~ 0xffff) | ((val >> 16) & 0xffff); - bfd_put_32 (abfd, insn, l->addr); + bfd_put_32 (input_bfd, insn, l->addr); next = l->next; free (l); @@ -544,9 +559,44 @@ m32r_elf_lo16_reloc (abfd, reloc_entry, m32r_hi16_list = NULL; } - /* Now do the LO16 reloc in the usual way. */ - return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, - input_section, output_bfd, error_message); + /* Now do the LO16 reloc in the usual way. + ??? It would be nice to call bfd_elf_generic_reloc here, + but we have partial_inplace == TRUE. bfd_elf_generic_reloc will + pass the handling back to bfd_install_relocation which will install + a section relative addend which is wrong. */ + + /* Sanity check the address (offset in section). */ + if (reloc_entry->address > input_section->_cooked_size) + return bfd_reloc_outofrange; + + ret = bfd_reloc_ok; + if (bfd_is_und_section (symbol->section) + && output_bfd == (bfd *) NULL) + ret = bfd_reloc_undefined; + + if (bfd_is_com_section (symbol->section) + || output_bfd != (bfd *) NULL) + relocation = 0; + else + relocation = symbol->value; + + /* Only do this for a final link. */ + if (output_bfd == (bfd *) NULL) + { + relocation += symbol->section->output_section->vma; + relocation += symbol->section->output_offset; + } + + relocation += reloc_entry->addend; + + insn = bfd_get_32 (input_bfd, data + reloc_entry->address); + insn = (insn & 0xffff0000) | (relocation & 0xffff); + bfd_put_32 (input_bfd, insn, data + reloc_entry->address); + + if (output_bfd != (bfd *) NULL) + reloc_entry->address += input_section->output_offset; + + return ret; } /* Handle the R_M32R_SDA16 reloc. diff -upr --new-file binutils-2.9.5.0.29/bfd/elf32-m68k.c binutils-2.9.5.0.31/bfd/elf32-m68k.c --- binutils-2.9.5.0.29/bfd/elf32-m68k.c Wed Mar 1 10:00:36 2000 +++ binutils-2.9.5.0.31/bfd/elf32-m68k.c Sun Mar 12 09:40:13 2000 @@ -847,8 +847,8 @@ elf_m68k_gc_sweep_hook (abfd, info, sec, unsigned long r_symndx; struct elf_link_hash_entry *h; bfd *dynobj; - asection *sgot; - asection *srelgot; + asection *sgot = NULL; + asection *srelgot = NULL; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); @@ -1486,7 +1486,7 @@ elf_m68k_relocate_section (output_bfd, i if (!(info->callbacks->undefined_symbol (info, h->root.root.string, input_bfd, input_section, rel->r_offset, - !info->shared || info->no_undefined))) + (!info->shared || info->no_undefined)))) return false; relocation = 0; } diff -upr --new-file binutils-2.9.5.0.29/bfd/elf32-mcore.c binutils-2.9.5.0.31/bfd/elf32-mcore.c --- binutils-2.9.5.0.29/bfd/elf32-mcore.c Wed Mar 1 10:00:36 2000 +++ binutils-2.9.5.0.31/bfd/elf32-mcore.c Sun Mar 12 09:40:13 2000 @@ -454,7 +454,7 @@ mcore_elf_relocate_section (output_bfd, Elf_Internal_Sym * sym = (Elf_Internal_Sym *) 0; unsigned long r_symndx; struct elf_link_hash_entry * h = (struct elf_link_hash_entry *) 0; - unsigned short oldinst; + unsigned short oldinst = 0; /* Unknown relocation handling */ if ((unsigned) r_type >= (unsigned) R_MCORE_max diff -upr --new-file binutils-2.9.5.0.29/bfd/elf32-mips.c binutils-2.9.5.0.31/bfd/elf32-mips.c --- binutils-2.9.5.0.29/bfd/elf32-mips.c Wed Mar 1 10:00:36 2000 +++ binutils-2.9.5.0.31/bfd/elf32-mips.c Sun Mar 12 09:40:13 2000 @@ -108,8 +108,10 @@ 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 *)); @@ -157,8 +159,9 @@ static boolean mips_elf_record_global_go 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_lo16_relocation - PARAMS ((const Elf_Internal_Rela *, const Elf_Internal_Rela *)); +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 *, @@ -612,7 +615,7 @@ static reloc_howto_type elf_mips_howto_t true, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + true), /* pcrel_offset */ /* 16 bit call through global offset table. */ HOWTO (R_MIPS_CALL16, /* type */ @@ -942,6 +945,87 @@ static reloc_howto_type elf_mips16_gprel 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 */ @@ -1880,6 +1964,16 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, c 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; } } @@ -1903,6 +1997,21 @@ mips_rtype_to_howto (r_type) 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); @@ -2115,7 +2224,7 @@ bfd_mips_elf_swap_options_out (abfd, in, 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 @@ -2127,7 +2236,7 @@ bfd_mips_elf_swap_msym_in (abfd, ex, 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 @@ -5360,7 +5469,7 @@ mips_elf_got_page (abfd, info, value, of struct mips_got_info *g; bfd_byte *entry; bfd_byte *last_entry; - bfd_vma index; + bfd_vma index = 0; bfd_vma address; g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot); @@ -5409,7 +5518,7 @@ mips_elf_got16_entry (abfd, info, value) struct mips_got_info *g; bfd_byte *entry; bfd_byte *last_entry; - bfd_vma index; + bfd_vma index = 0; bfd_vma address; /* Although the ABI says that it is "the high-order 16 bits" that we @@ -5442,11 +5551,12 @@ mips_elf_got16_entry (abfd, info, value) return index; } -/* Returns the first R_MIPS_LO16 relocation found, beginning with +/* Returns the first relocation of type r_type found, beginning with RELOCATION. RELEND is one-past-the-end of the relocation table. */ static const Elf_Internal_Rela * -mips_elf_next_lo16_relocation (relocation, relend) +mips_elf_next_relocation (r_type, relocation, relend) + unsigned int r_type; const Elf_Internal_Rela *relocation; const Elf_Internal_Rela *relend; { @@ -5458,7 +5568,7 @@ mips_elf_next_lo16_relocation (relocatio extension in general, as that is useful for GCC. */ while (relocation < relend) { - if (ELF32_R_TYPE (relocation->r_info) == R_MIPS_LO16) + if (ELF32_R_TYPE (relocation->r_info) == r_type) return relocation; ++relocation; @@ -5838,7 +5948,7 @@ mips_elf_calculate_relocation (abfd, if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.root.string, input_bfd, input_section, relocation->r_offset, - !info->shared || info->no_undefined))) + (!info->shared || info->no_undefined)))) return bfd_reloc_undefined; symbol = 0; } @@ -6004,6 +6114,24 @@ mips_elf_calculate_relocation (abfd, value &= howto->dst_mask; break; + case R_MIPS_PC32: + case R_MIPS_PC64: + case R_MIPS_GNU_REL_LO16: + value = symbol + addend - p; + value &= howto->dst_mask; + break; + + 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; + + case R_MIPS_GNU_REL_HI16: + value = mips_elf_high (addend + symbol - p); + value &= howto->dst_mask; + break; + 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 @@ -6415,7 +6543,7 @@ _bfd_mips_elf_relocate_section (output_b { Elf_Internal_Rela *rel; const Elf_Internal_Rela *relend; - bfd_vma addend; + bfd_vma addend = 0; boolean use_saved_addend_p = false; struct elf_backend_data *bed; @@ -6482,6 +6610,7 @@ _bfd_mips_elf_relocate_section (output_b 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))) @@ -6489,6 +6618,7 @@ _bfd_mips_elf_relocate_section (output_b 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 @@ -6496,15 +6626,18 @@ _bfd_mips_elf_relocate_section (output_b a `lui' of the HI16 value, and then an `addiu' of the LO16 value.) - Scan ahead to find a matching R_MIPS_LO16 - relocation. */ + 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_lo16_relocation (rel, relend); + = mips_elf_next_relocation (lo, rel, relend); if (lo16_relocation == NULL) return false; /* Obtain the addend kept there. */ - lo16_howto = mips_rtype_to_howto (R_MIPS_LO16); + lo16_howto = mips_rtype_to_howto (lo); l = mips_elf_obtain_contents (lo16_howto, lo16_relocation, input_bfd, contents); @@ -6535,6 +6668,10 @@ _bfd_mips_elf_relocate_section (output_b 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 @@ -6552,7 +6689,8 @@ _bfd_mips_elf_relocate_section (output_b || 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) + 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 @@ -6568,17 +6706,19 @@ _bfd_mips_elf_relocate_section (output_b /* 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) + 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) + 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. */ + We have to cast away constness for REL. */ rel->r_addend = addend; else { @@ -6588,6 +6728,43 @@ _bfd_mips_elf_relocate_section (output_b 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)) @@ -6629,7 +6806,7 @@ _bfd_mips_elf_relocate_section (output_b case bfd_reloc_undefined: /* mips_elf_calculate_relocation already called the - undefined_symbol callback. There's no real point in + 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; @@ -6682,13 +6859,13 @@ _bfd_mips_elf_relocate_section (output_b bfd_vma low_bits; bfd_vma high_bits; - if (value & 0x80000000) - sign_bits = 0xffffffff; + if (value & 0x80000000u) + sign_bits = 0xffffffffu; else sign_bits = 0; - /* If only a 32-bit VMA is available do two separate - stores. */ + /* If we don't know that we have a 64-bit type, + do two separate stores. */ if (bfd_big_endian (input_bfd)) { /* Undo what we did above. */ diff -upr --new-file binutils-2.9.5.0.29/bfd/elf32-ppc.c binutils-2.9.5.0.31/bfd/elf32-ppc.c --- binutils-2.9.5.0.29/bfd/elf32-ppc.c Wed Mar 1 10:00:36 2000 +++ binutils-2.9.5.0.31/bfd/elf32-ppc.c Sun Mar 12 09:40:13 2000 @@ -3110,8 +3110,8 @@ ppc_elf_relocate_section (output_bfd, in input_bfd, input_section, rel->r_offset, - !info->shared - || info->no_undefined)) + (!info->shared + || info->no_undefined))) return false; relocation = 0; } diff -upr --new-file binutils-2.9.5.0.29/bfd/elf32-sh.c binutils-2.9.5.0.31/bfd/elf32-sh.c --- binutils-2.9.5.0.29/bfd/elf32-sh.c Wed Mar 1 10:00:36 2000 +++ binutils-2.9.5.0.31/bfd/elf32-sh.c Sun Mar 12 09:40:13 2000 @@ -2101,7 +2101,7 @@ sh_elf_set_mach_from_flags (abfd) { flagword flags = elf_elfheader (abfd)->e_flags; - switch (elf_elfheader (abfd)->e_flags & EF_SH_MACH_MASK) + switch (flags & EF_SH_MACH_MASK) { case EF_SH1: bfd_default_set_arch_mach (abfd, bfd_arch_sh, bfd_mach_sh); diff -upr --new-file binutils-2.9.5.0.29/bfd/elf32-sparc.c binutils-2.9.5.0.31/bfd/elf32-sparc.c --- binutils-2.9.5.0.29/bfd/elf32-sparc.c Wed Mar 1 10:00:36 2000 +++ binutils-2.9.5.0.31/bfd/elf32-sparc.c Sun Mar 12 09:40:13 2000 @@ -1220,7 +1220,7 @@ elf32_sparc_relocate_section (output_bfd if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, rel->r_offset, - !info->shared || info->no_undefined))) + (!info->shared || info->no_undefined)))) return false; relocation = 0; } diff -upr --new-file binutils-2.9.5.0.29/bfd/elf64-alpha.c binutils-2.9.5.0.31/bfd/elf64-alpha.c --- binutils-2.9.5.0.29/bfd/elf64-alpha.c Wed Mar 1 10:00:36 2000 +++ binutils-2.9.5.0.31/bfd/elf64-alpha.c Sun Mar 19 11:52:01 2000 @@ -2577,9 +2577,10 @@ elf64_alpha_check_relocs (abfd, info, se 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; @@ -3477,7 +3478,7 @@ elf64_alpha_relocate_section (output_bfd if (!((*info->callbacks->undefined_symbol) (info, h->root.root.root.string, input_bfd, input_section, rel->r_offset, - !info->shared || info->no_undefined))) + (!info->shared || info->no_undefined)))) return false; relocation = 0; } @@ -3619,7 +3620,9 @@ elf64_alpha_relocate_section (output_bfd outrel.r_addend = addend; addend = 0, relocation = 0; } - else if (info->shared) + /* A RELATIVE relocation makes no sense if this section + isn't to be loaded into memory. */ + else if (info->shared && (input_section->flags & SEC_ALLOC)) { outrel.r_info = ELF64_R_INFO(0, R_ALPHA_RELATIVE); outrel.r_addend = 0; diff -upr --new-file binutils-2.9.5.0.29/bfd/elf64-sparc.c binutils-2.9.5.0.31/bfd/elf64-sparc.c --- binutils-2.9.5.0.29/bfd/elf64-sparc.c Wed Mar 1 10:00:36 2000 +++ binutils-2.9.5.0.31/bfd/elf64-sparc.c Sun Mar 12 09:40:13 2000 @@ -2056,7 +2056,7 @@ sparc64_elf_relocate_section (output_bfd if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, rel->r_offset, - !info->shared || info->no_undefined))) + (!info->shared || info->no_undefined)))) return false; relocation = 0; } diff -upr --new-file binutils-2.9.5.0.29/bfd/elflink.h binutils-2.9.5.0.31/bfd/elflink.h --- binutils-2.9.5.0.29/bfd/elflink.h Wed Mar 1 10:00:36 2000 +++ binutils-2.9.5.0.31/bfd/elflink.h Sun Mar 12 09:40:13 2000 @@ -83,7 +83,7 @@ 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; + bfd * abfd ATTRIBUTE_UNUSED; Elf_Internal_Sym * sym; { /* Local symbols do not count, but target specific ones might. */ diff -upr --new-file binutils-2.9.5.0.29/bfd/freebsd.h binutils-2.9.5.0.31/bfd/freebsd.h --- binutils-2.9.5.0.29/bfd/freebsd.h Thu Jun 3 11:01:54 1999 +++ binutils-2.9.5.0.31/bfd/freebsd.h Sun Mar 12 09:32:09 2000 @@ -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 -upr --new-file binutils-2.9.5.0.29/bfd/hp300hpux.c binutils-2.9.5.0.31/bfd/hp300hpux.c --- binutils-2.9.5.0.29/bfd/hp300hpux.c Sat Jul 17 13:52:29 1999 +++ binutils-2.9.5.0.31/bfd/hp300hpux.c Sun Mar 12 09:32:09 2000 @@ -1,5 +1,5 @@ /* BFD backend for hp-ux 9000/300 - Copyright (C) 1990, 91, 94, 95, 97, 1999 Free Software Foundation, Inc. + Copyright (C) 1990, 91, 94, 95, 97, 99, 2000 Free Software Foundation, Inc. Written by Glenn Engel. This file is part of BFD, the Binary File Descriptor library. @@ -270,11 +270,8 @@ MY (write_object_contents) (abfd) file_ptr text_end; memset (&exec_bytes, 0, sizeof (exec_bytes)); -#if CHOOSE_RELOC_SIZE - CHOOSE_RELOC_SIZE (abfd); -#else + obj_reloc_entry_size (abfd) = RELOC_STD_SIZE; -#endif if (adata (abfd).magic == undecided_magic) NAME (aout,adjust_sizes_and_vmas) (abfd, &text_size, &text_end); diff -upr --new-file binutils-2.9.5.0.29/bfd/ieee.c binutils-2.9.5.0.31/bfd/ieee.c --- binutils-2.9.5.0.29/bfd/ieee.c Fri Nov 19 09:42:50 1999 +++ binutils-2.9.5.0.31/bfd/ieee.c Sun Mar 12 09:32:10 2000 @@ -1336,7 +1336,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)); @@ -1345,7 +1345,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)); @@ -1448,6 +1448,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); diff -upr --new-file binutils-2.9.5.0.29/bfd/netbsd.h binutils-2.9.5.0.31/bfd/netbsd.h --- binutils-2.9.5.0.29/bfd/netbsd.h Thu Jun 3 11:01:54 1999 +++ binutils-2.9.5.0.31/bfd/netbsd.h Sun Mar 12 09:32:13 2000 @@ -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 -upr --new-file binutils-2.9.5.0.29/bfd/pc532-mach.c binutils-2.9.5.0.31/bfd/pc532-mach.c --- binutils-2.9.5.0.29/bfd/pc532-mach.c Thu Jun 3 11:01:54 1999 +++ binutils-2.9.5.0.31/bfd/pc532-mach.c Sun Mar 12 09:32:15 2000 @@ -1,5 +1,5 @@ /* BFD back-end for Mach3/532 a.out-ish binaries. - Copyright (C) 1990, 1991, 1992, 1994 Free Software Foundation, Inc. + Copyright (C) 1990, 1991, 1992, 1994, 2000 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -92,11 +92,7 @@ bfd *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_ASSERT (bfd_get_arch (abfd) == bfd_arch_ns32k); switch (bfd_get_mach (abfd)) diff -upr --new-file binutils-2.9.5.0.29/bfd/pe-mips.c binutils-2.9.5.0.31/bfd/pe-mips.c --- binutils-2.9.5.0.29/bfd/pe-mips.c Wed Mar 1 10:00:36 2000 +++ binutils-2.9.5.0.31/bfd/pe-mips.c Sun Mar 12 09:40:13 2000 @@ -41,7 +41,7 @@ static reloc_howto_type *coff_mips_rtype 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 *, @@ -52,7 +52,7 @@ static void mips_adjust_reloc_in PARAMS 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. */ @@ -74,9 +74,9 @@ coff_mips_reloc (abfd, reloc_entry, symb 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; @@ -169,7 +169,7 @@ coff_mips_reloc (abfd, reloc_entry, symb appear in the output .reloc section. */ static boolean in_reloc_p(abfd, howto) - bfd * abfd; + bfd * abfd ATTRIBUTE_UNUSED; reloc_howto_type *howto; { return ! howto->pc_relative && howto->type != MIPS_R_RVA; @@ -310,32 +310,32 @@ static reloc_howto_type howto_table[] = 0xffff, /* dst_mask */ false), /* pcrel_offset */ - { 8 }, - { 9 }, - { 10 }, - { 11 }, - { 12 }, - { 13 }, - { 14 }, - { 15 }, - { 16 }, - { 17 }, - { 18 }, - { 19 }, - { 20 }, - { 21 }, - { 22 }, - { 23 }, - { 24 }, - { 25 }, - { 26 }, - { 27 }, - { 28 }, - { 29 }, - { 30 }, - { 31 }, - { 32 }, - { 33 }, + 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) */ @@ -349,8 +349,8 @@ static reloc_howto_type howto_table[] = 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - { 35 }, - { 36 }, + EMPTY_HOWTO (35), + EMPTY_HOWTO (36), HOWTO (MIPS_R_PAIR, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -413,7 +413,7 @@ static reloc_howto_type howto_table[] = static reloc_howto_type * coff_mips_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; @@ -497,7 +497,7 @@ coff_mips_rtype_to_howto (abfd, sec, rel static reloc_howto_type * coff_mips_reloc_type_lookup (abfd, code) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; bfd_reloc_code_real_type code; { int mips_type; @@ -644,18 +644,13 @@ coff_pe_mips_relocate_section (output_bf struct internal_syment *syms; asection **sections; { - asection **symndx_to_section; - struct ecoff_link_hash_entry **sym_hashes; - struct coff_link_hash_entry *h; bfd_vma gp; boolean gp_undefined; size_t adjust; - long *offsets; struct internal_reloc *rel; struct internal_reloc *rel_end; unsigned int i; boolean got_lo; - struct internal_reloc lo_int_rel; if (info->relocateable) { @@ -695,7 +690,6 @@ coff_pe_mips_relocate_section (output_bf bfd_vma addend = 0; bfd_vma val, tmp, targ, src, low; reloc_howto_type *howto; - bfd_reloc_status_type rstat; unsigned char *mem = contents + rel->r_vaddr; symndx = rel->r_symndx; @@ -821,7 +815,7 @@ coff_pe_mips_relocate_section (output_bf case MIPS_R_JMPADDR: tmp = bfd_get_32(input_bfd, mem); targ = val + (tmp&0x03ffffff)*4; - if (src & 0xf0000000 != targ & 0xf0000000) + if ((src & 0xf0000000) != (targ & 0xf0000000)) { (*_bfd_error_handler)(_("%s: jump too far away\n"), bfd_get_filename (input_bfd)); @@ -894,7 +888,7 @@ coff_pe_mips_relocate_section (output_bf 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; + - pe_data (input_section->output_section->owner)->pe_opthdr.ImageBase; bfd_put_32 (input_bfd, tmp, mem); break; diff -upr --new-file binutils-2.9.5.0.29/bfd/peicode.h binutils-2.9.5.0.31/bfd/peicode.h --- binutils-2.9.5.0.29/bfd/peicode.h Wed Mar 1 08:25:54 2000 +++ binutils-2.9.5.0.31/bfd/peicode.h Sun Mar 12 09:40:13 2000 @@ -1,5 +1,5 @@ /* Support for the generic parts of PE/PEI, for BFD. - Copyright 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. Written by Cygnus Solutions. This file is part of BFD, the Binary File Descriptor library. @@ -114,10 +114,13 @@ typedef struct unsigned int * sym_table; unsigned int * table_ptr; - + combined_entry_type * native_syms; combined_entry_type * native_ptr; + coff_symbol_type ** sym_ptr_table; + coff_symbol_type ** sym_ptr_ptr; + unsigned int sec_index; char * string_table; @@ -135,9 +138,10 @@ static asection_ptr pe_ILF_make_a_ static void pe_ILF_make_a_reloc PARAMS ((pe_ILF_vars *, bfd_vma, bfd_reloc_code_real_type, asection_ptr)); static void pe_ILF_make_a_symbol PARAMS ((pe_ILF_vars *, const char *, const char *, asection_ptr, flagword)); static void pe_ILF_save_relocs PARAMS ((pe_ILF_vars *, asection_ptr)); +static void pe_ILF_make_a_symbol_reloc PARAMS ((pe_ILF_vars *, bfd_vma, bfd_reloc_code_real_type, struct symbol_cache_entry **, unsigned int)); static boolean pe_ILF_build_a_bfd PARAMS ((bfd *, unsigned short, bfd_byte *, bfd_byte *, unsigned int, unsigned int)); static const bfd_target * pe_ILF_object_p PARAMS ((bfd *)); -static const bfd_target * pe_bfd_object_p PARAMS ((bfd *)); +static const bfd_target * pe_bfd_object_p PARAMS ((bfd *)); #endif /* COFF_IMAGE_WITH_PE */ /**********************************************************************/ @@ -431,11 +435,11 @@ pe_bfd_copy_private_bfd_data (ibfd, obfd The value for SIZEOF_ILF_STRINGS is computed as follows: There will be NUM_ILF_SECTIONS section symbols. Allow 9 characters - per symbol for their names (longest section name is .idata$2). + per symbol for their names (longest section name is .idata$x). There will be two symbols for the imported value, one the symbol name and one with _imp__ prefixed. Allowing for the terminating nul's this - is strlen (symbol_name) * 2 + 8. + is strlen (symbol_name) * 2 + 8 + 21 + strlen (source_dll). The strings in the string table must start STRING__SIZE_SIZE bytes into the table in order to for the string lookup code in coffgen/coffcode to @@ -447,10 +451,14 @@ pe_bfd_copy_private_bfd_data (ibfd, obfd #define SIZEOF_ILF_SYMS (NUM_ILF_SYMS * sizeof (* vars.sym_cache)) #define SIZEOF_ILF_SYM_TABLE (NUM_ILF_SYMS * sizeof (* vars.sym_table)) #define SIZEOF_ILF_NATIVE_SYMS (NUM_ILF_SYMS * sizeof (* vars.native_syms)) +#define SIZEOF_ILF_SYM_PTR_TABLE (NUM_ILF_SYMS * sizeof (* vars.sym_ptr_table)) #define SIZEOF_ILF_EXT_SYMS (NUM_ILF_SYMS * sizeof (* vars.esym_table)) #define SIZEOF_ILF_RELOCS (NUM_ILF_RELOCS * sizeof (* vars.reltab)) #define SIZEOF_ILF_INT_RELOCS (NUM_ILF_RELOCS * sizeof (* vars.int_reltab)) -#define SIZEOF_ILF_STRINGS (strlen (symbol_name) * 2 + 8 + NUM_ILF_SECTIONS * 9 + STRING_SIZE_SIZE) +#define SIZEOF_ILF_STRINGS (strlen (symbol_name) * 2 + 8 \ + + 21 + strlen (source_dll) \ + + NUM_ILF_SECTIONS * 9 \ + + STRING_SIZE_SIZE) #define SIZEOF_IDATA2 (5 * 4) #define SIZEOF_IDATA4 (1 * 4) #define SIZEOF_IDATA5 (1 * 4) @@ -463,6 +471,7 @@ pe_bfd_copy_private_bfd_data (ibfd, obfd + SIZEOF_ILF_SYMS \ + SIZEOF_ILF_SYM_TABLE \ + SIZEOF_ILF_NATIVE_SYMS \ + + SIZEOF_ILF_SYM_PTR_TABLE \ + SIZEOF_ILF_EXT_SYMS \ + SIZEOF_ILF_RELOCS \ + SIZEOF_ILF_INT_RELOCS \ @@ -478,10 +487,11 @@ pe_bfd_copy_private_bfd_data (ibfd, obfd /* Create an empty relocation against the given symbol. */ static void -pe_ILF_make_a_reloc (pe_ILF_vars * vars, - bfd_vma address, - bfd_reloc_code_real_type reloc, - asection_ptr sec) +pe_ILF_make_a_symbol_reloc (pe_ILF_vars * vars, + bfd_vma address, + bfd_reloc_code_real_type reloc, + struct symbol_cache_entry ** sym, + unsigned int sym_index) { arelent * entry; struct internal_reloc * internal; @@ -492,10 +502,10 @@ pe_ILF_make_a_reloc (pe_ILF_vars * entry->address = address; entry->addend = 0; entry->howto = bfd_reloc_type_lookup (vars->abfd, reloc); - entry->sym_ptr_ptr = sec->symbol_ptr_ptr; + entry->sym_ptr_ptr = sym; internal->r_vaddr = address; - internal->r_symndx = coff_section_data (vars->abfd, sec)->i; + internal->r_symndx = sym_index; internal->r_type = entry->howto->type; #if 0 /* These fields do not need to be initialised. */ internal->r_size = 0; @@ -508,6 +518,17 @@ pe_ILF_make_a_reloc (pe_ILF_vars * BFD_ASSERT (vars->relcount <= NUM_ILF_RELOCS); } +/* Create an empty relocation against the given section. */ +static void +pe_ILF_make_a_reloc (pe_ILF_vars * vars, + bfd_vma address, + bfd_reloc_code_real_type reloc, + asection_ptr sec) +{ + pe_ILF_make_a_symbol_reloc (vars, address, reloc, sec->symbol_ptr_ptr, + coff_section_data (vars->abfd, sec)->i); +} + /* Move the queued relocs into the given section. */ static void pe_ILF_save_relocs (pe_ILF_vars * vars, @@ -546,7 +567,7 @@ pe_ILF_make_a_symbol (pe_ILF_vars * var unsigned short sclass; if (extra_flags & BSF_LOCAL) - sclass = C_LABEL; + sclass = C_STAT; else sclass = C_EXT; @@ -556,7 +577,7 @@ pe_ILF_make_a_symbol (pe_ILF_vars * var if (extra_flags & BSF_FUNCTION) sclass = C_THUMBEXTFUNC; else if (extra_flags & BSF_LOCAL) - sclass = C_THUMBLABEL; + sclass = C_THUMBSTAT; else sclass = C_THUMBEXT; } @@ -571,6 +592,9 @@ pe_ILF_make_a_symbol (pe_ILF_vars * var /* Copy the symbol's name into the string table. */ sprintf (vars->string_ptr, "%s%s", prefix, symbol_name); + if (section == NULL) + section = (asection_ptr) & bfd_und_section; + /* Initialise the external symbol. */ bfd_h_put_32 (vars->abfd, vars->string_ptr - vars->string_table, (bfd_byte *) esym->e.e.e_offset); bfd_h_put_16 (vars->abfd, section->target_index, (bfd_byte *) esym->e_scnum); @@ -612,14 +636,16 @@ pe_ILF_make_a_symbol (pe_ILF_vars * var #endif * vars->table_ptr = vars->sym_index; - + * vars->sym_ptr_ptr = sym; + /* Adjust pointers for the next symbol. */ vars->sym_index ++; vars->sym_ptr ++; + vars->sym_ptr_ptr ++; vars->table_ptr ++; vars->native_ptr ++; vars->esym_ptr ++; - vars->string_ptr += strlen (symbol_name) + 1; + vars->string_ptr += strlen (symbol_name) + strlen (prefix) + 1; BFD_ASSERT (vars->string_ptr < vars->end_string_ptr); } @@ -672,7 +698,7 @@ pe_ILF_make_a_section (pe_ILF_vars * var /* Create a symbol to refer to this section. */ pe_ILF_make_a_symbol (vars, "", name, sec, BSF_LOCAL); - /* Cache the index to the symbol in the coff_section_data structire. */ + /* Cache the index to the symbol in the coff_section_data structure. */ coff_section_data (vars->abfd, sec)->i = vars->sym_index - 1; return sec; @@ -761,10 +787,10 @@ pe_ILF_build_a_bfd (bfd * abfd struct internal_filehdr internal_f; unsigned int import_type; unsigned int import_name_type; - asection_ptr id2, id4, id5, id6, id7, text; + asection_ptr id4, id5, id6 = NULL, text = NULL; + coff_symbol_type ** imp_sym; + unsigned int imp_index; - text = NULL; - /* Decode and verify the types field of the ILF structure. */ import_type = types & 0x3; import_name_type = (types & 0x1c) >> 2; @@ -832,6 +858,10 @@ pe_ILF_build_a_bfd (bfd * abfd vars.native_syms = (combined_entry_type *) ptr; vars.native_ptr = (combined_entry_type *) ptr; ptr += SIZEOF_ILF_NATIVE_SYMS; + + vars.sym_ptr_table = (coff_symbol_type **) ptr; + vars.sym_ptr_ptr = (coff_symbol_type **) ptr; + ptr += SIZEOF_ILF_SYM_PTR_TABLE; vars.esym_table = (SYMENT *) ptr; vars.esym_ptr = (SYMENT *) ptr; @@ -857,16 +887,15 @@ pe_ILF_build_a_bfd (bfd * abfd vars.magic = magic; /* Create the initial .idata$ sections: - .idata$2: Import Directory Table + [.idata$2: Import Directory Table -- not needed] .idata$4: Import Lookup Table .idata$5: Import Address Table Note we do not create a .idata$3 section as this is created for us by the linker script. */ - id2 = pe_ILF_make_a_section (& vars, ".idata$2", SIZEOF_IDATA2, 0); id4 = pe_ILF_make_a_section (& vars, ".idata$4", SIZEOF_IDATA4, 0); id5 = pe_ILF_make_a_section (& vars, ".idata$5", SIZEOF_IDATA5, 0); - if (id2 == NULL || id4 == NULL || id5 == NULL) + if (id4 == NULL || id5 == NULL) return false; /* Fill in the contents of these sections. */ @@ -876,8 +905,8 @@ pe_ILF_build_a_bfd (bfd * abfd /* XXX - treat as IMPORT_NAME ??? */ abort (); - * (unsigned int *) id4->contents = ordinal | 0x80000000; - * (unsigned int *) id5->contents = ordinal | 0x80000000; + * (unsigned int *) id4->contents = ordinal | 0x80000000UL; + * (unsigned int *) id5->contents = ordinal | 0x80000000UL; } else { @@ -905,22 +934,12 @@ pe_ILF_build_a_bfd (bfd * abfd * symbol = 0; } - strcpy (id6->contents, symbol); + id6->contents[0] = ordinal & 0xff; + id6->contents[1] = ordinal >> 8; + + strcpy (id6->contents + 2, symbol); } - /* Create .idata$7 - the Dll Name Table. */ - id7 = pe_ILF_make_a_section (& vars, ".idata$7", SIZEOF_IDATA7, 0); - if (id7 == NULL) - return false; - - strcpy (id7->contents + 2, source_dll); - - /* Now generate the relocs for the sections. */ - pe_ILF_make_a_reloc (& vars, 0, BFD_RELOC_RVA, id4); - pe_ILF_make_a_reloc (& vars, 12, BFD_RELOC_RVA, id7); - pe_ILF_make_a_reloc (& vars, 16, BFD_RELOC_RVA, id5); - pe_ILF_save_relocs (& vars, id2); - if (import_name_type != IMPORT_ORDINAL) { pe_ILF_make_a_reloc (& vars, 0, BFD_RELOC_RVA, id6); @@ -957,17 +976,25 @@ pe_ILF_build_a_bfd (bfd * abfd /* Copy in the jump code. */ memcpy (text->contents, jtab[i].data, jtab[i].size); + /* Create an import symbol. */ + pe_ILF_make_a_symbol (& vars, "__imp_", symbol_name, id5, 0); + imp_sym = vars.sym_ptr_ptr - 1; + imp_index = vars.sym_index - 1; + /* Create a reloc for the data in the text section. */ #ifdef MIPS_ARCH_MAGIC_WINCE if (magic == MIPS_ARCH_MAGIC_WINCE) { - pe_ILF_make_a_reloc (& vars, 0, BFD_RELOC_HI16_S, id5); + pe_ILF_make_a_symbol_reloc (& vars, 0, BFD_RELOC_HI16_S, + (asection **) imp_sym, imp_index); pe_ILF_make_a_reloc (& vars, 0, BFD_RELOC_LO16, text); - pe_ILF_make_a_reloc (& vars, 4, BFD_RELOC_LO16, id5); + pe_ILF_make_a_symbol_reloc (& vars, 4, BFD_RELOC_LO16, + (asection **) imp_sym, imp_index); } else #endif - pe_ILF_make_a_reloc (& vars, jtab[i].offset, BFD_RELOC_32, id5); + pe_ILF_make_a_symbol_reloc (& vars, jtab[i].offset, BFD_RELOC_32, + (asymbol **) imp_sym, imp_index); pe_ILF_save_relocs (& vars, text); break; @@ -1013,13 +1040,24 @@ pe_ILF_build_a_bfd (bfd * abfd /* Now create a symbol describing the imported value. */ switch (import_type) { + bfd_byte * ptr; + case IMPORT_CODE: pe_ILF_make_a_symbol (& vars, "", symbol_name, text, BSF_NOT_AT_END | BSF_FUNCTION); + + /* Create an import symbol for the DLL, without the + .dll suffix. */ + ptr = strrchr (source_dll, '.'); + if (ptr) + * ptr = 0; + pe_ILF_make_a_symbol (& vars, "__IMPORT_DESCRIPTOR_", source_dll, NULL, 0); + if (ptr) + * ptr = '.'; break; case IMPORT_DATA: - /* XXX not sure if I need to do anythign here. */ + /* Nothing to do here. */ break; default: @@ -1027,8 +1065,6 @@ pe_ILF_build_a_bfd (bfd * abfd abort (); } - pe_ILF_make_a_symbol (& vars, "_imp__", symbol_name, id5, 0); - /* Point the bfd at the symbol table. */ obj_symbols (abfd) = vars.sym_cache; bfd_get_symcount (abfd) = vars.sym_index; @@ -1197,7 +1233,7 @@ _("%s: Recognised but unhandled machine source_dll = ptr + strlen (ptr) + 1; /* Verify that the strings are null terminated. */ - if (ptr[size - 1] != 0 || ((source_dll - ptr) >= size)) + if (ptr[size - 1] != 0 || ((unsigned long) (source_dll - ptr) >= size)) { _bfd_error_handler (_("%s: string not null terminated in ILF object file."), diff -upr --new-file binutils-2.9.5.0.29/bfd/reloc.c binutils-2.9.5.0.31/bfd/reloc.c --- binutils-2.9.5.0.29/bfd/reloc.c Wed Mar 1 10:00:36 2000 +++ binutils-2.9.5.0.31/bfd/reloc.c Sun Mar 19 12:07:55 2000 @@ -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 <> 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 @@ -527,17 +540,14 @@ bfd_check_overflow (how, bitsize, rights case complain_overflow_bitfield: /* Bitfields are sometimes signed, sometimes unsigned. We - overflow if the value has some, but not all, bits set outside - the field, or if it has any bits set outside the field but - the sign bit is not set. */ + 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; - if ((a & ~ fieldmask) != 0) - { - signmask = (fieldmask >> 1) + 1; - ss = (signmask << rightshift) - 1; - if ((ss | relocation) != ~ (bfd_vma) 0) - flag = bfd_reloc_overflow; - } + ss = a & ~ fieldmask; + if (ss != 0 && ss != (((bfd_vma) -1 >> rightshift) & ~ fieldmask)) + flag = bfd_reloc_overflow; break; default: @@ -872,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 - 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 + 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 - and N N N N N get instruction + ( i i i i i o o o o o from bfd_get + 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 + = R R R R R R R R R R put into bfd_put */ #define DOIT(x) \ @@ -1015,7 +1025,7 @@ bfd_install_relocation (abfd, reloc_entr 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, @@ -1262,23 +1272,23 @@ space consuming. For each target: R result Do this: - i i i i i o o o o o from bfd_get - 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 + 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 - and N N N N N get instruction + ( i i i i i o o o o o from bfd_get + 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 + = R R R R R R R R R R put into bfd_put */ #define DOIT(x) \ @@ -1415,7 +1425,7 @@ _bfd_relocate_contents (howto, input_bfd { int size; bfd_vma x = 0; - boolean overflow; + bfd_reloc_status_type flag; unsigned int rightshift = howto->rightshift; unsigned int bitpos = howto->bitpos; @@ -1453,7 +1463,7 @@ _bfd_relocate_contents (howto, input_bfd 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 addrmask, fieldmask, signmask, ss; @@ -1479,7 +1489,7 @@ _bfd_relocate_contents (howto, input_bfd signmask = ~ (fieldmask >> 1); ss = a & signmask; if (ss != 0 && ss != ((addrmask >> rightshift) & signmask)) - overflow = true; + 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 @@ -1491,7 +1501,7 @@ _bfd_relocate_contents (howto, input_bfd if ((b & signmask) != 0) { /* Set all the bits above the sign bit. */ - b -= signmask <<= 1; + b -= signmask << 1; } b = (b & addrmask) >> bitpos; @@ -1509,7 +1519,7 @@ _bfd_relocate_contents (howto, input_bfd */ signmask = (fieldmask >> 1) + 1; if (((~ (a ^ b)) & (a ^ sum)) & signmask) - overflow = true; + flag = bfd_reloc_overflow; break; @@ -1529,64 +1539,35 @@ _bfd_relocate_contents (howto, input_bfd b = (b & addrmask) >> bitpos; sum = (a + b) & addrmask; if ((a | b | sum) & ~ fieldmask) - overflow = true; + flag = bfd_reloc_overflow; break; case complain_overflow_bitfield: - /* Much like unsigned, except no trimming with addrmask. In - addition, the sum overflows if there is a carry out of - the bfd_vma, i.e., the sum is less than either input - operand. */ + /* Much like the signed check, but for a field one bit + wider, and no trimming 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; - b >>= bitpos; - - /* Bitfields are sometimes used for signed numbers; for - example, a 13-bit field sometimes represents values in - 0..8191 and sometimes represents values in -4096..4095. - If the field is signed and a is -4095 (0x1001) and b is - -1 (0x1fff), the sum is -4096 (0x1000), but (0x1001 + - 0x1fff is 0x3000). It's not clear how to handle this - everywhere, since there is not way to know how many bits - are significant in the relocation, but the original code - assumed that it was fully sign extended, and we will keep - that assumption. */ - signmask = (fieldmask >> 1) + 1; - if ((a & ~ fieldmask) != 0) - { - /* Some bits out of the field are set. This might not - be a problem: if this is a signed bitfield, it is OK - iff all the high bits are set, including the sign - bit. We'll try setting all but the most significant - bit in the original relocation value: if this is all - ones, we are OK, assuming a signed bitfield. */ - ss = (signmask << rightshift) - 1; - if ((ss | relocation) != ~ (bfd_vma) 0) - overflow = true; - a &= fieldmask; - } + signmask = ~ fieldmask; + ss = a & signmask; + if (ss != 0 && ss != (((bfd_vma) -1 >> rightshift) & signmask)) + flag = bfd_reloc_overflow; - /* We just assume (b & ~ fieldmask) == 0. */ + signmask = ((~ howto->src_mask) >> 1) & howto->src_mask; + if ((b & signmask) != 0) + b -= signmask << 1; - /* We explicitly permit wrap around if this relocation - covers the high bit of an address. 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. */ - if (howto->bitsize + rightshift - == bfd_arch_bits_per_address (input_bfd)) - break; + b >>= bitpos; sum = a + b; - if (sum < a || (sum & ~ fieldmask) != 0) - { - /* There was a carry out, or the field overflow. Test - for signed operands again. Here is the overflow test - is as for complain_overflow_signed. */ - if (((~ (a ^ b)) & (a ^ sum)) & signmask) - overflow = true; - } + + signmask = fieldmask + 1; + if (((~ (a ^ b)) & (a ^ sum)) & signmask) + flag = bfd_reloc_overflow; break; @@ -1627,7 +1608,7 @@ _bfd_relocate_contents (howto, input_bfd break; } - return overflow ? bfd_reloc_overflow : bfd_reloc_ok; + return flag; } /* @@ -2139,7 +2120,7 @@ ENUMX BFD_RELOC_PJ_CODE_REL32 ENUMDOC Picojava relocs. Not all of these appear in object files. - + ENUM BFD_RELOC_PPC_B26 ENUMX @@ -2372,46 +2353,46 @@ ENUMDOC ENUM BFD_RELOC_D30V_9_PCREL ENUMDOC - This is a 6-bit pc-relative reloc with - the right 3 bits assumed to be 0. + 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 + 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. + of the container. ENUM BFD_RELOC_D30V_15 ENUMDOC - This is a 12-bit absolute reloc with the - right 3 bitsassumed to be 0. + 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. + 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 + 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. + of the container. ENUM BFD_RELOC_D30V_21 ENUMDOC - This is an 18-bit absolute reloc with + 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 + 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 + 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. @@ -2593,7 +2574,7 @@ ENUM 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 @@ -2608,13 +2589,13 @@ ENUMX BFD_RELOC_MCORE_RVA ENUMDOC Motorola Mcore relocations. - + ENUM BFD_RELOC_VTABLE_INHERIT ENUMX BFD_RELOC_VTABLE_ENTRY ENUMDOC - These two relocations are used by the linker to determine which of + 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 @@ -2628,7 +2609,7 @@ ENUMDOC 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 + 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. diff -upr --new-file binutils-2.9.5.0.29/bfd/reloc16.c binutils-2.9.5.0.31/bfd/reloc16.c --- binutils-2.9.5.0.29/bfd/reloc16.c Wed Mar 1 10:00:36 2000 +++ binutils-2.9.5.0.31/bfd/reloc16.c Sun Mar 19 12:07:55 2000 @@ -195,9 +195,10 @@ bfd_coff_reloc16_relax_section (abfd, i, { 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 { @@ -219,13 +220,14 @@ bfd_coff_reloc16_relax_section (abfd, i, 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 -upr --new-file binutils-2.9.5.0.29/binutils/ChangeLog binutils-2.9.5.0.31/binutils/ChangeLog --- binutils-2.9.5.0.29/binutils/ChangeLog Tue Feb 29 10:59:50 2000 +++ binutils-2.9.5.0.31/binutils/ChangeLog Sun Mar 12 09:31:33 2000 @@ -1,3 +1,9 @@ +2000-03-08 H.J. Lu + + * Makefile.am (install-exec-local): Depend on + install-binPROGRAMS for parallel make. + * Makefile.in: Regenerated. + 2000-02-27 Ian Lance Taylor From Brad Lucier : diff -upr --new-file binutils-2.9.5.0.29/binutils/ChangeLog.linux binutils-2.9.5.0.31/binutils/ChangeLog.linux --- binutils-2.9.5.0.29/binutils/ChangeLog.linux Fri Feb 25 13:39:23 2000 +++ binutils-2.9.5.0.31/binutils/ChangeLog.linux Sun Mar 12 09:40:14 2000 @@ -49,7 +49,7 @@ Tue Feb 16 11:21:18 1999 H.J. Lu (hjl@ * nm.c: Likewise. * objdump.c: Likewise. -Thu Dec 17 06:44:44 1998 Matthew Benjamin +Thu Dec 17 06:44:44 1998 Matthew Benjamin * objcopy.c (lookup_sym_redefinition): New. (redefine_list_append): New. diff -upr --new-file binutils-2.9.5.0.29/binutils/Makefile.am binutils-2.9.5.0.31/binutils/Makefile.am --- binutils-2.9.5.0.29/binutils/Makefile.am Mon Aug 9 10:27:15 1999 +++ binutils-2.9.5.0.31/binutils/Makefile.am Sun Mar 12 09:40:14 2000 @@ -343,7 +343,7 @@ CLEANFILES = dep.sed DEP DEP1 .PHONY: install-exec-local -install-exec-local: $(bin_PROGRAMS) $(noinst_PROGRAMS) +install-exec-local: install-binPROGRAMS $(bin_PROGRAMS) $(noinst_PROGRAMS) @list='$(noinst_PROGRAMS)'; for p in $$list; do \ if test -f $$p; then \ echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ diff -upr --new-file binutils-2.9.5.0.29/binutils/Makefile.in binutils-2.9.5.0.31/binutils/Makefile.in --- binutils-2.9.5.0.29/binutils/Makefile.in Tue Feb 29 11:15:14 2000 +++ binutils-2.9.5.0.31/binutils/Makefile.in Sun Mar 12 09:40:14 2000 @@ -1199,7 +1199,7 @@ mostlyclean-local: .PHONY: install-exec-local -install-exec-local: $(bin_PROGRAMS) $(noinst_PROGRAMS) +install-exec-local: install-binPROGRAMS $(bin_PROGRAMS) $(noinst_PROGRAMS) @list='$(noinst_PROGRAMS)'; for p in $$list; do \ if test -f $$p; then \ echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ diff -upr --new-file binutils-2.9.5.0.29/binutils/testsuite/ChangeLog binutils-2.9.5.0.31/binutils/testsuite/ChangeLog --- binutils-2.9.5.0.29/binutils/testsuite/ChangeLog Mon Nov 1 14:31:11 1999 +++ binutils-2.9.5.0.31/binutils/testsuite/ChangeLog Sun Mar 19 11:54:15 2000 @@ -1,3 +1,10 @@ +2000-03-13 Nick Clifton + + * binutils-all/readelf.s: Adjust to match noew format of readelf + output. + * binutils-all/readelf.ss: Adjust to match noew format of readelf + output. + 1999-11-01 Nick Clifton * binutils-all/objcopy.exp: Expect simple objcopy test for fail diff -upr --new-file binutils-2.9.5.0.29/binutils/testsuite/binutils-all/readelf.s binutils-2.9.5.0.31/binutils/testsuite/binutils-all/readelf.s --- binutils-2.9.5.0.29/binutils/testsuite/binutils-all/readelf.s Thu Jun 3 11:01:56 1999 +++ binutils-2.9.5.0.31/binutils/testsuite/binutils-all/readelf.s Sun Mar 19 11:54:16 2000 @@ -2,12 +2,15 @@ There are .* section headers, starting a Section Headers: \[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al - \[ 0\] NULL 00000000 000000 000000 00 0 0 0 - \[ 1\] .text PROGBITS 00000000 000034 000008 00 AX 0 0 . - \[ 2\] .rel.+text +REL. +0+ 0+.* 00000. 0. . 1 4 - \[ 3\] .data PROGBITS 00000000 00003c 000004 00 WA 0 0 . - \[ 4\] .bss NOBITS 00000000 000040 000000 00 WA 0 0 . - \[ 5\] .shstrtab STRTAB 00000000 000040 0000.* 00 0 0 . - \[ 6\] .symtab SYMTAB 00000000 0+.* 0+.* 10 7 6 4 - \[ 7\] .strtab STRTAB 00000000 0+.* 0+.* 00 0 0 1 + \[ 0\] NULL 00000000 000000 000000 00 0 0 0 + \[ 1\] .text PROGBITS 00000000 000034 000008 00 AX 0 0 . + \[ 2\] .rel.+text +REL. +0+ 0+.* 00000. 0. . 1 4 + \[ 3\] .data PROGBITS 00000000 00003c 000004 00 WA 0 0 . + \[ 4\] .bss NOBITS 00000000 000040 000000 00 WA 0 0 . + \[ .\] .shstrtab STRTAB 00000000 000040 0000.* 00 0 0 . + \[ .\] .symtab SYMTAB 00000000 0+.* 0+.* 10 7 6 4 + \[ .\] .strtab STRTAB 00000000 0+.* 0+.* 00 0 0 1 +Key to Flags: W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\) + I \(info\), L \(link order\), O \(extra OS processing required\) + o \(os specific\), p \(processor specific\) x \(unknown\) diff -upr --new-file binutils-2.9.5.0.29/binutils/testsuite/binutils-all/readelf.ss binutils-2.9.5.0.31/binutils/testsuite/binutils-all/readelf.ss --- binutils-2.9.5.0.29/binutils/testsuite/binutils-all/readelf.ss Thu Jun 3 11:01:56 1999 +++ binutils-2.9.5.0.31/binutils/testsuite/binutils-all/readelf.ss Sun Mar 19 11:54:16 2000 @@ -1,13 +1,13 @@ Symbol table '.symtab' contains .* entries: - Num: Value Size Type Bind Ot Ndx Name - 0: 0 0 NOTYPE LOCAL 0 UND - 1: 0 0 SECTION LOCAL 0 1 - 2: 0 0 SECTION LOCAL 0 3 - 3: 0 0 SECTION LOCAL 0 4 - 4: 0 0 NOTYPE LOCAL 0 1 static_text_symbol - 5: 0 0 NOTYPE LOCAL 0 3 static_data_symbol - .: 0 0 NOTYPE GLOBAL 0 1 text_symbol - .: 0 0 NOTYPE GLOBAL 0 UND external_symbol - .*: 0 0 NOTYPE GLOBAL 0 3 data_symbol - .*: 4 4 OBJECT GLOBAL 0 COM common_symbol + Num: Value Size Type Bind Vis Ndx Name + 0: 00000000 0 NOTYPE LOCAL DEFAULT UND + 1: 00000000 0 SECTION LOCAL DEFAULT 1 + 2: 00000000 0 SECTION LOCAL DEFAULT 3 + 3: 00000000 0 SECTION LOCAL DEFAULT 4 + 4: 00000000 0 NOTYPE LOCAL DEFAULT 1 static_text_symbol + 5: 00000000 0 NOTYPE LOCAL DEFAULT 3 static_data_symbol +.* .: 00000000 0 NOTYPE GLOBAL DEFAULT 1 text_symbol + .: 00000000 0 NOTYPE GLOBAL DEFAULT UND external_symbol + .: 00000000 0 NOTYPE GLOBAL DEFAULT 3 data_symbol + .: 00000004 4 OBJECT GLOBAL DEFAULT COM common_symbol diff -upr --new-file binutils-2.9.5.0.29/binutils.spec binutils-2.9.5.0.31/binutils.spec --- binutils-2.9.5.0.29/binutils.spec Wed Mar 1 10:06:17 2000 +++ binutils-2.9.5.0.31/binutils.spec Sun Mar 19 12:09:10 2000 @@ -1,6 +1,6 @@ Summary: GNU Binary Utility Development Utilities Name: binutils -Version: 2.9.5.0.29 +Version: 2.9.5.0.31 Release: 1 Copyright: GPL Group: Development/Tools diff -upr --new-file binutils-2.9.5.0.29/configure.in binutils-2.9.5.0.31/configure.in --- binutils-2.9.5.0.29/configure.in Tue Feb 29 11:15:08 2000 +++ binutils-2.9.5.0.31/configure.in Sun Mar 12 09:40:09 2000 @@ -347,7 +347,6 @@ case "${enable_target_optspace}:${target yes:*) target_makefile_frag="${target_makefile_frag} config/mt-ospace" ;; - # CYGNUS LOCAL d10v, d30v, fr30 :d30v-*) target_makefile_frag="${target_makefile_frag} config/mt-d30v" ;; @@ -617,15 +616,12 @@ case "${target}" in thumb-*-coff) noconfigdirs="$noconfigdirs target-libgloss" ;; -# CYGNUS LOCAL clm/arm-elf thumb-*-elf) noconfigdirs="$noconfigdirs target-libgloss" ;; thumb-*-oabi) noconfigdirs="$noconfigdirs target-libgloss" ;; -# END CYGNUS LOCAL -# CYGNUS LOCAL nickc/strongarm strongarm-*-elf) noconfigdirs="$noconfigdirs target-libgloss" if [ x${is_cross_compiler} != xno ] ; then @@ -638,8 +634,7 @@ case "${target}" in target_configdirs="${target_configdirs} target-bsp target-cygmon" fi ;; -# END CYGNUS LOCAL - thumb-*-pe) # CYGNUS LOCAL nickc/thumb + thumb-*-pe) noconfigdirs="$noconfigdirs target-libgloss" ;; arm-*-riscix*) @@ -648,17 +643,13 @@ case "${target}" in d10v-*-*) noconfigdirs="$noconfigdirs target-librx target-libg++ target-libstdc++ target-libio" ;; -# CYGNUS LOCAL d30v d30v-*-*) ;; -# END CYGNUS LOCAL -# CYGNUS LOCAL fr30 fr30-*-elf*) if [ x${is_cross_compiler} != xno ] ; then target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon" fi ;; -# END CYGNUS LOCAL h8300*-*-* | \ h8500-*-*) noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss" @@ -870,12 +861,12 @@ case "${target}" in v850-*-*) noconfigdirs="$noconfigdirs target-libgloss" ;; - v850e-*-*) # CYGNUS LOCAL v850e + v850e-*-*) noconfigdirs="$noconfigdirs target-libgloss" ;; v850ea-*-*) noconfigdirs="$noconfigdirs target-libgloss" - ;; # END CYGNUS LOCAL + ;; vax-*-vms) noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss" ;; diff -upr --new-file binutils-2.9.5.0.29/gas/ChangeLog binutils-2.9.5.0.31/gas/ChangeLog --- binutils-2.9.5.0.29/gas/ChangeLog Tue Feb 29 11:00:38 2000 +++ binutils-2.9.5.0.31/gas/ChangeLog Sun Mar 19 11:55:01 2000 @@ -1,3 +1,110 @@ +2000-03-17 Thomas de Lellis + + * config/tc-arm.c (do_t_adr): Flag "adr Rd,label" + instruction operand bad if Rd > 7 when generating + thumb instructions. Prevents for example, + "adr r12,label" from silently failing and generating + the wrong instruction. + +2000-03-17 Nick Clifton + + * config/tc-arm.c (md_apply_fix3): Handle same-section relocations + that have a destingation >= 0x400000. + Fix compile time warning messages. + +Thu Mar 16 23:45:16 2000 J"orn Rennecke + + * config/tc-sh.c (md_begin): When encountering insn that are + not supported by the current arch, only change the name if + its contents are the same as prev_name. + (get_specific): If the the architecture doesn't match, fail. + +Thu Mar 16 21:18:13 2000 J"orn Rennecke + + * config/tc-sh.c (IDENT_CHAR): Define. + (parse_reg): Use it instead of isalnum. Put r[0..7]_bank operand + matching back where it came from. + +Thu Mar 16 20:58:10 2000 J"orn Rennecke + + * config/tc-sh.c (md_show_usage): Add description of -dsp. + +2000-03-15 Jonathan Larmour + + * config/tc-sh.c (parse_reg): Match r[0..7]_bank operands before + normal operands. + +2000-03-15 Kazu Hirata + + * config/tc-h8300.c: Add ATTRIBUTE_UNUSED as appropriate. + +Mon Mar 13 22:02:59 2000 Hans-Peter Nilsson + + * expr.c (operand) [case 'f']: When testing if '0f' can start a + floating-point-number, make sure 'f' is in FLT_CHARS. + +Sat Mar 11 00:01:39 2000 Hans-Peter Nilsson + + * read.c (TC_IMPLICIT_LCOMM_ALIGNMENT): New default-definition. + (s_lcomm_internal): Use it. + * doc/internals.texi (CPU backend): Document it. + * config/obj-evax.h (TC_IMPLICIT_LCOMM_ALIGNMENT): Set to 2**3 + bytes. + +2000-03-10 Geoffrey Keating + + * config/tc-mips.c (mips_ip): Don't put stuff in .rodata + when embedded-pic. + + * config/tc-mips.c (SWITCH_TABLE): The ELF embedded-pic + implementation doesn't have special handling for switch + statements. + (macro_build): Allow for code in sections other than .text. + (macro): Likewise. + (mips_ip): Likewise. + (md_apply_fix): Do pc-relative relocation madness for MIPS ELF. + Don't perform relocs if we will be outputting them. + (tc_gen_reloc): For ELF, just use fx_addnumber for pc-relative + relocations. Allow BFD_RELOC_16_PCREL_S2 relocs when + embedded-pic. + +2000-03-09 Catherine Moore + + * config/tc-m32r.c (m32r_fix_adjustable): Look up the + relocation type based on the entry in the fixup structure. + +2000-03-08 H.J. Lu (hjl@gnu.org) + + * Makefile.am (install-exec-tooldir): Depend on + install-exec-bindir for parallel make. + * Makefile.in: Regenerated. + +2000-03-06 Nick Clifton + + * config/tc-m32r.c (struct md_longopts): Add -m32r command line + switch. + (md_parse_option): Parse -m32r command line switch - disable m32rx + compatability. + (md_show_usage): Document new option. + + * doc/Makefile.am (CPU_DOCS): Add c-m32r.texi. + * doc/Makefile.in: Regenerate. + * doc/c-m32r.texi (M32R-Opts): Document new command line switch. + +2000-03-02 Michael Meissner + + * config/tc-d30v.c (check_range): Remove code that incorrectly + sign extended values where bits < 32. + +2000-03-02 H.J. Lu (hjl@gnu.org) + + * configure.in: Support --enable-targets=all on ia32. + * configure: Regenerated. + +2000-03-01 Nick Clifton + + * gasp.c (do_align): Remove bogus check of alignment value. + 2000-02-27 Thomas de Lellis * config/obj-elf.c (elf_frob_symbol): Remove code which when diff -upr --new-file binutils-2.9.5.0.29/gas/ChangeLog.linux binutils-2.9.5.0.31/gas/ChangeLog.linux --- binutils-2.9.5.0.29/gas/ChangeLog.linux Fri Feb 25 17:24:02 2000 +++ binutils-2.9.5.0.31/gas/ChangeLog.linux Sun Mar 12 09:40:14 2000 @@ -1,38 +1,3 @@ -Fri Feb 25 17:18:59 2000 H.J. Lu (hjl@gnu.org) - - * as.c (parse_args): Remove flag_i370_mri. - * read.c (s_mri): Likewise. - -Wed Feb 2 09:49:57 2000 H.J. Lu (hjl@gnu.org) - - * configure.in: Support --enable-targets=all and enable - i386aout and i386coff for Linux when --enable-targets=all - is used. - * configure: Regenerated. - -1999-12-13 Jakub Jelinek - - * config/tc-sparc.c (OPTION_UNDECLARED_REGS): New option. - (md_parse_option): Handle it. - (md_show_usage): Document it. - -Wed Dec 1 07:15:43 1999 H.J. Lu (hjl@gnu.org) - - * config/tc-mips.c (mips_fix_adjustable): Back out the change - made by Ralf Baechle on Thu Aug 12 - 16:56:08 1999. - -Tue Aug 31 10:15:35 1999 H.J. Lu (hjl@gnu.org) - - * config/tc-i386.c: Undo the last change. - -Fri Aug 27 11:31:30 1999 H.J. Lu (hjl@gnu.org) - - * config/tc-i386.c (i386_extract_reg): New function. Handle - spaces in FP register names. - (i386_is_reg): Use it. - (parse_register): Likewise. - Thu Aug 12 16:56:08 1999 Ralf Baechle * config/obj-elf.c (obj_elf_ident): Make it extern. @@ -41,8 +6,6 @@ Thu Aug 12 16:56:08 1999 Ralf Baechle < * config/tc-mips.c (s_ident): New. (mips_pseudo_table): Add "ident". - (mips_fix_adjustable): Prevent all adjustments to global - symbols. Mon Apr 6 08:05:01 1998 H.J. Lu (hjl@gnu.org) diff -upr --new-file binutils-2.9.5.0.29/gas/Makefile.am binutils-2.9.5.0.31/gas/Makefile.am --- binutils-2.9.5.0.29/gas/Makefile.am Fri Jan 28 09:10:50 2000 +++ binutils-2.9.5.0.31/gas/Makefile.am Sun Mar 12 09:40:14 2000 @@ -606,7 +606,7 @@ install-exec-bindir: $(noinst_PROGRAMS) else :; fi; \ done -install-exec-tooldir: $(noinst_PROGRAMS) +install-exec-tooldir: install-exec-bindir $(noinst_PROGRAMS) $(mkinstalldirs) $(tooldir)/bin n=`echo as | sed '$(transform)'`; \ if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/as$(EXEEXT)" ]; then \ diff -upr --new-file binutils-2.9.5.0.29/gas/Makefile.in binutils-2.9.5.0.31/gas/Makefile.in --- binutils-2.9.5.0.29/gas/Makefile.in Tue Feb 29 11:15:14 2000 +++ binutils-2.9.5.0.31/gas/Makefile.in Sun Mar 12 09:40:14 2000 @@ -2209,7 +2209,7 @@ install-exec-bindir: $(noinst_PROGRAMS) else :; fi; \ done -install-exec-tooldir: $(noinst_PROGRAMS) +install-exec-tooldir: install-exec-bindir $(noinst_PROGRAMS) $(mkinstalldirs) $(tooldir)/bin n=`echo as | sed '$(transform)'`; \ if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/as$(EXEEXT)" ]; then \ diff -upr --new-file binutils-2.9.5.0.29/gas/config/obj-evax.h binutils-2.9.5.0.31/gas/config/obj-evax.h --- binutils-2.9.5.0.29/gas/config/obj-evax.h Thu Jun 3 11:02:01 1999 +++ binutils-2.9.5.0.31/gas/config/obj-evax.h Sun Mar 19 11:55:06 2000 @@ -1,5 +1,5 @@ /* This file is obj-evax.h - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 2000 Free Software Foundation, Inc. Contributed by Klaus Kämpf (kkaempf@progis.de) of proGIS Software, Aachen, Germany. @@ -84,6 +84,8 @@ typedef void *object_headers; #define PDSC_S_M_NO_JACKET 0x20 /* high byte */ #define LKP_S_K_SIZE 16 + +#define TC_IMPLICIT_LCOMM_ALIGNMENT(SIZE, P2VAR) (P2VAR) = 3 /* * Local Variables: diff -upr --new-file binutils-2.9.5.0.29/gas/config/tc-arm.c binutils-2.9.5.0.31/gas/config/tc-arm.c --- binutils-2.9.5.0.29/gas/config/tc-arm.c Fri Feb 25 14:34:52 2000 +++ binutils-2.9.5.0.31/gas/config/tc-arm.c Sun Mar 19 11:55:06 2000 @@ -104,16 +104,16 @@ static boolean pic_code = false; #endif /* This array holds the chars that always start a comment. If the - pre-processor is disabled, these aren't very useful */ + pre-processor is disabled, these aren't very useful. */ CONST char comment_chars[] = "@"; /* This array holds the chars that only start a comment at the beginning of a line. If the line seems to have the form '# 123 filename' - .line and .file directives will appear in the pre-processed output */ + .line and .file directives will appear in the pre-processed output. */ /* Note that input_file.c hand checks for '#' at the beginning of the first line of the input file. This is because the compiler outputs - #NO_APP at the beginning of its output. */ -/* Also note that comments like this one will always work. */ + #NO_APP at the beginning of its output. */ +/* Also note that comments like this one will always work. */ CONST char line_comment_chars[] = "#"; #ifdef TE_LINUX @@ -122,7 +122,8 @@ CONST char line_separator_chars[] = ";"; CONST char line_separator_chars[] = ""; #endif -/* Chars that can be used to separate mant from exp in floating point nums */ +/* Chars that can be used to separate mant + from exp in floating point numbers. */ CONST char EXP_CHARS[] = "eE"; /* Chars that mean this number is a floating point constant */ @@ -143,7 +144,7 @@ CONST int md_reloc_size = 8; /* Size of static int thumb_mode = 0; /* 0: assemble for ARM, 1: assemble for Thumb, 2: assemble for Thumb even though target cpu - does not support thumb instructions */ + does not support thumb instructions. */ typedef struct arm_fix { int thumb_mode; @@ -197,7 +198,7 @@ CONST char * fp_const[] = "0.0", "1.0", "2.0", "3.0", "4.0", "5.0", "0.5", "10.0", 0 }; -/* Number of littlenums required to hold an extended precision number */ +/* Number of littlenums required to hold an extended precision number. */ #define MAX_LITTLENUMS 6 LITTLENUM_TYPE fp_values[NUM_FLOAT_VALS][MAX_LITTLENUMS]; @@ -226,7 +227,7 @@ struct asm_cond unsigned long value; }; -/* This is to save a hash look-up in the common case */ +/* This is to save a hash look-up in the common case. */ #define COND_ALWAYS 0xe0000000 static CONST struct asm_cond conds[] = @@ -251,7 +252,7 @@ static CONST struct asm_cond conds[] = /* Warning: If the top bit of the set_bits is set, then the standard instruction bitmask is ignored, and the new bitmask is taken from - the set_bits: */ + the set_bits: */ struct asm_flg { CONST char * template; /* Basic flag string */ @@ -416,7 +417,7 @@ static CONST struct asm_psr psrs[] = {"spsr_ctl", SPSR_CTL} }; -/* Functions called by parser */ +/* Functions called by parser. */ /* ARM instructions */ static void do_arit PARAMS ((char *, unsigned long)); static void do_cmp PARAMS ((char *, unsigned long)); @@ -497,13 +498,11 @@ static bfd_reloc_code_real_type arm_pars #endif /* ARM instructions take 4bytes in the object file, Thumb instructions - take 2: */ + take 2: */ #define INSN_SIZE 4 /* LONGEST_INST is the longest basic instruction name without conditions or - * flags. - * ARM7M has 4 of length 5 - */ + flags. ARM7M has 4 of length 5. */ #define LONGEST_INST 5 @@ -631,7 +630,7 @@ static CONST struct asm_opcode insns[] = {"flt", 0x0e000110, "sde", round_flags, FPU_ALL, do_fp_from_reg}, {"fix", 0x0e100110, NULL, fix_flags, FPU_ALL, do_fp_to_reg}, -/* Generic copressor instructions */ +/* Generic copressor instructions. */ {"cdp", 0x0e000000, NULL, NULL, ARM_2UP, do_cdp}, {"ldc", 0x0c100000, NULL, cplong_flag, ARM_2UP, do_lstc}, {"stc", 0x0c000000, NULL, cplong_flag, ARM_2UP, do_lstc}, @@ -639,8 +638,7 @@ static CONST struct asm_opcode insns[] = {"mrc", 0x0e100010, NULL, NULL, ARM_2UP, do_co_reg}, }; -/* defines for various bits that we will want to toggle */ - +/* Defines for various bits that we will want to toggle. */ #define INST_IMMEDIATE 0x02000000 #define OFFSET_REG 0x02000000 #define HWOFFSET_IMM 0x00400000 @@ -655,8 +653,7 @@ static CONST struct asm_opcode insns[] = #define OPCODE_MASK 0xfe1fffff #define DATA_OP_SHIFT 21 -/* Codes to distinguish the arithmetic instructions */ - +/* Codes to distinguish the arithmetic instructions. */ #define OPCODE_AND 0 #define OPCODE_EOR 1 #define OPCODE_SUB 2 @@ -753,7 +750,7 @@ static void do_t_adr PARAMS ((char *)); static int thumb_reg PARAMS ((char ** str, int hi_lo)); -#define THUMB_SIZE 2 /* Size of thumb instruction */ +#define THUMB_SIZE 2 /* Size of thumb instruction. */ #define THUMB_REG_LO 0x1 #define THUMB_REG_HI 0x2 #define THUMB_REG_ANY 0x3 @@ -773,7 +770,7 @@ static int thumb_reg PARAMS ((char ** s #define THUMB_PP_PC_LR 0x0100 -/* These three are used for immediate shifts, do not alter */ +/* These three are used for immediate shifts, do not alter. */ #define THUMB_WORD 2 #define THUMB_HALFWORD 1 #define THUMB_BYTE 0 @@ -862,7 +859,7 @@ struct reg_entry #define REG_LR 14 #define REG_SP 13 -/* These are the standard names. Users can add aliases with .req */ +/* These are the standard names. Users can add aliases with .req */ static CONST struct reg_entry reg_table[] = { /* Processor Register Numbers. */ @@ -912,10 +909,9 @@ static struct hash_control * arm_psr_hsh /* This table describes all the machine specific pseudo-ops the assembler has to support. The fields are: - pseudo-op name without dot - function to call to execute this pseudo-op - Integer arg to pass to the function - */ + pseudo-op name without dot + function to call to execute this pseudo-op + Integer arg to pass to the function. */ static void s_req PARAMS ((int)); static void s_align PARAMS ((int)); @@ -1007,12 +1003,13 @@ add_to_lit_pool () current_poolP = symbol_create (FAKE_LABEL_NAME, undefined_section, (valueT) 0, &zero_address_frag); - /* Check if this literal value is already in the pool: */ + /* Check if this literal value is already in the pool: */ while (lit_count < next_literal_pool_place) { if (literals[lit_count].exp.X_op == inst.reloc.exp.X_op && inst.reloc.exp.X_op == O_constant - && literals[lit_count].exp.X_add_number == inst.reloc.exp.X_add_number + && literals[lit_count].exp.X_add_number + == inst.reloc.exp.X_add_number && literals[lit_count].exp.X_unsigned == inst.reloc.exp.X_unsigned) break; lit_count++; @@ -1091,8 +1088,8 @@ symbol_locate (symbolP, name, segment, v #endif /* DEBUG_SYMS */ } -/* Check that an immediate is valid, and if so, convert it to the right format. */ - +/* Check that an immediate is valid, and if so, + convert it to the right format. */ static unsigned int validate_immediate (val) unsigned int val; @@ -1112,7 +1109,6 @@ validate_immediate (val) /* Check to see if an immediate can be computed as two seperate immediate values, added together. We already know that this value cannot be computed by just one ARM instruction. */ - static unsigned int validate_immediate_twopart (val, highpart) unsigned int val; @@ -1163,14 +1159,14 @@ validate_offset_imm (val, hwse) static void s_req (a) - int a; + int a ATTRIBUTE_UNUSED; { as_bad (_("Invalid syntax for .req directive.")); } static void s_bss (ignore) - int ignore; + int ignore ATTRIBUTE_UNUSED; { /* We don't support putting frags in the BSS segment, we fake it by marking in_bss, then looking at s_skip for clues?.. */ @@ -1180,7 +1176,7 @@ s_bss (ignore) static void s_even (ignore) - int ignore; + int ignore ATTRIBUTE_UNUSED; { if (!need_pass_2) /* Never make frag if expect extra pass. */ frag_align (1, 0, 0); @@ -1192,7 +1188,7 @@ s_even (ignore) static void s_ltorg (ignored) - int ignored; + int ignored ATTRIBUTE_UNUSED; { int lit_count = 0; char sym_name[20]; @@ -1220,7 +1216,7 @@ s_ltorg (ignored) #endif while (lit_count < next_literal_pool_place) - /* First output the expression in the instruction to the pool */ + /* First output the expression in the instruction to the pool. */ emit_expr (&(literals[lit_count++].exp), 4); /* .word */ next_literal_pool_place = 0; @@ -1229,7 +1225,7 @@ s_ltorg (ignored) static void s_align (unused) /* Same as s_align_ptwo but align 0 => align 2 */ - int unused; + int unused ATTRIBUTE_UNUSED; { register int temp; register long temp_fill; @@ -1265,7 +1261,7 @@ s_align (unused) /* Same as s_align_ptwo static void s_force_thumb (ignore) - int ignore; + int ignore ATTRIBUTE_UNUSED; { /* If we are not already in thumb mode go into it, EVEN if the target processor does not support thumb instructions. @@ -1285,7 +1281,7 @@ s_force_thumb (ignore) static void s_thumb_func (ignore) - int ignore; + int ignore ATTRIBUTE_UNUSED; { /* The following label is the name/address of the start of a Thumb function. We need to know this for the interworking support. */ @@ -1471,7 +1467,7 @@ opcode_select (width) static void s_arm (ignore) - int ignore; + int ignore ATTRIBUTE_UNUSED; { opcode_select (32); demand_empty_rest_of_line (); @@ -1479,7 +1475,7 @@ s_arm (ignore) static void s_thumb (ignore) - int ignore; + int ignore ATTRIBUTE_UNUSED; { opcode_select (16); demand_empty_rest_of_line (); @@ -1487,7 +1483,7 @@ s_thumb (ignore) static void s_code (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { register int temp; @@ -1538,8 +1534,7 @@ skip_past_comma (str) /* A standard register must be given at this point. Shift is the place to put it in inst.instruction. Restores input start point on err. - Returns the reg#, or FAIL. */ - + Returns the reg#, or FAIL. */ static int reg_required_here (str, shift) char ** str; @@ -1955,7 +1950,7 @@ do_msr (str, flags) else { unsigned value = validate_immediate (inst.reloc.exp.X_add_number); - if (value == FAIL) + if (value == (unsigned) FAIL) { inst.error = _("Invalid constant"); return; @@ -2464,7 +2459,7 @@ negate_data_op (instruction, value) return FAIL; } - if (value == FAIL) + if (value == (unsigned) FAIL) return FAIL; *instruction &= OPCODE_MASK; @@ -2647,8 +2642,7 @@ do_adr (str, flags) unsigned long flags; { /* This is a pseudo-op of the form "adr rd, label" to be converted - into a relative address of the form "add rd, pc, #label-.-8" */ - + into a relative address of the form "add rd, pc, #label-.-8". */ skip_whitespace (str); if (reg_required_here (&str, 12) == FAIL @@ -2659,10 +2653,11 @@ do_adr (str, flags) inst.error = BAD_ARGS; return; } + /* Frag hacking will turn this into a sub instruction if the offset turns out to be negative. */ inst.reloc.type = BFD_RELOC_ARM_IMMEDIATE; - inst.reloc.exp.X_add_number -= 8; /* PC relative adjust */ + inst.reloc.exp.X_add_number -= 8; /* PC relative adjust. */ inst.reloc.pc_rel = 1; inst.instruction |= flags; end_of_line (str); @@ -3301,7 +3296,7 @@ do_swap (str, flags) static void do_branch (str, flags) char * str; - unsigned long flags; + unsigned long flags ATTRIBUTE_UNUSED; { if (my_get_expression (&inst.reloc.exp, &str)) return; @@ -3347,7 +3342,7 @@ do_branch (str, flags) static void do_bx (str, flags) char * str; - unsigned long flags; + unsigned long flags ATTRIBUTE_UNUSED; { int reg; @@ -3368,7 +3363,7 @@ do_bx (str, flags) static void do_cdp (str, flags) char * str; - unsigned long flags; + unsigned long flags ATTRIBUTE_UNUSED; { /* Co-processor data operation. Format: CDP{cond} CP#,,CRd,CRn,CRm{,} */ @@ -3535,7 +3530,7 @@ do_co_reg (str, flags) static void do_fp_ctrl (str, flags) char * str; - unsigned long flags; + unsigned long flags ATTRIBUTE_UNUSED; { /* FP control registers. Format: {cond} Rn */ @@ -3556,7 +3551,7 @@ do_fp_ctrl (str, flags) static void do_fp_ldst (str, flags) char * str; - unsigned long flags; + unsigned long flags ATTRIBUTE_UNUSED; { skip_whitespace (str); @@ -4910,11 +4905,15 @@ static void do_t_adr (str) char * str; { + int reg; + /* This is a pseudo-op of the form "adr rd, label" to be converted - into a relative address of the form "add rd, pc, #label-.-4" */ + into a relative address of the form "add rd, pc, #label-.-4". */ skip_whitespace (str); - if (reg_required_here (&str, 4) == FAIL /* Store Rd in temporary location inside instruction. */ + /* Store Rd in temporary location inside instruction. */ + if ((reg = reg_required_here (&str, 4)) == FAIL + || (reg > 7) /* For Thumb reg must be r0..r7. */ || skip_past_comma (&str) == FAIL || my_get_expression (&inst.reloc.exp, &str)) { @@ -4924,9 +4923,10 @@ do_t_adr (str) } inst.reloc.type = BFD_RELOC_ARM_THUMB_ADD; - inst.reloc.exp.X_add_number -= 4; /* PC relative adjust */ + inst.reloc.exp.X_add_number -= 4; /* PC relative adjust. */ inst.reloc.pc_rel = 1; - inst.instruction |= REG_PC; /* Rd is already placed into the instruction */ + inst.instruction |= REG_PC; /* Rd is already placed into the instruction. */ + end_of_line (str); } @@ -4983,7 +4983,8 @@ set_constant_flonums () void md_begin () { - int i; + unsigned mach; + unsigned int i; if ( (arm_ops_hsh = hash_new ()) == NULL || (arm_tops_hsh = hash_new ()) == NULL @@ -5013,7 +5014,7 @@ md_begin () { unsigned int flags = 0; - /* Set the flags in the private structure */ + /* Set the flags in the private structure. */ if (uses_apcs_26) flags |= F_APCS26; if (support_interwork) flags |= F_INTERWORK; if (uses_apcs_float) flags |= F_APCS_FLOAT; @@ -5024,47 +5025,43 @@ md_begin () } #endif - { - unsigned mach; - - /* Record the CPU type as well */ - switch (cpu_variant & ARM_CPU_MASK) - { - case ARM_2: - mach = bfd_mach_arm_2; - break; - - case ARM_3: /* also ARM_250 */ - mach = bfd_mach_arm_2a; - break; - - default: - case ARM_6 | ARM_3 | ARM_2: /* Actually no CPU type defined */ + /* Record the CPU type as well. */ + switch (cpu_variant & ARM_CPU_MASK) + { + case ARM_2: + mach = bfd_mach_arm_2; + break; + + case ARM_3: /* Also ARM_250. */ + mach = bfd_mach_arm_2a; + break; + + default: + case ARM_6 | ARM_3 | ARM_2: /* Actually no CPU type defined. */ + mach = bfd_mach_arm_4; + break; + + case ARM_7: /* Also ARM_6. */ + mach = bfd_mach_arm_3; + break; + } + + /* Catch special cases. */ + if (cpu_variant != (FPU_DEFAULT | CPU_DEFAULT)) + { + if (cpu_variant & (ARM_EXT_V5 & ARM_THUMB)) + mach = bfd_mach_arm_5T; + else if (cpu_variant & ARM_EXT_V5) + mach = bfd_mach_arm_5; + else if (cpu_variant & ARM_THUMB) + mach = bfd_mach_arm_4T; + else if ((cpu_variant & ARM_ARCH_V4) == ARM_ARCH_V4) mach = bfd_mach_arm_4; - break; - - case ARM_7: /* also ARM_6 */ - mach = bfd_mach_arm_3; - break; - } - - /* Catch special cases. */ - if (cpu_variant != (FPU_DEFAULT | CPU_DEFAULT)) - { - if (cpu_variant & (ARM_EXT_V5 & ARM_THUMB)) - mach = bfd_mach_arm_5T; - else if (cpu_variant & ARM_EXT_V5) - mach = bfd_mach_arm_5; - else if (cpu_variant & ARM_THUMB) - mach = bfd_mach_arm_4T; - else if ((cpu_variant & ARM_ARCH_V4) == ARM_ARCH_V4) - mach = bfd_mach_arm_4; - else if (cpu_variant & ARM_LONGMUL) - mach = bfd_mach_arm_3M; - } - - bfd_set_arch_mach (stdoutput, TARGET_ARCH, mach); - } + else if (cpu_variant & ARM_LONGMUL) + mach = bfd_mach_arm_3M; + } + + bfd_set_arch_mach (stdoutput, TARGET_ARCH, mach); } /* Turn an integer of n bytes (in val) into a stream of bytes appropriate @@ -5227,7 +5224,7 @@ md_pcrel_from (fixP) /* Round up a section size to the appropriate boundary. */ valueT md_section_align (segment, size) - segT segment; + segT segment ATTRIBUTE_UNUSED; valueT size; { #ifdef OBJ_ELF @@ -5560,13 +5557,63 @@ md_apply_fix3 (fixP, val, seg) case BFD_RELOC_ARM_PCREL_BRANCH: newval = md_chars_to_number (buf, INSN_SIZE); + /* Sign-extend a 24-bit number. */ +#define SEXT24(x) ((((x) & 0xffffff) ^ (~ 0x7fffff)) + 0x800000) + #ifdef OBJ_ELF if (! target_oabi) - value = fixP->fx_offset; + value = fixP->fx_offset; #endif - value = (value >> 2) & 0x00ffffff; - value = (value + (newval & 0x00ffffff)) & 0x00ffffff; - newval = value | (newval & 0xff000000); + + /* We are going to store value (shifted right by two) in the + instruction, in a 24 bit, signed field. Thus we need to check + that none of the top 8 bits of the shifted value (top 7 bits of + the unshifted, unsigned value) are set, or that they are all set. */ + if ((value & 0xfe000000UL) != 0 + && ((value & 0xfe000000UL) != 0xfe000000UL)) + { +#ifdef OBJ_ELF + /* Normally we would be stuck at this point, since we cannot store + the absolute address that is the destination of the branch in the + 24 bits of the branch instruction. If however, we happen to know + that the destination of the branch is in the same section as the + branch instruciton itself, then we can compute the relocation for + ourselves and not have to bother the linker with it. + + FIXME: The tests for OBJ_ELF and ! target_oabi are only here + because I have not worked out how to do this for OBJ_COFF or + target_oabi. */ + if (! target_oabi + && fixP->fx_addsy != NULL + && S_IS_DEFINED (fixP->fx_addsy) + && S_GET_SEGMENT (fixP->fx_addsy) == seg) + { + /* Get pc relative value to go into the branch. */ + value = * val; + + /* Permit a backward branch provided that enough bits are set. + Allow a forwards branch, provided that enough bits are clear. */ + if ((value & 0xfe000000UL) == 0xfe000000UL + || (value & 0xfe000000UL) == 0) + fixP->fx_done = 1; + } + + if (! fixP->fx_done) +#endif + as_bad_where (fixP->fx_file, fixP->fx_line, + _("gas can't handle same-section branch dest >= 0x04000000")); + } + + value >>= 2; + value += SEXT24 (newval); + + if ((value & 0xff000000UL) != 0 + && (fixP->fx_done == 0 + || ((value & 0xff000000UL) != 0xff000000UL))) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("out of range branch")); + + newval = (value & 0x00ffffff) | (newval & 0xff000000); md_number_to_chars (buf, newval, INSN_SIZE); break; @@ -5863,7 +5910,7 @@ md_apply_fix3 (fixP, val, seg) format. */ arelent * tc_gen_reloc (section, fixp) - asection * section; + asection * section ATTRIBUTE_UNUSED; fixS * fixp; { arelent * reloc; @@ -6007,8 +6054,8 @@ tc_gen_reloc (section, fixp) int md_estimate_size_before_relax (fragP, segtype) - fragS * fragP; - segT segtype; + fragS * fragP ATTRIBUTE_UNUSED; + segT segtype ATTRIBUTE_UNUSED; { as_fatal (_("md_estimate_size_before_relax\n")); return 1; @@ -6310,7 +6357,8 @@ _("Warning: Use of the 'nv' conditional else if (regnum != FAIL) { if (reg != regnum) - as_warn (_("ignoring redefinition of register alias '%s'"), copy_of_str ); + as_warn (_("ignoring redefinition of register alias '%s'"), + copy_of_str ); /* Do not warn about redefinitions to the same alias. */ } @@ -6594,20 +6642,25 @@ md_parse_option (c, arg) case '8': if (streq (str, "8") || streq (str, "810")) - cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_8 | ARM_ARCH_V4 | ARM_LONGMUL; + cpu_variant = (cpu_variant & ~ARM_ANY) + | ARM_8 | ARM_ARCH_V4 | ARM_LONGMUL; else goto bad; break; case '9': if (streq (str, "9")) - cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_9 | ARM_ARCH_V4 | ARM_LONGMUL | ARM_THUMB; + cpu_variant = (cpu_variant & ~ARM_ANY) + | ARM_9 | ARM_ARCH_V4 | ARM_LONGMUL | ARM_THUMB; else if (streq (str, "920")) - cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_9 | ARM_ARCH_V4 | ARM_LONGMUL; + cpu_variant = (cpu_variant & ~ARM_ANY) + | ARM_9 | ARM_ARCH_V4 | ARM_LONGMUL; else if (streq (str, "920t")) - cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_9 | ARM_ARCH_V4 | ARM_LONGMUL | ARM_THUMB; + cpu_variant = (cpu_variant & ~ARM_ANY) + | ARM_9 | ARM_ARCH_V4 | ARM_LONGMUL | ARM_THUMB; else if (streq (str, "9tdmi")) - cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_9 | ARM_ARCH_V4 | ARM_LONGMUL | ARM_THUMB; + cpu_variant = (cpu_variant & ~ARM_ANY) + | ARM_9 | ARM_ARCH_V4 | ARM_LONGMUL | ARM_THUMB; else goto bad; break; @@ -6617,21 +6670,28 @@ md_parse_option (c, arg) if (streq (str, "strongarm") || streq (str, "strongarm110") || streq (str, "strongarm1100")) - cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_8 | ARM_ARCH_V4 | ARM_LONGMUL; + cpu_variant = (cpu_variant & ~ARM_ANY) + | ARM_8 | ARM_ARCH_V4 | ARM_LONGMUL; else goto bad; break; case 'v': - /* Select variant based on architecture rather than processor */ + /* Select variant based on architecture rather than processor. */ switch (*++str) { case '2': switch (*++str) { - case 'a': cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_3; break; - case 0: cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_2; break; - default: as_bad (_("Invalid architecture variant -m%s"), arg); break; + case 'a': + cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_3; + break; + case 0: + cpu_variant = (cpu_variant & ~ARM_ANY) | ARM_2; + break; + default: + as_bad (_("Invalid architecture variant -m%s"), arg); + break; } break; @@ -6642,7 +6702,9 @@ md_parse_option (c, arg) { case 'm': cpu_variant |= ARM_LONGMUL; break; case 0: break; - default: as_bad (_("Invalid architecture variant -m%s"), arg); break; + default: + as_bad (_("Invalid architecture variant -m%s"), arg); + break; } break; @@ -6653,7 +6715,9 @@ md_parse_option (c, arg) { case 't': cpu_variant |= ARM_THUMB; break; case 0: break; - default: as_bad (_("Invalid architecture variant -m%s"), arg); break; + default: + as_bad (_("Invalid architecture variant -m%s"), arg); + break; } break; @@ -6664,7 +6728,9 @@ md_parse_option (c, arg) case 't': cpu_variant |= ARM_THUMB; break; case 'e': cpu_variant |= ARM_EXT_V5E; break; case 0: break; - default: as_bad (_("Invalid architecture variant -m%s"), arg); break; + default: + as_bad (_("Invalid architecture variant -m%s"), arg); + break; } break; @@ -6699,8 +6765,7 @@ void md_show_usage (fp) FILE * fp; { - fprintf (fp, -_("\ + fprintf (fp, _("\ ARM Specific Assembler Options:\n\ -m[arm][] select processor variant\n\ -m[arm]v[2|2a|3|3m|4|4t|5[t][e]] select architecture variant\n\ @@ -6709,29 +6774,20 @@ _("\ -mall allow any instruction\n\ -mfpa10, -mfpa11 select floating point architecture\n\ -mfpe-old don't allow floating-point multiple instructions\n\ - -mno-fpu don't allow any floating-point instructions.\n")); - fprintf (fp, -_("\ + -mno-fpu don't allow any floating-point instructions.\n\ -k generate PIC code.\n")); #if defined OBJ_COFF || defined OBJ_ELF - fprintf (fp, -_("\ - -mapcs-32, -mapcs-26 specify which ARM Procedure Calling Standard to use\n")); - fprintf (fp, -_("\ - -mapcs-float floating point args are passed in FP regs\n")); - fprintf (fp, -_("\ + fprintf (fp, _("\ + -mapcs-32, -mapcs-26 specify which ARM Procedure Calling Standard to use\n\ + -mapcs-float floating point args are passed in FP regs\n\ -mapcs-reentrant the code is position independent/reentrant\n")); #endif #ifdef OBJ_ELF - fprintf (fp, -_("\ + fprintf (fp, _("\ -moabi support the old ELF ABI\n")); #endif #ifdef ARM_BI_ENDIAN - fprintf (fp, -_("\ + fprintf (fp, _("\ -EB assemble code for a big endian cpu\n\ -EL assemble code for a little endian cpu\n")); #endif @@ -6916,11 +6972,14 @@ arm_adjust_symtab () elf_sym = elf_symbol (symbol_get_bfdsym (sym)); bind = ELF_ST_BIND (elf_sym); - /* If it's a .thumb_func, declare it as so, else tag label as .code 16. */ + /* If it's a .thumb_func, declare it as so, + otherwise tag label as .code 16. */ if (THUMB_IS_FUNC (sym)) - elf_sym->internal_elf_sym.st_info = ELF_ST_INFO (bind, STT_ARM_TFUNC); + elf_sym->internal_elf_sym.st_info = + ELF_ST_INFO (bind, STT_ARM_TFUNC); else - elf_sym->internal_elf_sym.st_info = ELF_ST_INFO (bind, STT_ARM_16BIT); + elf_sym->internal_elf_sym.st_info = + ELF_ST_INFO (bind, STT_ARM_16BIT); } } #endif @@ -7054,7 +7113,7 @@ arm_parse_reloc () { char id[16]; char * ip; - int i; + unsigned int i; static struct { char * str; @@ -7122,7 +7181,8 @@ s_arm_elf_cons (nbytes) int size = bfd_get_reloc_size (howto); if (size > nbytes) - as_bad ("%s relocations do not fit in %d bytes", howto->name, nbytes); + as_bad ("%s relocations do not fit in %d bytes", + howto->name, nbytes); else { register char * p = frag_more ((int) nbytes); @@ -7137,7 +7197,7 @@ s_arm_elf_cons (nbytes) } while (*input_line_pointer++ == ','); - input_line_pointer--; /* Put terminator back into stream. */ + input_line_pointer--; /* Put terminator back into stream. */ demand_empty_rest_of_line (); } diff -upr --new-file binutils-2.9.5.0.29/gas/config/tc-d30v.c binutils-2.9.5.0.31/gas/config/tc-d30v.c --- binutils-2.9.5.0.29/gas/config/tc-d30v.c Thu Feb 24 11:11:47 2000 +++ binutils-2.9.5.0.31/gas/config/tc-d30v.c Sun Mar 12 09:32:43 2000 @@ -247,10 +247,6 @@ check_range (num, bits, flags) if (bits == 32 && sizeof(unsigned long) * CHAR_BIT == 32) return 0; - /* Sign extend signed values to unsigned long */ - if ((flags & OPERAND_SIGNED) && (num & ((unsigned long)1 << (bits - 1)))) - num |= ((long)-1 << (bits - 1)); - if (flags & OPERAND_SHIFT) { /* We know that all shifts are right by three bits.... */ diff -upr --new-file binutils-2.9.5.0.29/gas/config/tc-h8300.c binutils-2.9.5.0.31/gas/config/tc-h8300.c --- binutils-2.9.5.0.29/gas/config/tc-h8300.c Thu Jun 3 11:02:01 1999 +++ binutils-2.9.5.0.31/gas/config/tc-h8300.c Sun Mar 19 11:55:07 2000 @@ -311,7 +311,7 @@ parse_exp (s, op) static char * skip_colonthing (ptr, exp, mode) char *ptr; - expressionS *exp; + expressionS *exp ATTRIBUTE_UNUSED; int *mode; { if (*ptr == ':') @@ -399,7 +399,7 @@ static void get_operand (ptr, op, dst, direction) char **ptr; struct h8_op *op; - unsigned int dst; + unsigned int dst ATTRIBUTE_UNUSED; int direction; { char *src = *ptr; @@ -1343,21 +1343,21 @@ md_assemble (str) void tc_crawl_symbol_chain (headers) - object_headers * headers; + object_headers * headers ATTRIBUTE_UNUSED; { printf (_("call to tc_crawl_symbol_chain \n")); } symbolS * md_undefined_symbol (name) - char *name; + char *name ATTRIBUTE_UNUSED; { return 0; } void tc_headers_hook (headers) - object_headers * headers; + object_headers * headers ATTRIBUTE_UNUSED; { printf (_("call to tc_headers_hook \n")); } @@ -1433,15 +1433,15 @@ size_t md_longopts_size = sizeof(md_long int md_parse_option (c, arg) - int c; - char *arg; + int c ATTRIBUTE_UNUSED; + char *arg ATTRIBUTE_UNUSED; { return 0; } void md_show_usage (stream) - FILE *stream; + FILE *stream ATTRIBUTE_UNUSED; { } @@ -1454,9 +1454,9 @@ tc_aout_fix_to_chars () void md_convert_frag (headers, seg, fragP) - object_headers *headers; - segT seg; - fragS *fragP; + object_headers *headers ATTRIBUTE_UNUSED; + segT seg ATTRIBUTE_UNUSED; + fragS *fragP ATTRIBUTE_UNUSED; { printf (_("call to md_convert_frag \n")); abort (); @@ -1500,8 +1500,8 @@ md_apply_fix (fixP, val) int md_estimate_size_before_relax (fragP, segment_type) - register fragS *fragP; - register segT segment_type; + register fragS *fragP ATTRIBUTE_UNUSED; + register segT segment_type ATTRIBUTE_UNUSED; { printf (_("call tomd_estimate_size_before_relax \n")); abort (); @@ -1519,7 +1519,7 @@ md_number_to_chars (ptr, use, nbytes) } long md_pcrel_from (fixP) - fixS *fixP; + fixS *fixP ATTRIBUTE_UNUSED; { abort (); } diff -upr --new-file binutils-2.9.5.0.29/gas/config/tc-m32r.c binutils-2.9.5.0.31/gas/config/tc-m32r.c --- binutils-2.9.5.0.29/gas/config/tc-m32r.c Sat Oct 9 09:13:28 1999 +++ binutils-2.9.5.0.31/gas/config/tc-m32r.c Sun Mar 12 09:32:44 2000 @@ -157,29 +157,30 @@ const char * md_shortopts = M32R_SHORTOP struct option md_longopts[] = { -#define OPTION_M32RX (OPTION_MD_BASE) +#define OPTION_M32R (OPTION_MD_BASE) +#define OPTION_M32RX (OPTION_M32R + 1) +#define OPTION_WARN_PARALLEL (OPTION_M32RX + 1) +#define OPTION_NO_WARN_PARALLEL (OPTION_WARN_PARALLEL + 1) +#define OPTION_SPECIAL (OPTION_NO_WARN_PARALLEL + 1) +#define OPTION_WARN_UNMATCHED (OPTION_SPECIAL + 1) +#define OPTION_NO_WARN_UNMATCHED (OPTION_WARN_UNMATCHED + 1) + {"m32r", no_argument, NULL, OPTION_M32R}, {"m32rx", no_argument, NULL, OPTION_M32RX}, -#define OPTION_WARN_PARALLEL (OPTION_MD_BASE + 1) {"warn-explicit-parallel-conflicts", no_argument, NULL, OPTION_WARN_PARALLEL}, {"Wp", no_argument, NULL, OPTION_WARN_PARALLEL}, -#define OPTION_NO_WARN_PARALLEL (OPTION_MD_BASE + 2) {"no-warn-explicit-parallel-conflicts", no_argument, NULL, OPTION_NO_WARN_PARALLEL}, {"Wnp", no_argument, NULL, OPTION_NO_WARN_PARALLEL}, -#define OPTION_SPECIAL (OPTION_MD_BASE + 3) {"hidden", no_argument, NULL, OPTION_SPECIAL}, - /* Sigh. I guess all warnings must now have both variants. */ -#define OPTION_WARN_UNMATCHED (OPTION_MD_BASE + 4) {"warn-unmatched-high", no_argument, NULL, OPTION_WARN_UNMATCHED}, {"Wuh", no_argument, NULL, OPTION_WARN_UNMATCHED}, -#define OPTION_NO_WARN_UNMATCHED (OPTION_MD_BASE + 5) {"no-warn-unmatched-high", no_argument, NULL, OPTION_NO_WARN_UNMATCHED}, {"Wnuh", no_argument, NULL, OPTION_NO_WARN_UNMATCHED}, #if 0 /* not supported yet */ -#define OPTION_RELAX (OPTION_MD_BASE + 6) +#define OPTION_RELAX (OPTION_NO_WARN_UNMATCHED + 1) +#define OPTION_CPU_DESC (OPTION_RELAX + 1) {"relax", no_argument, NULL, OPTION_RELAX}, -#define OPTION_CPU_DESC (OPTION_MD_BASE + 7) {"cpu-desc", required_argument, NULL, OPTION_CPU_DESC}, #endif {NULL, no_argument, NULL, 0} @@ -197,6 +198,10 @@ md_parse_option (c, arg) optimize = 1; break; + case OPTION_M32R: + allow_m32rx (0); + break; + case OPTION_M32RX: allow_m32rx (1); break; @@ -251,6 +256,8 @@ md_show_usage (stream) fprintf (stream, _(" M32R specific command line options:\n")); fprintf (stream, _("\ + -m32r disable support for the m32rx instruction set\n")); + fprintf (stream, _("\ -m32rx support the extended m32rx instruction set\n")); fprintf (stream, _("\ -O try to combine instructions in parallel\n")); @@ -1880,6 +1887,18 @@ m32r_fix_adjustable (fixP) fixS *fixP; { + bfd_reloc_code_real_type reloc_type; + + if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED) + { + const CGEN_INSN *insn = NULL; + int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED; + const CGEN_OPERAND *operand = cgen_operand_lookup_by_num(gas_cgen_cpu_desc, opindex); + reloc_type = md_cgen_lookup_reloc (insn, operand, fixP); + } + else + reloc_type = fixP->fx_r_type; + if (fixP->fx_addsy == NULL) return 1; @@ -1890,8 +1909,8 @@ m32r_fix_adjustable (fixP) return 0; /* We need the symbol name for the VTABLE entries */ - if (fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT - || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY) + if (reloc_type == BFD_RELOC_VTABLE_INHERIT + || reloc_type == BFD_RELOC_VTABLE_ENTRY) return 0; return 1; diff -upr --new-file binutils-2.9.5.0.29/gas/config/tc-mips.c binutils-2.9.5.0.31/gas/config/tc-mips.c --- binutils-2.9.5.0.29/gas/config/tc-mips.c Fri Feb 25 16:45:28 2000 +++ binutils-2.9.5.0.31/gas/config/tc-mips.c Sun Mar 12 09:40:14 2000 @@ -2599,7 +2599,6 @@ macro_build (place, counter, ep, name, f || r == BFD_RELOC_MIPS_GOT_LO16 || r == BFD_RELOC_MIPS_CALL_LO16 || (ep->X_op == O_subtract - && now_seg == text_section && r == BFD_RELOC_PCREL_LO16)); continue; @@ -2613,7 +2612,6 @@ macro_build (place, counter, ep, name, f || r == BFD_RELOC_MIPS_GOT_HI16 || r == BFD_RELOC_MIPS_CALL_HI16)) || (ep->X_op == O_subtract - && now_seg == text_section && r == BFD_RELOC_PCREL_HI16_S))); if (ep->X_op == O_constant) { @@ -4152,23 +4150,23 @@ macro (ip) /* When generating embedded PIC code, we permit expressions of the form la $4,foo-bar - where bar is an address in the .text section. These are used + where bar is an address in the current section. These are used when getting the addresses of functions. We don't permit X_add_number to be non-zero, because if the symbol is external the relaxing code needs to know that any addend is purely the offset to X_op_symbol. */ if (mips_pic == EMBEDDED_PIC && offset_expr.X_op == O_subtract - && now_seg == text_section && (symbol_constant_p (offset_expr.X_op_symbol) - ? S_GET_SEGMENT (offset_expr.X_op_symbol) == text_section + ? S_GET_SEGMENT (offset_expr.X_op_symbol) == now_seg : (symbol_equated_p (offset_expr.X_op_symbol) && (S_GET_SEGMENT (symbol_get_value_expression (offset_expr.X_op_symbol) ->X_add_symbol) - == text_section))) + == now_seg))) && breg == 0 - && offset_expr.X_add_number == 0) + && (offset_expr.X_add_number == 0 + || OUTPUT_FLAVOR == bfd_target_elf_flavour)) { macro_build ((char *) NULL, &icnt, &offset_expr, "lui", "t,u", treg, (int) BFD_RELOC_PCREL_HI16_S); @@ -7668,11 +7666,15 @@ mips_ip (str, ip) default: /* unused default case avoids warnings. */ case 'L': newname = RDATA_SECTION_NAME; - if (USE_GLOBAL_POINTER_OPT && g_switch_value >= 8) + if ((USE_GLOBAL_POINTER_OPT && g_switch_value >= 8) + || mips_pic == EMBEDDED_PIC) newname = ".lit8"; break; case 'F': - newname = RDATA_SECTION_NAME; + if (mips_pic == EMBEDDED_PIC) + newname = ".lit8"; + else + newname = RDATA_SECTION_NAME; break; case 'l': assert (!USE_GLOBAL_POINTER_OPT @@ -7815,9 +7817,8 @@ mips_ip (str, ip) || offset_expr.X_add_number < -0x8000) && (mips_pic != EMBEDDED_PIC || offset_expr.X_op != O_subtract - || now_seg != text_section || (S_GET_SEGMENT (offset_expr.X_op_symbol) - != text_section))) + != now_seg))) break; if (c == 'h' || c == 'H') @@ -9497,6 +9498,7 @@ mips_frob_file () fixup requires the special reloc. */ #define SWITCH_TABLE(fixp) \ ((fixp)->fx_r_type == BFD_RELOC_32 \ + && OUTPUT_FLAVOR != bfd_target_elf_flavour \ && (fixp)->fx_addsy != NULL \ && (fixp)->fx_subsy != NULL \ && S_GET_SEGMENT ((fixp)->fx_addsy) == text_section \ @@ -9544,15 +9546,16 @@ md_apply_fix (fixP, valueP) symbol, we need to adjust the value. */ #ifdef OBJ_ELF if (fixP->fx_addsy != NULL && OUTPUT_FLAVOR == bfd_target_elf_flavour) + { if (S_GET_OTHER (fixP->fx_addsy) == STO_MIPS16 || S_IS_WEAK (fixP->fx_addsy) || (symbol_used_in_reloc_p (fixP->fx_addsy) && (((bfd_get_section_flags (stdoutput, - S_GET_SEGMENT (fixP->fx_addsy)) - & SEC_LINK_ONCE) != 0) - || !strncmp (segment_name (S_GET_SEGMENT (fixP->fx_addsy)), - ".gnu.linkonce", - sizeof (".gnu.linkonce") - 1)))) + S_GET_SEGMENT (fixP->fx_addsy)) + & SEC_LINK_ONCE) != 0) + || !strncmp (segment_name (S_GET_SEGMENT (fixP->fx_addsy)), + ".gnu.linkonce", + sizeof (".gnu.linkonce") - 1)))) { value -= S_GET_VALUE (fixP->fx_addsy); @@ -9560,12 +9563,29 @@ md_apply_fix (fixP, valueP) { /* In this case, the bfd_install_relocation routine will incorrectly add the symbol value back in. We just want - the addend to appear in the object file. */ + the addend to appear in the object file. + FIXME: If this makes VALUE zero, we're toast. */ value -= S_GET_VALUE (fixP->fx_addsy); } } -#endif + /* This code was generated using trial and error and so is + fragile and not trustworthy. If you change it, you should + rerun the elf-rel, elf-rel2, and empic testcases and ensure + they still pass. */ + if (fixP->fx_pcrel || fixP->fx_subsy != NULL) + { + value += fixP->fx_frag->fr_address + fixP->fx_where; + + /* BFD's REL handling, for MIPS, is _very_ weird. + This gives the right results, but it can't possibly + be the way things are supposed to work. */ + if (fixP->fx_r_type != BFD_RELOC_16_PCREL_S2 + || S_GET_SEGMENT (fixP->fx_addsy) != undefined_section) + value += fixP->fx_frag->fr_address + fixP->fx_where; + } + } +#endif fixP->fx_addnumber = value; /* Remember value for tc_gen_reloc */ @@ -9603,7 +9623,12 @@ md_apply_fix (fixP, valueP) case BFD_RELOC_PCREL_HI16_S: /* The addend for this is tricky if it is internal, so we just do everything here rather than in bfd_install_relocation. */ - if ((symbol_get_bfdsym (fixP->fx_addsy)->flags & BSF_SECTION_SYM) == 0) + if (OUTPUT_FLAVOR == bfd_target_elf_flavour + && !fixP->fx_done + && value != 0) + break; + if (fixP->fx_addsy + && (symbol_get_bfdsym (fixP->fx_addsy)->flags & BSF_SECTION_SYM) == 0) { /* For an external symbol adjust by the address to make it pcrel_offset. We use the address of the RELLO reloc @@ -9623,7 +9648,12 @@ md_apply_fix (fixP, valueP) case BFD_RELOC_PCREL_LO16: /* The addend for this is tricky if it is internal, so we just do everything here rather than in bfd_install_relocation. */ - if ((symbol_get_bfdsym (fixP->fx_addsy)->flags & BSF_SECTION_SYM) == 0) + if (OUTPUT_FLAVOR == bfd_target_elf_flavour + && !fixP->fx_done + && value != 0) + break; + if (fixP->fx_addsy + && (symbol_get_bfdsym (fixP->fx_addsy)->flags & BSF_SECTION_SYM) == 0) value += fixP->fx_frag->fr_address + fixP->fx_where; buf = (unsigned char *) fixP->fx_frag->fr_literal + fixP->fx_where; if (target_big_endian) @@ -9706,6 +9736,15 @@ md_apply_fix (fixP, valueP) if ((value & 0x3) != 0) as_bad_where (fixP->fx_file, fixP->fx_line, _("Branch to odd address (%lx)"), value); + + if (!fixP->fx_done && value != 0) + break; + /* If 'value' is zero, the remaining reloc code won't actually + do the store, so it must be done here. This is probably + a bug somewhere. */ + if (!fixP->fx_done) + value -= fixP->fx_frag->fr_address + fixP->fx_where; + value >>= 2; /* update old instruction data */ @@ -11074,6 +11113,8 @@ tc_gen_reloc (section, fixp) as_fatal (_("Double check fx_r_type in tc-mips.c:tc_gen_reloc")); fixp->fx_r_type = BFD_RELOC_GPREL32; } + else if (fixp->fx_pcrel == 0 || OUTPUT_FLAVOR == bfd_target_elf_flavour) + reloc->addend = fixp->fx_addnumber; else if (fixp->fx_r_type == BFD_RELOC_PCREL_LO16) { /* We use a special addend for an internal RELLO reloc. */ @@ -11098,8 +11139,6 @@ tc_gen_reloc (section, fixp) + fixp->fx_next->fx_frag->fr_address + fixp->fx_next->fx_where); } - else if (fixp->fx_pcrel == 0) - reloc->addend = fixp->fx_addnumber; else { if (OUTPUT_FLAVOR != bfd_target_aout_flavour) @@ -11238,7 +11277,8 @@ tc_gen_reloc (section, fixp) /* To support a PC relative reloc when generating embedded PIC code for ECOFF, we use a Cygnus extension. We check for that here to make sure that we don't let such a reloc escape normally. */ - if (OUTPUT_FLAVOR == bfd_target_ecoff_flavour + if ((OUTPUT_FLAVOR == bfd_target_ecoff_flavour + || OUTPUT_FLAVOR == bfd_target_elf_flavour) && code == BFD_RELOC_16_PCREL_S2 && mips_pic != EMBEDDED_PIC) reloc->howto = NULL; @@ -11903,6 +11943,3 @@ s_loc (x) symbolP->sy_segment = now_seg; } #endif - - - diff -upr --new-file binutils-2.9.5.0.29/gas/config/tc-sh.c binutils-2.9.5.0.31/gas/config/tc-sh.c --- binutils-2.9.5.0.29/gas/config/tc-sh.c Fri Feb 25 14:34:55 2000 +++ binutils-2.9.5.0.31/gas/config/tc-sh.c Sun Mar 19 11:55:09 2000 @@ -222,8 +222,10 @@ md_begin () /* Insert unique names into hash table */ for (opcode = sh_table; opcode->name; opcode++) { - if (opcode->arch & target_arch && strcmp (prev_name, opcode->name)) + if (strcmp (prev_name, opcode->name)) { + if (! (opcode->arch & target_arch)) + continue; prev_name = opcode->name; hash_insert (opcode_hash_control, opcode->name, (char *) opcode); } @@ -252,6 +254,8 @@ typedef struct sh_operand_info; +#define IDENT_CHAR(c) (isalnum (c) || (c) == '_') + /* try and parse a reg name, returns number of chars consumed */ static int parse_reg (src, mode, reg) @@ -259,16 +263,16 @@ parse_reg (src, mode, reg) int *mode; int *reg; { - /* We use !isalnum for the next character after the register name, to + /* We use ! IDENT_CHAR for the next character after the register name, to make sure that we won't accidentally recognize a symbol name such as - 'sram' as being a reference to the register 'sr'. */ + 'sram' or sr_ram as being a reference to the register 'sr'. */ if (src[0] == 'r') { if (src[1] == '1') { if (src[2] >= '0' && src[2] <= '5' - && ! isalnum ((unsigned char) src[3])) + && ! IDENT_CHAR ((unsigned char) src[3])) { *mode = A_REG_N; *reg = 10 + src[2] - '0'; @@ -276,26 +280,26 @@ parse_reg (src, mode, reg) } } if (src[1] >= '0' && src[1] <= '9' - && ! isalnum ((unsigned char) src[2])) + && ! IDENT_CHAR ((unsigned char) src[2])) { *mode = A_REG_N; *reg = (src[1] - '0'); return 2; } - if (src[1] >= '0' && src[1] <= '7' && strncmp(&src[2], "_bank", 5) == 0 - && ! isalnum ((unsigned char) src[7])) + if (src[1] >= '0' && src[1] <= '7' && strncmp (&src[2], "_bank", 5) == 0 + && ! IDENT_CHAR ((unsigned char) src[7])) { *mode = A_REG_B; *reg = (src[1] - '0'); return 7; } - if (src[1] == 'e' && ! isalnum ((unsigned char) src[2])) + if (src[1] == 'e' && ! IDENT_CHAR ((unsigned char) src[2])) { *mode = A_RE; return 2; } - if (src[1] == 's' && ! isalnum ((unsigned char) src[2])) + if (src[1] == 's' && ! IDENT_CHAR ((unsigned char) src[2])) { *mode = A_RS; return 2; @@ -306,13 +310,13 @@ parse_reg (src, mode, reg) { if (src[1] == '0') { - if (! isalnum ((unsigned char) src[2])) + if (! IDENT_CHAR ((unsigned char) src[2])) { *mode = DSP_REG_N; *reg = A_A0_NUM; return 2; } - if (src[2] == 'g' && ! isalnum ((unsigned char) src[3])) + if (src[2] == 'g' && ! IDENT_CHAR ((unsigned char) src[3])) { *mode = DSP_REG_N; *reg = A_A0G_NUM; @@ -321,13 +325,13 @@ parse_reg (src, mode, reg) } if (src[1] == '1') { - if (! isalnum ((unsigned char) src[2])) + if (! IDENT_CHAR ((unsigned char) src[2])) { *mode = DSP_REG_N; *reg = A_A1_NUM; return 2; } - if (src[2] == 'g' && ! isalnum ((unsigned char) src[3])) + if (src[2] == 'g' && ! IDENT_CHAR ((unsigned char) src[3])) { *mode = DSP_REG_N; *reg = A_A1G_NUM; @@ -336,21 +340,21 @@ parse_reg (src, mode, reg) } if (src[1] == 'x' && src[2] >= '0' && src[2] <= '1' - && ! isalnum ((unsigned char) src[3])) + && ! IDENT_CHAR ((unsigned char) src[3])) { *mode = A_REG_N; *reg = 4 + (src[1] - '0'); return 3; } if (src[1] == 'y' && src[2] >= '0' && src[2] <= '1' - && ! isalnum ((unsigned char) src[3])) + && ! IDENT_CHAR ((unsigned char) src[3])) { *mode = A_REG_N; *reg = 6 + (src[1] - '0'); return 3; } if (src[1] == 's' && src[2] >= '0' && src[2] <= '3' - && ! isalnum ((unsigned char) src[3])) + && ! IDENT_CHAR ((unsigned char) src[3])) { int n = src[1] - '0'; @@ -360,7 +364,7 @@ parse_reg (src, mode, reg) } } - if (src[0] == 'i' && src[1] && ! isalnum ((unsigned char) src[3])) + if (src[0] == 'i' && src[1] && ! IDENT_CHAR ((unsigned char) src[3])) { if (src[1] == 's') { @@ -383,7 +387,7 @@ parse_reg (src, mode, reg) } if (src[0] == 'x' && src[1] >= '0' && src[1] <= '1' - && ! isalnum ((unsigned char) src[2])) + && ! IDENT_CHAR ((unsigned char) src[2])) { *mode = DSP_REG_N; *reg = A_X0_NUM + src[1] - '0'; @@ -391,7 +395,7 @@ parse_reg (src, mode, reg) } if (src[0] == 'y' && src[1] >= '0' && src[1] <= '1' - && ! isalnum ((unsigned char) src[2])) + && ! IDENT_CHAR ((unsigned char) src[2])) { *mode = DSP_REG_N; *reg = A_Y0_NUM + src[1] - '0'; @@ -399,7 +403,7 @@ parse_reg (src, mode, reg) } if (src[0] == 'm' && src[1] >= '0' && src[1] <= '1' - && ! isalnum ((unsigned char) src[2])) + && ! IDENT_CHAR ((unsigned char) src[2])) { *mode = DSP_REG_N; *reg = src[1] == '0' ? A_M0_NUM : A_M1_NUM; @@ -408,78 +412,78 @@ parse_reg (src, mode, reg) if (src[0] == 's' && src[1] == 's' - && src[2] == 'r' && ! isalnum ((unsigned char) src[3])) + && src[2] == 'r' && ! IDENT_CHAR ((unsigned char) src[3])) { *mode = A_SSR; return 3; } if (src[0] == 's' && src[1] == 'p' && src[2] == 'c' - && ! isalnum ((unsigned char) src[3])) + && ! IDENT_CHAR ((unsigned char) src[3])) { *mode = A_SPC; return 3; } if (src[0] == 's' && src[1] == 'g' && src[2] == 'r' - && ! isalnum ((unsigned char) src[3])) + && ! IDENT_CHAR ((unsigned char) src[3])) { *mode = A_SGR; return 3; } if (src[0] == 'd' && src[1] == 's' && src[2] == 'r' - && ! isalnum ((unsigned char) src[3])) + && ! IDENT_CHAR ((unsigned char) src[3])) { *mode = A_DSR; return 3; } if (src[0] == 'd' && src[1] == 'b' && src[2] == 'r' - && ! isalnum ((unsigned char) src[3])) + && ! IDENT_CHAR ((unsigned char) src[3])) { *mode = A_DBR; return 3; } - if (src[0] == 's' && src[1] == 'r' && ! isalnum ((unsigned char) src[2])) + if (src[0] == 's' && src[1] == 'r' && ! IDENT_CHAR ((unsigned char) src[2])) { *mode = A_SR; return 2; } - if (src[0] == 's' && src[1] == 'p' && ! isalnum ((unsigned char) src[2])) + if (src[0] == 's' && src[1] == 'p' && ! IDENT_CHAR ((unsigned char) src[2])) { *mode = A_REG_N; *reg = 15; return 2; } - if (src[0] == 'p' && src[1] == 'r' && ! isalnum ((unsigned char) src[2])) + if (src[0] == 'p' && src[1] == 'r' && ! IDENT_CHAR ((unsigned char) src[2])) { *mode = A_PR; return 2; } - if (src[0] == 'p' && src[1] == 'c' && ! isalnum ((unsigned char) src[2])) + if (src[0] == 'p' && src[1] == 'c' && ! IDENT_CHAR ((unsigned char) src[2])) { *mode = A_DISP_PC; return 2; } if (src[0] == 'g' && src[1] == 'b' && src[2] == 'r' - && ! isalnum ((unsigned char) src[3])) + && ! IDENT_CHAR ((unsigned char) src[3])) { *mode = A_GBR; return 3; } if (src[0] == 'v' && src[1] == 'b' && src[2] == 'r' - && ! isalnum ((unsigned char) src[3])) + && ! IDENT_CHAR ((unsigned char) src[3])) { *mode = A_VBR; return 3; } if (src[0] == 'm' && src[1] == 'a' && src[2] == 'c' - && ! isalnum ((unsigned char) src[4])) + && ! IDENT_CHAR ((unsigned char) src[4])) { if (src[3] == 'l') { @@ -493,7 +497,7 @@ parse_reg (src, mode, reg) } } if (src[0] == 'm' && src[1] == 'o' && src[2] == 'd' - && ! isalnum ((unsigned char) src[4])) + && ! IDENT_CHAR ((unsigned char) src[4])) { *mode = A_MOD; return 3; @@ -503,7 +507,7 @@ parse_reg (src, mode, reg) if (src[2] == '1') { if (src[3] >= '0' && src[3] <= '5' - && ! isalnum ((unsigned char) src[4])) + && ! IDENT_CHAR ((unsigned char) src[4])) { *mode = F_REG_N; *reg = 10 + src[3] - '0'; @@ -511,7 +515,7 @@ parse_reg (src, mode, reg) } } if (src[2] >= '0' && src[2] <= '9' - && ! isalnum ((unsigned char) src[3])) + && ! IDENT_CHAR ((unsigned char) src[3])) { *mode = F_REG_N; *reg = (src[2] - '0'); @@ -523,7 +527,7 @@ parse_reg (src, mode, reg) if (src[2] == '1') { if (src[3] >= '0' && src[3] <= '4' && ! ((src[3] - '0') & 1) - && ! isalnum ((unsigned char) src[4])) + && ! IDENT_CHAR ((unsigned char) src[4])) { *mode = D_REG_N; *reg = 10 + src[3] - '0'; @@ -531,7 +535,7 @@ parse_reg (src, mode, reg) } } if (src[2] >= '0' && src[2] <= '8' && ! ((src[2] - '0') & 1) - && ! isalnum ((unsigned char) src[3])) + && ! IDENT_CHAR ((unsigned char) src[3])) { *mode = D_REG_N; *reg = (src[2] - '0'); @@ -543,7 +547,7 @@ parse_reg (src, mode, reg) if (src[2] == '1') { if (src[3] >= '0' && src[3] <= '4' && ! ((src[3] - '0') & 1) - && ! isalnum ((unsigned char) src[4])) + && ! IDENT_CHAR ((unsigned char) src[4])) { *mode = X_REG_N; *reg = 11 + src[3] - '0'; @@ -551,7 +555,7 @@ parse_reg (src, mode, reg) } } if (src[2] >= '0' && src[2] <= '8' && ! ((src[2] - '0') & 1) - && ! isalnum ((unsigned char) src[3])) + && ! IDENT_CHAR ((unsigned char) src[3])) { *mode = X_REG_N; *reg = (src[2] - '0') + 1; @@ -560,14 +564,14 @@ parse_reg (src, mode, reg) } if (src[0] == 'f' && src[1] == 'v') { - if (src[2] == '1'&& src[3] == '2' && ! isalnum ((unsigned char) src[4])) + if (src[2] == '1'&& src[3] == '2' && ! IDENT_CHAR ((unsigned char) src[4])) { *mode = V_REG_N; *reg = 12; return 4; } if ((src[2] == '0' || src[2] == '4' || src[2] == '8') - && ! isalnum ((unsigned char) src[3])) + && ! IDENT_CHAR ((unsigned char) src[3])) { *mode = V_REG_N; *reg = (src[2] - '0'); @@ -575,21 +579,21 @@ parse_reg (src, mode, reg) } } if (src[0] == 'f' && src[1] == 'p' && src[2] == 'u' && src[3] == 'l' - && ! isalnum ((unsigned char) src[4])) + && ! IDENT_CHAR ((unsigned char) src[4])) { *mode = FPUL_N; return 4; } if (src[0] == 'f' && src[1] == 'p' && src[2] == 's' && src[3] == 'c' - && src[4] == 'r' && ! isalnum ((unsigned char) src[5])) + && src[4] == 'r' && ! IDENT_CHAR ((unsigned char) src[5])) { *mode = FPSCR_N; return 5; } if (src[0] == 'x' && src[1] == 'm' && src[2] == 't' && src[3] == 'r' - && src[4] == 'x' && ! isalnum ((unsigned char) src[5])) + && src[4] == 'x' && ! IDENT_CHAR ((unsigned char) src[5])) { *mode = XMTRX_M4; return 5; @@ -1146,6 +1150,8 @@ get_specific (opcode, operands) goto fail; } } + if ( !(valid_arch & this_try->arch)) + goto fail; valid_arch &= this_try->arch; return this_try; fail:; @@ -1845,7 +1851,8 @@ md_show_usage (stream) SH options:\n\ -little generate little endian code\n\ -relax alter jump instructions for long displacements\n\ --small align sections to 4 byte boundaries, not 16\n")); +-small align sections to 4 byte boundaries, not 16\n +-dsp enable sh-dsp insns, and disable sh3e / sh4 insns.\n")); } void diff -upr --new-file binutils-2.9.5.0.29/gas/configure binutils-2.9.5.0.31/gas/configure --- binutils-2.9.5.0.29/gas/configure Tue Feb 29 11:15:14 2000 +++ binutils-2.9.5.0.31/gas/configure Sun Mar 12 09:40:14 2000 @@ -1584,14 +1584,19 @@ te_file=generic install_tooldir=install-exec-tooldir canon_targets="" +all_targets=no if test -n "$enable_targets" ; then for t in `echo $enable_targets | sed 's/,/ /g'`; do + if test $t = "all"; then + all_targets=yes + continue + fi result=`$ac_config_sub $t 2>/dev/null` if test -n "$result" ; then canon_targets="$canon_targets $result" - else - # Permit "all", etc. We don't support it yet though. - canon_targets="$canon_targets $t" +# else +# # Permit "all", etc. We don't support it yet though. +# canon_targets="$canon_targets $t" fi done _gas_uniq_list="$canon_targets" @@ -1613,9 +1618,7 @@ emulations="" for this_target in $target $canon_targets ; do -if test "$this_target" != "all"; then eval `echo $this_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/cpu=\1 vendor=\2 os=\3/'` -fi # check for architecture variants arch= @@ -2052,14 +2055,10 @@ EOF big) emulation="mipsbelf mipslelf mipself" ;; *) emulation="mipslelf mipsbelf mipself" ;; esac ;; - # Turn on support for i386 AOUT and COFF if asked. - i386-*-linux*-elf) - if test x"$this_target" = x"all"; then - emulation="i386aout i386coff" - else - emulation="i386elf" - fi - ;; + # Uncommenting the next line will turn on support for i386 AOUT + # for the default linux configuration + # i386-*-linux*-elf) emulation="i386elf i386aout" ;; + # i386-*-aout) emulation="i386aout" ;; i386-*-coff) emulation="i386coff" ;; i386-*-elf) emulation="i386elf" ;; @@ -2069,6 +2068,25 @@ EOF done +# Turn on all targets if possible +if test ${all_targets} = "yes"; then + case ${target_cpu_type} in + i386) + case ${obj_format} in + aout) + emulations="$emulations i386coff i386elf" + ;; + coff) + emulations="$emulations i386aout i386elf" + ;; + elf) + emulations="$emulations i386aout i386coff" + ;; + esac + ;; + esac +fi + # Assign floating point type. Most processors with FP support # IEEE FP. On those that don't support FP at all, usually IEEE # is emulated. @@ -2362,7 +2380,7 @@ EOF # 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:2366: checking for $ac_word" >&5 +echo "configure:2384: 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 @@ -2392,7 +2410,7 @@ 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:2396: checking for $ac_word" >&5 +echo "configure:2414: 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 @@ -2443,7 +2461,7 @@ fi # 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:2447: checking for $ac_word" >&5 +echo "configure:2465: 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 @@ -2475,7 +2493,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2479: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2497: 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. @@ -2486,12 +2504,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2490 "configure" +#line 2508 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2513: \"$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 @@ -2517,12 +2535,12 @@ 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:2521: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2539: 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:2526: checking whether we are using GNU C" >&5 +echo "configure:2544: 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 @@ -2531,7 +2549,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2535: \"$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:2553: \"$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 @@ -2550,7 +2568,7 @@ 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:2554: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2572: 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 @@ -2587,7 +2605,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2591: checking for $ac_word" >&5 +echo "configure:2609: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2618,7 +2636,7 @@ done test -n "$YACC" || YACC="yacc" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2622: checking how to run the C preprocessor" >&5 +echo "configure:2640: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2633,13 +2651,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2643: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2661: \"$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 : @@ -2650,13 +2668,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2660: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2678: \"$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 : @@ -2667,13 +2685,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2677: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (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 : @@ -2703,7 +2721,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2707: checking for $ac_word" >&5 +echo "configure:2725: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2736,7 +2754,7 @@ test -n "$LEX" || LEX=""$missing_dir/mis # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2740: checking for $ac_word" >&5 +echo "configure:2758: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2770,7 +2788,7 @@ then *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:2774: checking for yywrap in -l$ac_lib" >&5 +echo "configure:2792: checking for yywrap in -l$ac_lib" >&5 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2778,7 +2796,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2811: \"$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 @@ -2812,7 +2830,7 @@ fi fi echo $ac_n "checking lex output file root""... $ac_c" 1>&6 -echo "configure:2816: checking lex output file root" >&5 +echo "configure:2834: checking lex output file root" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2833,7 +2851,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6 -echo "configure:2837: checking whether yytext is a pointer" >&5 +echo "configure:2855: checking whether yytext is a pointer" >&5 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2845,14 +2863,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPU ac_save_LIBS="$LIBS" LIBS="$LIBS $LEXLIB" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_prog_lex_yytext_pointer=yes else @@ -2876,7 +2894,7 @@ fi ALL_LINGUAS= echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:2880: checking for POSIXized ISC" >&5 +echo "configure:2898: 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 @@ -2897,12 +2915,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2901: checking for ANSI C header files" >&5 +echo "configure:2919: 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 < #include @@ -2910,7 +2928,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2914: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2932: \"$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* @@ -2927,7 +2945,7 @@ rm -f conftest* 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 @@ -2945,7 +2963,7 @@ 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 @@ -2966,7 +2984,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2977,7 +2995,7 @@ if (XOR (islower (i), ISLOWER (i)) || to exit (0); } EOF -if { (eval echo configure:2981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3001,12 +3019,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3005: checking for working const" >&5 +echo "configure:3023: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3077: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3076,21 +3094,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:3080: checking for inline" >&5 +echo "configure:3098: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3112: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -3116,12 +3134,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:3120: checking for off_t" >&5 +echo "configure:3138: 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 > conftest.$ac_ext < #if STDC_HEADERS @@ -3149,12 +3167,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3153: checking for size_t" >&5 +echo "configure:3171: 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 < #if STDC_HEADERS @@ -3184,19 +3202,19 @@ 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:3188: checking for working alloca.h" >&5 +echo "configure:3206: 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 < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:3200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3218: \"$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 @@ -3217,12 +3235,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3221: checking for alloca" >&5 +echo "configure:3239: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3272: \"$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 @@ -3282,12 +3300,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:3286: checking whether alloca needs Cray hooks" >&5 +echo "configure:3304: 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 <&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:3316: checking for $ac_func" >&5 +echo "configure:3334: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3362: \"$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 @@ -3367,7 +3385,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3371: checking stack direction for C alloca" >&5 +echo "configure:3389: 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 @@ -3375,7 +3393,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3416: \"$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 @@ -3419,17 +3437,17 @@ 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:3423: checking for $ac_hdr" >&5 +echo "configure:3441: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3433: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3451: \"$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* @@ -3458,12 +3476,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3462: checking for $ac_func" >&5 +echo "configure:3480: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3508: \"$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 @@ -3511,7 +3529,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:3515: checking for working mmap" >&5 +echo "configure:3533: 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 @@ -3519,7 +3537,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3681: \"$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 @@ -3687,17 +3705,17 @@ 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:3691: checking for $ac_hdr" >&5 +echo "configure:3709: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3701: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3719: \"$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* @@ -3727,12 +3745,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3731: checking for $ac_func" >&5 +echo "configure:3749: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3777: \"$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 @@ -3784,12 +3802,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3788: checking for $ac_func" >&5 +echo "configure:3806: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3834: \"$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 @@ -3846,19 +3864,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3850: checking for LC_MESSAGES" >&5 +echo "configure:3868: 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 < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:3862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3880: \"$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 @@ -3879,7 +3897,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3883: checking whether NLS is requested" >&5 +echo "configure:3901: 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" @@ -3899,7 +3917,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3903: checking whether included gettext is requested" >&5 +echo "configure:3921: 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" @@ -3918,17 +3936,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3922: checking for libintl.h" >&5 +echo "configure:3940: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3932: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3950: \"$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* @@ -3945,19 +3963,19 @@ 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:3949: checking for gettext in libc" >&5 +echo "configure:3967: 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 < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3979: \"$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 @@ -3973,7 +3991,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3977: checking for bindtextdomain in -lintl" >&5 +echo "configure:3995: 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 @@ -3981,7 +3999,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4014: \"$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 @@ -4008,19 +4026,19 @@ 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:4012: checking for gettext in libintl" >&5 +echo "configure:4030: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4042: \"$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 @@ -4048,7 +4066,7 @@ 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:4052: checking for $ac_word" >&5 +echo "configure:4070: 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 @@ -4082,12 +4100,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4086: checking for $ac_func" >&5 +echo "configure:4104: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4132: \"$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 @@ -4137,7 +4155,7 @@ 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:4141: checking for $ac_word" >&5 +echo "configure:4159: 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 @@ -4173,7 +4191,7 @@ 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:4177: checking for $ac_word" >&5 +echo "configure:4195: 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 @@ -4205,7 +4223,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -4245,7 +4263,7 @@ fi # 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:4249: checking for $ac_word" >&5 +echo "configure:4267: 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 @@ -4279,7 +4297,7 @@ 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:4283: checking for $ac_word" >&5 +echo "configure:4301: 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 @@ -4315,7 +4333,7 @@ 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:4319: checking for $ac_word" >&5 +echo "configure:4337: 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 @@ -4405,7 +4423,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:4409: checking for catalogs to be installed" >&5 +echo "configure:4427: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -4433,17 +4451,17 @@ echo "configure:4409: checking for catal 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:4437: checking for linux/version.h" >&5 +echo "configure:4455: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4447: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4465: \"$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* @@ -4506,7 +4524,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:4510: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:4528: 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" @@ -4529,12 +4547,12 @@ fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:4533: checking for Cygwin environment" >&5 +echo "configure:4551: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4567: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -4562,19 +4580,19 @@ 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:4566: checking for mingw32 environment" >&5 +echo "configure:4584: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4596: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -4593,7 +4611,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=y echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:4597: checking for executable suffix" >&5 +echo "configure:4615: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4603,7 +4621,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:4607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:4625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; @@ -4628,17 +4646,17 @@ for ac_hdr in string.h stdlib.h memory.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4632: checking for $ac_hdr" >&5 +echo "configure:4650: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4642: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4660: \"$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* @@ -4668,7 +4686,7 @@ done # Put this here so that autoconf's "cross-compiling" message doesn't confuse # people who are not cross-compiling but are compiling cross-assemblers. echo $ac_n "checking whether compiling a cross-assembler""... $ac_c" 1>&6 -echo "configure:4672: checking whether compiling a cross-assembler" >&5 +echo "configure:4690: checking whether compiling a cross-assembler" >&5 if test "${host}" = "${target}"; then cross_gas=no else @@ -4683,19 +4701,19 @@ echo "$ac_t""$cross_gas" 1>&6 # 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:4687: checking for working alloca.h" >&5 +echo "configure:4705: 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 < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:4699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4717: \"$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 @@ -4716,12 +4734,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:4720: checking for alloca" >&5 +echo "configure:4738: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4771: \"$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 @@ -4781,12 +4799,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:4785: checking whether alloca needs Cray hooks" >&5 +echo "configure:4803: 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 <&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:4815: checking for $ac_func" >&5 +echo "configure:4833: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4861: \"$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 @@ -4866,7 +4884,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:4870: checking stack direction for C alloca" >&5 +echo "configure:4888: 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 @@ -4874,7 +4892,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4915: \"$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 @@ -4915,21 +4933,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:4919: checking for inline" >&5 +echo "configure:4937: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4951: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -4959,12 +4977,12 @@ esac for ac_func in unlink remove do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4963: checking for $ac_func" >&5 +echo "configure:4981: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5009: \"$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 @@ -5016,12 +5034,12 @@ done for ac_func in sbrk do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5020: checking for $ac_func" >&5 +echo "configure:5038: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5066: \"$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 @@ -5073,12 +5091,12 @@ done # enough, but on some of those systems, the assert macro relies on requoting # working properly! echo $ac_n "checking for working assert macro""... $ac_c" 1>&6 -echo "configure:5077: checking for working assert macro" >&5 +echo "configure:5095: checking for working assert macro" >&5 if eval "test \"`echo '$''{'gas_cv_assert_ok'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5094,7 +5112,7 @@ assert (a == b ; return 0; } EOF -if { (eval echo configure:5098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_assert_ok=yes else @@ -5135,12 +5153,12 @@ gas_test_headers=" " echo $ac_n "checking whether declaration is required for strstr""... $ac_c" 1>&6 -echo "configure:5139: checking whether declaration is required for strstr" >&5 +echo "configure:5157: checking whether declaration is required for strstr" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_strstr=no else @@ -5172,12 +5190,12 @@ fi echo $ac_n "checking whether declaration is required for malloc""... $ac_c" 1>&6 -echo "configure:5176: checking whether declaration is required for malloc" >&5 +echo "configure:5194: checking whether declaration is required for malloc" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_malloc=no else @@ -5209,12 +5227,12 @@ fi echo $ac_n "checking whether declaration is required for free""... $ac_c" 1>&6 -echo "configure:5213: checking whether declaration is required for free" >&5 +echo "configure:5231: checking whether declaration is required for free" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_free=no else @@ -5246,12 +5264,12 @@ fi echo $ac_n "checking whether declaration is required for sbrk""... $ac_c" 1>&6 -echo "configure:5250: checking whether declaration is required for sbrk" >&5 +echo "configure:5268: checking whether declaration is required for sbrk" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_sbrk'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_sbrk=no else @@ -5283,12 +5301,12 @@ fi echo $ac_n "checking whether declaration is required for environ""... $ac_c" 1>&6 -echo "configure:5287: checking whether declaration is required for environ" >&5 +echo "configure:5305: checking whether declaration is required for environ" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_environ'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_environ=no else @@ -5323,12 +5341,12 @@ fi # for it? echo $ac_n "checking whether declaration is required for errno""... $ac_c" 1>&6 -echo "configure:5327: checking whether declaration is required for errno" >&5 +echo "configure:5345: checking whether declaration is required for errno" >&5 if eval "test \"`echo '$''{'gas_cv_decl_needed_errno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gas_cv_decl_needed_errno=no else diff -upr --new-file binutils-2.9.5.0.29/gas/configure.in binutils-2.9.5.0.31/gas/configure.in --- binutils-2.9.5.0.29/gas/configure.in Fri Feb 25 16:45:28 2000 +++ binutils-2.9.5.0.31/gas/configure.in Sun Mar 12 09:40:14 2000 @@ -59,14 +59,19 @@ te_file=generic install_tooldir=install-exec-tooldir canon_targets="" +all_targets=no if test -n "$enable_targets" ; then for t in `echo $enable_targets | sed 's/,/ /g'`; do + if test $t = "all"; then + all_targets=yes + continue + fi result=`$ac_config_sub $t 2>/dev/null` if test -n "$result" ; then canon_targets="$canon_targets $result" - else - # Permit "all", etc. We don't support it yet though. - canon_targets="$canon_targets $t" +# else +# # Permit "all", etc. We don't support it yet though. +# canon_targets="$canon_targets $t" fi done GAS_UNIQ(canon_targets) @@ -76,11 +81,9 @@ emulations="" for this_target in $target $canon_targets ; do -if test "$this_target" != "all"; then changequote(,)dnl eval `echo $this_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/cpu=\1 vendor=\2 os=\3/'` changequote([,])dnl -fi # check for architecture variants arch= @@ -508,14 +511,10 @@ changequote([,])dnl big) emulation="mipsbelf mipslelf mipself" ;; *) emulation="mipslelf mipsbelf mipself" ;; esac ;; - # Turn on support for i386 AOUT and COFF if asked. - i386-*-linux*-elf) - if test x"$this_target" = x"all"; then - emulation="i386aout i386coff" - else - emulation="i386elf" - fi - ;; + # Uncommenting the next line will turn on support for i386 AOUT + # for the default linux configuration + # i386-*-linux*-elf) emulation="i386elf i386aout" ;; + # i386-*-aout) emulation="i386aout" ;; i386-*-coff) emulation="i386coff" ;; i386-*-elf) emulation="i386elf" ;; @@ -524,6 +523,25 @@ changequote([,])dnl emulations="$emulations $emulation" done + +# Turn on all targets if possible +if test ${all_targets} = "yes"; then + case ${target_cpu_type} in + i386) + case ${obj_format} in + aout) + emulations="$emulations i386coff i386elf" + ;; + coff) + emulations="$emulations i386aout i386elf" + ;; + elf) + emulations="$emulations i386aout i386coff" + ;; + esac + ;; + esac +fi # Assign floating point type. Most processors with FP support # IEEE FP. On those that don't support FP at all, usually IEEE diff -upr --new-file binutils-2.9.5.0.29/gas/doc/Makefile.am binutils-2.9.5.0.31/gas/doc/Makefile.am --- binutils-2.9.5.0.29/gas/doc/Makefile.am Mon Sep 6 10:57:22 1999 +++ binutils-2.9.5.0.31/gas/doc/Makefile.am Sun Mar 12 09:40:14 2000 @@ -25,6 +25,7 @@ CPU_DOCS = \ c-i370.texi \ c-i386.texi \ c-i960.texi \ + c-m32r.texi \ c-m68k.texi \ c-mips.texi \ c-ns32k.texi \ diff -upr --new-file binutils-2.9.5.0.29/gas/doc/Makefile.in binutils-2.9.5.0.31/gas/doc/Makefile.in --- binutils-2.9.5.0.29/gas/doc/Makefile.in Tue Feb 29 11:15:14 2000 +++ binutils-2.9.5.0.31/gas/doc/Makefile.in Sun Mar 12 09:40:14 2000 @@ -127,6 +127,7 @@ CPU_DOCS = \ c-i370.texi \ c-i386.texi \ c-i960.texi \ + c-m32r.texi \ c-m68k.texi \ c-mips.texi \ c-ns32k.texi \ diff -upr --new-file binutils-2.9.5.0.29/gas/doc/c-m32r.texi binutils-2.9.5.0.31/gas/doc/c-m32r.texi --- binutils-2.9.5.0.29/gas/doc/c-m32r.texi Sat Oct 9 09:13:32 1999 +++ binutils-2.9.5.0.31/gas/doc/c-m32r.texi Sun Mar 12 09:32:47 2000 @@ -38,6 +38,14 @@ to the M32RX microprocessor, which adds basic M32R instruction set, and some additional parameters to some of the original instructions. +@item -m32r +@cindex @samp{-m32r} option, M32R +@cindex architecture options, M32R +@cindex M32R architecture options +This option can be used to restore the assembler's default behaviour of +assembling for the M32R microprocessor. This can be useful if the +default has been changed by a previous command line option. + @item -warn-explicit-parallel-conflicts @cindex @samp{-warn-explicit-parallel-conflicts} option, M32RX Instructs @code{@value{AS}} to produce warning messages when diff -upr --new-file binutils-2.9.5.0.29/gas/doc/internals.texi binutils-2.9.5.0.31/gas/doc/internals.texi --- binutils-2.9.5.0.29/gas/doc/internals.texi Tue Feb 29 11:00:51 2000 +++ binutils-2.9.5.0.31/gas/doc/internals.texi Sun Mar 19 11:55:12 2000 @@ -8,7 +8,7 @@ This chapter describes the internals of the assembler. It is incomplete, but it may help a bit. -This chapter was last modified on $Date: 2000/02/28 04:08:32 $. It is not updated regularly, and it +This chapter was last modified on $Date: 2000/03/13 20:46:07 $. It is not updated regularly, and it may be out of date. @menu @@ -1058,6 +1058,16 @@ upon the number of bytes that the alignm @cindex HANDLE_ALIGN You may define this macro to do special handling for an alignment directive. GAS will call it at the end of the assembly. + +@item TC_IMPLICIT_LCOMM_ALIGNMENT (@var{size}, @var{p2var}) +@cindex TC_IMPLICIT_LCOMM_ALIGNMENT +An @code{.lcomm} directive with no explicit alignment parameter will use this +macro to set @var{p2var} to the alignment that a request for @var{size} bytes +will have. The alignment is expressed as a power of two. If no alignment +should take place, the macro definition should do nothing. Some targets define +a @code{.bss} directive that is also affected by this macro. The default +definition will set @var{p2var} to the truncated power of two of sizes up to +eight bytes. @item md_flush_pending_output @cindex md_flush_pending_output diff -upr --new-file binutils-2.9.5.0.29/gas/expr.c binutils-2.9.5.0.31/gas/expr.c --- binutils-2.9.5.0.29/gas/expr.c Thu Feb 24 11:11:41 2000 +++ binutils-2.9.5.0.31/gas/expr.c Sun Mar 19 11:55:04 2000 @@ -923,7 +923,8 @@ operand (expressionP) number, make it one. Otherwise, make it a local label, and try to deal with parsing the rest later. */ if (!input_line_pointer[1] - || (is_end_of_line[0xff & input_line_pointer[1]])) + || (is_end_of_line[0xff & input_line_pointer[1]]) + || strchr (FLT_CHARS, 'f') == NULL) goto is_0f_label; { char *cp = input_line_pointer + 1; diff -upr --new-file binutils-2.9.5.0.29/gas/gasp.c binutils-2.9.5.0.31/gas/gasp.c --- binutils-2.9.5.0.29/gas/gasp.c Fri Jan 28 09:10:50 2000 +++ binutils-2.9.5.0.31/gas/gasp.c Sun Mar 12 09:40:14 2000 @@ -1439,11 +1439,6 @@ do_align (idx, in) have_fill = 1; } - if (al != 1 - && al != 2 - && al != 4) - WARNING ((stderr, _("alignment must be one of 1, 2 or 4.\n"))); - fprintf (outfile, ".align %d", al); if (have_fill) fprintf (outfile, ",%d", fill); diff -upr --new-file binutils-2.9.5.0.29/gas/read.c binutils-2.9.5.0.31/gas/read.c --- binutils-2.9.5.0.29/gas/read.c Fri Feb 25 17:24:02 2000 +++ binutils-2.9.5.0.31/gas/read.c Sun Mar 19 12:07:57 2000 @@ -53,6 +53,21 @@ Software Foundation, 59 Temple Place - S #define TC_START_LABEL(x,y) (x==':') #endif +/* Set by the object-format or the target. */ +#ifndef TC_IMPLICIT_LCOMM_ALIGNMENT +#define TC_IMPLICIT_LCOMM_ALIGNMENT(SIZE, P2VAR) \ + do { \ + if ((SIZE) >= 8) \ + (P2VAR) = 3; \ + else if ((SIZE) >= 4) \ + (P2VAR) = 2; \ + else if ((SIZE) >= 2) \ + (P2VAR) = 1; \ + else \ + (P2VAR) = 0; \ + } while (0) +#endif + /* The NOP_OPCODE is for the alignment fill value. * fill it a nop instruction so that the disassembler does not choke * on it @@ -530,7 +545,7 @@ read_a_source_file (name) contin: /* JF this goto is my fault I admit it. Someone brave please re-write the whole input section here? Pleeze??? */ - while (input_line_pointer && (input_line_pointer < buffer_limit)) + while (input_line_pointer < buffer_limit) { /* We have more of this buffer to parse. */ @@ -1973,24 +1988,14 @@ s_lcomm_internal (needs_align, bytes_p) } } #endif + if (!needs_align) { - /* FIXME. This needs to be machine independent. */ - if (temp >= 8) - align = 3; - else if (temp >= 4) - align = 2; - else if (temp >= 2) - align = 1; - else - align = 0; - -#ifdef OBJ_EVAX - /* FIXME: This needs to be done in a more general fashion. */ - align = 3; -#endif + TC_IMPLICIT_LCOMM_ALIGNMENT (temp, align); - record_alignment(bss_seg, align); + /* Still zero unless TC_IMPLICIT_LCOMM_ALIGNMENT set it. */ + if (align) + record_alignment(bss_seg, align); } if (needs_align) diff -upr --new-file binutils-2.9.5.0.29/gas/testsuite/ChangeLog binutils-2.9.5.0.31/gas/testsuite/ChangeLog --- binutils-2.9.5.0.29/gas/testsuite/ChangeLog Tue Feb 29 11:00:52 2000 +++ binutils-2.9.5.0.31/gas/testsuite/ChangeLog Sun Mar 12 09:32:48 2000 @@ -1,3 +1,14 @@ +2000-03-10 Geoffrey Keating + + * gas/mips/empic.d: New file. + * gas/mips/empic.s: New file. + * gas/mips/mips16-e.d: New file. + * gas/mips/mips16-e.s: New file. + * gas/mips/mips16-f.d: New file. + * gas/mips/mips16-f.s: New file. + * gas/mips/mips.exp: Add empic, mips16-e. Add mips16-f as an + expected failure. + 2000-02-25 H.J. Lu * gas/i386/general.l: Support a.out and coff. diff -upr --new-file binutils-2.9.5.0.29/gas/testsuite/ChangeLog.linux binutils-2.9.5.0.31/gas/testsuite/ChangeLog.linux --- binutils-2.9.5.0.29/gas/testsuite/ChangeLog.linux Fri Feb 25 16:45:28 2000 +++ binutils-2.9.5.0.31/gas/testsuite/ChangeLog.linux Sun Mar 12 09:40:14 2000 @@ -1,3 +0,0 @@ -Fri Feb 25 15:24:18 2000 H.J. Lu - - * gas/i386/general.l: Support a.out. diff -upr --new-file binutils-2.9.5.0.29/gas/testsuite/gas/mips/empic.d binutils-2.9.5.0.31/gas/testsuite/gas/mips/empic.d --- binutils-2.9.5.0.29/gas/testsuite/gas/mips/empic.d Wed Dec 31 16:00:00 1969 +++ binutils-2.9.5.0.31/gas/testsuite/gas/mips/empic.d Sun Mar 12 09:33:02 2000 @@ -0,0 +1,155 @@ +#objdump: -rst -mmips:4000 +#name: MIPS empic +#as: -membedded-pic -mips3 + +# Check GNU-specific embedded relocs, for ELF. + +.*: +file format elf.*mips.* + +SYMBOL TABLE: +0+0000000 l d \.text 0+0000000 +0+0000000 l d \.data 0+0000000 +0+0000000 l d \.bss 0+0000000 +0+0000000 l d \.foo 0+0000000 +0+0000000 l d \.reginfo 0+0000000 +0+0000000 l d \.mdebug 0+0000000 +0+0000004 l \.text 0+0000000 l2 +0+0000000 \*UND\* 0+0000000 g1 +0+0000000 \*UND\* 0+0000000 g2 +0+0000100 l \.foo 0+0000000 l1 +0+0000034 l \.text 0+0000000 l3 +0+0000098 l \.text 0+0000000 l5 +0+0000004 l \.foo 0+0000000 l4 + + +RELOCATION RECORDS FOR \[\.text\]: +OFFSET TYPE VALUE +0+0000004 R_MIPS_GNU_REL16_S2 g1 +0+000000c R_MIPS_GNU_REL16_S2 g2 +0+0000014 R_MIPS_GNU_REL16_S2 g2 +0+000001c R_MIPS_GNU_REL16_S2 \.foo +0+0000024 R_MIPS_GNU_REL16_S2 \.text +0+000002c R_MIPS_GNU_REL16_S2 \.foo +0+0000034 R_MIPS_GNU_REL16_S2 \.text +0+000003c R_MIPS_GNU_REL_HI16 g1 +0+0000040 R_MIPS_GNU_REL_LO16 g1 +0+0000044 R_MIPS_GNU_REL_HI16 \.foo +0+0000048 R_MIPS_GNU_REL_LO16 \.foo +0+0000050 R_MIPS_32 g1 +0+0000054 R_MIPS_32 \.foo +0+0000058 R_MIPS_32 \.text +0+000005c R_MIPS_PC32 g1 +0+0000060 R_MIPS_PC32 \.foo +0+0000068 R_MIPS_64 g1 +0+0000070 R_MIPS_64 \.foo +0+0000078 R_MIPS_64 \.text +0+0000080 R_MIPS_PC64 g1 +0+0000088 R_MIPS_PC64 \.foo +0+0000098 R_MIPS_GNU_REL16_S2 \.text +0+000009c R_MIPS_GNU_REL16_S2 \.text +0+00000a0 R_MIPS_GNU_REL_HI16 \.text +0+00000a4 R_MIPS_GNU_REL_LO16 \.text +0+00000a8 R_MIPS_GNU_REL_HI16 \.text +0+00000ac R_MIPS_GNU_REL_LO16 \.text +0+00000b0 R_MIPS_32 \.text +0+00000b8 R_MIPS_64 \.text +0+00000cc R_MIPS_GNU_REL16_S2 \.text +0+00000d0 R_MIPS_GNU_REL16_S2 \.text +0+00000d4 R_MIPS_GNU_REL_HI16 \.text +0+00000d8 R_MIPS_GNU_REL_LO16 \.text +0+00000dc R_MIPS_GNU_REL_HI16 \.text +0+00000e0 R_MIPS_GNU_REL_LO16 \.text +0+00000e4 R_MIPS_32 \.text +0+00000f0 R_MIPS_64 \.text + + +RELOCATION RECORDS FOR \[\.foo\]: +OFFSET TYPE VALUE +0+0000004 R_MIPS_GNU_REL_HI16 g1 +0+0000008 R_MIPS_GNU_REL_LO16 g1 +0+000000c R_MIPS_GNU_REL_HI16 \.foo +0+0000010 R_MIPS_GNU_REL_LO16 \.foo +0+0000014 R_MIPS_GNU_REL_HI16 \.text +0+0000018 R_MIPS_GNU_REL_LO16 \.text +0+000001c R_MIPS_GNU_REL_HI16 g1 +0+0000020 R_MIPS_GNU_REL_LO16 g1 +0+0000024 R_MIPS_GNU_REL_HI16 g1 +0+0000028 R_MIPS_GNU_REL_LO16 g1 +0+000002c R_MIPS_GNU_REL_HI16 \.foo +0+0000030 R_MIPS_GNU_REL_LO16 \.foo +0+0000034 R_MIPS_GNU_REL_HI16 \.text +0+0000038 R_MIPS_GNU_REL_LO16 \.text +0+000003c R_MIPS_32 g1 +0+0000040 R_MIPS_32 \.foo +0+0000044 R_MIPS_32 \.text +0+0000048 R_MIPS_PC32 g1 +0+0000050 R_MIPS_PC32 \.text +0+0000058 R_MIPS_64 g1 +0+0000060 R_MIPS_64 \.foo +0+0000068 R_MIPS_64 \.text +0+0000070 R_MIPS_PC64 g1 +0+0000080 R_MIPS_PC64 \.text +0+0000088 R_MIPS_GNU_REL_HI16 g1 +0+000008c R_MIPS_GNU_REL_LO16 g1 +0+0000090 R_MIPS_GNU_REL_HI16 \.foo +0+0000094 R_MIPS_GNU_REL_LO16 \.foo +0+0000098 R_MIPS_GNU_REL_HI16 \.text +0+000009c R_MIPS_GNU_REL_LO16 \.text +0+00000a0 R_MIPS_GNU_REL_HI16 g1 +0+00000a4 R_MIPS_GNU_REL_LO16 g1 +0+00000a8 R_MIPS_GNU_REL_HI16 \.foo +0+00000ac R_MIPS_GNU_REL_LO16 \.foo +0+00000b0 R_MIPS_GNU_REL_HI16 \.text +0+00000b4 R_MIPS_GNU_REL_LO16 \.text +0+00000b8 R_MIPS_32 g1 +0+00000bc R_MIPS_32 \.foo +0+00000c0 R_MIPS_32 \.text +0+00000c4 R_MIPS_PC32 g1 +0+00000cc R_MIPS_PC32 \.text +0+00000d0 R_MIPS_64 g1 +0+00000d8 R_MIPS_64 \.foo +0+00000e0 R_MIPS_64 \.text +0+00000e8 R_MIPS_PC64 g1 +0+00000f8 R_MIPS_PC64 \.text + +Contents of section \.text: + 0000 00000000 0411ffff 00000000 1000ffff .* + 0010 00000000 1000ffff 00000000 0411003f .* + 0020 00000000 04110000 00000000 10000041 .* + 0030 00000000 10000000 00000000 3c030000 .* + 0040 [26]463000c 3c030000 [26]4630114 2403ffd0 .* + 0050 00000000 00000100 00000004 00000028 .* + 0060 0000012c ffffffd0 00000000 00000000 .* + 0070 00000000 00000100 00000000 00000004 .* + 0080 00000000 0000004c 00000000 00000154 .* + 0090 ffffffff ffffffd0 10000032 10000033 .* + 00a0 3c030000 [26]46300d8 3c030000 [26]46300e8 .* + 00b0 000000cc 00000034 00000000 000000cc .* + 00c0 00000000 00000034 00000000 10000032 .* + 00d0 10000033 3c030000 [26]463010c 3c030000 .* + 00e0 [26]463011c 000000cc 00000034 00000000 .* + 00f0 00000000 000000cc 00000000 00000034 .* +Contents of section \.data: +Contents of section \.reginfo: + 0000 80000008 00000000 00000000 00000000 .* + 0010 00000000 00000000 .* +Contents of section \.mdebug: +#... +Contents of section \.foo: + 0000 00000000 3c030000 [26]4630004 3c030000 .* + 0010 [26]463010c 3c030000 [26]4630018 3c030000 .* + 0020 [26]463001c 3c030000 [26]4630024 3c030000 .* + 0030 [26]463012c 3c030000 [26]4630038 00000000 .* + 0040 00000100 00000004 00000044 000000fc .* + 0050 00000050 00000000 00000000 00000000 .* + 0060 00000000 00000100 00000000 00000004 .* + 0070 00000000 0000006c 00000000 000000fc .* + 0080 00000000 00000080 3c030000 [26]463008c .* + 0090 3c030000 [26]4630194 3c030000 [26]46300a0 .* + 00a0 3c030000 [26]46300a4 3c030000 [26]46301ac .* + 00b0 3c030000 [26]46300b8 00000004 00000104 .* + 00c0 00000008 000000c4 00000100 000000d0 .* + 00d0 00000000 00000004 00000000 00000104 .* + 00e0 00000000 00000008 00000000 000000e8 .* + 00f0 00000000 00000100 00000000 000000fc .* + 0100 00000000 .* diff -upr --new-file binutils-2.9.5.0.29/gas/testsuite/gas/mips/empic.s binutils-2.9.5.0.31/gas/testsuite/gas/mips/empic.s --- binutils-2.9.5.0.29/gas/testsuite/gas/mips/empic.s Wed Dec 31 16:00:00 1969 +++ binutils-2.9.5.0.31/gas/testsuite/gas/mips/empic.s Sun Mar 12 09:33:02 2000 @@ -0,0 +1,112 @@ +# Check GNU-specific embedded relocs, for ELF. + + .text + .set noreorder + nop +l2: jal g1 # R_MIPS_GNU_REL16_S2 g1 -1 + nop + b g2 # R_MIPS_GNU_REL16_S2 g2 -1 + nop + b g2 # R_MIPS_GNU_REL16_S2 g2 -1 + nop + jal l1 # R_MIPS_GNU_REL16_S2 .foo 3F + nop + jal l2 # R_MIPS_GNU_REL16_S2 .text 0 or -9 + nop + b l1+8 # R_MIPS_GNU_REL16_S2 .foo 41 + nop +l3: + b l2 # R_MIPS_GNU_REL16_S2 .text 0 or -D + nop + la $3,g1-l3 # R_MIPS_GNU_REL_HI16 g1 0 + # R_MIPS_GNU_REL_LO16 g1 C + la $3,l1-l3 # R_MIPS_GNU_REL_HI16 .foo 0 + # R_MIPS_GNU_REL_LO16 .foo 114 + la $3,l2-l3 # -30 + .word g1 # R_MIPS_32 g1 0 + .word l1 # R_MIPS_32 .foo 100 + .word l2 # R_MIPS_32 .text 4 + .word g1-l3 # R_MIPS_PC32 g1 28 + .word l1-l3 # R_MIPS_PC32 .foo 12C + .word l2-l3 # -30 + .align 3 + .dword g1 # R_MIPS_64 g1 0 + .dword l1 # R_MIPS_64 .foo 100 + .dword l2 # R_MIPS_64 .text 4 + .dword g1-l3 # R_MIPS_PC64 g1 4C + .dword l1-l3 # R_MIPS_PC64 .foo 154 + .dword l2-l3 # -30 +l5: + b 2f # R_MIPS_GNU_REL16_S2 .text 32 + b 2f+4 # R_MIPS_GNU_REL16_S2 .text 33 + la $3,2f-l5 # R_MIPS_GNU_REL_HI16 .text 0 + # R_MIPS_GNU_REL_HI16 .text D8 + la $3,2f+8-l5 # R_MIPS_GNU_REL_HI16 .text 0 + # R_MIPS_GNU_REL_HI16 .text E8 + + .word 2f # R_MIPS_32 .text CC + .word 2f-l5 # R_MIPS_PC32 .text EC or 34 + .dword 2f # R_MIPS_64 .text CC + .dword 2f-l5 # R_MIPS_PC64 .text F8 or 34 + nop +2: # at address 0xCC. + b 2b # R_MIPS_GNU_REL16_S2 .text 32 + b 2b+4 # R_MIPS_GNU_REL16_S2 .text 33 + la $3,2b-l5 # R_MIPS_GNU_REL_HI16 .text 0 + # R_MIPS_GNU_REL_HI16 .text 10C + la $3,2b+8-l5 # R_MIPS_GNU_REL_HI16 .text 0 + # R_MIPS_GNU_REL_HI16 .text 11C + .word 2b # R_MIPS_32 .text CC + .word 2b-l5 # R_MIPS_PC32 .text 11C or 34 + nop + .dword 2b # R_MIPS_64 .text CC + .dword 2b-l5 # R_MIPS_PC64 .text 98 or 34 + + .section ".foo","ax",@progbits + nop +l4: + la $3,g1-l4 + la $3,l1-l4 + la $3,l2-l4 + la $3,g1-l4 + + dla $3,g1-l4 + dla $3,l1-l4 + dla $3,l2-l4 + + .word g1 + .word l1 + .word l2 + .word g1-l4 + .word l1-l4 + .word l2-l4 + .dword g1 + .dword l1 + .dword l2 + .dword g1-l4 + .dword l1-l4 + .dword l2-l4 + + la $3,g1-l4+4 + la $3,l1-l4+4 + la $3,l2-l4+4 + + dla $3,g1-l4+4 + dla $3,l1-l4+4 + dla $3,l2-l4+4 + + .word g1+4 + .word l1+4 + .word l2+4 + .word g1-l4+4 + .word l1-l4+4 + .word l2-l4+4 + .dword g1+4 + .dword l1+4 + .dword l2+4 + .dword g1-l4+4 + .dword l1-l4+4 + .dword l2-l4+4 +l1: + + nop diff -upr --new-file binutils-2.9.5.0.29/gas/testsuite/gas/mips/mips.exp binutils-2.9.5.0.31/gas/testsuite/gas/mips/mips.exp --- binutils-2.9.5.0.29/gas/testsuite/gas/mips/mips.exp Sat Oct 9 09:13:45 1999 +++ binutils-2.9.5.0.31/gas/testsuite/gas/mips/mips.exp Sun Mar 12 09:33:02 2000 @@ -107,5 +107,11 @@ if [istarget mips*-*-*] then { } { run_dump_test "e32-rel2" } + run_dump_test "empic" + if { !$no_mips16 } { + run_dump_test "mips16-e" + setup_xfail "mips*-*-*" + run_dump_test "mips16-f" + } } } diff -upr --new-file binutils-2.9.5.0.29/gas/testsuite/gas/mips/mips16-e.d binutils-2.9.5.0.31/gas/testsuite/gas/mips/mips16-e.d --- binutils-2.9.5.0.29/gas/testsuite/gas/mips/mips16-e.d Wed Dec 31 16:00:00 1969 +++ binutils-2.9.5.0.31/gas/testsuite/gas/mips/mips16-e.d Sun Mar 12 09:33:02 2000 @@ -0,0 +1,41 @@ +#objdump: -rst -mips16 +#name: MIPS16 reloc +#as: -mips16 + +# Check MIPS16 reloc processing + +.*: +file format elf.*mips.* + +SYMBOL TABLE: +0+0000000 l d \.text 0+0000000 +0+0000000 l d \.data 0+0000000 +0+0000000 l d \.bss 0+0000000 +0+0000000 l d foo 0+0000000 +0+0000000 l d \.reginfo 0+0000000 +0+0000000 l d \.mdebug 0+0000000 +0+0000002 l \.text 0+0000000 0xf0 l1 +0+0000004 l \.text 0+0000000 0xf0 L1.1 +0+0000000 \*UND\* 0+0000000 g1 + + +RELOCATION RECORDS FOR \[foo\]: +OFFSET TYPE VALUE +0+0000000 R_MIPS_32 l1 +0+0000004 R_MIPS_32 l1 +0+0000008 R_MIPS_32 L1.1 +0+000000c R_MIPS_32 L1.1 +0+0000010 R_MIPS_32 g1 +0+0000014 R_MIPS_32 g1 + + +Contents of section \.text: + 0000 65006500 65006500 .* +Contents of section \.data: +Contents of section \.reginfo: + 0000 00000001 00000000 00000000 00000000 .* + 0010 00000000 00000000 .* +Contents of section \.mdebug: +#... +Contents of section foo: + 0000 00000000 00000008 00000000 00000003 .* + 0010 00000000 00000008 .* diff -upr --new-file binutils-2.9.5.0.29/gas/testsuite/gas/mips/mips16-e.s binutils-2.9.5.0.31/gas/testsuite/gas/mips/mips16-e.s --- binutils-2.9.5.0.29/gas/testsuite/gas/mips/mips16-e.s Wed Dec 31 16:00:00 1969 +++ binutils-2.9.5.0.31/gas/testsuite/gas/mips/mips16-e.s Sun Mar 12 09:33:02 2000 @@ -0,0 +1,13 @@ + .set noreorder + .text + nop +l1: nop +1: nop + nop + .section "foo" + .word l1 + .word l1+8 + .word 1b + .word 1b+3 + .word g1 + .word g1+8 diff -upr --new-file binutils-2.9.5.0.29/gas/testsuite/gas/mips/mips16-f.d binutils-2.9.5.0.31/gas/testsuite/gas/mips/mips16-f.d --- binutils-2.9.5.0.29/gas/testsuite/gas/mips/mips16-f.d Wed Dec 31 16:00:00 1969 +++ binutils-2.9.5.0.31/gas/testsuite/gas/mips/mips16-f.d Sun Mar 12 09:33:02 2000 @@ -0,0 +1,33 @@ +#objdump: -rst -mips16 +#name: MIPS16 reloc 2 +#as: -mips16 + +# Check MIPS16 reloc processing + +.*: +file format elf.*mips.* + +SYMBOL TABLE: +0+0000000 l d \.text 0+0000000 +0+0000000 l d \.data 0+0000000 +0+0000000 l d \.bss 0+0000000 +0+0000000 l d foo 0+0000000 +0+0000000 l d \.reginfo 0+0000000 +0+0000000 l d \.mdebug 0+0000000 +0+0000002 l \.text 0+0000000 0xf0 l1 + + +RELOCATION RECORDS FOR \[foo\]: +OFFSET TYPE VALUE +0+0000000 R_MIPS_32 l1 + + +Contents of section \.text: + 0000 65006500 .* +Contents of section \.data: +Contents of section \.reginfo: + 0000 00000001 00000000 00000000 00000000 .* + 0010 00000000 00000000 .* +Contents of section \.mdebug: +#... +Contents of section foo: + 0000 00000003 .* diff -upr --new-file binutils-2.9.5.0.29/gas/testsuite/gas/mips/mips16-f.s binutils-2.9.5.0.31/gas/testsuite/gas/mips/mips16-f.s --- binutils-2.9.5.0.29/gas/testsuite/gas/mips/mips16-f.s Wed Dec 31 16:00:00 1969 +++ binutils-2.9.5.0.31/gas/testsuite/gas/mips/mips16-f.s Sun Mar 12 09:33:02 2000 @@ -0,0 +1,6 @@ + .set noreorder + .text + nop +l1: nop + .section "foo" + .word l1+3 diff -upr --new-file binutils-2.9.5.0.29/include/ChangeLog binutils-2.9.5.0.31/include/ChangeLog --- binutils-2.9.5.0.29/include/ChangeLog Thu Feb 24 11:11:29 2000 +++ binutils-2.9.5.0.31/include/ChangeLog Sun Mar 12 09:32:30 2000 @@ -1,3 +1,8 @@ +2000-03-01 H.J. Lu + + * bfdlink.h (bfd_link_callbacks): Add a boolean arg to + the undefined_symbol callback. + 2000-02-23 Linas Vepstas * dis-asm.h (print_insn_i370): Declare. diff -upr --new-file binutils-2.9.5.0.29/include/ChangeLog.linux binutils-2.9.5.0.31/include/ChangeLog.linux --- binutils-2.9.5.0.29/include/ChangeLog.linux Wed Mar 1 10:01:12 2000 +++ binutils-2.9.5.0.31/include/ChangeLog.linux Sun Mar 12 09:40:14 2000 @@ -1,8 +1,3 @@ -2000-03-01 H.J. Lu - - * bfdlink.h (bfd_link_callbacks): Add a boolean arg to - the undefined_symbol callback. - Mon Oct 11 09:57:57 1999 H.J. Lu (hjl@gnu.org) * demangle.h (demangling_styles): Renumbered. diff -upr --new-file binutils-2.9.5.0.29/include/bfdlink.h binutils-2.9.5.0.31/include/bfdlink.h --- binutils-2.9.5.0.29/include/bfdlink.h Wed Mar 1 10:01:12 2000 +++ binutils-2.9.5.0.31/include/bfdlink.h Sun Mar 12 09:40:14 2000 @@ -329,8 +329,8 @@ struct bfd_link_callbacks /* A function which is called when a relocation is attempted against an undefined symbol. NAME is the symbol which is undefined. ABFD, SECTION and ADDRESS identify the location from which the - reference is made. FATAL indicates an undefined symbol is a - fatal error or not. In some cases SECTION may be NULL. */ + reference is made. FATAL indicates whether an undefined symbol is + a fatal error or not. In some cases SECTION may be NULL. */ boolean (*undefined_symbol) PARAMS ((struct bfd_link_info *, const char *name, bfd *abfd, asection *section, diff -upr --new-file binutils-2.9.5.0.29/include/coff/ChangeLog binutils-2.9.5.0.31/include/coff/ChangeLog --- binutils-2.9.5.0.29/include/coff/ChangeLog Tue Feb 29 11:00:34 2000 +++ binutils-2.9.5.0.31/include/coff/ChangeLog Sun Mar 19 11:54:56 2000 @@ -1,3 +1,7 @@ +2000-03-15 Kazu Hirata + + * internal.h: Fix a typo in the comment for R_MOVL2. + 2000-02-28 Nick Clifton * mipspe.h (MIPS_PE_MAGIC): Define. diff -upr --new-file binutils-2.9.5.0.29/include/coff/internal.h binutils-2.9.5.0.31/include/coff/internal.h --- binutils-2.9.5.0.29/include/coff/internal.h Wed Sep 22 14:50:50 1999 +++ binutils-2.9.5.0.31/include/coff/internal.h Sun Mar 19 11:54:56 2000 @@ -671,7 +671,7 @@ struct internal_reloc #define R_MOVL1 0x4c /* This reloc identifies mov.[wl] insns which formerlly had - a 32/24bit absolute address and how have a 16bit absolute address. */ + a 32/24bit absolute address and now have a 16bit absolute address. */ #define R_MOVL2 0x4d /* This reloc identifies a bCC:8 which will have it's condition diff -upr --new-file binutils-2.9.5.0.29/include/elf/ChangeLog binutils-2.9.5.0.31/include/elf/ChangeLog --- binutils-2.9.5.0.29/include/elf/ChangeLog Thu Feb 24 11:11:34 2000 +++ binutils-2.9.5.0.31/include/elf/ChangeLog Sun Mar 12 09:32:32 2000 @@ -1,3 +1,9 @@ +2000-03-10 Geoffrey Keating + + * mips.h: Add R_MIPS_GNU_REL_HI16, R_MIPS_GNU_REL_LO16, + R_MIPS_GNU_REL16_S2, R_MIPS_PC64 and R_MIPS_PC32 relocation + numbers. + 2000-02-23 Linas Vepstas * i370.h: New file. diff -upr --new-file binutils-2.9.5.0.29/include/elf/mips.h binutils-2.9.5.0.31/include/elf/mips.h --- binutils-2.9.5.0.29/include/elf/mips.h Thu Jan 13 11:36:04 2000 +++ binutils-2.9.5.0.31/include/elf/mips.h Sun Mar 12 09:32:32 2000 @@ -75,6 +75,12 @@ START_RELOC_NUMBERS (elf_mips_reloc_type /* These relocs are used for the mips16. */ RELOC_NUMBER (R_MIPS16_26, 100) RELOC_NUMBER (R_MIPS16_GPREL, 101) + /* These are GNU extensions to handle embedded-pic. */ + RELOC_NUMBER (R_MIPS_PC32, 248) + RELOC_NUMBER (R_MIPS_PC64, 249) + RELOC_NUMBER (R_MIPS_GNU_REL16_S2, 250) + RELOC_NUMBER (R_MIPS_GNU_REL_LO16, 251) + RELOC_NUMBER (R_MIPS_GNU_REL_HI16, 252) /* These are GNU extensions to enable C++ vtable garbage collection. */ RELOC_NUMBER (R_MIPS_GNU_VTINHERIT, 253) RELOC_NUMBER (R_MIPS_GNU_VTENTRY, 254) diff -upr --new-file binutils-2.9.5.0.29/include/opcode/ChangeLog binutils-2.9.5.0.31/include/opcode/ChangeLog --- binutils-2.9.5.0.29/include/opcode/ChangeLog Fri Feb 25 14:34:48 2000 +++ binutils-2.9.5.0.31/include/opcode/ChangeLog Sun Mar 12 09:32:34 2000 @@ -1,3 +1,14 @@ +2000-03-02 J"orn Rennecke + + * d30v.h: + (SHORT_B2r, SHORT_B3, SHORT_B3r, SHORT_B3b, SHORT_B3br): Updated. + (SHORT_D1r, SHORT_D2, SHORT_D2r, SHORT_D2Br, SHORT_U): Updated. + (SHORT_F, SHORT_AF, SHORT_T, SHORT_A5, SHORT_CMP, SHORT_CMPU): Updated. + (SHORT_A1, SHORT_AA, SHORT_RA, SHORT_MODINC, SHORT_MODDEC): Updated. + (SHORT_C1, SHORT_C2, SHORT_UF, SHORT_A2, SHORT_NONE, LONG): Updated. + (LONG_U, LONG_Ur, LONG_CMP, LONG_M, LONG_M2, LONG_2, LONG_2r): Updated. + (LONG_2b, LONG_2br, LONG_D, LONG_Dr, LONG_Dbr): Updated. + 2000-02-25 Alan Modra * i386.h (fild, fistp): Change intel d_Suf form to fildd and diff -upr --new-file binutils-2.9.5.0.29/include/opcode/d30v.h binutils-2.9.5.0.31/include/opcode/d30v.h --- binutils-2.9.5.0.29/include/opcode/d30v.h Thu Feb 24 11:11:36 2000 +++ binutils-2.9.5.0.31/include/opcode/d30v.h Sun Mar 12 09:32:34 2000 @@ -1,5 +1,5 @@ /* d30v.h -- Header file for D30V opcode table - Copyright 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 2000 Free Software Foundation, Inc. Written by Martin Hunt (hunt@cygnus.com), Cygnus Solutions This file is part of GDB, GAS, and the GNU binutils. @@ -85,40 +85,46 @@ struct d30v_opcode #define SHORT_A 9 #define SHORT_B1 11 #define SHORT_B2 12 -#define SHORT_B3 13 -#define SHORT_B3b 15 -#define SHORT_D1 17 -#define SHORT_D2 19 -#define SHORT_D2B 21 -#define SHORT_U 23 /* unary SHORT_A. ABS for example */ -#define SHORT_F 25 /* SHORT_A with flag registers */ -#define SHORT_AF 27 /* SHORT_A with only the first register a flag register */ -#define SHORT_T 29 /* for trap instruction */ -#define SHORT_A5 30 /* SHORT_A with a 5-bit immediate instead of 6 */ -#define SHORT_CMP 32 /* special form for CMPcc */ -#define SHORT_CMPU 34 /* special form for CMPUcc */ -#define SHORT_A1 36 /* special form of SHORT_A for MACa opcodes where a=1 */ -#define SHORT_AA 38 /* SHORT_A with the first register an accumulator */ -#define SHORT_RA 40 /* SHORT_A with the second register an accumulator */ -#define SHORT_MODINC 42 -#define SHORT_MODDEC 43 -#define SHORT_C1 44 -#define SHORT_C2 45 -#define SHORT_UF 46 -#define SHORT_A2 47 -#define SHORT_A5S 49 -#define SHORT_NONE 51 /* no operands */ -#define LONG 52 -#define LONG_U 53 /* unary LONG */ -#define LONG_AF 54 /* LONG with the first register a flag register */ -#define LONG_CMP 55 /* special form for CMPcc and CMPUcc */ -#define LONG_M 56 /* Memory long for ldb, stb */ -#define LONG_M2 57 /* Memory long for ld2w, st2w */ -#define LONG_2 58 /* LONG with 2 operands; bratnz */ -#define LONG_2b 59 /* LONG_2 with modifier of 3 */ -#define LONG_D 60 /* for DBRAI*/ -#define LONG_Db 61 /* for repeati*/ -#define SHORT_AR 62 /* like SHORT_AA but only accept register as third parameter */ +#define SHORT_B2r 13 +#define SHORT_B3 14 +#define SHORT_B3r 16 +#define SHORT_B3b 18 +#define SHORT_B3br 20 +#define SHORT_D1r 22 +#define SHORT_D2 24 +#define SHORT_D2r 26 +#define SHORT_D2Br 28 +#define SHORT_U 30 /* unary SHORT_A. ABS for example */ +#define SHORT_F 31 /* SHORT_A with flag registers */ +#define SHORT_AF 33 /* SHORT_A with only the first register a flag register */ +#define SHORT_T 35 /* for trap instruction */ +#define SHORT_A5 36 /* SHORT_A with a 5-bit immediate instead of 6 */ +#define SHORT_CMP 38 /* special form for CMPcc */ +#define SHORT_CMPU 40 /* special form for CMPUcc */ +#define SHORT_A1 48 /* special form of SHORT_A for MACa opcodes where a=1 */ +#define SHORT_AA 44 /* SHORT_A with the first register an accumulator */ +#define SHORT_RA 46 /* SHORT_A with the second register an accumulator */ +#define SHORT_MODINC 48 +#define SHORT_MODDEC 49 +#define SHORT_C1 50 +#define SHORT_C2 51 +#define SHORT_UF 52 +#define SHORT_A2 53 +#define SHORT_NONE 55 /* no operands */ +#define LONG 56 +#define LONG_U 57 /* unary LONG */ +#define LONG_Ur 58 /* LONG pc-relative */ +#define LONG_CMP 59 /* special form for CMPcc and CMPUcc */ +#define LONG_M 60 /* Memory long for ldb, stb */ +#define LONG_M2 61 /* Memory long for ld2w, st2w */ +#define LONG_2 62 /* LONG with 2 operands; jmptnz */ +#define LONG_2r 63 /* LONG with 2 operands; bratnz */ +#define LONG_2b 64 /* LONG_2 with modifier of 3 */ +#define LONG_2br 65 /* LONG_2r with modifier of 3 */ +#define LONG_D 66 /* for DJMPI*/ +#define LONG_Dr 67 /* for DBRAI*/ +#define LONG_Dbr 68 /* for repeati*/ +#define SHORT_AR 69 /* like SHORT_AA but only accept register as third parameter */ /* the execution unit(s) used */ int unit; @@ -248,6 +254,10 @@ extern const struct d30v_operand d30v_op /* let the optimizer know that two registers are affected */ #define OPERAND_2REG (0x10000) + +/* This operand is pc-relative. Note that repeati can have two immediate + operands, one of which is pcrel, the other (the IMM6U one) is not. */ +#define OPERAND_PCREL (0x20000) /* The format table is an array of struct d30v_format. */ struct d30v_format diff -upr --new-file binutils-2.9.5.0.29/ld/ChangeLog binutils-2.9.5.0.31/ld/ChangeLog --- binutils-2.9.5.0.29/ld/ChangeLog Tue Feb 29 18:53:52 2000 +++ binutils-2.9.5.0.31/ld/ChangeLog Sun Mar 12 09:33:11 2000 @@ -1,3 +1,41 @@ +2000-03-09 Andreas Jaeger + + * Makefile.am (check-DEJAGNU): Also unset LANG. + * Makefile.in: Rebuild. + +2000-03-06 Ian Lance Taylor + + * ldfile.c (ldfile_try_open_bfd): Don't crash if we see an empty + archive. + +2000-03-02 H.J. Lu + + * emulparams/elf32mcore.sh: Include "getopt.h". + +2000-03-01 Ian Lance Taylor + + * configure.tgt: Remove *-*-aout, *-*-coff, and *-*-netware. + +2000-03-01 H.J. Lu + + * emulparams/mipspe.sh: Add SUBSYSTEM and INITIAL_SYMBOL_CHAR. + * emulparams/shpe.sh: Likewise. + +2000-03-01 Nick Clifton + + * pe-dll.c: Remove unused variables and add ATTRIBUTE_UNUSED + to unused parameters. + + * emultempl/pe.em: Add "#ifdef DLL_SUPPORT" around static + functions only used by DLL code. + (_place_orphan): Initialise 'dollar'. + +2000-03-01 H.J. Lu + + * ldmain.c (undefined_symbol): Take one more arg, fatal, to + indicate if the undefined symbol is a fatal error or not. + Don't delete the output file if "fatal" is false. + 2000-02-29 H.J. Lu * Makefile.am (check-DEJAGNU): Also pass LIBS="$(LIBS)". diff -upr --new-file binutils-2.9.5.0.29/ld/ChangeLog.linux binutils-2.9.5.0.31/ld/ChangeLog.linux --- binutils-2.9.5.0.29/ld/ChangeLog.linux Wed Mar 1 10:00:58 2000 +++ binutils-2.9.5.0.31/ld/ChangeLog.linux Sun Mar 12 09:40:14 2000 @@ -1,13 +1,6 @@ -2000-03-01 H.J. Lu +2000-03-07 H.J. Lu - * ldmain.c (undefined_symbol): Take one more arg, fatal, to - indicate if the undefined symbol is a fatal error or not. - Don't delete the output file if "fatal" is false. - -2000-03-01 H.J. Lu - - * emulparams/mipspe.sh: Add SUBSYSTEM and INITIAL_SYMBOL_CHAR. - * emulparams/shpe.sh: Likewise. + * emulparams/elf64alpha.sh: Include "getopt.h". 2000-01-29 Ivan Kokshaysky diff -upr --new-file binutils-2.9.5.0.29/ld/Makefile.am binutils-2.9.5.0.31/ld/Makefile.am --- binutils-2.9.5.0.29/ld/Makefile.am Tue Feb 29 18:57:16 2000 +++ binutils-2.9.5.0.31/ld/Makefile.am Sun Mar 12 09:40:14 2000 @@ -664,7 +664,7 @@ TESTBFDLIB = @TESTBFDLIB@ check-DEJAGNU: site.exp srcroot=`cd $(srcdir) && pwd`; export srcroot; \ r=`pwd`; export r; \ - LC_COLLATE=; LC_ALL=; export LC_COLLATE LC_ALL; \ + LC_COLLATE=; LC_ALL=; LANG=; export LC_COLLATE LC_ALL LANG; \ EXPECT=$(EXPECT); export EXPECT; \ if [ -f $(top_builddir)/../expect/expect ]; then \ TCL_LIBRARY=`cd $(top_srcdir)/../tcl/library && pwd`; \ diff -upr --new-file binutils-2.9.5.0.29/ld/Makefile.in binutils-2.9.5.0.31/ld/Makefile.in --- binutils-2.9.5.0.29/ld/Makefile.in Tue Feb 29 18:57:16 2000 +++ binutils-2.9.5.0.31/ld/Makefile.in Sun Mar 12 09:40:14 2000 @@ -1355,7 +1355,7 @@ $(EMULATION_OFILES): ../bfd/bfd.h sysdep check-DEJAGNU: site.exp srcroot=`cd $(srcdir) && pwd`; export srcroot; \ r=`pwd`; export r; \ - LC_COLLATE=; LC_ALL=; export LC_COLLATE LC_ALL; \ + LC_COLLATE=; LC_ALL=; LANG=; export LC_COLLATE LC_ALL LANG; \ EXPECT=$(EXPECT); export EXPECT; \ if [ -f $(top_builddir)/../expect/expect ]; then \ TCL_LIBRARY=`cd $(top_srcdir)/../tcl/library && pwd`; \ diff -upr --new-file binutils-2.9.5.0.29/ld/NEWS binutils-2.9.5.0.31/ld/NEWS --- binutils-2.9.5.0.29/ld/NEWS Sun Jun 20 10:05:05 1999 +++ binutils-2.9.5.0.31/ld/NEWS Sun Mar 12 09:33:12 2000 @@ -25,6 +25,10 @@ affects ELF shared library generation). * Added --no-undefined option to disallow undefined symbols when creating a shared library. +* The linker now issues a warning, not an error, for an undefined symbol when + using -Bsymbolic; use the new --no-undefined option to get the old + behaviour. + * Added --demangle and --no-demangle options. Changes in version 2.9: diff -upr --new-file binutils-2.9.5.0.29/ld/configure.tgt binutils-2.9.5.0.31/ld/configure.tgt --- binutils-2.9.5.0.29/ld/configure.tgt Fri Feb 25 16:45:28 2000 +++ binutils-2.9.5.0.31/ld/configure.tgt Sun Mar 12 09:40:14 2000 @@ -282,9 +282,6 @@ fr30-*-*) targ_emul=elf32fr30 ;; mcore-*-pe) targ_emul=mcorepe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;; mcore-*-elf) targ_emul=elf32mcore ;; -*-*-aout) targ_emul=${target_cpu}-${target_vendor} ;; -*-*-coff) targ_emul=${target_cpu}-${target_vendor} ;; -*-*-netware) targ_emul=${target_cpu}-nw ;; *-*-ieee*) targ_emul=vanilla ;; *) diff -upr --new-file binutils-2.9.5.0.29/ld/emulparams/elf32mcore.sh binutils-2.9.5.0.31/ld/emulparams/elf32mcore.sh --- binutils-2.9.5.0.29/ld/emulparams/elf32mcore.sh Thu Nov 4 09:50:02 1999 +++ binutils-2.9.5.0.31/ld/emulparams/elf32mcore.sh Sun Mar 12 09:33:15 2000 @@ -37,6 +37,8 @@ PARSE_AND_LIST_ARGS=' #define OPTION_BASE_FILE 300 +#include "getopt.h" + static struct option longopts[] = { {"base-file", required_argument, NULL, OPTION_BASE_FILE}, diff -upr --new-file binutils-2.9.5.0.29/ld/emulparams/elf64alpha.sh binutils-2.9.5.0.31/ld/emulparams/elf64alpha.sh --- binutils-2.9.5.0.29/ld/emulparams/elf64alpha.sh Wed Feb 2 10:56:33 2000 +++ binutils-2.9.5.0.31/ld/emulparams/elf64alpha.sh Sun Mar 12 09:40:14 2000 @@ -23,6 +23,8 @@ PARSE_AND_LIST_ARGS=' static int elf64alpha_32bit = 0; +#include "getopt.h" + static struct option longopts[] = { {"taso", no_argument, NULL, OPTION_TASO}, diff -upr --new-file binutils-2.9.5.0.29/ld/emultempl/pe.em binutils-2.9.5.0.31/ld/emultempl/pe.em --- binutils-2.9.5.0.29/ld/emultempl/pe.em Thu Feb 24 11:12:26 2000 +++ binutils-2.9.5.0.31/ld/emultempl/pe.em Sun Mar 12 09:33:18 2000 @@ -114,9 +114,11 @@ static int support_old_code = 0; static char * thumb_entry_symbol = NULL; static lang_assignment_statement_type *image_base_statement = 0; -static char *pe_out_def_filename = 0; static int pe_enable_stdcall_fixup = -1; /* 0=disable 1=enable */ +#ifdef DLL_SUPPORT +static char *pe_out_def_filename = 0; static char *pe_implib_filename = 0; +#endif extern const char *output_filename; @@ -642,6 +644,7 @@ pe_undef_cdecl_match (h, string) return true; } +#ifdef DLL_SUPPORT static void pe_fixup_stdcalls () { @@ -706,6 +709,7 @@ pe_fixup_stdcalls () } } } +#endif /* DLL_SUPPORT */ static void gld_${EMULATION_NAME}_after_open () @@ -757,7 +761,7 @@ gld_${EMULATION_NAME}_after_open () #endif { - int is_ms_arch; + int is_ms_arch = 0; bfd *cur_arch = 0; lang_input_statement_type *is2; @@ -869,7 +873,7 @@ gld_${EMULATION_NAME}_before_allocation( /* This is called when an input file isn't recognized as a BFD. We check here for .DEF files and pull them in automatically. */ - +#ifdef DLL_SUPPORT static int saw_option(char *option) { @@ -879,10 +883,11 @@ saw_option(char *option) return init[i].inited; return 0; } +#endif static boolean gld_${EMULATION_NAME}_unrecognized_file(entry) - lang_input_statement_type *entry; + lang_input_statement_type *entry ATTRIBUTE_UNUSED; { #ifdef DLL_SUPPORT const char *ext = entry->filename + strlen (entry->filename) - 4; @@ -967,7 +972,7 @@ gld_${EMULATION_NAME}_unrecognized_file( static boolean gld_${EMULATION_NAME}_recognized_file(entry) - lang_input_statement_type *entry; + lang_input_statement_type *entry ATTRIBUTE_UNUSED; { #ifdef DLL_SUPPORT #ifdef TARGET_IS_i386pe @@ -1087,7 +1092,7 @@ gld_${EMULATION_NAME}_place_orphan (file asection *s; { const char *secname; - char *dollar; + char *dollar = NULL; if ((s->flags & SEC_ALLOC) == 0) return false; diff -upr --new-file binutils-2.9.5.0.29/ld/ldfile.c binutils-2.9.5.0.31/ld/ldfile.c --- binutils-2.9.5.0.29/ld/ldfile.c Fri Feb 25 13:39:24 2000 +++ binutils-2.9.5.0.31/ld/ldfile.c Sun Mar 12 09:40:14 2000 @@ -1,4 +1,6 @@ -/* Copyright (C) 1991, 92, 93, 94, 95, 98, 99, 2000 Free Software Foundation, Inc. +/* Linker file opening and searching. + Copyright (C) 1991, 92, 93, 94, 95, 98, 99, 2000 + Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -140,15 +142,18 @@ ldfile_try_open_bfd (attempt, entry) else check = entry->the_bfd; - if (! bfd_check_format (check, bfd_object)) - return true; - if (bfd_arch_get_compatible (check, output_bfd) == NULL) + if (check != NULL) { - einfo (_("%P: skipping incompatible %s when searching for %s"), - attempt, entry->local_sym_name); - bfd_close (entry->the_bfd); - entry->the_bfd = NULL; - return false; + if (! bfd_check_format (check, bfd_object)) + return true; + if (bfd_arch_get_compatible (check, output_bfd) == NULL) + { + einfo (_("%P: skipping incompatible %s when searching for %s"), + attempt, entry->local_sym_name); + bfd_close (entry->the_bfd); + entry->the_bfd = NULL; + return false; + } } } diff -upr --new-file binutils-2.9.5.0.29/ld/ldmain.c binutils-2.9.5.0.31/ld/ldmain.c --- binutils-2.9.5.0.29/ld/ldmain.c Wed Mar 1 10:00:58 2000 +++ binutils-2.9.5.0.31/ld/ldmain.c Sun Mar 12 09:40:14 2000 @@ -1219,12 +1219,10 @@ undefined_symbol (info, name, abfd, sect { if (error_count < MAX_ERRORS_IN_A_ROW) { - if (fatal == false) - einfo (_("%C: undefined reference to `%T'\n"), - abfd, section, address, name); - else - einfo (_("%X%C: undefined reference to `%T'\n"), - abfd, section, address, name); + einfo (_("%C: undefined reference to `%T'\n"), + abfd, section, address, name); + if (fatal) + einfo ("%X"); } else if (error_count == MAX_ERRORS_IN_A_ROW) einfo (_("%D: more undefined references to `%T' follow\n"), @@ -1234,12 +1232,10 @@ undefined_symbol (info, name, abfd, sect { if (error_count < MAX_ERRORS_IN_A_ROW) { - if (fatal == false) - einfo (_("%B: undefined reference to `%T'\n"), - abfd, name); - else - einfo (_("%X%B: undefined reference to `%T'\n"), - abfd, name); + einfo (_("%B: undefined reference to `%T'\n"), + abfd, name); + if (fatal) + einfo ("%X"); } else if (error_count == MAX_ERRORS_IN_A_ROW) einfo (_("%B: more undefined references to `%T' follow\n"), diff -upr --new-file binutils-2.9.5.0.29/ld/pe-dll.c binutils-2.9.5.0.31/ld/pe-dll.c --- binutils-2.9.5.0.29/ld/pe-dll.c Thu Feb 24 11:12:21 2000 +++ binutils-2.9.5.0.31/ld/pe-dll.c Sun Mar 12 09:33:14 2000 @@ -617,15 +617,12 @@ generate_edata (abfd, info) static void fill_exported_offsets (abfd, info) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { - int i, j; + int i; struct bfd_link_hash_entry *blhe; - bfd *b; - struct sec *s; - def_file_export *e=0; - + for (i = 0; i < pe_def_file->num_exports; i++) { char *name = (char *) xmalloc (strlen (pe_def_file->exports[i].internal_name) + 2); @@ -1402,12 +1399,12 @@ make_one (exp, parent) bfd *parent; { asection *tx, *id7, *id5, *id4, *id6; - unsigned char *td, *d7, *d5, *d4, *d6; + unsigned char *td, *d7, *d5, *d4, *d6 = NULL; int len; char *oname; bfd *abfd; - unsigned char *jmp_bytes; - int jmp_byte_count; + unsigned char *jmp_bytes = NULL; + int jmp_byte_count = 0; switch (pe_details->pe_arch) { diff -upr --new-file binutils-2.9.5.0.29/ld/testsuite/ChangeLog binutils-2.9.5.0.31/ld/testsuite/ChangeLog --- binutils-2.9.5.0.29/ld/testsuite/ChangeLog Tue Feb 29 11:01:24 2000 +++ binutils-2.9.5.0.31/ld/testsuite/ChangeLog Sun Mar 19 11:55:43 2000 @@ -1,3 +1,7 @@ +2000-03-13 Nick Clifton + + * ld-scripts/phdrs.t: Discard all unexpected sections. + 2000-02-27 H.J. Lu (hjl@gnu.org) * lib/ld-lib.exp (default_ld_link): Added "$LIBS" to libs. diff -upr --new-file binutils-2.9.5.0.29/ld/testsuite/ld-scripts/phdrs.t binutils-2.9.5.0.31/ld/testsuite/ld-scripts/phdrs.t --- binutils-2.9.5.0.29/ld/testsuite/ld-scripts/phdrs.t Thu Jun 3 11:02:11 1999 +++ binutils-2.9.5.0.31/ld/testsuite/ld-scripts/phdrs.t Sun Mar 19 11:55:44 2000 @@ -10,5 +10,5 @@ SECTIONS . = 0x80000 + SIZEOF_HEADERS; .text : { *(.text) } :text .data : { *(.data) } :data - /DISCARD/ : { *(.reginfo) } + /DISCARD/ : { *(.*) } } diff -upr --new-file binutils-2.9.5.0.29/opcodes/ChangeLog binutils-2.9.5.0.31/opcodes/ChangeLog --- binutils-2.9.5.0.29/opcodes/ChangeLog Tue Feb 29 10:59:55 2000 +++ binutils-2.9.5.0.31/opcodes/ChangeLog Sun Mar 12 09:31:37 2000 @@ -1,3 +1,28 @@ +Mon Mar 6 19:52:05 2000 J"orn Rennecke + + * sh-opc.h (sh_table): ldre and ldrs have a *signed* displacement. + +2000-03-02 J"orn Rennecke + + * d30v-dis.c (print_insn): Remove d*i hacks. Use per-operand + flag to determine if operand is pc-relative. + * d30v-opc.c: + (d30v_format_table): + (REL6S3): Renamed from IMM6S3. + Added flag OPERAND_PCREL. + (REL12S3, REL18S3, REL32): Split from IMM12S3, IMM18S3, REL32, with + added flag OPERAND_PCREL. + (IMM12S3U): Replaced with REL12S3. + (SHORT_D2, LONG_D): Delay target is pc-relative. + (SHORT_B2r, SHORT_B3r, SHORT_B3br, SHORT_D2r, LONG_Ur, LONG_2r): + Split from SHORT_B2, SHORT_D2, SHORT_B3b, SHORT_D2, LONG_U, LONG_2r, + using the REL* operands. + (LONG_2br, LONG_Dr): Likewise, from LONG_2b, LONG_D. + (SHORT_D1r, SHORT_D2Br, LONG_Dbr): Renamed from SHORT_D1, SHORT_D2B, + LONG_Db, using REL* operands. + (SHORT_U, SHORT_A5S): Removed stray alternatives. + (d30v_opcode_table): Use new *r formats. + 2000-02-28 Nick Clifton * m32r-desc.c (m32r_cgen_cpu_open): Replace 'flags' with diff -upr --new-file binutils-2.9.5.0.29/opcodes/d30v-dis.c binutils-2.9.5.0.31/opcodes/d30v-dis.c --- binutils-2.9.5.0.29/opcodes/d30v-dis.c Thu Jun 3 11:02:12 1999 +++ binutils-2.9.5.0.31/opcodes/d30v-dis.c Sun Mar 12 09:31:39 2000 @@ -1,5 +1,5 @@ /* Disassemble D30V instructions. - Copyright (C) 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc. 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 @@ -305,38 +305,41 @@ print_insn ( info, memaddr, num, insn, i (info->stream, _(""), val & 0x3F); } } - else if (insn->op->reloc_flag == RELOC_PCREL || - (opind == 1 && (insn->form->form == SHORT_D2 || insn->form->form == LONG_D))) - { - long max; - int neg=0; - max = (1 << (bits - 1)); - if (val & max) + /* repeati has a relocation, but its first argument is a plain + immediate. OTOH instructions like djsri have a pc-relative + delay target, but a absolute jump target. Therefore, a test + of insn->op->reloc_flag is not specific enough; we must test + if the actual operand we are handling now is pc-relative. */ + else if (oper->flags & OPERAND_PCREL) + { + int neg = 0; + + /* IMM6S3 is unsigned. */ + if (oper->flags & OPERAND_SIGNED || bits == 32) + { + long max; + max = (1 << (bits - 1)); + if (val & max) + { + if (bits == 32) + val = -val; + else + val = -val & ((1 << bits)-1); + neg = 1; + } + } + if (neg) { - if (bits == 32) - val = -val; - else - val = -val & ((1 << bits)-1); - neg = 1; + (*info->fprintf_func) (info->stream, "-%x\t(",val); + (*info->print_address_func) ((memaddr - val) & PC_MASK, info); + (*info->fprintf_func) (info->stream, ")"); } - if (opind == 1 && (insn->form->form == SHORT_D2 || insn->form->form == LONG_D)) + else { - (*info->fprintf_func) (info->stream, "%x",val); + (*info->fprintf_func) (info->stream, "%x\t(",val); + (*info->print_address_func) ((memaddr + val) & PC_MASK, info); + (*info->fprintf_func) (info->stream, ")"); } - else { - if (neg) - { - (*info->fprintf_func) (info->stream, "-%x\t(",val); - (*info->print_address_func) ((memaddr - val) & PC_MASK, info); - (*info->fprintf_func) (info->stream, ")"); - } - else - { - (*info->fprintf_func) (info->stream, "%x\t(",val); - (*info->print_address_func) ((memaddr + val) & PC_MASK, info); - (*info->fprintf_func) (info->stream, ")"); - } - } } else if (insn->op->reloc_flag == RELOC_ABS) { diff -upr --new-file binutils-2.9.5.0.29/opcodes/d30v-opc.c binutils-2.9.5.0.31/opcodes/d30v-opc.c --- binutils-2.9.5.0.29/opcodes/d30v-opc.c Thu Feb 24 11:10:45 2000 +++ binutils-2.9.5.0.31/opcodes/d30v-opc.c Sun Mar 12 09:31:39 2000 @@ -1,5 +1,5 @@ /* d30v-opc.c -- D30V opcode list - Copyright 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc. Written by Martin Hunt, Cygnus Support This file is part of GDB, GAS, and the GNU binutils. @@ -222,20 +222,20 @@ const struct d30v_opcode d30v_opcode_tab { "avg2h", IALU1, 0xb, { SHORT_A, LONG}, EITHER, 0, 0, 0 }, { "bclr", LOGIC, 0x3, { SHORT_A }, EITHER_BUT_PREFER_MU, 0, 0, 0 }, { "bnot", LOGIC, 0x1, { SHORT_A }, EITHER_BUT_PREFER_MU, 0, 0, 0 }, - { "bra", BRA, 0, { SHORT_B1, SHORT_B2, LONG_U }, MU, FLAG_JMP, 0, RELOC_PCREL }, - { "bratnz", BRA, 0x4, { SHORT_B3b, LONG_2b }, MU, FLAG_JMP, 0, RELOC_PCREL }, - { "bratzr", BRA, 0x4, { SHORT_B3, LONG_2 }, MU, FLAG_JMP, 0, RELOC_PCREL }, + { "bra", BRA, 0, { SHORT_B1, SHORT_B2r, LONG_Ur }, MU, FLAG_JMP, 0, RELOC_PCREL }, + { "bratnz", BRA, 0x4, { SHORT_B3br, LONG_2br }, MU, FLAG_JMP, 0, RELOC_PCREL }, + { "bratzr", BRA, 0x4, { SHORT_B3r, LONG_2r }, MU, FLAG_JMP, 0, RELOC_PCREL }, { "bset", LOGIC, 0x2, { SHORT_A }, EITHER_BUT_PREFER_MU, 0, 0, 0 }, - { "bsr", BRA, 0x2, { SHORT_B1, SHORT_B2, LONG_U }, MU, FLAG_JSR, 0, RELOC_PCREL }, - { "bsrtnz", BRA, 0x6, { SHORT_B3b, LONG_2b }, MU, FLAG_JSR, 0, RELOC_PCREL }, - { "bsrtzr", BRA, 0x6, { SHORT_B3, LONG_2 }, MU, FLAG_JSR, 0, RELOC_PCREL }, + { "bsr", BRA, 0x2, { SHORT_B1, SHORT_B2r, LONG_Ur }, MU, FLAG_JSR, 0, RELOC_PCREL }, + { "bsrtnz", BRA, 0x6, { SHORT_B3br, LONG_2br }, MU, FLAG_JSR, 0, RELOC_PCREL }, + { "bsrtzr", BRA, 0x6, { SHORT_B3r, LONG_2r }, MU, FLAG_JSR, 0, RELOC_PCREL }, { "btst", LOGIC, 0, { SHORT_AF }, EITHER_BUT_PREFER_MU, 0, 0, 0 }, { "cmp", LOGIC, 0xC, { SHORT_CMP, LONG_CMP }, EITHER, 0, 0, 0 }, { "cmpu", LOGIC, 0xD, { SHORT_CMPU, LONG_CMP }, EITHER, 0, 0, 0 }, - { "dbra", BRA, 0x10, { SHORT_B3, LONG_2 }, MU, FLAG_JMP | FLAG_DELAY, FLAG_RP, RELOC_PCREL }, - { "dbrai", BRA, 0x14, { SHORT_D2, LONG_D }, MU, FLAG_JMP | FLAG_DELAY, FLAG_RP, RELOC_PCREL }, - { "dbsr", BRA, 0x12, { SHORT_B3, LONG_2 }, MU, FLAG_JSR | FLAG_DELAY, FLAG_RP, RELOC_PCREL }, - { "dbsri", BRA, 0x16, { SHORT_D2, LONG_D }, MU, FLAG_JSR | FLAG_DELAY, FLAG_RP, RELOC_PCREL }, + { "dbra", BRA, 0x10, { SHORT_B3r, LONG_2r }, MU, FLAG_JMP | FLAG_DELAY, FLAG_RP, RELOC_PCREL }, + { "dbrai", BRA, 0x14, { SHORT_D2r, LONG_Dr }, MU, FLAG_JMP | FLAG_DELAY, FLAG_RP, RELOC_PCREL }, + { "dbsr", BRA, 0x12, { SHORT_B3r, LONG_2r }, MU, FLAG_JSR | FLAG_DELAY, FLAG_RP, RELOC_PCREL }, + { "dbsri", BRA, 0x16, { SHORT_D2r, LONG_Dr }, MU, FLAG_JSR | FLAG_DELAY, FLAG_RP, RELOC_PCREL }, { "dbt", BRA, 0xb, { SHORT_NONE }, MU, FLAG_JSR, FLAG_LKR, 0 }, { "djmp", BRA, 0x11, { SHORT_B3, LONG_2 }, MU, FLAG_JMP | FLAG_DELAY, FLAG_RP, RELOC_ABS }, { "djmpi", BRA, 0x15, { SHORT_D2, LONG_D }, MU, FLAG_JMP | FLAG_DELAY, FLAG_RP, RELOC_ABS }, @@ -290,8 +290,8 @@ const struct d30v_opcode d30v_opcode_tab { "or", LOGIC, 0x1a, { SHORT_A, LONG }, EITHER, 0, 0, 0 }, { "orfg", LOGIC, 0xa, { SHORT_F }, EITHER, 0, 0, 0 }, { "reit", BRA, 0x8, { SHORT_NONE }, MU, FLAG_SM | FLAG_JMP, FLAG_SM | FLAG_LKR, 0 }, - { "repeat", BRA, 0x18, { SHORT_D1, LONG_2 }, MU, FLAG_RP, FLAG_RP, RELOC_PCREL }, - { "repeati", BRA, 0x1a, { SHORT_D2B, LONG_Db }, MU, FLAG_RP, FLAG_RP, RELOC_PCREL }, + { "repeat", BRA, 0x18, { SHORT_D1r, LONG_2r }, MU, FLAG_RP, FLAG_RP, RELOC_PCREL }, + { "repeati", BRA, 0x1a, { SHORT_D2Br, LONG_Dbr }, MU, FLAG_RP, FLAG_RP, RELOC_PCREL }, { "rot", LOGIC, 0x14, { SHORT_A }, EITHER, 0, 0, 0 }, { "rot2h", LOGIC, 0x15, { SHORT_A }, EITHER, 0, 0, 0 }, { "rtd", BRA, 0xa, { SHORT_NONE }, MU, FLAG_JMP, FLAG_LKR, 0 }, @@ -357,25 +357,29 @@ const struct d30v_operand d30v_operand_t { 6, 1, 6, OPERAND_ACC|OPERAND_REG }, #define IMM5 (Ab + 1) { 6, 5, 12, OPERAND_NUM }, -#define IMM5U (IMM5 + 1) - { 6, 5, 12, OPERAND_NUM|OPERAND_SIGNED }, -#define IMM5S3 (IMM5U + 1) - { 6, 5, 12, OPERAND_NUM|OPERAND_SIGNED }, -#define IMM6 (IMM5S3 + 1) +#define IMM5U (IMM5 + 1) + { 6, 5, 12, OPERAND_NUM|OPERAND_SIGNED }, /* not used */ +#define IMM5S3 (IMM5U + 1) + { 6, 5, 12, OPERAND_NUM|OPERAND_SIGNED }, /* not used */ +#define IMM6 (IMM5S3 + 1) { 6, 6, 12, OPERAND_NUM|OPERAND_SIGNED }, -#define IMM6U (IMM6 + 1) +#define IMM6U (IMM6 + 1) { 6, 6, 0, OPERAND_NUM }, -#define IMM6U2 (IMM6U + 1) +#define IMM6U2 (IMM6U + 1) { 6, 6, 12, OPERAND_NUM }, -#define IMM6S3 (IMM6U2 + 1) - { 6, 6, 0, OPERAND_NUM|OPERAND_SHIFT }, -#define IMM12S3 (IMM6S3 + 1) +#define REL6S3 (IMM6U2 + 1) + { 6, 6, 0, OPERAND_NUM|OPERAND_SHIFT|OPERAND_PCREL }, +#define REL12S3 (REL6S3 + 1) + { 12, 12, 12, OPERAND_NUM|OPERAND_SIGNED|OPERAND_SHIFT|OPERAND_PCREL }, +#define IMM12S3 (REL12S3 + 1) { 12, 12, 12, OPERAND_NUM|OPERAND_SIGNED|OPERAND_SHIFT }, -#define IMM12S3U (IMM12S3 + 1) - { 12, 12, 12, OPERAND_NUM|OPERAND_SHIFT }, -#define IMM18S3 (IMM12S3U + 1) +#define REL18S3 (IMM12S3 + 1) + { 18, 18, 12, OPERAND_NUM|OPERAND_SIGNED|OPERAND_SHIFT|OPERAND_PCREL }, +#define IMM18S3 (REL18S3 + 1) { 18, 18, 12, OPERAND_NUM|OPERAND_SIGNED|OPERAND_SHIFT }, -#define IMM32 (IMM18S3 + 1) +#define REL32 (IMM18S3 + 1) + { 32, 32, 0, OPERAND_NUM|OPERAND_PCREL }, +#define IMM32 (REL32 + 1) { 32, 32, 0, OPERAND_NUM }, #define Fa (IMM32 + 1) { 6, 3, 0, OPERAND_REG | OPERAND_FLAG | OPERAND_DEST }, @@ -414,25 +418,31 @@ const struct d30v_format d30v_format_tab { SHORT_M, 2, { Ra, ATPAR, Rb, IMM6 } }, /* Ra,@(Rb,imm6) */ { SHORT_M, 3, { Ra, ATPAR, Rb, MINUS, Rc } }, /* Ra,@(Rb-,Rc) */ { SHORT_M2, 0, { Ra2, ATPAR, Rb, Rc } }, /* Ra,@(Rb,Rc) */ - { SHORT_M2, 1, { Ra2, ATPAR, Rb, PLUS, Rc } }, /* Ra,@(Rb+,Rc) */ + { SHORT_M2, 1, { Ra2, ATPAR, Rb, PLUS, Rc } },/* Ra,@(Rb+,Rc) */ { SHORT_M2, 2, { Ra2, ATPAR, Rb, IMM6 } }, /* Ra,@(Rb,imm6) */ - { SHORT_M2, 3, { Ra2, ATPAR, Rb, MINUS, Rc } }, /* Ra,@(Rb-,Rc) */ + { SHORT_M2, 3, { Ra2, ATPAR, Rb, MINUS, Rc } },/* Ra,@(Rb-,Rc) */ { SHORT_A, 0, { Ra, Rb, Rc } }, /* Ra,Rb,Rc */ { SHORT_A, 2, { Ra, Rb, IMM6 } }, /* Ra,Rb,imm6 */ { SHORT_B1, 0, { Rc } }, /* Rc */ { SHORT_B2, 2, { IMM18S3 } }, /* imm18 */ + { SHORT_B2r, 2, { REL18S3 } }, /* rel18 */ { SHORT_B3, 0, { Ra3, Rc } }, /* Ra,Rc */ { SHORT_B3, 2, { Ra3, IMM12S3 } }, /* Ra,imm12 */ + { SHORT_B3r, 0, { Ra3, Rc } }, /* Ra,Rc */ + { SHORT_B3r, 2, { Ra3, REL12S3 } }, /* Ra,rel12 */ { SHORT_B3b, 1, { Ra3, Rc } }, /* Ra,Rc */ { SHORT_B3b, 3, { Ra3, IMM12S3 } }, /* Ra,imm12 */ - { SHORT_D1, 0, { Ra, Rc } }, /* Ra,Rc */ - { SHORT_D1, 2, { Ra, IMM12S3 } }, /* Ra,imm12s3 */ - { SHORT_D2, 0, { IMM6S3, Rc } }, /* imm6s3,Rc */ - { SHORT_D2, 2, { IMM6S3, IMM12S3 } }, /* imm6s3,imm12s3 */ - { SHORT_D2B, 0, { IMM6U, Rc } }, /* imm6u,Rc */ - { SHORT_D2B, 2, { IMM6U, IMM12S3U } }, /* imm6u,imm12s3u */ + { SHORT_B3br, 1, { Ra3, Rc } }, /* Ra,Rc */ + { SHORT_B3br, 3, { Ra3, REL12S3 } }, /* Ra,rel12 */ + { SHORT_D1r, 0, { Ra, Rc } }, /* Ra,Rc */ + { SHORT_D1r, 2, { Ra, REL12S3 } }, /* Ra,rel12s3 */ + { SHORT_D2, 0, { REL6S3, Rc } }, /* rel6s3,Rc */ + { SHORT_D2, 2, { REL6S3, IMM12S3 } }, /* rel6s3,imm12s3 */ + { SHORT_D2r, 0, { REL6S3, Rc } }, /* rel6s3,Rc */ + { SHORT_D2r, 2, { REL6S3, REL12S3 } }, /* rel6s3,rel12s3 */ + { SHORT_D2Br, 0, { IMM6U, Rc } }, /* imm6u,Rc */ + { SHORT_D2Br, 2, { IMM6U, REL12S3 } }, /* imm6u,rel12s3 */ { SHORT_U, 0, { Ra, Rb } }, /* Ra,Rb */ - { SHORT_U, 2, { Ra, IMM12S3 } }, /* Ra,imm12 (repeat) */ { SHORT_F, 0, { Fa, Fb, Fc } }, /* Fa,Fb,Fc (orfg, xorfg) */ { SHORT_F, 2, { Fa, Fb, IMM6 } }, /* Fa,Fb,imm6 */ { SHORT_AF, 0, { Fa, Rb, Rc } }, /* Fa,Rb,Rc */ @@ -457,19 +467,20 @@ const struct d30v_format d30v_format_tab { SHORT_UF, 0, { Fa, Fb } }, /* Fa,Fb (notfg) */ { SHORT_A2, 0, { Ra2, Rb, Rc } }, /* Ra2,Rb,Rc */ { SHORT_A2, 2, { Ra2, Rb, IMM6 } }, /* Ra2,Rb,imm6 */ - { SHORT_A5S, 0, { Ra, Rb, Rc } }, /* Ra,Rb,Rc */ - { SHORT_A5S, 2, { Ra, Rb, IMM5U } }, /* Ra,Rb,imm5u (shifts) */ { SHORT_NONE, 0, { 0 } }, /* no operands (nop, reit) */ { LONG, 2, { Ra, Rb, IMM32 } }, /* Ra,Rb,imm32 */ { LONG_U, 2, { IMM32 } }, /* imm32 */ - { LONG_AF, 2, { Fa, Rb, IMM32 } }, /* Fa,Rb,imm32 */ + { LONG_Ur, 2, { REL32 } }, /* rel32 */ { LONG_CMP, 2, { CC, Fa2, Rb, IMM32} }, /* CC Fa2,Rb,imm32 */ { LONG_M, 2, { Ra, ATPAR, Rb, IMM32 } }, /* Ra,@(Rb,imm32) */ { LONG_M2, 2, { Ra2, ATPAR, Rb, IMM32 } }, /* Ra,@(Rb,imm32) */ { LONG_2, 2, { Ra3, IMM32 } }, /* Ra,imm32 */ + { LONG_2r, 2, { Ra3, REL32 } }, /* Ra,rel32 */ { LONG_2b, 3, { Ra3, IMM32 } }, /* Ra,imm32 */ - { LONG_D, 2, { IMM6S3, IMM32 } }, /* imm6s3,imm32 */ - { LONG_Db, 2, { IMM6U, IMM32 } }, /* imm6,imm32 */ + { LONG_2br, 3, { Ra3, REL32 } }, /* Ra,rel32 */ + { LONG_D, 2, { REL6S3, IMM32 } }, /* rel6s3,imm32 */ + { LONG_Dr, 2, { REL6S3, REL32 } }, /* rel6s3,rel32 */ + { LONG_Dbr, 2, { IMM6U, REL32 } }, /* imm6,rel32 */ { SHORT_AR, 0, { Aa, Rb, Rc } }, /* Aa,Rb,Rc */ { 0, 0, { 0 } }, }; diff -upr --new-file binutils-2.9.5.0.29/opcodes/sh-opc.h binutils-2.9.5.0.31/opcodes/sh-opc.h --- binutils-2.9.5.0.29/opcodes/sh-opc.h Sat Feb 19 11:21:20 2000 +++ binutils-2.9.5.0.31/opcodes/sh-opc.h Sun Mar 12 09:31:41 2000 @@ -276,9 +276,9 @@ sh_opcode_info sh_table[] = { /* 0100nnnn1xxx0111 ldc.l ,Rn_BANK */{"ldc.l",{A_INC_N,A_REG_B},{HEX_4,REG_N,REG_B,HEX_7}, arch_sh3_up}, -/* 10001110i8p4.... ldre @(,PC) */{"ldre",{A_DISP_PC},{HEX_8,HEX_E,PCRELIMM_8BY2}, arch_sh_dsp_up}, +/* 10001110i8p2.... ldre @(,PC) */{"ldre",{A_BDISP8},{HEX_8,HEX_E,BRANCH_8}, arch_sh_dsp_up}, -/* 10001100i8p4.... ldrs @(,PC) */{"ldre",{A_DISP_PC},{HEX_8,HEX_C,PCRELIMM_8BY2}, arch_sh_dsp_up}, +/* 10001100i8p2.... ldrs @(,PC) */{"ldrs",{A_BDISP8},{HEX_8,HEX_C,BRANCH_8}, arch_sh_dsp_up}, /* 0100nnnn00001010 lds ,MACH */{"lds",{A_REG_N,A_MACH},{HEX_4,REG_N,HEX_0,HEX_A}, arch_sh1_up},